Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
For each message from the provider, check for a match in the local db. If any changes, get its _id and _rev to update the record instead of inserting a new one. But if no changes, just discard the record from the update batch. If no match, just insert the record asis.
function detectUpdates (fetched, existing) { const existingByProviderId = keyBy(existing, 'key') return fetched.map((msg) => { const match = existingByProviderId[msg.providerId] if (match) { if (msg.status !== match.value.status) { // Changes detected (we only care about status at the moment) msg._id = match.id msg._rev = match.value._rev } else { // Since map doesn't let us remove the record, we set this for .filter() msg.noChanges = true } } return msg }).filter((msg) => !msg.noChanges) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _patchLocal(data, callback) {\n _patchServiceDB(data);\n view_model.lastChecked = generateTimestamp();\n if( _hasIndexedDB() ) {\n _putArrayToIndexedDB(data, function() {\n callback(\"Patched records to ServiceDB & IndexedDB.\");\n });\n } else {\n callback(\"Patched records to ServiceDB only.\");\n }\n }", "function seedWithMessages (db, twilio) {\n db.list({\n descending: true,\n limit: 1,\n include_docs: true,\n endkey: 'msg-' // '_' comes before 'm' in ASCII sort\n }, (err, body) => {\n if (err) return console.error(err)\n\n const fetchOpts = {} // By default, fetch a page of most recent messages\n if (body.rows.length) {\n // If db already contains message records, fetch records since latest one\n console.log('most recent message', body.rows[0])\n const mostRecentDate = body.rows[0].doc.date\n fetchOpts['DateSent>'] = mostRecentDate\n }\n twilio.messages.get(fetchOpts, formatAndInsert)\n })\n\n function formatAndInsert (err, response) {\n if (err) return console.error('Error fetching messages from twilio')\n\n const fetchedMessages = response.messages.map(formatData.fromTwilioRest)\n const fetchedProviderIds = fetchedMessages.map((msg) => msg.providerId)\n\n // Check if messages are already stored in local db\n db.view('messages', 'byProviderId', { keys: fetchedProviderIds }, (err, body) => {\n if (err) return console.error('Error querying view', err)\n\n const updateBatch = detectUpdates(fetchedMessages, body.rows)\n\n if (updateBatch.length) {\n db.bulk({ docs: updateBatch }, (err, body) => {\n if (err) return console.error('Error inserting messages into database', err)\n console.log(body)\n })\n }\n })\n }\n}", "submitUpdatePair(data, sendingUpdate, recievingUpdate) {\n return new Promise((resolve, reject) => {\n Promise.all([\n this.db.User.Data.updateOne(\n { _id: ObjectID(data[0]._id) },\n sendingUpdate,\n { upsert: false }\n ).then(update => { return update; }),\n this.db.User.Data.updateOne(\n { _id: ObjectID(data[1]._id) },\n recievingUpdate,\n { upsert: false }\n ).then(update => { return update; })\n ])\n .then(data => { \n resolve(data); })\n .catch(err => { \n console.log(err);\n reject(err); });\n });\n }", "static async updateOne(data) {\n try {\n let criteria = {\n _id: data._id\n };\n\n let modifiedFields = {\n courier: data.courier,\n projectIds: data.projectIds,\n referenceNo: data.referenceNo,\n receivedBy: data.receivedBy,\n deliveredBy: data.deliveredBy,\n shipmentStatus: data.shipmentStatus,\n nosOfSamples: data.nosOfSamples\n };\n const projectSamples = data.projectSamples;\n // remove key\n let result = await DatabaseService.updateByCriteria(\n collectionName,\n criteria,\n modifiedFields\n );\n // for project Samples which have status 'SAMPLE_ADDED' // LEAVE it\n let deleteIds = [];\n let insertProjectSamples = [];\n for (let row of projectSamples) {\n if (row.status !== \"SAMPLE ADDED\") {\n if (row._id) {\n deleteIds.push(row._id);\n }\n // insert such //take status back to 0\n row.status = \"SAMPLE ADDITION PENDING\";\n insertProjectSamples.push(row);\n }\n }\n console.log(\"deleteIds\");\n\n console.log(deleteIds);\n console.log(\"insertProjectSamples\");\n\n console.log(insertProjectSamples);\n\n if (deleteIds.length > 0) {\n let r = await ShipmentHandler.deleteProjectSamples(deleteIds);\n console.log(\"result\");\n console.log(r);\n }\n // insert ProjectSamples\n if (insertProjectSamples.length > 0) {\n await ShipmentHandler.saveProjectSamples(\n insertProjectSamples,\n data._id\n );\n }\n return result;\n } catch (err) {\n throw err;\n }\n }", "function updateDBEntries(aRecordsToUpdate) {\n\t\ttry {\n\t\t\t//Get Database Connection\n\t\t\tvar conn = $.db.getConnection();\n\n\t\t\t//Prepare SQL Statement to be executed\n\t\t\tvar pstmt = conn.prepareStatement(\n\t\t\t\t\"UPDATE \\\"\" + gvSchemaName + \"\\\".\\\"\" + gvTableName + \"\\\" SET STATUS = ? WHERE MESSAGE_GUID = ?\");\n\n\t\t\t//Prepare the batch of statements\t\n\t\t\tpstmt.setBatchSize(aRecordsToUpdate.length);\n\t\t\tfor (var i = 0; i < aRecordsToUpdate.length; i++) {\n\t\t\t\tvar oRecord = aRecordsToUpdate[i];\n\t\t\t\tpstmt.setString(1, oRecord.STATUS);\n\t\t\t\tpstmt.setString(2, oRecord.MESSAGE_GUID);\n\t\t\t\tpstmt.addBatch();\n\t\t\t}\n\n\t\t\t//Execute the Statement and Close the connection\n\t\t\tpstmt.executeBatch();\n\t\t\tpstmt.close();\n\t\t\tconn.commit();\n\t\t\tconn.close();\n\n\t\t\t//Return Results\n\t\t\treturn aRecordsToUpdate.length;\n\t\t} catch (err) {\n\t\t\tif (pstmt !== null) {\n\t\t\t\tpstmt.close();\n\t\t\t}\n\t\t\tif (conn !== null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t\tgvTableUpdate = err.message;\n\t\t\tthrow new Error(err.message);\n\t\t}\n\t}", "async function matching(msg, db, bot) {\n db.all(`SELECT * \n FROM users \n WHERE status != 0 \n ORDER BY status DESC,\n random()`, [], (err, rows) => {\n if (err) throw err;\n\n for (let i = 0; i < rows.length; i += 2) {\n if (rows[i + 1]) {\n Promise.all([checkHistory(rows[i].userID, rows[i + 1].userID, db)])\n .then((talkedTo) => {\n if (!talkedTo[0]) {\n console.log(`${msg.guild.id}::::::::${rows[i].userID} is matched with ${rows[i + 1].userID}`)\n updateUsers(rows[i].userID, rows[i + 1].userID, 0, db)\n addToHistory(rows[i].userID, rows[i + 1].userID, db)\n sendPrivateMsg(rows[i].userID, rows[i + 1].userID, bot, msg.guild)\n } else {\n updateUsers(rows[i].userID, rows[i + 1].userID, 2, db)\n console.log(`${msg.guild.id}::::::::${rows[i].userID} already mached with ${rows[i + 1].userID} send to priority queue`)\n }\n })\n } else {\n db.run(`UPDATE users \n SET status = 2\n WHERE userID = '${rows[i].userID}'`)\n console.log(`${msg.guild.id}::::::::${rows[i].userID} is ignored, send to priority queue`)\n }\n }\n });\n}", "function adminMatchMigrateSchema(matches) {\n var numMigrated = 0;\n matches.forEach(function(match) {\n if ((match.ownerState.lastMsg.length === 0) || (match.requesterState.lastMsg.length === 0)) {\n numMigrated = numMigrated + 1;\n var newOwnerMsg = {\n language: 'en',\n text: match.ownerState.lastMessage\n };\n var newRequesterMsg = {\n language: 'en',\n text: match.requesterState.lastMessage\n };\n if (match.ownerState.lastMsg.length === 0) {\n match.ownerState.lastMsg = [];\n match.ownerState.lastMsg.push(newOwnerMsg);\n match.ownerState.lastMessage = undefined;\n }\n if (match.requesterState.lastMsg.length === 0) {\n match.requesterState.lastMsg = [];\n match.requesterState.lastMsg.push(newRequesterMsg);\n match.requesterState.lastMessage = undefined;\n }\n match.save(function (err) {\n if (err) {\n console.log('Match: Admin: Error saving migrated match with id \\'' + match._id.toString() + '\\', error: ' + JSON.stringify(err));\n }\n });\n }\n });\n console.log('Match: Admin: Migrated ' + numMigrated + ' out of ' + matches.length + ' matches to new schema.');\n}", "static _pushMailboxAfterChanged(id) {\n this._mailboxs.findOne({'_id': ObjectID(String(id))}, (err, doc) => {\n this._mailboxPub.publish('model.insert', JSON.stringify(doc));\n });\n }", "findOneAndUpdate(query={}, data) {\n // get the collection and find the matching records using sift\n const collection = this.getCollection();\n const record = sift(query, collection)[0];\n // update the records with the new data, then validate\n Object.assign(record, data);\n return this.validate(record)\n .then(() => {\n // once updated data is validated, persist to localStorage and return the updated records\n this.setCollection(collection);\n return record;\n });\n }", "flushPendingSave() {\n var pending = this._pendingSave.slice();\n this._pendingSave = [];\n\n for (var i = 0, j = pending.length; i < j; i++) {\n var pendingItem = pending[i];\n var snapshot = pendingItem.snapshot;\n var resolver = pendingItem.resolver;\n var internalModel = snapshot._internalModel;\n var adapter = this.adapterFor(internalModel.modelName);\n var operation = void 0;\n\n if (internalModel.currentState.stateName === 'root.deleted.saved') {\n resolver.resolve();\n continue;\n } else if (internalModel.isNew()) {\n operation = 'createRecord';\n } else if (internalModel.isDeleted()) {\n operation = 'deleteRecord';\n } else {\n operation = 'updateRecord';\n }\n\n resolver.resolve(_commit(adapter, this, operation, snapshot));\n }\n }", "function set_activities_to_synced(response)\n{\n\tif(typeof static_local_db=='undefined')\n\t{\n\t\topen_local_db(function()\n\t\t{\n\t\t\tset_activities_to_synced(response);\n\t\t});\n\t}\n\telse\n\t{\n\t\t//var delete_ids=response.responseXML.childNodes[0].childNodes[0].getElementsByTagName('id');\n\t\tvar update_ids=response;\n\t\tvar transaction=static_local_db.transaction(['activities'],\"readwrite\");\n\t\tvar objectStore=transaction.objectStore('activities');\n\t\tlocaldb_open_requests+=update_ids.length;\n\n\t\ttransaction.onabort = function(e)\n\t\t{\n\t\t\tconsole.log(\"aborted\");\n\t\t\tconsole.log(this.error);\n\t\t};\n\t\ttransaction.oncomplete = function(e)\n\t\t{\n\t\t\tconsole.log(\"transaction complete\");\n\t\t};\n\n\t\tfunction local_update_record(row_index)\n\t\t{\n\t\t\tif(row_index<update_ids.length)\n\t\t\t{\n\t\t\t\tvar record_id=update_ids[row_index];\n\t\t\t\tvar req=objectStore.get(record_id);\n\t\t\t\treq.onsuccess=function(e)\n\t\t\t\t{\n\t\t\t\t\tvar data=req.result;\n\t\t\t\t\trow_index+=1;\n\t\t\t\t\tif(data)\n\t\t\t\t\t{\n\t\t\t\t\t\tdata['status']='synced';\n\t\t\t\t\t\tdata['data_xml']='';\n\t\t\t\t\t\tvar put_req=objectStore.put(data);\n\t\t\t\t\t\tput_req.onsuccess=function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocaldb_open_requests-=1;\n\t\t\t\t\t\t\tlocal_update_record(row_index);\n\t\t\t\t\t\t};\n\t\t\t\t\t\tput_req.onerror=function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocaldb_open_requests-=1;\n\t\t\t\t\t\t\tlocal_update_record(row_index);\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\tlocaldb_open_requests-=1;\n\t\t\t\t\t\tlocal_update_record(row_index);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\tlocal_update_record(0);\n\t}\n}", "function post_updates()\n{\n\t// Do nothing if we are offline.\n\tif(! navigator.onLine)\n\t{\n\t\treturn false;\n\t}\n\t\t\n\t// Loop through the different stores.\n\tvar found = false;\n\t \t\n\tfor(var i in site.config.indexeddb.stores)\n\t{\n\t\tmodels[site.config.indexeddb.stores[i]].query(function (data) {\n\t\t\tvar total = parseInt(data.length);\n\t\t\n\t\t\tif(data.length)\n\t\t\t{\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t\n\t\t\tfor(var r in data)\n\t\t\t{\t\t\t\t\n\t\t\t\tsite.sync[site.config.indexeddb.stores[i]].update(data[r], data[r].FilesId, function (json) {\n\t\t\t\t\ttotal--;\n\t\t\t\t\t\n\t\t\t\t\t// Have we processed everything? If so do a full sync with our server.\n\t\t\t\t\tif((total <= 0) && ((i + 1) == site.config.indexeddb.stores.length))\n\t\t\t\t\t{\n\t\t\t\t\t\tget_files_data();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}, \n\t\t{\n\t\t\tindex: 'State',\n\t\t\tkeyRange: models[site.config.indexeddb.stores[i]].makeKeyRange({ only: 'updated' })\n\t\t});\n\t}\n\t\n\t// If there was nothing to update.\n\tif(! found)\n\t{\n\t\tget_files_data();\n\t}\n}", "function testPostUpdateState (cb) {\n d.find({}, function (err, docs) {\n var doc1 = _.find(docs, function (d) { return d._id === id1; })\n , doc2 = _.find(docs, function (d) { return d._id === id2; })\n , doc3 = _.find(docs, function (d) { return d._id === id3; })\n ;\n\n docs.length.should.equal(3);\n\n assert.deepEqual(doc1, { somedata: 'ok', _id: doc1._id });\n\n // doc2 or doc3 was modified. Since we sort on _id and it is random\n // it can be either of two situations\n try {\n assert.deepEqual(doc2, { newDoc: 'yes', _id: doc2._id });\n assert.deepEqual(doc3, { somedata: 'again', _id: doc3._id });\n } catch (e) {\n assert.deepEqual(doc2, { somedata: 'again', plus: 'additional data', _id: doc2._id });\n assert.deepEqual(doc3, { newDoc: 'yes', _id: doc3._id });\n }\n\n return cb();\n });\n }", "function updateMatches(payload) {\n console.log('payload', payload)\n return new Promise((resolve, reject) => {\n const sql = `UPDATE [matches] SET user1Id = @user1Id, user2Id = @user2Id, created_at = @created_at WHERE id = @id`;\n const request = new Request(sql, (err, rowcount) => {\n console.log('rowcount', rowcount);\n if (err) {\n reject(err);\n console.log(err);\n } else if (rowcount == 0) {\n reject({ message: \"data not exist\" });\n } else if (rowcount === 1) {\n resolve({ message: 'successfully updated.!' })\n }\n });\n\n request.addParameter(\"user1Id\", TYPES.BigInt, payload.user1Id);\n request.addParameter(\"user2Id\", TYPES.BigInt, payload.user2Id);\n request.addParameter(\"created_at\", TYPES.Binary, payload.created_at);\n\n request.on(\"done\", (row) => {\n console.log(\"data Updated\", row);\n // resolve(\"data Updated\", row);\n });\n\n request.on(\"doneProc\", function (rowCount, more, returnStatus, rows) {\n console.log('Row Count' + rowCount);\n console.log('More? ' + more);\n console.log('Return Status: ' + returnStatus);\n console.log('Rows:' + rows);\n });\n\n connection.execSql(request);\n });\n}", "function mapUpdates(aHCIRecordsRetrieved, oDBRecordsMap) {\n\t\tvar oUpdateResults = {\n\t\t\tiUpdatesRequested: 0,\n\t\t\tiUpdatesProcessed: 0\n\t\t};\n\n\t\t//Loop through the records to see which ones are valid for update\n\t\tvar aRecordsToUpdate = [];\n\t\tfor (var i = 0; i < aHCIRecordsRetrieved.length; i++) {\n\t\t\tvar oHCIRecord = aHCIRecordsRetrieved[i];\n\t\t\tvar oDBRecord = oDBRecordsMap[oHCIRecord.MESSAGE_GUID];\n\t\t\tif (oHCIRecord.MESSAGE_GUID === oDBRecord.MESSAGE_GUID) {\n\t\t\t\tvar bRequiresUpdate = false;\n\t\t\t\tvar sFormattedStatus = oHCIRecord.STATUS;\n\t\t\t\tif (oDBRecord.STATUS !== null) {\n\t\t\t\t\tvar sFormattedDBRecord = oDBRecord.STATUS;\n\t\t\t\t\tif (sFormattedStatus !== sFormattedDBRecord) {\n\t\t\t\t\t\tbRequiresUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbRequiresUpdate = true;\n\t\t\t\t}\n\t\t\t\tif (bRequiresUpdate === true) {\n\t\t\t\t\tvar oUpdateEntry = {\n\t\t\t\t\t\tMESSAGE_GUID: oHCIRecord.MESSAGE_GUID,\n\t\t\t\t\t\tSTATUS: oHCIRecord.STATUS\n\t\t\t\t\t};\n\t\t\t\t\taRecordsToUpdate.push(oUpdateEntry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toUpdateResults.iUpdatesRequested = aRecordsToUpdate.length;\n\t\tif (oUpdateResults.iUpdatesRequested > 0) {\n\t\t\toUpdateResults.iUpdatesProcessed = updateDBEntries(aRecordsToUpdate);\n\t\t}\n\t\treturn oUpdateResults;\n\t}", "sync() {\n const starterMsg = this.threadStarterMessage;\n const solvedTraninge = this.traninge\n .filter((traning) => traning.solved)\n .map((traning) => traning.author);\n\n if (starterMsg.editable) {\n starterMsg.edit(this.encrypt([...solvedTraninge]));\n }\n }", "function handle_request(msg, callback) {\n\n console.log(\"\\n\\nInside kafka backend for booking \")\n\n\n\n\nconsole.log(msg.cid)\nconsole.log(msg.traveler)\n userinfos.updateOne(\n {\n $and: [{ email: msg.traveler },\n { 'conversation.cid': msg.cid }]\n },\n {\n $push: {\n 'conversation.$.msg': msg.msg\n }\n },\n { upsert: true },\n function (err1, result1) {\n if (err1) {\n console.log(\"error in updating, at kafka\");\n console.log(err1);\n callback(err1, \"Error in updating from database at kafka11111111111111.\");\n } else {\n userinfos.updateOne(\n {\n $and: [{ _id: msg.ownerId },\n { 'conversation.cid': msg.cid }]\n },\n {\n $push: {\n 'conversation.$.msg': msg.msg\n }\n },\n { upsert: true },\n function (err1, result1) {\n if (err1) {\n console.log(\"error in updating, at kafka\");\n console.log(err);\n callback(err, \"Error in updating from database at kafka.\");\n } else {\n console.log(result1)\n let data = {\n status: 1,\n msg: \"Successfully booked\",\n // info: information\n }\n console.log(\"successfully booked the property\")\n callback(null, data)\n }\n });\n }\n });\n\n\n\n\n\n\n // userinfos.updateOne(\n // { email: msg.email },\n // {\n // $push: {\n // pastPropertyList: msg.property\n\n // }\n // },\n // { upsert: true },\n // function (err, result) {\n // if (err) {\n // console.log(\"error in updating, at kafka\");\n // console.log(err);\n // callback(err, \"Error in updating from database at kafka.\");\n // } else {\n // // console.log(result)\n // if (msg.property && msg.property.ownderId) {\n\n // userinfos.updateOne(\n // {\n // $and: [{ _id: msg.property.ownderId },\n // { 'propertyList.street': msg.property.street }]\n // },\n // {\n // $push: {\n // 'propertyList.$.booked': msg.property.booked\n // }\n // },\n // { upsert: true },\n // function (err1, result1) {\n // if (err1) {\n // console.log(\"error in updating, at kafka\");\n // console.log(err);\n // callback(err, \"Error in updating from database at kafka.\");\n // } else {\n // // console.log(result1)\n // let data = {\n // status: 1,\n // msg: \"Successfully booked\",\n // // info: information\n // }\n // console.log(\"successfully booked the property\")\n // callback(null, data)\n // }\n // });\n // }\n // else {\n // console.log(\"error in updating, at kafka\");\n // console.log(err);\n // callback(err, \"Error in updating from database at kafka.\");\n // }\n // }\n // });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}", "function findCallback(err, foundRecord) {\n // if error is returned or there is no record create a new record and insert our key\n if (err != null || foundRecord == null) {\n var newRecord = {};\n newRecord[collectionKey] = []; // add empty array\n globalDB.collection('emailData').insertOne({}, newRecord, function (err, insertRes) {\n if (err == null) {\n return res.status(200).send(newRecord[collectionKey]); // callback function\n }\n else {\n console.log(\"Failed to Insert\");\n }\n });\n }\n // if record exists but the key is not found in record (does not yet exist)\n else {\n if (foundRecord[collectionKey] == null) {\n foundRecord[collectionKey] = []; // add empty array\n globalDB.collection('emailData').updateOne({}, { $set: foundRecord }, { upsert: true }, function (err, updateRes) {\n if (err == null) {\n console.log(updateRes.result.nModified + \" document(s) updated\");\n return res.status(200).send(foundRecord[collectionKey]); // callback function\n }\n else {\n console.log(\"Failed to Insert\");\n }\n });\n }\n // record exists and key is found, return success\n else {\n return res.status(200).send(foundRecord[collectionKey]); // callback function\n }\n }\n }", "mergeSaveUpdates(updateResponseData, collection, mergeStrategy, skipUnchanged = false) {\n if (updateResponseData == null || updateResponseData.length === 0) {\n return collection; // nothing to merge.\n }\n let didMutate = false;\n let changeState = collection.changeState;\n mergeStrategy =\n mergeStrategy == null ? MergeStrategy.OverwriteChanges : mergeStrategy;\n let updates;\n switch (mergeStrategy) {\n case MergeStrategy.IgnoreChanges:\n updates = filterChanged(updateResponseData);\n return this.adapter.updateMany(updates, collection);\n case MergeStrategy.OverwriteChanges:\n changeState = updateResponseData.reduce((chgState, update) => {\n const oldId = update.id;\n const change = chgState[oldId];\n if (change) {\n if (!didMutate) {\n chgState = { ...chgState };\n didMutate = true;\n }\n delete chgState[oldId];\n }\n return chgState;\n }, collection.changeState);\n collection = didMutate ? { ...collection, changeState } : collection;\n updates = filterChanged(updateResponseData);\n return this.adapter.updateMany(updates, collection);\n case MergeStrategy.PreserveChanges: {\n const updateableEntities = [];\n changeState = updateResponseData.reduce((chgState, update) => {\n const oldId = update.id;\n const change = chgState[oldId];\n if (change) {\n // Tracking a change so update original value but not the current value\n if (!didMutate) {\n chgState = { ...chgState };\n didMutate = true;\n }\n const newId = this.selectId(update.changes);\n const oldChangeState = change;\n // If the server changed the id, register the new \"originalValue\" under the new id\n // and remove the change tracked under the old id.\n if (newId !== oldId) {\n delete chgState[oldId];\n }\n const newOrigValue = {\n ...oldChangeState.originalValue,\n ...update.changes,\n };\n chgState[newId] = {\n ...oldChangeState,\n originalValue: newOrigValue,\n };\n }\n else {\n updateableEntities.push(update);\n }\n return chgState;\n }, collection.changeState);\n collection = didMutate ? { ...collection, changeState } : collection;\n updates = filterChanged(updateableEntities);\n return this.adapter.updateMany(updates, collection);\n }\n }\n /**\n * Conditionally keep only those updates that have additional server changes.\n * (e.g., for optimistic saves because they updates are already in the current collection)\n * Strip off the `changed` property.\n * @responseData Entity response data from server.\n * May be an UpdateResponseData<T>, a subclass of Update<T> with a 'changed' flag.\n * @returns Update<T> (without the changed flag)\n */\n function filterChanged(responseData) {\n if (skipUnchanged === true) {\n // keep only those updates that the server changed (knowable if is UpdateResponseData<T>)\n responseData = responseData.filter((r) => r.changed === true);\n }\n // Strip unchanged property from responseData, leaving just the pure Update<T>\n // TODO: Remove? probably not necessary as the Update isn't stored and adapter will ignore `changed`.\n return responseData.map((r) => ({ id: r.id, changes: r.changes }));\n }\n }", "async function update(filteredRows){\n\n if(filteredRows.length === 0) return failure()\n\n collection.findOneAndUpdate({_id: filteredRows[0].id},par.put, {new: true} ,function(error, doc){\n if (error) return resolve( {error:error} )\n return resolve( doc)\n })\n }", "trackUpdateMany(updates, collection, mergeStrategy) {\n if (mergeStrategy === MergeStrategy.IgnoreChanges ||\n updates == null ||\n updates.length === 0) {\n return collection; // nothing to track\n }\n let didMutate = false;\n const entityMap = collection.entities;\n const changeState = updates.reduce((chgState, update) => {\n const { id, changes: entity } = update;\n if (id == null || id === '') {\n throw new Error(`${collection.entityName} entity update requires a key to be tracked`);\n }\n const originalValue = entityMap[id];\n // Only track if it is in the collection. Silently ignore if it is not.\n // @ngrx/entity adapter would also silently ignore.\n // Todo: should missing update entity really be reported as an error?\n if (originalValue) {\n const trackedChange = chgState[id];\n if (!trackedChange) {\n if (!didMutate) {\n didMutate = true;\n chgState = { ...chgState };\n }\n chgState[id] = { changeType: ChangeType.Updated, originalValue };\n }\n }\n return chgState;\n }, collection.changeState);\n return didMutate ? { ...collection, changeState } : collection;\n }", "saveMessages () {\n this._context.db.get('clients')\n .find({ id: this.id })\n .assign({\n messages: this.messages.map(msg => { return {\n _telegramMessage: msg._telegramMessage,\n groupMessage: msg.groupMessage\n }})\n })\n .write()\n }", "function createOrUpdateMatch(match) {\n // this retrieves the userId of the matching user\n return _uuidToUserId(match.uuid)\n .then(userId => {\n\n userId = parseInt(userId);\n match['fromUserId'] = userId;\n match.matchedUserId = parseInt(match.matchedUserId);\n\n if (userId === match.matchedUserId) {\n throw new Error('Cannot match your own userId!');\n }\n\n const matchObject = {\n 'userId1': '',\n 'userId2': ''\n };\n\n if (match.fromUserId < match.matchedUserId) {\n matchObject.userId1 = match.fromUserId;\n matchObject.userId2 = match.matchedUserId;\n } else {\n matchObject.userId2 = match.fromUserId;\n matchObject.userId1 = match.matchedUserId;\n }\n\n let currentUserString;\n if (matchObject.userId1 === match.fromUserId) {\n matchObject['opinion1'] = match.opinion;\n currentUserString = '1';\n } else {\n matchObject['opinion2'] = match.opinion;\n currentUserString = '2';\n }\n\n // this retrieves a row where from and to are the same\n return knex('matches')\n .where({ 'userId1': matchObject.userId1,\n 'userId2': matchObject.userId2 })\n .then(rows => {\n if (rows.length === 0) {\n return knex('matches')\n .insert(matchObject)\n .then(result => {\n console.log('matchRow added');\n });\n } else {\n const earlierRow = rows[0];\n // check if the row in DB already has this user's new opinion\n if (earlierRow['opinion' + currentUserString] !== match.opinion) {\n // console.log('opinion changed or missing --> update with this matchObject:');\n // console.log(matchObject);\n return knex('matches')\n .returning('id')\n .where({ 'userId1': matchObject.userId1,\n 'userId2': matchObject.userId2 })\n .update(matchObject)\n .then(updatedRows => {\n const otherUserString = currentUserString === '1' ? '2' : '1';\n const otherUserOpinion = earlierRow['opinion' + otherUserString];\n // console.log('currentUserString: ' + currentUserString);\n // console.log('currentUserOpinion: ' + match.opinion);\n // console.log('oterUserString: ' + otherUserString);\n // console.log('oterUserOpinion: ' + otherUserOpinion);\n if (match.opinion === 'UP' && otherUserOpinion === 'UP') {\n // console.log('both users have UP');\n // if the row ALREADY has firebaseChatId then the two users\n // already have a chat in Firebase -> no need to create a new one\n // this could happen if one first UPs, then the other UPs, then\n // either DOWNs and UPs again\n if (!earlierRow['firebaseChatId']) {\n return handleMatch(matchObject);\n }\n }\n })\n }\n }\n })\n })\n}", "function applyMessage(msg, cb) {\n var msgData = msgpack.decode(msg.message)\n\n // in browsers, for some reason we have to manually construct the buffers\n msgData.obj.$msg = util.toBuffer(msgData.obj.$msg)\n msg.author = util.toBuffer(msg.author)\n\n if (!msgData || !msgData.obj || msgData.obj.$rel != 'eco-object')\n return cb() // not an update message\n if (!msgData.obj.$msg || msgData.obj.$msg.toString('hex') != idString)\n return cb() // not an update message for this object\n\n var err = msglib.validate(msgData)\n if (err) return cb(err)\n\n // lookup author node\n var authi = memberIdStrings.indexOf(msg.author.toString('hex'))\n if (authi === -1) return cb() // not by an object member\n\n // update metadata\n if (msgData.seq > state.seq)\n state.seq = msgData.seq\n\n if (msgData.path === '') {\n // operation on the object\n var result = objApply(msg.id, msgData, msg.author, authi, msgData.seq)\n addHistory(msg, msgData, authi)\n if (result instanceof Error)\n return cb(result)\n if (result) {\n // store new state\n return persist(function(err) {\n if (err) return cb(err)\n if (Array.isArray(result))\n cb(false, result[0], result[1], result[2], { author: msg.author, authi: authi, seq: msgData.seq })\n else\n cb()\n })\n }\n return cb()\n }\n\n // operation on a value\n var meta = state.meta[msgData.path]\n if (!meta || typeof state.data[msgData.path] == 'undefined') {\n // havent received the declaration message yet, put it in the queue\n bufferMessage(msgData.prev.$msg, msg, msgData.seq)\n return cb()\n }\n var type = types[meta.type]\n if (!type) return cb(new Error('Unrecognized type \"' + meta.type + '\" in object meta'))\n\n // run op\n var result = type.apply(state, msgData, authi)\n\n // update meta\n addHistory(msg, msgData, authi)\n if (msgData.seq > state.meta[msgData.path].seq)\n state.meta[msgData.path].seq = msgData.seq\n\n if (result) {\n if (result instanceof Error)\n return cb(result)\n\n // update prev link if the message was used\n if (Array.isArray(result))\n state.meta[msgData.path].prev = msg.id\n\n // store new state\n persist(function(err) {\n if (err) return cb(err)\n if (Array.isArray(result))\n cb(false, msgData.path, result[0], result[1], { author: msg.author, authi: authi, seq: msgData.seq })\n else\n cb()\n })\n if (Array.isArray(result)) // a visible change? (as signified by a diff array)\n obj.emit('change', msgData.path, result[0], result[1], { author: msg.author, authi: authi, seq: msgData.seq })\n } else\n cb()\n }", "function localChanges() {\n return dbPromise.then(db => {\n\n //create transaction to write to database\n const tx = db.transaction('backSync', 'readwrite')\n const store = tx.objectStore('backSync');\n\n // add all the reviews to indexDB\n return store.getAll()\n .then(reviews => {\n return Promise.all(\n reviews.map(review => {\n fetch('http://localhost:1337/reviews/', {\n method: 'POST',\n body: JSON.stringify(review),\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then (response => {\n store.delete(review.createAt);\n return tx.complete;\n })\n })\n )\n })\n }).catch(err => {\n console.log(err);\n })\n}", "async update_message(msgid, status, message) {\n var return_value = false;\n return new Promise((resolve, reject) => {\n console.log(msgid, status, message);\n this.db().run(\"UPDATE messages SET status = ?, message = ? WHERE msgid = ?\", [status, message, msgid], (error) => {\n if(!error) {\n resolve(true);\n } else {\n // Provide feedback for the error\n console.log(error);\n resolve(false);\n }\n });\n });\n }", "saveMessage(convid, msg){\n var newMsg = new Message();\n newMsg.conversationId = convid;\n newMsg.msgcontent = msg.msgcontent;\n newMsg.author = msg.author;\n newMsg.save((err,msg) => {\n if (err) {\n throw err;\n } \n console.log(msg);\n // Update the latest message in the conversation\n Conversation.findByIdAndUpdate(convid, {latestMessage: msg._id}, (err, conv) => {\n if (err) throw err;\n })\n });\n }", "function up() {\n var conn = db.createConnection();\n return conn.withTransaction(function() {\n // Fix the conversation column. That one's easy.\n return conn.query(\n 'UPDATE messages SET conversation=sender WHERE recipient != \\'\\' ' +\n 'AND LEFT(recipient, 1) != \\'@\\''\n ).then(function() {\n // And now class_key_base and instance_key_base...\n return conn.query(\n 'SELECT id, class_key, instance_key, class_key_base, instance_key_base FROM messages'\n ).then(function(rows) {\n // Only redo the bad ones.\n rows = rows.filter(function(row) {\n return message.baseString(row.class_key.toString('utf8')) !=\n row.class_key_base.toString('utf8');\n });\n return rows.reduce(function(soFar, row) {\n return soFar.then(function() {\n return conn.query(\n 'UPDATE messages SET class_key_base = ?, instance_key_base = ? ' +\n 'WHERE id = ?',\n [new Buffer(message.baseString(row.class_key.toString('utf8'))),\n new Buffer(message.baseString(row.instance_key.toString('utf8'))),\n row.id]);\n });\n }, Q());\n });\n });\n }).finally(function() {\n conn.end();\n });\n}", "storeLocal(notes) {\n Realm.open({schema: [Schema.Note]})\n .then(realm => {\n realm.write(() => {\n let realmNotes = realm.objects('Note');\n\n for (let i = 0; i < notes.length; i++) {\n let newNeeded = true;\n let editNote = null;\n for (let j = 0; j < realmNotes.length; j++) {\n if (realmNotes[j].time == notes[i].time) {\n newNeeded = false;\n editNote = realmNotes[j];\n break;\n }\n }\n // Here we store a new note in Realm database if it doesn't exist already\n if (newNeeded === true) {\n const nNote = realm.create('Note', {\n time: notes[i].time,\n lastEdited: notes[i].lastEdited,\n order: notes[i].order,\n title: notes[i].title,\n text: notes[i].text,\n color: notes[i].color,\n left: notes[i].left,\n top: notes[i].top\n });\n } else {\n // However, if the note exists, we shall update its values.\n editNote.lastEdited = notes[i].lastEdited;\n editNote.order = notes[i].order;\n editNote.title = notes[i].title;\n editNote.text = notes[i].text;\n editNote.color = notes[i].color;\n editNote.left = notes[i].left;\n editNote.top = notes[i].top;\n }\n }\n });\n this.setState({ realm: realm });\n realm.close();\n });\n }", "beforeApplyUpdate() {\n const diffFragmentQueue = RB.PageManager.getPage().diffFragmentQueue;\n const diffCommentsData = this.model.get('diffCommentsData');\n\n for (let i = 0; i < diffCommentsData.length; i++) {\n diffFragmentQueue.saveFragment(diffCommentsData[i][0]);\n }\n }", "function migrateMessages() {\n var groupId = '[email protected]';\n var messagesToMigrate = getRecentMessagesContent();\n for (var i = 0; i < messagesToMigrate.length; i++) {\n var messageContent = messagesToMigrate[i];\n var contentBlob = Utilities.newBlob(messageContent, 'message/rfc822');\n AdminGroupsMigration.Archive.insert(groupId, contentBlob);\n }\n}", "function storeMessages(){\n if (stagedMessages && stagedMessages.length > 0){\n var q1 = 'INSERT INTO messages (date, username, message) VALUES';\n\n //TODO: update this to deal with SQL injection .e.g. setting a username to '; DROP TABLE ...'\n\n var msgCount = stagedMessages.length;\n var i = 0;\n stagedMessages.map(function(msg){\n q1 += \"('\"+stripDate(msg.date)+\"', '\"+msg.author+\"', '\"+msg.message+ \"')\";\n if (i++ != (msgCount-1)){\n q1+=\",\";\n }\n });\n q1 += ';';\n\n db.query(q1, function(done){ if(!done){\n debug.log('serverDB: storeMessages: error');} });\n stagedMessages = [];\n }\n}", "handleMatchBegin() {\n\t\tthis.syncModelWithRemote();\n\t}", "updateProtocolMatches() {\n log.trace('ProtocolEngine::updateProtocolMatches');\n\n // Clear all data currently in matchedProtocols\n this._clearMatchedProtocols();\n\n // For each study, find the matching protocols\n this.studies.forEach(study => {\n const matched = this.findMatchByStudy(study);\n\n // For each matched protocol, check if it is already in MatchedProtocols\n matched.forEach(matchedDetail => {\n const protocol = matchedDetail.protocol;\n if (!protocol) {\n return;\n }\n\n // If it is not already in the MatchedProtocols Collection, insert it with its score\n if (!this.matchedProtocols.has(protocol.id)) {\n log.trace(\n 'ProtocolEngine::updateProtocolMatches inserting protocol match',\n matchedDetail\n );\n this.matchedProtocols.set(protocol.id, protocol);\n this.matchedProtocolScores[protocol.id] = matchedDetail.score;\n }\n });\n });\n }", "static async findByIndexAndUpdateAtLatest(index, updatedEntryFields, insert) {\n\n if (!insert) logEntryModification(OP_TYPES.UPDATE, index, updatedEntryFields)\n\n const entry = await this.findByIndexAtRevision(index, null, true)\n if (entry || insert) {\n\n let latest\n if (entry && entry._revisionIndex === getLatestRevisionIndex()) latest = entry\n else latest = new this(entry && entry.toObject() || { index })\n Object.keys(updatedEntryFields).forEach(key => { latest[key] = updatedEntryFields[key] })\n return latest.save()\n\n } else return null\n\n }", "update() {\n this.checkOkToUpdate();\n\n if (true) {\n let key = DB._getDbKey(this.obj.toModel(), this.collection);\n\n if (key != this.key) {\n console.log(\"Old key: \", this.key, \"New key: \", key);\n throw \"Update should not change key!\";\n }\n }\n\n if (this.state == ObjectStates.COMMITTED) {\n this.state = ObjectStates.UPDATE_PENDING;\n this.db._addDirty(this, this.collection);\n }\n }", "function updateMultipleStatus(itemsDB, itemCode, swapItemCode, status, callback){\n itemsDB.updateMany({$or:[{ItemCode:itemCode},{ItemCode:swapItemCode}]}, {Status: status}, function(err,val){\n if(!err){\n if(status == \"pending\"){\n itemsDB.updateOne({ItemCode:itemCode}, {Initiated:1}, function(error2, doc2){\n if(!error2){\n itemsDB.updateOne({ItemCode:swapItemCode}, {Initiated:0}, function(error3, doc3){\n if(!error3){\n callback(false);\n } else {\n console.log(error3);\n callback(true);\n }\n });\n } else {\n console.log(error2);\n callback(true);\n }\n });\n } else if(status == \"swapped\"){\n callback(false);\n } else if(status == \"available\"){\n itemsDB.updateOne({ItemCode:itemCode}, {Initiated:0}, function(error2, doc2){\n if(!error2){\n itemsDB.updateOne({ItemCode:swapItemCode}, {Initiated:0}, function(error3, doc3){\n if(!error3){\n callback(false);\n } else {\n console.log(error3);\n callback(true);\n }\n });\n } else {\n console.log(error2);\n callback(true);\n }\n });\n }\n }else{\n console.log(err);\n callback(true);\n }\n });\n}", "function pushChanges() {\n _.chain(Agents.getChanges())\n .groupBy('obj.id')\n // Get only one of the objects\n .map(function (items) {\n // If there's only a single object, return it\n if (items.count === 1) {\n return items[0];\n }\n\n // Return either the deleted item or the first item.\n return _.some(items, { operation: 'R' })\n ? _.find(items, { operation: 'R' })\n : items[0];\n })\n .forEach(function (item) {\n // If the interaction was removed, disable it in the DB.\n // Otherwise find it and update or insert it\n var _agent = item.operation !== 'R'\n ? Agents.findOne({ id: item.obj.id })\n : _.assign({}, item.obj, { isDisabled: true });\n\n icwsDb.setAgent(_agent, true);\n })\n .value();\n\n // Clear the changes\n Agents.flushChanges();\n}", "function doUpdate() {\n Subscription.find()\n .exec()\n .then(doc => {\n doc.forEach((item) => {\n console.log('Found subscription: Id %d Url %s', item._id, item.url);\n rssFeeder.promisedGet(item.url, makePath('xml', item._id, 'xml'))\n .then(() => {\n rssFeeder.promisedJson(makePath('xml', item._id, 'xml'),\n makePath('json', item._id, 'json'))\n .then((json) => {\n let obj = utils.transform(json);\n Subscription.findByIdAndUpdate(item.id,\n {$set: {channel: obj.channel, items: obj.items}},\n {$upsert: true})\n .exec()\n .then((doc)=> {\n console.log('Subscription updated: Id %d Url %s', doc._id, doc.url);\n })\n .catch(err => {\n console.error('**** Update Error; Reason '+err);\n });\n })\n .catch(function(err) {\n console.error('Error on Parse to json; fid '+item._id+' Reason: ', err);\n throw Error('Error on Parse to json; fid '+item._id+' Reason: ', err);\n });\n })\n .catch(function(err) {\n console.error('Error on Get URL; Url '+item.url+' Reason: ', err);\n// throw Error('Error on Parse to json; fid '+item._id+' Reason: ', err);\n });\n });\n })\n .catch(function(err) {\n console.error('Error; Reason: ', err);\n });\n}", "handleNew(newCheck){\n if(this.handlingNewFlag){\n this.newCheckTransient = newCheck; //keep updating, but don't do more requests\n return; //blocking from doing request forever\n }\n this.handlingNewFlag = true;\n this.newCheckTransient = newCheck; //init time\n\n let completeCheck = null;\n\n let xhr = new XMLHttpRequest();\n xhr.open('POST', '/newCheck/'.concat(this.props.account.id), true);\n xhr.onreadystatechange = function(){\n if(xhr.readyState == 4){\n //got the new check, result will have the id we need\n // console.log(xhr.response)\n const result = JSON.parse(xhr.response);\n this.setState(function(prevState){\n let newChecks = prevState.checks.map(check => check);\n let newCheckUpd = this.newCheckTransient; //use the latest edits\n newCheckUpd.id = result.id; //use the db id\n completeCheck = newCheckUpd;\n newChecks.push(newCheckUpd);\n return ({\n checks: newChecks\n });\n }, () => {\n this.finalCheckRef.current.giveFocus();\n this.newCheckRef.current.resetState();\n this.handlingNewFlag = false;\n this.newCheckTransient = null;\n this.updatedContent.push(completeCheck); //because it will be the only new one for sure, and now have set id so can safely push\n //have to use completeCheck to get the newCheckTransient updates AND the newCheckUpd id\n this.scrollToBottom();\n });\n }\n }.bind(this);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify(newCheck));\n\n\n\n\n // console.log(\"new\")\n // //PROBLEM HERE IS NEW CHECK DOESN'T HAVE AN ID YET!\n\n // //stuff for handling a new check\n // //for now this is same as handleEdit but with an additional push of the updated check\n // this.newCheckRef.current.resetState();\n \n // this.setState(function (prevState) {\n // //can implement pseudo id or can try to patch over by finding largest id and doing +1 there\n\n // //the reason for duplicates is likely that this id doesn't agree with repo one, so then\n // //when it sets the state it actually adds it as another check; every simple time\n // //the post interval happens, then, the check is sent as a new one because \n // //repo.save does both updating and merging, so unbeknownst what seems like it should\n // //be an update is actually a save into the db\n // //I think that's at least part of what it must be; might be deeper though\n // let newChecks = prevState.checks.map(check => check);\n // //See [F] on how to change to internal id\n // newCheck.id = newChecks[newChecks.length-1].id + 1; //this is a hack for ids to work\n // newChecks.push(newCheck);\n // return {\n // checks: newChecks\n // }\n // }, () => {\n // this.scrollToBottom();\n // this.finalCheckRef.current.giveFocus()\n \n // let contained = false;\n // this.updatedContent.forEach((arrayCheck, i) => {\n // if(arrayCheck.id == newCheck.id){\n // contained = true;\n // }\n // });\n // if(!contained){\n // this.updatedContent.push(newCheck); \n // //so if a single character is entered, this check will still be pushed\n // //BUT, if it is already in there (IE, with >1 character) from future handleEdit events,\n // //then it won't be pushed; this prevents accidently reverting to the earlier state when\n // //handleNew was called and then handleEdit was called in future\n // }\n // });\n }", "function updateB(wordParam, product_id, degree_connection, num_suggestions, relationship_desc, seed_word) {\n\n var deferred = Q.defer();\n var word = wordParam;\n var id = product_id;\n var connection = degree_connection;\n var nodes = num_suggestions;\n var seed = seed_word;\n\n waitAndCall(function(){\n downloadFile();\n });\n\n updateBoard();\n //convert the number of children to an interger\n var n = parseInt(nodes);\n\n addChildren(n);\n\n function addChildren(n) {\n\n if(id === seed) {\n db.boards.update(\n { search_word: seed }, { $inc: { children: n } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n else {\n db.boards.update({ search_word: seed , \"links.target\": id}, { $inc: { \"links.$.children\": n } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n }\n\n function updateBoard() {\n\n var newMeta = [];\n\n //Want to check for duplicates in newMeta array and slice the repitition off the results at the index of repitition\n newMeta = convertToDoubleMeta(word, id);\n var arrayBlacklist = containsAndRemove(newMeta, newMeta, word, id);\n\n var i = 0;\n var index = 0;\n\n var string_data = JSON.stringify(word); //outputs string from JSON\n var json_array1 = JSON.parse(string_data);\n\n //Removes words from blacklist array\n for (i = 0; i < word.length; i++) {\n if (containsAndRemoveObject(arrayBlacklist, word[i], json_array1, index) === false) {\n index++;\n }\n }\n //Checks there are enough words returned after the double meta and stemmer removal\n var newLength = json_array1.length;\n if (newLength < nodes) {\n return console.log('Sorry, not enough records found in Datamuse for word: ' + id + ' with connection: ' + connection + ' and suggestions: ' + nodes + '. Try less suggestions.');\n }\n\n word = json_array1;\n\n var z = parseInt(\"0\");\n\n if (nodes === '1' && word !== 'undefined') {\n db.boards.update({ search_word: seed }, { $push: { links: { $each: [\n { source: id, target: word[0].target, type: word[0].type, defs: word[0].defs, children: z }\n ] } } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n\n if (nodes === '2' && word !== 'undefined') {\n db.boards.update({ search_word: seed }, { $push: { links: { $each: [\n { source: id, target: word[0].target, type: word[0].type, defs: word[0].defs, children: z },\n { source: id, target: word[1].target, type: word[1].type, defs: word[1].defs, children: z }\n ] } } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n\n if (nodes === '3' && word !== 'undefined') {\n db.boards.update({ search_word: seed }, { $push: { links: { $each: [\n { source: id, target: word[0].target, type: word[0].type, defs: word[0].defs, children: z },\n { source: id, target: word[1].target, type: word[1].type, defs: word[1].defs, children: z },\n { source: id, target: word[2].target, type: word[2].type, defs: word[2].defs, children: z }\n ] } } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n\n if (nodes === '4' && word !== 'undefined') {\n db.boards.update({ search_word: seed }, { $push: { links: { $each: [\n { source: id, target: word[0].target, type: word[0].type, defs: word[0].defs, children: z },\n { source: id, target: word[1].target, type: word[1].type, defs: word[1].defs, children: z },\n { source: id, target: word[2].target, type: word[2].type, defs: word[2].defs, children: z },\n { source: id, target: word[3].target, type: word[3].type, defs: word[3].defs, children: z }\n ] } } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n\n if (nodes === '5' && word !== 'undefined') {\n db.boards.update({ search_word: seed }, { $push: { links: { $each: [\n { source: id, target: word[0].target, type: word[0].type, defs: word[0].defs, children: z },\n { source: id, target: word[1].target, type: word[1].type, defs: word[1].defs, children: z },\n { source: id, target: word[2].target, type: word[2].type, defs: word[2].defs, children: z },\n { source: id, target: word[3].target, type: word[3].type, defs: word[3].defs, children: z },\n { source: id, target: word[4].target, type: word[4].type, defs: word[4].defs, children: z }\n ] } } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n\n if (nodes === '6' && word !== 'undefined') {\n db.boards.update({ search_word: seed }, { $push: { links: { $each: [\n { source: id, target: word[0].target, type: word[0].type, defs: word[0].defs, children: z },\n { source: id, target: word[1].target, type: word[1].type, defs: word[1].defs, children: z },\n { source: id, target: word[2].target, type: word[2].type, defs: word[2].defs, children: z },\n { source: id, target: word[3].target, type: word[3].type, defs: word[3].defs, children: z },\n { source: id, target: word[4].target, type: word[4].type, defs: word[4].defs, children: z },\n { source: id, target: word[5].target, type: word[5].type, defs: word[5].defs, children: z }\n ] } } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n\n if (nodes === '7' && word !== 'undefined') {\n db.boards.update({ search_word: seed }, { $push: { links: { $each: [\n { source: id, target: word[0].target, type: word[0].type, defs: word[0].defs, children: z },\n { source: id, target: word[1].target, type: word[1].type, defs: word[1].defs, children: z },\n { source: id, target: word[2].target, type: word[2].type, defs: word[2].defs, children: z },\n { source: id, target: word[3].target, type: word[3].type, defs: word[3].defs, children: z },\n { source: id, target: word[4].target, type: word[4].type, defs: word[4].defs, children: z },\n { source: id, target: word[5].target, type: word[5].type, defs: word[5].defs, children: z },\n { source: id, target: word[6].target, type: word[6].type, defs: word[6].defs, children: z }\n ] } } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n\n if (nodes === '8' && word !== 'undefined') {\n db.boards.update({ search_word: seed }, { $push: { links: { $each: [\n { source: id, target: word[0].target, type: word[0].type, defs: word[0].defs, children: z },\n { source: id, target: word[1].target, type: word[1].type, defs: word[1].defs, children: z },\n { source: id, target: word[2].target, type: word[2].type, defs: word[2].defs, children: z },\n { source: id, target: word[3].target, type: word[3].type, defs: word[3].defs, children: z },\n { source: id, target: word[4].target, type: word[4].type, defs: word[4].defs, children: z },\n { source: id, target: word[5].target, type: word[5].type, defs: word[5].defs, children: z },\n { source: id, target: word[6].target, type: word[6].type, defs: word[6].defs, children: z },\n { source: id, target: word[7].target, type: word[7].type, defs: word[7].defs, children: z }\n ] } } },\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n }\n else {\n console.log(\"Sorry not enough results found. Try reducing the number of nodes or searching another word\");\n }\n\n } // end of update board\n return deferred.promise;\n}", "saveBotEntry(entry) {\n return __awaiter(this, void 0, void 0, function* () {\n // if (context.teamId && context.channelId && data.channelData) {\n // await this.initialize();\n if (!this.botStateCollection) {\n return;\n }\n let filter = { \"_id\": entry._id };\n // let document = {\n // teamId: context.teamId,\n // channelId: context.channelId,\n // data: data.channelData,\n // };\n // let document = {\n // token: tokens.token,\n // refreshToken: tokens.refreshToken,\n // };\n yield this.botStateCollection.updateOne(filter, entry, { upsert: true });\n // await this.close();\n // }\n });\n }", "function mergeNewMessages(\n oldMessageStore: MessageStore,\n newMessageInfos: $ReadOnlyArray<RawMessageInfo>,\n truncationStatus: {[threadID: string]: MessageTruncationStatus},\n threadInfos: ?{[threadID: string]: RawThreadInfo},\n replaceUnlessUnchanged: bool,\n): MessageStore {\n const orderedNewMessageInfos = _flow(\n _map((messageInfo: RawMessageInfo) => {\n const inputMessageInfo = messageInfo;\n invariant(inputMessageInfo.id, \"new messageInfos should have serverID\");\n const currentMessageInfo = oldMessageStore.messages[inputMessageInfo.id];\n if (\n currentMessageInfo &&\n typeof currentMessageInfo.localID === \"string\"\n ) {\n invariant(\n inputMessageInfo.type === messageType.TEXT,\n \"only MessageType.TEXT has localID\",\n );\n // Try to preserve localIDs. This is because we use them as React\n // keys and changing React keys leads to loss of component state.\n messageInfo = {\n type: messageType.TEXT,\n id: inputMessageInfo.id,\n localID: currentMessageInfo.localID,\n threadID: inputMessageInfo.threadID,\n creatorID: inputMessageInfo.creatorID,\n time: inputMessageInfo.time,\n text: inputMessageInfo.text,\n };\n }\n return _isEqual(messageInfo)(currentMessageInfo)\n ? currentMessageInfo\n : messageInfo;\n }),\n _orderBy('time')('desc'),\n )([...newMessageInfos]);\n\n const threadsToMessageIDs = threadsToMessageIDsFromMessageInfos(\n orderedNewMessageInfos,\n );\n const oldMessageInfosToCombine = [];\n const mustResortThreadMessageIDs = [];\n const lastPruned = Date.now();\n const watchedIDs = threadWatcher.getWatchedIDs();\n const threads = _flow(\n _pickBy(\n (messageIDs: string[], threadID: string) =>\n !threadInfos || threadIsWatched(threadInfos[threadID], watchedIDs),\n ),\n _mapValuesWithKeys((messageIDs: string[], threadID: string) => {\n const oldThread = oldMessageStore.threads[threadID];\n const truncate = truncationStatus[threadID];\n if (!oldThread) {\n return {\n messageIDs,\n startReached: truncate === messageTruncationStatus.EXHAUSTIVE,\n lastNavigatedTo: 0,\n lastPruned,\n };\n }\n const expectedTruncationStatus = oldThread.startReached\n ? messageTruncationStatus.EXHAUSTIVE\n : messageTruncationStatus.TRUNCATED;\n if (\n _isEqual(messageIDs)(oldThread.messageIDs) &&\n (truncate === messageTruncationStatus.UNCHANGED ||\n truncate === expectedTruncationStatus)\n ) {\n return oldThread;\n }\n let mergedMessageIDs = messageIDs;\n if (\n !replaceUnlessUnchanged ||\n truncate === messageTruncationStatus.UNCHANGED\n ) {\n const oldNotInNew = _difference(oldThread.messageIDs)(messageIDs);\n for (let messageID of oldNotInNew) {\n oldMessageInfosToCombine.push(oldMessageStore.messages[messageID]);\n }\n mergedMessageIDs = [ ...messageIDs, ...oldNotInNew ];\n mustResortThreadMessageIDs.push(threadID);\n }\n return {\n messageIDs: mergedMessageIDs,\n startReached: truncate === messageTruncationStatus.EXHAUSTIVE ||\n (truncate === messageTruncationStatus.UNCHANGED &&\n oldThread.startReached),\n lastNavigatedTo: oldThread.lastNavigatedTo,\n lastPruned: oldThread.lastPruned,\n };\n }),\n )(threadsToMessageIDs);\n\n for (let threadID in oldMessageStore.threads) {\n if (\n threads[threadID] ||\n (threadInfos && !threadIsWatched(threadInfos[threadID], watchedIDs))\n ) {\n continue;\n }\n const thread = oldMessageStore.threads[threadID];\n const truncate = truncationStatus[threadID];\n if (truncate === messageTruncationStatus.EXHAUSTIVE) {\n thread.startReached = true;\n }\n threads[threadID] = thread;\n for (let messageID of thread.messageIDs) {\n const messageInfo = oldMessageStore.messages[messageID];\n if (messageInfo) {\n oldMessageInfosToCombine.push(messageInfo);\n }\n }\n }\n\n for (let threadID in threadInfos) {\n const threadInfo = threadInfos[threadID];\n if (threads[threadID] || !threadIsWatched(threadInfo, watchedIDs)) {\n continue;\n }\n threads[threadID] = {\n messageIDs: [],\n // We can conclude that startReached, since no messages were returned\n startReached: true,\n lastNavigatedTo: 0,\n lastPruned,\n };\n }\n\n const messages = _flow(\n _orderBy('time')('desc'),\n _keyBy(messageID),\n )([ ...orderedNewMessageInfos, ...oldMessageInfosToCombine ]);\n\n for (let threadID of mustResortThreadMessageIDs) {\n threads[threadID].messageIDs = _orderBy([\n (messageID: string) => messages[messageID].time,\n ])('desc')(threads[threadID].messageIDs);\n }\n\n return { messages, threads };\n}", "function updateValues(data) {\n var queryMessage = \"INSERT INTO production.MATERIAL_PROD (prodmat_id,chargen_nr,whitness,ppml,absorbency,viscosity,delta_e) VALUES (\" + data[0][\"prodmat_id\"] + \",\" + data[0][\"chargen_nr\"] + \",\" + data[0][\"whiteness\"] + \",\" + data[0][\"ppml\"] + \",\" + data[0][\"absorbency\"] + \",\" + data[0][\"viscosity\"] + \",\" + data[0][\"delta_e\"] + \")\";\n\n if (data.length > 1) {\n for (var i = 1; i < data.length; i++) {\n queryMessage += \",(\" + data[i][\"prodmat_id\"] + \",\" + data[i][\"chargen_nr\"] + \",\" + data[i][\"whiteness\"] + \",\" + data[i][\"ppml\"] + \",\" + data[i][\"absorbency\"] + \",\" + data[i][\"viscosity\"] + \",\" + data[i][\"delta_e\"] + \")\";\n }\n }\n queryMessage += \"ON DUPLICATE KEY UPDATE prodmat_id = VALUES (prodmat_id), chargen_nr = VALUES (chargen_nr),whitness = VALUES (whitness),ppml = VALUES (ppml),absorbency = VALUES (absorbency),viscosity = VALUES (viscosity),delta_e = VALUES (delta_e)\";\n return (queryMessage);\n}", "function handleUpdateEvent(model) {\n\t\t\tvar matches = this.matchesQuery(model);\n\t\t\tvar existsInCollection = this.in(model);\n\n\t\t\tif (!existsInCollection && matches) {\n\t\t\t\tthis.addModel(model, true);\n\t\t\t} else if (existsInCollection && !matches) {\n\t\t\t\tthis.removeModel(model);\n\t\t\t}\n\t\t}", "function syncEntriesDownstream2(entryDetails) {\n var defer = $q.defer();\n var entries = [];\n console.log(\"aalatief - syncEntriesDownstream2 global.status = \" + global.status);\n console.log(\"aalatief - syncEntriesDownstream2 entryDetails = \" + JSON.stringify(entryDetails)); \n var promises = [];\n var listlocalid;\n var itemlocalid;\n entries.push(entryDetails.entry.entry) ;\n console.log(\"aalatief - entries =\" + JSON.stringify(entries));\n//aalatief testing \n Promise.all([dbHelper.getLocalIdFromServerId(entries.listServerId,'list'),dbHelper.getLocalIdFromServerId(entries.itemServerId,'item')]) \n \n .then(function (results) { \n console.log(\"aalatief - results = \" +JSON.stringify(results));\n })\n \n \n //aalatief calls pending entries postponed for now\n buildPromise(entryDetails, \"CREATE\").then(function (response) {\n\n console.log(\"syncEntriesDownstream server response \" + angular.toJson(response));\n\n /* syncDependentDownstream(response.data.item, response.data.retailers).then(function () {*/\n\n dbHelper.buildLocalIds2(entries).then(function (result) {\n console.log(\"serverHandlerEntryV2 localIds = \" + angular.toJson(result));\n affectedLists = result.lists;\n var insertPromises = [];\n for (var i = 0; i < entries.length; i++) {\n\n var localIds = dbHelper.getLocalIds(entries[i], result);\n console.log(\"syncEntriesDownstream entry i =\" + i + \" \" + angular.toJson(response.data.entries[i]));\n console.log(\"syncEntriesDownstream localIds =\" + angular.toJson(localIds));\n \n var retailerLocalId = '';\n var uom;\n if (entries[i].uom) {\n uom = entries[i].uom;\n } else {\n uom = \"PCS\";\n }\n\n var qty;\n if (entries[i].qty) {\n qty = entries[i].qty;\n } else {\n qty = 1.0;\n }\n console.log(\"serverHandlerEntry.syncEntriesDownstream localValues listLocalId = \" + angular.toJson(localIds));\n console.log(\"syncEntriesDownstream localValues qty = \" + qty);\n console.log(\"syncEntriesDownstream localValues uom = \" + uom);\n\n var entry = {\n /* listLocalId: listlocalid,\n itemLocalId: itemlocalid,*/\n /*itemName: localIds.itemName,\n categoryName: localIds.categoryName,*/\n quantity: qty,\n uom: uom,\n entryCrossedFlag: 0,\n deleted: 0,\n updatedFlag: 0,\n flag: 5,\n //seenFlag: 0,\n retailerLocalId: retailerLocalId,\n //retailerName: localIds.retailerName,\n language: 'EN' /*response.data.entries[i].entryServerId.language*/,\n entryServerId: entries[i].entryServerId,\n userServerId: entries[i].userServerId\n }; \n \n\n \n \n console.log(\"syncEntriesDownstream localIds =\" + JSON.stringify(entryDetails));\n $q.all([dbHelper.getLocalIdFromServerId(entries[i].listServerId,'list'),\n dbHelper.getLocalIdFromServerId(entries[i].itemServerId,'item')])\n .then(function(localId){\n listlocalid = localId[0].localId;\n itemlocalid = localId[1].localId;\n \n entry.listLocalId = listlocalid;\n entry.itemLocalId = itemlocalid;\n \n console.log(\"aalatief - syncEntriesDownstream2 localId =\" + JSON.stringify(localId));\n console.log(\"aalatief -itemlocalid: \"+itemlocalid+\" listlocalid \"+listlocalid);\n console.log(\"aalatief - entries =\" + JSON.stringify(entries[i]));\n \n \n \n \n console.log(\"syncEntriesDownstream $state.current.name = \" + $state.current.name);\n console.log(\"syncEntriesDownstream localIds.listLocalId = \" + listlocalid);\n console.log(\"syncEntriesDownstream global.currentList = \" + global.currentList);\n console.log(\"syncEntriesDownstream global.status = \" + global.status);\n\n if ($state.current.name == 'item' && global.currentList.listLocalId == listlocalid && global.status == 'foreground') {\n entry.flag = 6;\n entry.createStatus = 'FE_SEEN'\n }\n console.log(\"aalatief - syncEntriesDownstream addEntry = \" + JSON.stringify(entry)); \n insertPromises.push(addEntry(entry, 'S'));\n \n \n \n },function(error){\n console.log(\"aalatief - syncEntriesDownstream2 localId error=\" + JSON.stringify(error));\n }) ; \n\n /* if (!localIds.retailerLocalId)\n localIds.retailerLocalId = '';*/\n \n\n }\n $q.all(insertPromises).then(function () {\n console.log(\"syncEntriesDownstream db insert success\"+JSON.stringify(entries));\n \n //confirm Deleviry\n serverHandlerEntryEvents.syncBackEvent(entries, \"CREATE\"); \n //sync other seen entris\n serverHandlerEntryEvents.syncEventUpstream('CREATE-SEEN');\n //update new count flag in local database +1\n serverHandlerEntryEvents.updateListNotificationCount('newCount', affectedLists);\n defer.resolve(affectedLists);\n }, function () {\n console.error(\"syncEntriesDownstream did not insert resolving affected lists \" + angular.toJson(affectedLists));\n defer.resolve(affectedLists);\n });\n },\n function (err) {\n console.error(\"syncEntriesDownstream localIds errors\");\n defer.reject(err);\n });\n /* });*/\n }, function (err) {\n console.error(\"syncEntriesDownstream server response error \" + err.message);\n defer.reject(err);\n });\n return defer.promise;\n /* })*/\n }", "_onWrite (entry) {\n this._updateEntries([entry])\n this._decrementSendingMessageCounter()\n }", "async downloadAndCommitNewItemsOf(commitingItem, con) {\n if (!this.processingState.canContinue)\n return;\n\n let ids = [];\n let hashes = [];\n for (let newItem of commitingItem.newItems) {\n ids.push(newItem.id);\n\n // we are looking for updatingItem's parent subscriptions and want to update it\n if (newItem.state.parent != null)\n hashes.push(newItem.state.parent);\n\n // we are looking for updatingItem's subscriptions by origin\n hashes.push(newItem.getOrigin());\n }\n\n // The record may not exist due to ledger desync too, so we create it if need\n let rs = await this.node.ledger.arrayFindOrCreate(ids, ItemState.PENDING, 0, con);\n let i = 0;\n\n let hashesWithSubscriptions = await this.node.ledger.getItemsWithSubscriptions(hashes, con);\n\n for (let newItem of commitingItem.newItems) {\n //TODO: synchronize all items in transaction\n await this.node.lock.synchronize(newItem.id, async () => {\n let r = rs[i];\n i++;\n\n await r.approve(con, newItem.getExpiresAt(), false, true);\n\n //save newItem to DB in Permanet mode\n if (this.node.config.permanetMode)\n await this.node.ledger.putKeptItem(r, newItem, con);\n\n let newExtraResult = {};\n // if new item is smart contract node calls method onCreated or onUpdated\n if (newItem instanceof NSmartContract) {\n if (this.negativeNodes.has(this.node.myInfo))\n this.addItemToResync(this.itemId, this.record);\n else {\n newItem.nodeInfoProvider = this.node.nodeInfoProvider;\n\n let ime = await this.node.getEnvironmentByContract(newItem, con);\n ime.nameCache = this.node.nameCache;\n let me = ime.getMutable();\n\n if (newItem.state.revision === 1) {\n // and call onCreated\n newExtraResult.onCreatedResult = await this.item.onCreated(me);\n } else {\n newExtraResult.onUpdateResult = await this.item.onUpdated(me);\n\n new ScheduleExecutor(async () => await this.node.callbackService.synchronizeFollowerCallbacks(me.id),\n 1000, this.node.executorService).run();\n }\n\n await me.save(con);\n }\n }\n\n // update new item's smart contracts link to\n await this.notifyContractSubscribers(newItem, r.state, hashesWithSubscriptions, con);\n\n let result = ItemResult.fromStateRecord(r);\n result.extra = newExtraResult;\n if (this.node.cache.get(r.id) == null)\n this.node.cache.put(newItem, result, r);\n else\n this.node.cache.update(r.id, result);\n });\n\n new ScheduleExecutor(() => this.node.checkSpecialItem(this.item), 100, this.node.executorService).run();\n\n await this.downloadAndCommitNewItemsOf(newItem, con);\n }\n }", "function live_SaveORUpdateGameToStaging(gameData,cb) {\n\n StagingGame.findOne({_id: gameData._id}, function (err, res) {\n if (err) {\n logger.error(err);\n cb(err, null);\n }\n else {\n // compile staging game snapshot for LIVE\n staginggame = createGameModelForStaging_Live(gameData, res);\n\n if (res == null) {\n // No game found with received gameid , save this new game\n staginggame.save(function (err, res) {\n if (err) {\n logger.error(err);\n cb(err, null);\n } else {\n logger.info(\"live_stagingGame successfully saved to STAGING db \");\n copyFiles(gameData._id,function(err,done){\n logger.info(\"DONE Copying files : \",done);\n if(err){\n //remove game from staging\n StagingGame.remove({_id: gameData._id}, function(err, res){\n if(!err)\n {\n logger.info(\"!!!Game with id : \", gameData._id,\" successfully removed from staging game database !!!\");\n cb(err, null);\n }\n else {\n cb(err, false);\n }\n });\n }\n else {\n cb(null, {\"_id\": gameData._id});\n }\n })\n\n }\n });\n }\n else {\n staginggame.save({_id: gameData._id}, function (err, res) {\n if (err) {\n logger.error(\"ERROR UPDATING GAME: \" + gameData._id);\n cb(err, null);\n } else {\n logger.info(\"live_stagingGame successfully updated to STAGING db \" + gameData._id);\n copyFiles( gameData._id , function(err,done){\n logger.info(\"DONE Copying files : \",done);\n if(err){\n\n //remove game from staging\n StagingGame.remove({_id: gameData._id}, function(err, res){\n if(!err)\n {\n logger.info(\"\\n!!!Game with id : \", gameData._id,\" successfully removed from staging game database !!!\\n\");\n cb(err, null);\n }\n else {\n cb(err, false);\n }\n });\n }\n else {\n cb(null, {\"_id\": gameData._id});\n }\n })\n }\n\n });\n\n }\n }\n });\n}", "saveDesc(desc) {\n let diffDesc = []\n //find results that have updated\n desc.forEach(descr => {\n if (this.state.description.find(des => des.categoryID === descr.categoryID).score !== descr.score) {\n diffDesc.push(descr)\n }\n })\n if (diffDesc.length > 0){\n //patch new eqi\n fetch('http://localhost:443/result/eqi',{\n method: \"PATCH\",\n headers: {\n \"Content-type\": \"application/json\",\n Authorization: 'Bearer ' + this.props.token\n },\n body: JSON.stringify({results: diffDesc})\n })\n .then(res => res.json())\n .then(res => {\n this.setState({description:desc})\n })\n }\n }", "_syncLiveRecordArray(array, modelName) {\n (true && !(typeof modelName === 'string') && Ember.assert(`recordArrayManger.syncLiveRecordArray expects modelName not modelClass as the second param`, typeof modelName === 'string'));\n\n var hasNoPotentialDeletions = Object.keys(this._pending).length === 0;\n var map = this.store._internalModelsFor(modelName);\n var hasNoInsertionsOrRemovals = Ember.get(map, 'length') === Ember.get(array, 'length');\n\n /*\n Ideally the recordArrayManager has knowledge of the changes to be applied to\n liveRecordArrays, and is capable of strategically flushing those changes and applying\n small diffs if desired. However, until we've refactored recordArrayManager, this dirty\n check prevents us from unnecessarily wiping out live record arrays returned by peekAll.\n */\n if (hasNoPotentialDeletions && hasNoInsertionsOrRemovals) {\n return;\n }\n\n var internalModels = this._visibleInternalModelsByType(modelName);\n var modelsToAdd = [];\n for (var i = 0; i < internalModels.length; i++) {\n var internalModel = internalModels[i];\n var recordArrays = internalModel._recordArrays;\n if (recordArrays.has(array) === false) {\n recordArrays.add(array);\n modelsToAdd.push(internalModel);\n }\n }\n\n array._pushInternalModels(modelsToAdd);\n }", "getMessageById(req,res){\n const messageId=req.params.messageId;\n const sql=\"SELECT * FROM messages WHERE message_id=$1 AND receiver_id=$2\";\n pool.query(sql,[messageId,req.user.id])\n .then(messages=>{\n if(messages.rows.length===0){\n return res.status(404).json({error:\"sorry message not found.\"});\n }else{\n //@update messages\n const updateMessage=\"UPDATE messages SET status=$1 WHERE message_id=$2 RETURNING *\";\n pool.query(updateMessage,[\"Read\",messageId])\n .then(data=>{\n return res.status(200).json({alert:\"message\",messages:data.rows});\n })\n .catch((errors)=>{\n //console.log(errors);\n return res.status(500).json({errors});\n })\n }\n })\n .catch((error)=>{\n // console.log(error);\n return res.status(500).json({error});\n })\n}", "beforeApplyUpdate() {\n /*\n * Stop watching for any updates. If there are still status updates\n * pending, render() will re-register for updates.\n */\n this.model.stopWatchingUpdates();\n\n /*\n * Store any diff fragments for the reload, so we don't have to\n * fetch them again from the server.\n */\n const diffFragmentQueue = RB.PageManager.getPage().diffFragmentQueue;\n const diffCommentsData = this.model.get('diffCommentsData') || [];\n\n for (let i = 0; i < diffCommentsData.length; i++) {\n diffFragmentQueue.saveFragment(diffCommentsData[i][0]);\n }\n }", "putReviews(reviews) {\n if (!reviews.push) reviews = [reviews];\n return this.db.then(db => {\n const store = db.transaction('reviews', 'readwrite').objectStore('reviews');\n Promise.all(reviews.map(networkReview => {\n return store.get(networkReview.id).then(idbReview => {\n if (!idbReview || new Date(networkReview.updatedAt) > new Date(idbReview.updatedAt)) {\n return store.put(networkReview);\n }\n });\n })).then(function () {\n return store.complete;\n });\n });\n }", "sendRequest(req, res, next) {\n const rqsterId = req.body.tokenId\n const rqsteeId = req.params.id\n let query = sortUsers(rqsterId, rqsteeId)\n console.log(\"User1: \" + query.user1)\n console.log(\"User2: \" + query.user2)\n Relationship.find({$and: [{ user1: query.user1 } , { use2: query.user2 }, { relation: 1 }]})\n .then(data => {\n if (data.length) res.json({message:'Already friends!', success: false })\n else {\n let updateSender = Player.findByIdAndUpdate(rqsterId, \n { $push: {'friends.pending_sent': rqsteeId }}, \n { new: true })\n let updateReceiver = Player.findByIdAndUpdate(rqsteeId, \n { $push: {'friends.pending_received': rqsterId }}, \n { new: true })\n \n Promise.all([updateSender, updateReceiver])\n .then(data => {\n if (data[0] == null) {\n if (data[1] == null) res.send('Your request has failed, Nobody found, pls try again later')\n else {\n Player.findByIdAndUpdate(rqsteeId, \n { $pullAll: {'friends.pending_received': [rqsterId] }}, \n { new: true }) \n .then(data => {\n res.send('Your request has failed, Sender not found, pls try again later')\n })\n .catch(err => {\n res.send(err)\n }) \n }\n } else if (data[1] == null && data[0] != null) {\n Player.findByIdAndUpdate(rqsterId, \n { pullAll: { 'friends.pending_sent': [rqsteeId] }}, \n { new: true })\n .then(data => {\n res.send('Your request has failed, Receiver not found, pls try again later')\n })\n .catch(err => {\n res.send(err)\n }) \n } else {\n res.send(data[0])\n }\n })\n .catch(err => {\n res.send(err)\n })\n }\n })\n .catch(err => {\n console.log(err)\n })\n }", "_update(update) {\n Channel._preprocessUpdate(update, this._sid);\n\n let updated = false;\n for (let key in update) {\n let localKey = fieldMappings[key];\n if (!localKey) {\n continue;\n }\n\n if (localKey === fieldMappings.status) {\n this._status = filterStatus(update.status);\n } else if (localKey === fieldMappings.attributes) {\n if (!JsonDiff.isDeepEqual(this._attributes, update.attributes)) {\n this._attributes = update.attributes;\n updated = true;\n }\n } else if (update[key] instanceof Date) {\n if (!this[localKey] || this[localKey].getTime() !== update[key].getTime()) {\n this['_' + localKey] = update[key];\n updated = true;\n }\n } else if (this[localKey] !== update[key]) {\n this['_' + localKey] = update[key];\n updated = true;\n }\n }\n\n // if uniqueName is not present in the update - then we should set it to null on the client object\n if (!update.status && !update.uniqueName) {\n if (this._uniqueName) {\n this._uniqueName = null;\n updated = true;\n }\n }\n\n if (updated) { this.emit('updated', this); }\n }", "async determineChanges () {\n\t\tthis.changes = {};\n\t\tObject.keys(this.attributes).forEach(attribute => {\n\t\t\tif (attribute === 'id' || attribute === '_id') { return; }\n\t\t\tif (!this.attributesAreEqual(\n\t\t\t\tthis.existingModel.get(attribute),\n\t\t\t\tthis.attributes[attribute])\n\t\t\t) {\n\t\t\t\tthis.changes[attribute] = this.attributes[attribute];\n\t\t\t}\n\t\t});\n\t}", "async function updateRecord(){\n for(i=0; i<records.length; i++){\n if(records[i].profileName == lastVisitedProfile.profileName){\n records[i].timeOnFB = records[i].timeOnFB + timeOnFB;\n return;\n }\n }\n records.push({profileName: lastVisitedProfile.profileName, profilePic: lastVisitedProfile.profilePic, timeOnFB: timeOnFB});\n return;\n}", "function populateCollection(collection, data, exampleKeys) {\n var metadata = {}\n return Promise.each(Object.keys(data), function(key) {\n console.log('~~~', data[key])\n var example = {}\n exampleKeys.forEach(function(k){\n example[k] = data[key][k];\n })\n example._type = data[key]._type;\n return Promise.resolve(collection.byExample(example)).call('all').then(function(matches) {\n if (matches.length === 0) {\n return collection.save(data[key]).then(function(res) {\n return metadata[key] = res;\n })\n }\n// If a single match is found, update it; apply extra handling for person matches\n if (matches.length === 1) {\n var update = data[key];\n if (example._type === 'person') update = handleUpdatePersonMatches(example, matches[0]);\n// console.log('node already exists. Updating', example,' with', update);\n return collection.update(matches[0]._id, update).then(function(res) {\n return metadata[key] = res;\n });\n }\n// Do not attempt to update when multiple matching nodes are found, except make an attempt for persons (disabled at the moment);\n if (matches.length > 1) {\n/*\n if (example._type === 'person') {\n var update = handleMultiplePersonMatches(example, matches);\n if (update) {\n console.log('multiple matches found for example. updating: ', example, 'with', update, matches)\n return collection.update(update._id, update);\n }\n }\n*/\n console.log('multiple matches found for example. Creating a unique node: ', example, matches)\n return collection.save(data[key]).then(function(res) {\n return metadata[key] = res\n })\n }\n })\n }).catch(function(err) { console.log(err)\n }).then(function(result) {\n return metadata\n })\n}", "async _checkRecords(index, record) {\n\t\tlet write = false;\n\n\t\tfor (const [index, record] of this.cache.records.entries()) {\n\t\t\tif (this.cache.currentIPv4 === record.recordContent || \n\t\t\t\tthis.cache.currentIPv6 === record.recordContent)\n\t\t\t\tcontinue;\n\t\n\t\t\tconsole.log(`Updating DNS record ${index} from ${record.recordContent} to ` +\n\t\t\t\t(record.ipv6 ? this.cache.currentIPv6 : this.cache.currentIPv4));\n\t\n\t\t\ttry {\n\t\t\t\tawait this._updateRecord(index);\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error('Error updating DNS record:\\n' + err);\n\t\t\t\tprocess.exit();\n\t\t\t}\n\t\n\t\t\tconsole.log('DNS record is up to date.');\n\t\t\twrite = true;\n\t\t}\n\n\t\treturn write;\n\t}", "ProcessDocChanges(documents) {\n // process document changes to build a list of documents for us to fetch in batches\n const docRequest = [];\n\n documents.forEach((doc) => {\n if (doc.deleted) {\n // TODO - remove document from database?\n\n // emit document deleted event\n this.emit('deleted', doc);\n } else if (doc.changes !== undefined && doc.changes.length) {\n let AlreadyHaveChange = false;\n docRequest.forEach((docRequested) => {\n if (docRequested.id === doc.id) {\n AlreadyHaveChange = true;\n\n // compare revision numbers\n if (RevisionToInt(doc.changes[0].rev) > RevisionToInt(docRequested.rev)) {\n // if this revision is greater than our existing one, replace\n docRequested.rev = doc.changes[0].rev;\n }\n\n // don't break out of for-loop in case there are even more revision in the changelist\n }\n });\n\n // push new change if we haven't already got one for this document ID in our list\n if (!AlreadyHaveChange) {\n docRequest.push({\n atts_since: null,\n rev: doc.changes[0].rev,\n id: doc.id,\n });\n }\n }\n });\n\n if (docRequest.length === 0) {\n this.Log('Extracted 0 document changes, skipping fetch');\n\n return Promise.resolve();\n }\n this.Log(`Extracted ${docRequest.length} document changes to fetch`);\n\n // filter out document revisions we already have\n return this.FilterAlreadyGotRevisions(docRequest).then((filteredDocRequest) => {\n this.Log(`After filtering on already-got revisions, left with ${filteredDocRequest.length} documents to fetch`);\n\n // split document requests into batches of docFetchBatchSize size\n const batches = [];\n while (filteredDocRequest.length > 0) {\n batches.push(filteredDocRequest.splice(0, Math.min(docFetchBatchSize, filteredDocRequest.length)));\n }\n\n this.Log(`Split document changes into ${batches.length} batches`);\n\n // resolve promises with each batch in order\n return batches.reduce((prev, cur) => prev.then(() => this.ProcessDocChangeBatch(cur)), Promise.resolve()).then(() => Promise.resolve());\n });\n }", "updatePuntsWithMakeup (puntArr, makeupTemplate, markAsComplete, callback) { // [Punt], PuntMakeupTemplate, Bool\n var batch = fb.db.batch()\n\n const makeupTemplateRef = fb.puntMakeupTemplatesRef.doc(makeupTemplate.id)\n const completionTime = markAsComplete ? new Date() : null\n\n puntArr.forEach(punt => {\n const assigneeRef = fb.usersRef.doc(punt.assignee.id)\n\n if (punt.makeUp !== null) {\n const oldMakeupRef = fb.puntMakeupsRef.doc(punt.makeUp.id)\n\n const makeupUpdateObj = {\n [puntMakeupKeys.completionTime]: completionTime,\n [puntMakeupKeys.template]: makeupTemplateRef\n }\n\n batch.update(oldMakeupRef, makeupUpdateObj)\n } else {\n const newMakeupRef = fb.puntMakeupsRef.doc()\n const newMakeupObj = {\n [puntMakeupKeys.completionTime]: completionTime,\n [puntMakeupKeys.template]: makeupTemplateRef,\n [puntMakeupKeys.assignee]: assigneeRef\n }\n\n batch.set(newMakeupRef, newMakeupObj)\n\n const puntRef = fb.allPuntsRef.doc(punt.id)\n const puntUpdateObj = {\n [puntKeys.makeUp]: newMakeupRef\n }\n\n batch.update(puntRef, puntUpdateObj)\n }\n })\n\n batch.commit()\n .then(() => { // Success\n callback(null)\n }, (error) => { // Failure\n callback(new Error(error))\n }).catch((error) => { // Error in callback\n throw error\n })\n }", "function updatePost(dbPostId){\n // Check if post exists in DB\n Post.findById(dbPostId).exec(function(err,post){\n if(err)\n console.log(err)\n else {\n if(post.length == 0)\n console.log(dbPostId + \" post does not exist in database\");\n else {\n //Main function logic goes in here\n request(\"https://graph.facebook.com/\" + post.fbId + \"?fields=message,attachments,updated_time&access_token=\" + Credentials.fb_token, function (err, response, body){\n if(!err && response.statusCode == 200){\n var currentPostJson = JSON.parse(body);\n \n // additional undefined checks needed \n var currentAttachments = [],\n currentMessage = currentPostJson[\"message\"],\n currentUpdatedTime = new Date(currentPostJson[\"updated_time\"]);\n \n // if updatedTime is the same, don't update \n if(currentUpdatedTime.getTime() === post.updatedTime.getTime()) {\n //console.log(dbPostId + \" post is up-to-date\" );\n }\n else {\n // separate checks needed for possibly undefined nested properties\n // KNOWN BUG: Sub-attachments (Multiple attachments for one post) not accounted for yet\n if (typeof currentPostJson[\"attachments\"] != 'undefined') { \n currentPostJson[\"attachments\"][\"data\"].forEach(function(object){\n for (var content in object[\"media\"]){\n currentAttachments.push(object[\"media\"][content][\"src\"]);\n }\n });\n }\n \n post.message = currentMessage;\n post.updatedTime = currentUpdatedTime;\n post.attachments = currentAttachments;\n post.save();\n }\n \n } else {\n console.log(\"updatePost: Unsuccessful Graph API call\");\n console.log(err + \"\\n\" +\n \"Response: \" + response);\n }\n }); \n }\n }\n });\n}", "function recordInDB_file_modified(file, str) {\n if (file.search(\"select-27.csv\") == -1) return;\n readFileToArr('./modelt-az-report-repository/' + file, function (file_content) {\n var updated_file_content = file_content[0].join(\",\") + \"\\n\\n\";\n //console.log(\"\\n\\n*********************************\\n\" + updated_file_content + \"***************************************\\n\\n\");\n var lines = str.split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n (function (i) {\n if (lines[i].substring(0, 2) == \"@@\") {\n for (var k = i + 1; k < lines.length; k++) {\n (function (k) {\n //console.log(\"\\n\" + lines[k] + \"\\n\");\n if (lines[k][0] == \"+\" || lines[k][0] == \"-\") {\n var line_content = lines[k].split(\",\");\n if (line_content.length == 11 && line_content[3] != \"------\") {\n var customer_id = line_content[0].substring(1, line_content[0].length);\n var customer_code = line_content[1];\n var customer_name = line_content[2];\n var env_id = line_content[3];\n var env_code = line_content[4];\n var env_name = line_content[5];\n var deployment_id = line_content[6];\n var failed_deployment = line_content[7];\n var deployment_started = line_content[8];\n var time_queried = line_content[9];\n var already_running_in_minutes = line_content[10];\n\n var contentStr = {\n ChangedFile: file,\n ChangeType: {$ne: \"Delete\"},\n CustomerID: customer_id,\n EnvID: env_id,\n DeploymentID: deployment_id,\n };\n\n //console.log(contentStr);\n const link = getModelTLink(file, deployment_id);\n // SUB\n // -: update DB\n if (lines[k][0] == \"+\") {\n updated_file_content = updated_file_content + \"-\" + lines[k].substring(1, lines[k].length) + \"\\n\" + link + \"\\n\";\n\n MongoClient.connect(DB_CONN_STR, {\n useNewUrlParser: true,\n useUnifiedTopology: true\n }, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO DELETE A LINE IN FILE\\n\");\n var dbo = db.db(\"sap-cx\");\n var collection = dbo.collection(\"CCv2LongRunningDeployment\");\n collection.updateOne(\n contentStr, {\n $set: {\n ChangeType: \"Delete\",\n DeleteTime: Date()\n }\n }, function (err, result) {\n if (err) console.log(err);\n //console.log(result);\n });\n db.close();\n });\n }\n // ADD\n // +: insert / update DB\n else if (lines[k][0] == \"-\") {\n // notification email content by line\n updated_file_content = updated_file_content + \"+\" + lines[k].substring(1, lines[k].length) + \"\\n\" + link + \"\\n\";\n // INSERT\n var document = {\n DBTime: Date(),\n ChangedFile: file,\n ChangeType: \"Insert\",\n CustomerID: customer_id,\n CustomerCode: customer_code,\n CustomerName: customer_name,\n EnvID: env_id,\n EnvCode: env_code,\n EnvName: env_name,\n DeploymentID: deployment_id,\n FailedDeployment: failed_deployment,\n DeploymentStarted: deployment_started,\n TimeQueried: time_queried,\n AlreadyRunningInMinutes: already_running_in_minutes,\n Link: link,\n DeleteTime: \"/\"\n };\n MongoClient.connect(DB_CONN_STR, {\n useNewUrlParser: true,\n useUnifiedTopology: true\n }, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO INSERT A FILE LINE\\n\");\n var dbo = db.db(\"sap-cx\");\n var collection = dbo.collection(\"CCv2LongRunningDeployment\");\n collection.insertOne(document, function (err, result) {\n if (err) console.log(err);\n //console.log(result);\n db.close();\n });\n });\n }\n }\n }\n })(k);\n }\n }\n })(i);\n }\n // send notification email\n sendNotificationEmail(file, 2, updated_file_content);\n });\n}", "onStoreUpdateRecord(params) {\n if (!this.project.isBatchingChanges) {\n let result;\n\n this.runWithTransition(() => {\n result = super.onStoreUpdateRecord(params);\n });\n\n return result;\n }\n }", "async batchMinedPayments( )\n {\n var self = this ;\n\n var unbatched_pmnts = await self.mongoInterface.findAll('balance_payment',{batchId: null})\n\n\n var batchedPayments = 0;\n\n\n const MIN_PAYMENTS_IN_BATCH = 5; //5\n\n if( unbatched_pmnts.length >= MIN_PAYMENTS_IN_BATCH)\n {\n\n\n var batchData = {\n id: web3utils.randomHex(32),\n confirmed: false\n }\n\n await self.mongoInterface.upsertOne('payment_batch',{id: batchData.id}, batchData )\n\n\n\n var paymentsToBatch = unbatched_pmnts.slice(0,25) //max to batch is 25\n\n for( var element of paymentsToBatch ) {\n\n element.batchId = batchData.id;\n\n await self.mongoInterface.upsertOne('balance_payment',{id: element.id}, element )\n\n batchedPayments++;\n\n }\n\n\n }\n\n return {success:true,batchedPayments:batchedPayments} ;\n }", "static addNewReviewsWhenOnline() {\n this.restaurantsDb.selectObjects(this.restaurantsDb.pendingReviewsTable)\n .then(pendingReviews => {\n if (pendingReviews.length) {\n const cleanPendingReviews = this.deleteTempProperties(pendingReviews)\n cleanPendingReviews.forEach(pendingReview => {\n this.fetchAddNewReview(pendingReview).then(response => {\n this.restaurantsDb.insertObjects(this.restaurantsDb.reviewsTable, [response]);\n })\n });\n }\n }).then(() => {\n this.restaurantsDb.clearTable(this.restaurantsDb.pendingReviewsTable);\n });\n }", "updateHandler() {\n\n // 1. Check if its (a) new note to be added or (b) update the existing note based on selectedBoardID\n var selectedBoardID = this.view.boardView.selectedBoardID;\n if (selectedBoardID === -1) {\n\n // There are 3-scenarios of add/insert\n // 1. First note added\n // 2. Insert after the last board displayed\n // 3. Append at last\n\n // 1. First note added\n if (this.startNoteID === -1 && this.endNoteID === -1) {\n\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = 0;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the empty board (if any) or the last board\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID\n this.startNoteID = 0;\n this.endNoteID = 0;\n\n } else {\n if (this.view.boardView.noOfNotes === this.view.boardView.maxNoBoards) {\n\n // NOTE: Board is full condition\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = this.endNoteID + 1;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the empty board (if any) or the last board\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID\n ++this.endNoteID;\n ++this.startNoteID;\n\n } else if (this.view.boardView.noOfNotes < this.view.boardView.maxNoBoards) {\n\n // Still empty boards are available to be filled\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = this.endNoteID + 1;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the end of the noteCollection\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID \n ++this.endNoteID;\n }\n }\n\n } else {\n\n // Update the existing note\n // 1. Update the note in the model\n var noteToBeUpdated = this.view.boardView.boardCollection[selectedBoardID].getNote();\n this.model.updateNote(noteToBeUpdated.noteID, this.noteForm.elementCollection);\n\n // 2. Update the note in the view\n var updatedNote = this.model.noteCollection[noteToBeUpdated.noteID];\n this.view.boardView.displayNoteAt(selectedBoardID, noteToBeUpdated.noteID, updatedNote.name);\n }\n }", "updatePendingMessagesOffer(id , data){\n return this.schema.updateOne({'pendingMessages.offerId' : id },\n { '$set' : {'pendingMessages.$.messageState': data} });\n }", "updateRecords(changes, namespace) {\n var changedObject,\n changedObjectIndex,\n objectExists,\n changedObjectKey;\n\n // If storageType is changed then source the data in new storage\n if (namespace === 'sync' && changes.hasOwnProperty('storageType') && changes['storageType'].newValue) {\n this.switchStorageType(changes['storageType'].newValue);\n return;\n }\n\n if (this.DB === chrome.storage[namespace]) {\n for (changedObjectKey in changes) {\n if (!changes.hasOwnProperty(changedObjectKey)) {\n continue;\n }\n\n changedObject = changes[changedObjectKey];\n changedObjectIndex = this.getCachedRecordIndex(changedObjectKey);\n objectExists = (changedObjectIndex !== -1);\n\n // Add/Update Object operation\n if (typeof changedObject.newValue !== 'undefined') {\n // Don't cache records when objects do not contain primaryKeys\n if (!this.hasPrimaryKey(changedObject.newValue)) {\n continue;\n }\n\n objectExists\n ? this.records[changedObjectIndex] = changedObject.newValue /* Update existing object (Edit) */\n : this.records.push(changedObject.newValue); /* Create New Object */\n }\n\n // Delete Rule Operation\n if (typeof changedObject.oldValue !== 'undefined' && typeof changedObject.newValue === 'undefined' && objectExists) {\n this.records.splice(changedObjectIndex, 1);\n }\n }\n }\n }", "function update_account_and_user_emails() {\n var user, doc_id;\n \n db.accounts.find({terminated: false}).limit(2000).forEach(function(account) {\n user = db.users.findOne({_id : account.account_owner});\n\n try {\n\n if(user.email !== account.contact.email) {\n // Creates a new ObjectId for the document since insert() does not return last id in 2.4.8 and below\n doc_id = new ObjectId;\n \n // Log the change before\n db.updated_contact_emails.insert({_id : doc_id, 'before' :\n {\n 'name' : user.name,\n 'user_id' : user._id,\n 'contact_email' : account.contact.email === undefined ? null : account.contact.email,\n 'primary_email' : user.email,\n 'secondary_email' : user.secondary_email === undefined ? null : user.secondary_email,\n 'account_id' : account._id,\n 'created_at' : ISODate(new Date().toISOString())\n },\n 'after' : {}\n }); \n\n // Sets the contact email as the scondary email\n db.users.update({_id : user._id}, {$set : {secondary_email : account.contact.email}});\n\n // Sets the login email (primary email) as the contect email\n db.accounts.update({_id : account._id}, {$set : {'contact.email' : user.email}});\n\n // Log the change after\n db.updated_contact_emails.update({_id : doc_id},\n {\n $set : {'after':{\n 'name' : user.name,\n 'user_id' : user._id,\n 'contact_email' : account.contact.email === undefined ? null : account.contact.email,\n 'primary_email' : user.email,\n 'secondary_email' : user.secondary_email === undefined ? null : user.secondary_email,\n 'account_id' : account._id,\n 'created_at' : ISODate(new Date().toISOString())\n }\n } \n });\n \n } \n \n }\n catch(e) {\n print(\"Could not update account and user\");\n print(\"AccountID: \" + account._id);\n print(\"Account Owner: \" + account.account_owner);\n print(e);\n print(\"-----------------------------------------------------\");\n }\n });\n\n}", "function testPostUpdateState (cb) {\n d.find({}, function (err, docs) {\n var doc1 = _.find(docs, function (d) { return d._id === id1; })\n , doc2 = _.find(docs, function (d) { return d._id === id2; })\n , doc3 = _.find(docs, function (d) { return d._id === id3; })\n ;\n\n docs.length.should.equal(3);\n\n Object.keys(doc1).length.should.equal(2);\n doc1.somedata.should.equal('ok');\n doc1._id.should.equal(id1);\n\n Object.keys(doc2).length.should.equal(2);\n doc2.newDoc.should.equal('yes');\n doc2._id.should.equal(id2);\n\n Object.keys(doc3).length.should.equal(2);\n doc3.newDoc.should.equal('yes');\n doc3._id.should.equal(id3);\n\n return cb();\n });\n }", "function syncDiff(original, incoming) {\n const diff = Object.keys(incoming).reduce((result, incomingRowId) => {\n const originalRow = original[incomingRowId];\n const incomingRow = incoming[incomingRowId];\n /**\n * When there isn't any matching row, we need to insert\n * the upcoming row\n */\n if (!originalRow) {\n result.added[incomingRowId] = incomingRow;\n }\n else if (Object.keys(incomingRow).find((key) => incomingRow[key] !== originalRow[key])) {\n /**\n * If any of the row attributes are different, then we must\n * update that row\n */\n result.updated[incomingRowId] = incomingRow;\n }\n return result;\n }, { added: {}, updated: {} });\n return diff;\n}", "function recordInDB_file_deleted(file) {\n if (file.search(\"select-27.csv\") == -1) return;\n MongoClient.connect(DB_CONN_STR, {useNewUrlParser: true, useUnifiedTopology: true}, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO DELETE WHOLE FILE LINES\");\n var dbo = db.db(\"sap-cx\");\n var collection = dbo.collection(\"CCv2LongRunningDeployment\");\n collection.updateMany({ChangedFile: file, DeleteTime: \"/\", ChangeType: {$ne: \"Delete\"}}, {\n $set: {\n DeleteTime: Date(),\n ChangeType: \"Delete\"\n }\n }, function (err, res) {\n if (err) console.log(err);\n console.log(res.result.nModified + \"Documents Updated.\\n\");\n });\n db.close();\n });\n readFileToArr('./modelt-az-report-repository/' + file, function (file_content) {\n //console.log(file_content);\n var updated_file_content = file_content[0].join(\",\") + \"\\n\\n\";\n //console.log(\"\\n\\n*********************************\\n\" + updated_file_content + \"***************************************\\n\\n\");\n file_content.forEach(function (file_content_i) {\n //console.log(file_content[i].length);\n //if(file_content_i != file_content[0] && file_content_i.length == file_content[0].length) {\n if (file_content_i != file_content[0] && file_content_i.length == file_content[0].length && file_content_i[0] != \"-----------\") {\n const link = getModelTLink(file, file_content_i[6]);\n updated_file_content = updated_file_content + \"-\" + file_content_i.join(',') + \"\\n\" + link + \"\\n\";\n }\n });\n // send notification email\n sendNotificationEmail(file, 1, updated_file_content)\n });\n}", "suspendChangesTracking() {\n this.crudIgnoreUpdates++;\n }", "function applyChanges(dbItem, stored, parsed) {\n\tlet changes = {};\n\tlet changed = false;\n\tconst ignore = ['created','updated','deleted'];\n\tconst done = [];\n\tconst change = key => {\n\t\tchanges[key] = parsed[key] === undefined ? null : parsed[key];\n\t\tchanges['updated'] = Firebase.ServerValue.TIMESTAMP;\n\t\tchanged = true;\n\t};\n\n\tfor (let key in stored) {\n\t\tdone.push(key);\n\t\tif (ignore.indexOf(key) == -1 &&\n\t\t\tstored.hasOwnProperty(key) &&\n\t\t\tstored[key] != parsed[key]) { change(key); }\n\t}\n\tfor (let key in parsed) {\n\t\tif (done.indexOf(key) == -1 &&\n\t\t\tparsed.hasOwnProperty(key)) { change(key); }\n\t}\n\tif (changed) { dbItem.update(changes); }\n}", "async update() {\n this.emit('updating');\n for (let retry = 0; retry < UPDATE_RETRIES; retry++) {\n Log('update:', retry);\n try {\n if (await this.connect()) {\n await this.read();\n return true;\n }\n }\n catch (e) {\n Log(e);\n Log('error during update');\n this._validated = false;\n this.detach();\n }\n }\n return false;\n }", "updateWith(data) {\n this.formattedTime(data.formattedTime);\n this.updatedAt(data.updatedAt);\n this.state(data.state);\n this.commentAmount(data.commentAmount);\n this.message(data.message);\n return this.isDeleted(data.isDeleted);\n }", "function insertInvite(req, res, next) {\n\n let newInv = new Invite({\n 'from': req.user.username,\n 'to': req.body.to,\n 'group': req.body.group,\n 'permissions': req.body.permissions\n });\n\n inviteMapper.getAll((err, invites) => {\n if (err) {\n next(err);\n }\n let equalFound = false;\n invites.forEach((element) => {\n if (newInv.equals(element)) {\n equalFound = true;\n //modify the element to be updated\n element.permissions = newInv.permissions;\n inviteMapper.update(element);\n return;\n }\n\n });\n if (equalFound) {\n return;\n }\n //an equal invite wasnt found\n\n inviteMapper.insert(newInv, ((err, id) => {\n if (err) {\n return next(err);\n }\n console.log(`Inserted a new invite with the id ${id}`);\n }));\n });\n}", "_verifyReinsertion(record, item, itemTrackBy, index) {\n let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev, index);\n }\n else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }", "_verifyReinsertion(record, item, itemTrackBy, index) {\n let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev, index);\n }\n else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }", "_verifyReinsertion(record, item, itemTrackBy, index) {\n let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev, index);\n }\n else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }", "_verifyReinsertion(record, item, itemTrackBy, index) {\n let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev, index);\n }\n else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }", "_verifyReinsertion(record, item, itemTrackBy, index) {\n let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev, index);\n }\n else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }", "_verifyReinsertion(record, item, itemTrackBy, index) {\n let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev, index);\n }\n else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }", "function checkForUpdates(){\n (getNewTelegrams() || []).map(t => sendTelegram(t));\n (getNewArticles() || []).map(a => sendUpdate(a));\n}", "uploadChanges() {\n const rowsData = this.readAllEntitiesFromSheet_();\n this.createNewEntities_(\n rowsData.filter((data) => data.action === 'CREATE'));\n this.updateData_(rowsData.filter((data) => data.action === 'MODIFY'));\n this.deleteEntries_(rowsData.filter((data) => data.action === 'DELETE'));\n }", "collectionsUpdated(ctx, recordTypeNames) {\n\n\t\t// check if anything was updated\n\t\tif (!recordTypeNames ||\n\t\t\t(Array.isArray(recordTypeNames) && (recordTypeNames.length === 0)) ||\n\t\t\t(recordTypeNames.size === 0))\n\t\t\treturn;\n\n\t\t// update the table\n\t\treturn this._init.then(() => new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tlet lastSql;\n\t\t\t\tctx.dbDriver.updateVersionTable(\n\t\t\t\t\tctx.connection, TABLE, Array.from(recordTypeNames),\n\t\t\t\t\tctx.executedOn, {\n\t\t\t\t\t\ttrace(sql) {\n\t\t\t\t\t\t\tlastSql = sql;\n\t\t\t\t\t\t\tctx.log(\n\t\t\t\t\t\t\t\t`(tx #${ctx.transaction.id}) executing SQL: ` +\n\t\t\t\t\t\t\t\t\tsql);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonSuccess() {\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError(err) {\n\t\t\t\t\t\t\tcommon.error(\n\t\t\t\t\t\t\t\t`error executing SQL [${lastSql}]`, err);\n\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} catch (err) {\n\t\t\t\tcommon.error(\n\t\t\t\t\t'error updating record collections monitor table', err);\n\t\t\t\treject(err);\n\t\t\t}\n\t\t}));\n\t}", "updateEntry(geoTestId,method_used,history_of_soil_sample,period_of_soaking_soil_sample_before_testing,trialSelected,number_of_blows_N,\r\n cup_number_ll,weight_of_the_cup_ll,weight_of_wet_soil_cup_ll,weight_of_dry_soil_cup_ll,water_content_ll,cup_number_pl,\r\n weight_of_the_cup_pl,weight_of_wet_soil_cup_pl,weight_of_dry_soil_cup_pl,water_content_pl){\r\n\r\n console.log(\"inside update entry func in atterberg limits db.js\");\r\n\r\n return new Promise((resolve, reject)=>{\r\n\r\n Determination_of_atterberg_limits.updateOne({geoTestId:geoTestId}, // updating values in the database\r\n {$set:\r\n {\r\n geoTestId : geoTestId,\r\n method_used : method_used,\r\n history_of_soil_sample : history_of_soil_sample,\r\n period_of_soaking_soil_sample_before_testing : period_of_soaking_soil_sample_before_testing,\r\n trialSelected : trialSelected,\r\n\r\n number_of_blows_N : number_of_blows_N,\r\n cup_number_ll : cup_number_ll,\r\n weight_of_the_cup_ll : weight_of_the_cup_ll,\r\n weight_of_wet_soil_cup_ll : weight_of_wet_soil_cup_ll,\r\n weight_of_dry_soil_cup_ll : weight_of_dry_soil_cup_ll,\r\n water_content_ll : water_content_ll,\r\n\r\n cup_number_pl : cup_number_pl,\r\n weight_of_the_cup_pl : weight_of_the_cup_pl,\r\n weight_of_wet_soil_cup_pl : weight_of_wet_soil_cup_pl,\r\n weight_of_dry_soil_cup_pl : weight_of_dry_soil_cup_pl,\r\n water_content_pl : water_content_pl,\r\n\r\n }\r\n })\r\n .then(response => resolve(response))\r\n .catch(err => reject(err));\r\n })\r\n }", "function createMatch(){\n return new Promise((resolve, reject) => {\n const sql = `BEGIN\n INSERT INTO GK7.matches (like_id, user1, user2)\n SELECT l1.id as like_id, l1.sender_id as user1, l1.receiver_id as user2\n FROM GK7.likes l1, GK7.likes l2\n WHERE (l1.sender_id = l2.receiver_id AND l2.sender_id = l1.receiver_id)\n AND l1.id < l2.id AND l1.id NOT IN (\n SELECT like_id FROM GK7.matches)\n END`\n const request = new Request(sql, err => {\n if (err) {\n reject (err)\n console.log(err)\n }\n \n });request.on('requestCompleted', (row) => {\n console.log('Match inserted', row); \n resolve('match inserted', row)\n });\n connection.execSql(request) \n \n})}", "function _saveLocalEdit() {\n\n // get changed vars\n var columnList = [];\n\n // changed names\n columnList.push({ column: \"playername\", value: firstname });\n columnList.push({ column: \"coachname\", value: coachname });\n columnList.push({ column: \"clubname\", value: clubname });\n\n // changed video\n if (path != viewModel.get(\"videoPath\")) {\n columnList.push({ column: \"path\", value: viewModel.get(\"videoPath\") });\n }\n columnList.push({ column: \"thumbnail\", value: thumbnail });\n\n // changed types\n if (shotTypeIndex != viewModel.get(\"shotTypeIndex\")) {\n columnList.push({ column: \"shottype\", value: viewModel.get(\"shotTypeIndex\") });\n }\n if (ratingTypeIndex != viewModel.get(\"ratingTypeIndex\")) {\n columnList.push({ column: \"ratingtype\", value: viewModel.get(\"ratingTypeIndex\") });\n }\n\n // changed ids\n columnList.push({ column: \"playerid\", value: playerId });\n columnList.push({ column: \"coachid\", value: coachId });\n columnList.push({ column: \"clubid\", value: clubId });\n\n // changed date\n var dateCheck = viewModel.get(\"date\");\n var timeCheck = viewModel.get(\"time\");\n var dateTimeCheck = dateCheck + \" \" + timeCheck;\n var curDateTime = dateTimeObj.toDateString() + \" \" + dateTimeObj.toLocaleTimeString(\"en-US\");\n if (curDateTime != dateTimeCheck) {\n columnList.push({ column: \"date\", value: new Date(dateCheck + \" \" + timeCheck) });\n }\n\n // build query\n var query = \"UPDATE \" + LocalSave._tableName + \" SET \";\n var first = true;\n var valList = [];\n for (var i = 0; i < columnList.length; i++) {\n var item = columnList[i];\n if (!first) {\n query += \", \";\n }\n query += item.column + \"=?\";\n valList.push(item.value);\n first = false;\n }\n query += \" WHERE id=?;\";\n valList.push(shotId);\n\n // run query.\n var complete = new Promise(function (resolve, reject) {\n db.queryExec(query, valList,\n function (id) {\n console.log(\"Saved new shot with id \" + id);\n resolve(id);\n },\n function (err) {\n reject(err);\n });\n });\n\n // handle query after it has completed\n complete.then(\n function (val) {\n if (page.android) {\n var Toast = android.widget.Toast;\n Toast.makeText(application.android.context, \"Shot Saved\", Toast.LENGTH_SHORT).show();\n }\n // leave page\n frameModule.topmost().goBack();\n },\n function (err) {\n _unlockFunctionality();\n });\n}", "function commitsChangeUpdate(timeSpan, callback) {\n var updateCollection = []\n MongoClient.connect(url, (errorDatabase, db) => {\n assert.equal(null, errorDatabase);\n\n var collection = db.collection('Achievement');\n\n collection.find().each((errorContributor, document) => {\n assert.equal(null, errorContributor);\n console.log(\"Connected correctly to server\");\n if (document != null) {\n var command = \"./scripts/git_diff.sh \" +\n document.repositoryLocalAddress + \" \\\"\" +\n document.contributorName + \"\\\" \\\"\" +\n document.gitSearchPattern + \"\\\" \" + timeSpan\n\n exec(command, (error, stdout, stderr) => {\n var now = new Date();\n var shouldUpdate = (now - document.lastUpdated) > 24 * millisPerHour;\n if (stdout != '0') {\n if (shouldUpdate) {\n document.daysInRow += 1;\n document.lastUpdated = now;\n updateCollection.push(document);\n }\n } else {\n if (shouldUpdate) {\n document.daysInRow = 0;\n document.lastUpdated = now;\n updateCollection.push(document);\n }\n }\n if (error !== null) {\n console.log('exec error: ' + error);\n }\n callback(updateCollection);\n });\n }\n });\n db.close();\n });\n\n}", "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "check(map) {\n this._reset();\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n this._forEach(map, (value, key) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n }\n else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n this._removalsHead = insertBefore;\n for (let record = insertBefore; record !== null; record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n // Make sure tails have no next records from previous runs\n if (this._changesTail)\n this._changesTail._nextChanged = null;\n if (this._additionsTail)\n this._additionsTail._nextAdded = null;\n return this.isDirty;\n }", "function updatePPOrder(next) {\n // If Order type is fasting show \n var search = {\n ordertype: \"PP\",\n parentorder_id: params.id,\n status:{$ne:\"Cancelled\"}\n }\n Model.findOne(search,{log:1, pendingtubes:1 },null,function(error, ppOrder) {\n if (error) return next(error);\n if(!ppOrder) return next(null);\n\n var log = function(ppOrder){\n \n if(!Array.isArray(logs)) logs = [];\n var logobj = {};\n //update log object only when its changes \n logobj.comments = \"Pending tubes updated\"\n logobj.updatedby = params.user_id;\n logobj.updateddatetime = moment().tz(TIMEZONE).toISOString(); //client date time\n logs.push(logobj);\n }\n logs = ppOrder.log;\n if(!ppOrder.pendingtubes) ppOrder.pendingtubes = [];\n if(!Array.isArray(ppOrder.pendingtubes)) ppOrder.pendingtubes = [];\n if(ppOrder.pendingtubes.length > 0 || params.updateobj.length > 0)\n {\n log(ppOrder);\n }\n\n update(ppOrder._id,{log:logs, pendingtubes:params.updateobj },function(e,r){\n if(e) return next(e)\n\n return next(null);\n });\n \n }); \n }", "updateRecentChannels(isChannelSelected, channelId, msg) {\n\n let channelData = {\n channelId: undefined,\n displayName: undefined,\n image: undefined,\n status: undefined,\n unreadMessages: undefined,\n };\n\n let recent = [...this.state.recentChannels];\n let recentChannelData = ( recent.filter( channel => channel.channelId === channelId ) ); //if > 0 it is already a recent channel\n //console.log('\\n\\n**updateRecentChannels(): check if data below can be used from recent channel if it previously existed');\n //console.log(`*updateRecentChannels(): recent channel data pulled BEFORE modification: ${JSON.stringify(recentChannelData)}\\n`);\n\n if ( !recentChannelData.length ) { //recent channel doesn't currently exist\n //console.log(`updateRecentChannels(): \"${channelId}\" currently doesn't exist`);\n\n if( isChannel( channelId ) ) { //updating channel \n //console.log('updateRecentChannels(): CHANNEL MESSAGE - searching this.allMessages for this channel');\n\n for(let i = 0; i < this.allMessages.length; i++) { //goes through all messages checking for channel data\n if ( this.allMessages[i].channelId === channelId ) { //found channel data\n //console.log(`updateRecentChannels() channel \"${channelId}\" found :D`);\n\n channelData.channelId = channelId;\n channelData.displayName = this.allMessages[i].channelId;\n channelData.image = './images/default_channel_icon.svg',\n channelData.status = 'none';\n channelData.unreadMessages = isChannelSelected ? 0 : 1; //since the channel didn't exist this is the first unread msg\n\n recent.unshift( channelData );\n this.setState({ recentChannels: recent });\n\n //console.log(`**updateRecentChannels(): channel \"${channelId} found. recent to-be state AFTER mod: ${JSON.stringify(recent)}\\n`); \n break;\n }\n }\n }\n\n else { //updating direct message - still pulled from allMessages instead of going through active users\n //console.log('updateRecentChannels(): DIRECT MESSAGE - searching this.allMessages for previous conversation');\n \n for(let i = 0; i < this.allMessages.length; i++) {\n if ( this.allMessages[i].channelId === channelId ) {\n //console.log('updateRecentChannels(): DIRECT MESSAGE - channel found :D');\n\n channelData.channelId = channelId;\n channelData.displayName = this.allMessages[i].channelDisplayName;\n channelData.status = 'online';\n channelData.unreadMessages = isChannelSelected ? 0 : 1; //since the channel didn't exist this is the first unread msg\n\n let aUsers = [...this.state.activeUsers];\n \n for(let k = 0; k < aUsers.length; k++) {\n if ( aUsers[k].username === channelData.displayName ) {\n //console.log('updateRecentChannels(): user image found for recent channel');\n\n channelData.image = aUsers[k].image; //updates image \n break;\n }\n }\n\n if ( typeof( channelData.image ) !== 'undefined' ) {\n //console.log('updateRecentChannels(): updating state now');\n\n recent.unshift( channelData );\n this.setState({ recentChannels: recent });\n }\n \n //console.log(`**updateRecentChannels(): channel \"${channelId} found. recent to-be state AFTER mod: ${JSON.stringify(recent)}\\n`);\n break;\n }\n }\n }\n }\n\n else { //recent channel already exists \n //UPDATE recent channel unread messages here\n //use recentchanneldata to get previous unread messages\n //console.log('updateRecentChannels(): recent channel already exists...searching for channel data');\n for(let i = 0; i < recent.length; i++) {\n if ( recent[i].channelId === channelId ) {\n recent[i].unreadMessages = isChannelSelected ? 0 : recent[i].unreadMessages + 1;\n\n this.setState({ recentChannels: recent });\n //console.log(`**updateRecentChannels(): channel \"${channelId} found. recent to-be state AFTER mod: ${JSON.stringify(recent)}\\n`);\n break;\n }\n } \n }\n \n console.log('*LEAVING updateRecentChannels()\\n');\n }" ]
[ "0.5628675", "0.5542125", "0.5396335", "0.5357955", "0.5272311", "0.5257271", "0.52004373", "0.5168438", "0.51678044", "0.51521236", "0.5144698", "0.5129431", "0.5113655", "0.5103172", "0.5092716", "0.50787765", "0.50736153", "0.5071947", "0.504469", "0.50335366", "0.5023428", "0.500542", "0.5002796", "0.49949303", "0.4993755", "0.49579126", "0.4949688", "0.49492496", "0.4929815", "0.49201542", "0.49174905", "0.49071205", "0.48981434", "0.48964733", "0.4875249", "0.485938", "0.4858791", "0.48515815", "0.48196396", "0.48166037", "0.48089394", "0.48012608", "0.47943902", "0.4791287", "0.47830433", "0.47705922", "0.47693357", "0.47656986", "0.47646323", "0.47619164", "0.47590652", "0.47574738", "0.47532186", "0.4750122", "0.4749444", "0.47449747", "0.47427854", "0.47402123", "0.47382286", "0.47377834", "0.4737343", "0.47319147", "0.47306874", "0.47242472", "0.4719494", "0.47066644", "0.47059914", "0.4704793", "0.4700969", "0.4700171", "0.46984494", "0.46981525", "0.46894747", "0.4684685", "0.46829388", "0.4680903", "0.4680119", "0.4673817", "0.46697134", "0.46592835", "0.46592835", "0.46592835", "0.46592835", "0.46592835", "0.46592835", "0.4654389", "0.4651394", "0.46453345", "0.46440032", "0.46415418", "0.46380198", "0.46365842", "0.4625355", "0.4625355", "0.4625355", "0.4625355", "0.4625355", "0.4625355", "0.46156126", "0.46152848" ]
0.6407937
0
Creating The Chart Function
function Chartresult() { var ctx = document.getElementById('myChart').getContext('2d'); var chart = new Chart(ctx, { // The type of chart we want to create type: 'bar', // The data for our dataset data: { labels: imagesArray, datasets: [{ label: 'VOTES', backgroundColor: 'rgba(99, 132, 0, 0.6)', borderColor: 'rgb(255, 99, 132)', data: Clicks }, { label: 'SEEN', backgroundColor: 'rgba(0, 99, 132, 0.6)', borderColor: 'rgb(255, 255, 255)', data: Seen } ] }, // Configuration options go here options: {} }); var chartcolor = document.getElementById('myChart') chartcolor.setAttribute("style", "background :cornflowerblue ; ") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "_drawChart()\n {\n\n }", "function initialChart(datain,CTY,TYPE) { \r\n\r\ngenChart(datain[0],datain[1],datain[2],CTY,TYPE); //Generates the chart\r\n \r\n}", "function ChartsBarchart() {\n}", "get Charting() {}", "function drawChart(arr) {\n drawSleepChart(arr);\n drawStepsChart(arr);\n drawCalorieChart(arr);\n drawHeartRateChart(arr);\n}", "function chart(){\n\t\tthis.init();\n\t}", "function SVGPieChart() {\r\n }", "function CreateChart(values,type){\n let data = GetDataFromDB(values,type);\n buildFlightsChart(data)\n}", "function drawChart() {\n\n // Create the data table.\n var data = google.visualization.arrayToDataTable([\n ['Test Name', 'Passed', 'Failed', 'Skipped']\n ].concat(values));\n\n var options = {\n title: 'Last ' + values.length + ' Test Runs',\n legend: { position: 'bottom' },\n colors: ['green', 'red', 'yellow'],\n backgroundColor: bgColor,\n isStacked: true\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.SteppedAreaChart(document.getElementById('historyChart'));\n chart.draw(data, options);\n \n }", "function drawChart() {\r\n\r\n // Create our data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Task');\r\n data.addColumn('number', 'Hours per Day');\r\n data.addRows([\r\n ['Work', 11],\r\n ['Eat', 2],\r\n ['Commute', 2],\r\n ['Watch TV', 2],\r\n ['Sleep', 7]\r\n ]);\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\r\n chart.draw(data, {width: 400, height: 240, is3D: true, title: 'My Daily Activities'});\r\n }", "function genChart(){ \n var cols = [ {\n id : \"t\",\n label : \"host\",\n type : \"string\"\n } ];\n angular.forEach(data.hit, function(v, index) {\n cols.push({\n id : \"R\" + index,\n label : v.hostname,\n type : \"number\"\n });\n });\n var rows = [];\n angular.forEach(data.hit, function(q, i) {\n var d = [ {\n v : q.name\n } ];\n angular.forEach(data.hit, function(r, i2) {\n d.push({\n v : r.runtime\n });\n });\n rows.push({\n c : d\n });\n });\n var options={\n title:'Compare: ' + data.suite + \" \" + data.query,\n vAxis: {title: 'Time (sec)'}\n ,hAxis: {title: 'System'}\n // ,legend: 'none'\n };\n return {\n type : \"ColumnChart\",\n options : options,\n data : {\n \"cols\" : cols,\n \"rows\" : rows\n }\n };\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(render);\n\n // Set chart options\n var options = {\n 'title': 'Cantidad de laboratorios por sede',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function drawChart() {\n\n\t\t// Get the dataGraphic array form PHP\n\t\tvar dataOptionsGraphic = JSON.parse(jsonDataGraphic);\n\n\t\tfor (col in dataOptionsGraphic) {\n\t\t\tdataOptionsGraphic[col][5] = strTooltipStart + dataOptionsGraphic[col][1] + strTooltipEnd;\n\t\t}\n\n\t\t// Header of the data Graphic\n\t\tvar headDataGraphic = [M.util.get_string('choice', 'evoting'), M.util.get_string('countvote', 'evoting'), {\n\t\t\ttype: 'string',\n\t\t\trole: 'style'\n\t\t}, {\n\t\t\ttype: 'string',\n\t\t\trole: 'annotation'\n\t\t}, 'id', {\n\t\t\t'type': 'string',\n\t\t\t'role': 'tooltip',\n\t\t\t'p': {\n\t\t\t\t'html': true\n\t\t\t}\n\t\t}, {\n\t\t\ttype: 'string'\n\t\t}];\n\t\t// Create the complete data of the Graphic by integrated header data\n\t\tdataOptionsGraphic.splice(0, 0, headDataGraphic);\n\t\toptionsGraph = {\n\t\t\ttitle: \"\",\n\t\t\tallowHtml: true,\n\t\t\theight: 450,\n\t\t\tlegend: {\n\t\t\t\tposition: 'none'\n\t\t\t},\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t\teasing: 'out'\n\t\t\t},\n\n\t\t\tvAxis: {\n\t\t\t\tgridlines: {\n\t\t\t\t\tcolor: '#000000'\n\t\t\t\t},\n\t\t\t\ttextPosition: 'out',\n\t\t\t\ttextStyle: {\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tfontName: 'Oswald, Times-Roman',\n\t\t\t\t\tbold: true,\n\t\t\t\t\titalic: false\n\t\t\t\t}\n\n\t\t\t},\n\t\t\thAxis: {\n\t\t\t\ttitle: M.util.get_string('totalvote', 'evoting') + \" : \" + sumVote,\n\t\t\t\tminValue: \"0\",\n\t\t\t\tmaxValue: max,\n\t\t\t\tgridlines: {\n\t\t\t\t\tcolor: '#e6e6e6'\n\t\t\t\t},\n\t\t\t\ttextStyle: {\n\t\t\t\t\tcolor: '#e6e6e6'\n\t\t\t\t},\n\t\t\t\ttitleTextStyle: {\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tfontName: 'Oswald, Times-Roman',\n\t\t\t\t\tbold: false,\n\t\t\t\t\titalic: false\n\t\t\t\t}\n\t\t\t},\n\t\t\tbaselineColor: '#007cb7',\n\t\t\ttooltip: {\n\t\t\t\tisHtml: true\n\t\t\t},\n\n\t\t\tannotations: {\n\t\t\t\ttextStyle: {\n\t\t\t\t\tfontName: 'Oswald,Helvetica,Arial,sans-serif',\n\t\t\t\t\tbold: false,\n\t\t\t\t\titalic: false,\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tauraColor: 'rgba(255,255,255,0)',\n\t\t\t\t\topacity: 1,\n\t\t\t\t\tx: 20\n\t\t\t\t},\n\t\t\t\talwaysOutside: false,\n\t\t\t\thighContrast: true,\n\t\t\t\tstemColor: '#000000'\n\t\t\t},\n\t\t\tbackgroundColor: '#f6f6f6',\n\t\t\tchartArea: {\n\t\t\t\tleft: '5%',\n\t\t\t\ttop: '5%',\n\t\t\t\theight: '75%',\n\t\t\t\twidth: '100%'\n\t\t\t}\n\t\t};\n\n\t\tdataGraph = google.visualization.arrayToDataTable(dataOptionsGraphic);\n\t\tdataGraph.setColumnProperty(0, {\n\t\t\tallowHtml: true\n\t\t});\n\t\tviewGraph = new google.visualization.DataView(dataGraph);\n\t\tviewGraph.setColumns([0, 1, 2, 3, 5]);\n\n\t\t// Create and draw the visualization.\n\t\tchart = new google.visualization.BarChart(document.getElementById('chartContainer'));\n\t\t$(\".answerCount\").each(function () {\n\t\t\tidOption = $(this).prop('id');\n\t\t});\n\t\tupdateOptionGraphicMax();\n\n\t\tmanageGoodAnswer();\n\t}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(rendergrafica);\n\n // Set chart options\n var options = {\n 'title': 'Cantidad de laboratorios por categoria',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function renderChart() {\n let datasets = [];\n\n if (funcionPoints.length > 0) {\n datasets.push({\n label: funcion,\n data: funcionPoints,\n borderColor: \"purple\",\n borderWidth: 2,\n fill: false,\n showLine: true,\n pointBackgroundColor: \"purple\",\n radius: 0,\n });\n } else {\n alert(\"No hay puntos para la funcion.\");\n }\n\n if (areaPoints.length > 0) {\n datasets.push({\n label: \"Area\",\n data: areaPoints,\n borderColor: \"blue\",\n borderWidth: 2,\n fill: true,\n showLine: true,\n pointBackgroundColor: \"blue\",\n tension: 0,\n radius: 0,\n });\n } else {\n alert(\"No hay puntos para el area.\");\n }\n\n if (insidePoints.length > 0) {\n datasets.push({\n label: \"Punto aleatorio por debajo de la función\",\n data: insidePoints,\n borderColor: \"green\",\n borderWidth: 2,\n fill: false,\n showLine: false,\n pointBackgroundColor: \"green\",\n });\n } else {\n alert(\"No hay puntos aleatorios.\");\n }\n\n if (outsidePoints.length > 0) {\n datasets.push({\n label: \"Punto aleatorio por arriba de la función\",\n data: outsidePoints,\n borderColor: \"red\",\n borderWidth: 2,\n fill: false,\n showLine: false,\n pointBackgroundColor: \"red\",\n });\n } else {\n alert(\"No hay puntos aleatorios.\");\n }\n\n data = { datasets };\n\n if (chart) {\n chart.data = data;\n chart.update();\n }\n }", "function drawChart() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(Object.entries(ar_chart));\n\n // Set chart options\n var options = {'title':'Percentage of file size',\n 'width':500,\n 'height':200};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "generateChart(){\n var ctx = document.getElementById(\"lineChart\");\n var lineChart = new Chart(ctx, {\n type: this._type,\n data: {\n labels: this._labelsArray,\n datasets: this._datasetJsonArray\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n return lineChart;\n }", "function makecharts() {\n dataprovider = [{\"time\":0,\"a\":50,\"b\":23,\"c\":23,\"d\":4,\"e\":4},{\"time\":1,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":2,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":3,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":11,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":22,\"a\":53,\"b\":43,\"c\":53,\"d\":4,\"e\":1},{\"time\":40,\"a\":50,\"b\":23,\"c\":23,\"d\":4,\"e\":4},{\"time\":41,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":42,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":43,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":51,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":52,\"a\":53,\"b\":43,\"c\":53,\"d\":4,\"e\":1}];\n variablel = [{\"name\":\"a\",\"axis\":0,\"description\":\"Somethinga\"},\n {\"name\":\"b\",\"axis\":0,\"description\":\"Somethingb\"},\n {\"name\":\"c\",\"axis\":1,\"description\":\"Somethingc\"},\n {\"name\":\"d\",\"axis\":0,\"description\":\"Somethingd\"}\n ]\n makechartswithdata(dataprovider,variablel); \n}", "function makeChartDynamic(testResultsArray, rangeLinesObject) {\n\tvar chart = c3.generate({\n\t\t//bindto: '#timeseriesPulseOx',\n\t\t//bindto: bindToID,\n\t\tdata: {\n\t\t\tx: 'Date',\n\t\t\tcolumns: testResultsArray\n\t\t},\n\t\tgrid: {\n\t\t\ty: {\n\t\t\t\t//lines : [{ value: 90, text : 'Respiratory function impacted!'}]\n\t\t\t\tlines: rangeLinesObject\n\t\t\t}\n\t\t},\n\t\taxis: {\n\t\t\tx: {\n\t\t\t\ttype: 'timeseries',\n\t\t\t\ttick: {\n\t\t\t\t\tformat: \"%Y-%m-%d\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "drawChart () {\r\n\t\t\r\n\t\t// Converts color range value (eg. 'red', 'blue') into the appropriate color array\r\n\t\tthis.colorRange = this.convertColorRange(this.colorRange);\r\n\r\n\t\t// Set width and height of graph based on size of bounding element and margins\r\n\t\tvar width = document.getElementById(this.elementName).offsetWidth - this.marginLeft - this.marginRight;\r\n\t\tvar height = document.getElementById(this.elementName).offsetHeight - this.marginTop - this.marginBottom;\r\n\r\n\t\t// Create axis, streams etc.\t\t\r\n\t\tvar x = d3.time.scale()\r\n\t\t\t.range([0, width]);\r\n\r\n\t\tvar y = d3.scale.linear()\r\n\t\t\t.range([height - 10, 0]);\r\n\r\n\t\tvar z = d3.scale.ordinal()\r\n\t\t\t.range(this.colorRange);\r\n\r\n\t\tvar xAxis = d3.svg.axis()\r\n\t\t\t.scale(x)\r\n\t\t\t.orient('bottom')\r\n\t\t\t.ticks(d3.time.years);\r\n\r\n\t\tvar yAxis = d3.svg.axis()\r\n\t\t\t.scale(y);\r\n\r\n\t\tvar stack = d3.layout.stack()\r\n\t\t\t.offset('silhouette')\r\n\t\t\t.values(function (d) { return d.values; })\r\n\t\t\t.x(function (d) { return d.date; })\r\n\t\t\t.y(function (d) { return d.value; });\r\n\r\n\t\tvar nest = d3.nest()\r\n\t\t\t.key(function (d) { return d.key; });\r\n\r\n\t\tvar area = d3.svg.area()\r\n\t\t\t.interpolate('cardinal')\r\n\t\t\t.x(function (d) { return x(d.date); })\r\n\t\t\t.y0(function (d) { return y(d.y0); })\r\n\t\t\t.y1(function (d) { return y(d.y0 + d.y); });\r\n\t\r\n\t\t// Create SVG area of an appropriate size\r\n\t\tvar svg = d3.select(this.element).append('svg')\r\n\t\t\t.attr('width', width + this.marginLeft + this.marginRight)\r\n\t\t\t.attr('height', height + this.marginTop + this.marginBottom)\r\n\t\t\t.append('g')\r\n\t\t\t.attr('transform', 'translate(' + this.marginLeft + ',' + this.marginTop + ')');\r\n\r\n\t\t// Read CSV file\r\n\t\td3.csv(this.csvfile, function (data) {\r\n\t\t\tvar format = d3.time.format('%Y-%m-%d');\r\n\t\t\tdata.forEach(function (d) {\r\n\t\t\t\td.date = format.parse(d.date);\r\n\t\t\t\td.value = +d.value;\r\n\t\t\t});\r\n\r\n\t\t\tvar layers = stack(nest.entries(data));\r\n\r\n\t\t\tx.domain(d3.extent(data, function (d) { return d.date; }));\r\n\t\t\ty.domain([0, d3.max(data, function (d) { return d.y0 + d.y; })]);\r\n\r\n\t\t\t// Apply data to graph\r\n\t\t\tsvg.selectAll('.layer')\r\n\t\t\t\t.data(layers)\r\n\t\t\t\t.enter().append('path')\r\n\t\t\t\t.attr('class', 'layer')\r\n\t\t\t\t.attr('d', function (d) { return area(d.values); })\r\n\t\t\t\t.style('fill', function (d, i) { return z(i); });\r\n\r\n\t\t\t// Add a black outline to streams\r\n\t\t\tsvg.selectAll('.layer')\r\n\t\t\t\t.attr('stroke', 'black')\r\n\t\t\t\t.attr('stroke-width', '0.5px');\r\n\r\n\t\t\tsvg.append('g')\r\n\t\t\t\t.attr('class', 'x axis')\r\n\t\t\t\t.attr('transform', 'translate(0,' + height + ')')\r\n\t\t\t\t.call(xAxis);\r\n\r\n\t\t\tsvg.append('g')\r\n\t\t\t\t.attr('class', 'y axis')\r\n\t\t\t\t.attr('transform', 'translate(' + width + ', 0)')\r\n\t\t\t\t.call(yAxis.orient('right'));\r\n\r\n\t\t\tsvg.append('g')\r\n\t\t\t\t.attr('class', 'y axis')\r\n\t\t\t\t.call(yAxis.orient('left'));\r\n\r\n\t\t\t// Other streams fade when one stream is hovered over with the cursor\r\n\t\t\tsvg.selectAll('.layer')\r\n\t\t\t\t.attr('opacity', 1)\r\n\t\t\t\t.on('mouseover', function (d, i) {\r\n\t\t\t\t\tsvg.selectAll('.layer').transition()\r\n\t\t\t\t\t\t.duration(250)\r\n\t\t\t\t\t\t.attr('opacity', function (d, j) {\r\n\t\t\t\t\t\t\treturn j !== i ? 0.2 : 1;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t})\r\n\r\n\t\t\t\t// Move the label which appears next to the cursor.\r\n\t\t\t\t.on('mousemove', function (d, i) {\r\n\t\t\t\t\tvar mousePos = d3.mouse(this);\r\n\t\t\t\t\tvar mouseX = mousePos[0];\r\n\t\t\t\t\tvar mouseY = mousePos[1];\r\n\t\t\t\t\tvar mouseElem = document.getElementById('besideMouse');\r\n\t\t\t\t\tdocument.getElementById('besideMouse').style.left = mouseX + 50 + 'px';\r\n\t\t\t\t\tmouseElem.style.top = mouseY - 10 + 'px';\r\n\t\t\t\t\tmouseElem.innerHTML = d.key;\r\n\t\t\t\t})\r\n\t\t\t\r\n\t\t\t\t// Set opacity back to 1 when the cursor is no longer hovering over a stream.\r\n\t\t\t\t.on('mouseout', function (d, i) {\r\n\t\t\t\t\tsvg.selectAll('.layer')\r\n\t\t\t\t\t\t.transition()\r\n\t\t\t\t\t\t.duration(250)\r\n\t\t\t\t\t\t.attr('opacity', '1');\r\n\t\t\t\t\tdocument.getElementById('besideMouse').innerHTML = '';\r\n\t\t\t\t});\r\n\t\t});\r\n\t}", "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Task');\n data.addColumn('number', '% of Time');\n data.addRows([\n ['Setup EEG', 30],\n ['Review EEG', 30],\n ['Troubleshoot Computer', 10],\n ['CME', 10],\n ['Other', 20]\n ]);\n\n // Set chart options\n var options = {'title':'Breakdown of Time at Work',\n 'width':300,\n 'height':300,\n is3D:true,\n 'backgroundColor': {fill:'transparent'}\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('work-chart'));\n chart.draw(data, options);\n }", "function drawChart4() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'InstallationDate');\n data.addColumn('number', 'Number of Meters');\n data.addRows(installationsPerDate());\n\n // Set chart options\n var options = {\n 'title': 'Installations Per Date',\n 'width': 250,\n 'height': 200,\n };\n\n // Instantiate and draw our chart, passing in some options.\n // var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n var chart = new google.visualization.PieChart(document.getElementById('chart_div4'));\n chart.draw(data, options);\n}", "function buildChart(temp, chart){\n // chart.data.datasets.forEach((dataset) => {\n // dataset.data.push(data);\n // });\n chart.data.datasets[0].data.push(temp[0])\n chart.data.datasets[0].data.push(parseInt(temp[1]))\n chart.data.datasets[0].data.push(parseInt(temp[2]))\n chart.data.datasets[0].data.push(parseInt(temp[1])) - chart.data.datasets[0].data.push(temp[0])\n chart.data.datasets[0].data.push(parseInt(temp[2])) - chart.data.datasets[0].data.push(temp[0])\n chart.update();\n }", "function generateChartData(details) {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 100);\n\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_0;\n var Dacoity = newData[1].cy_0;\n var HBsbyDay = newData[2].cy_0;\n var HBsbyNight = newData[3].cy_0;\n var Ordinary = newData[4].cy_0;\n var Robbery = newData[5].cy_0;\n\n chartData.push({\n date: \"2016\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_1;\n var Dacoity = newData[1].cy_1;\n var HBsbyDay = newData[2].cy_1;\n var HBsbyNight = newData[3].cy_1;\n var Ordinary = newData[4].cy_1;\n var Robbery = newData[5].cy_1;\n\n chartData.push({\n date: \"2014\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_2;\n var Dacoity = newData[1].cy_2;\n var HBsbyDay = newData[2].cy_2;\n var HBsbyNight = newData[3].cy_2;\n var Ordinary = newData[4].cy_2;\n var Robbery = newData[5].cy_2;\n\n chartData.push({\n date: \"2013\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_3;\n var Dacoity = newData[1].cy_3;\n var HBsbyDay = newData[2].cy_3;\n var HBsbyNight = newData[3].cy_3;\n var Ordinary = newData[4].cy_3;\n var Robbery = newData[5].cy_3;\n\n chartData.push({\n date: \"2012\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_4;\n var Dacoity = newData[1].cy_4;\n var HBsbyDay = newData[2].cy_4;\n var HBsbyNight = newData[3].cy_4;\n var Ordinary = newData[4].cy_4;\n var Robbery = newData[5].cy_4;\n\n chartData.push({\n date: \"2011\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n return chartData;\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(rendergrafica);\n\n // Set chart options\n var options = {\n 'title': 'cantidad de pruebas por laboratorio',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'X');\n data.addColumn('number', 'Price');\n \n data.addRows(graphData)\n\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n chart.draw(data, fullWidthOptions);\n }", "function hourlyFunction() {\naddNewLineChartFunction('hourlyId', 'hourly', hourlyData, ctLine, 'line' );\naddNewBarChartFunction('hourlyId', 'hourly', hourlyData, ctBar, 'bar' );\naddNewDoughnutChartFunction('hourlyId', 'hourly', hourlyDataDoughnut, ctDoughnut, 'doughnut' );\n}", "function drawchart() {\r\n const filters = getFilters();\r\n const drawData = filterData(\r\n filters[\"startDate\"],\r\n filters[\"endDate\"],\r\n filters[\"provincesFilter\"]\r\n );\r\n timeLapseChart = new TimeLapseChart(\"timelapse-chart\");\r\n timeLapseChart\r\n .setTitle(\"COVID-19 ARGENTINA - EVOLUCIÓN EN EL TIEMPO\")\r\n .setColumnsStyles(columnNames)\r\n .addDatasets(drawData)\r\n .render();\r\n}", "function FilterChart(){}", "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Country');\r\n data.addColumn('number', 'Population');\r\n data.addColumn('number', 'Area');\r\n data.addColumn('number', 'Occupancy');\r\n data.addRows([\r\n [cdata.name, cdata.population,cdata.area,(cdata.area/cdata.population)]\r\n \r\n \r\n ]);\r\n\r\n // Set chart options\r\n var options = {'title':'Population Area Ratio of '+cdata.name,\r\n 'width':250,\r\n 'height':300};\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.BarChart(document.getElementById('bc1'));\r\n chart.draw(data, options);\r\n }", "function SVGLineChart() {\r\n }", "function salesHeatmap() {}", "function drawChart1() {\n\n // Create the data table.\n var data1 = new google.visualization.DataTable();\n data1.addColumn('string', 'nombre');\n data1.addColumn('number', 'cantidad');\n data1.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por escuela',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data1, options1);\n\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Acertos', acertos],\n ['Erros', erros]\n ]);\n\n // Set chart options\n var options = {'width':800,\n 'height':600,\n 'backgroundColor': 'none',\n 'fontSize': 15,\n 'is3D':true};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawChart() {\n \n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n \n // Set chart options\n var options = {'title':'How Much Pizza I Ate Last Night'};\n \n // Instantiate and draw our chart, passing in some options.\n var piechart = new google.visualization.PieChart(elements.piechart);\n var linechart = new google.charts.Line(elements.linechart);\n var barchart = new google.charts.Bar(elements.barchart);\n piechart.draw(data, options);\n linechart.draw(data, options);\n barchart.draw(data,options);\n }", "function drawChart() {\n stroke(0);\n yAxis();\n xAxis();\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {'title':'How Much Pizza I Ate Last Night'};\n\n // Instantiate and draw our chart, passing in some options.\n var piechart = new google.visualization.PieChart(elements.piechart);\n var linechart = new google.charts.Line(elements.linechart);\n var barchart = new google.charts.Bar(elements.barchart);\n piechart.draw(data, options);\n linechart.draw(data, options);\n barchart.draw(data,options);\n }", "function chart(data, d3) {\n \n // DECLARE CONTAINERS\n var lists = {\n population: [],\n emission: [],\n capita: []\n }\n\n // FETCH THE YEARS FOR TOOLTIPS\n var years = Object.keys(data.overview);\n\n // LOOP THROUGH & FILL THE LISTS\n years.forEach(year => {\n lists.population.push(data.overview[year].population);\n lists.emission.push(data.overview[year].emission);\n lists.capita.push(data.overview[year].emission / data.overview[year].population);\n });\n\n // CONVERT ARRAY DATA TO CHARTS\n generate_charts(lists, years, d3);\n}", "function genChart(){\n var colors=[\"#3366cc\",\"#dc3912\",\"#ff9900\",\"#109618\",\"#990099\",\"#0099c6\",\"#dd4477\",\"#66aa00\",\"#b82e2e\",\"#316395\",\"#994499\",\"#22aa99\",\"#aaaa11\",\"#6633cc\",\"#e67300\",\"#8b0707\",\"#651067\",\"#329262\",\"#5574a6\",\"#3b3eac\",\"#b77322\",\"#16d620\",\"#b91383\",\"#f4359e\",\"#9c5935\",\"#a9c413\",\"#2a778d\",\"#668d1c\",\"#bea413\",\"#0c5922\",\"#743411\"];\n var states=_.map($scope.data.states,function(runs,state){return state;});\n\n var session=_.map($scope.data.queries,\n function(v,key){return {\n \"name\":key,\n \"runs\":_.sortBy(v,state)\n }\n ;});\n var c=[];\n if(session.length){\n c=_.map(session[0].runs,function(run,index){\n var state=run.mode + run.factor;\n var pos=states.indexOf(state);\n // console.log(\"��\",state,pos);\n return colors[pos];\n });\n c=_.flatten(c);\n };\n var options={\n title:'BenchX: ' + $scope.benchmark.suite + \" \" + $scope.benchmark.meta.description,\n vAxis: {title: 'Time (sec)'}\n ,hAxis: {title: 'Query'}\n // ,legend: 'none'\n ,colors: c\n };\n return utils.gchart(session,options);\n\n }", "function drawChart() {\n\n // Create the data table.\n var data = google.visualization.arrayToDataTable([\n ['Scenario Name', 'Duration', {role: 'style'}]\n ].concat(values));\n\n var options = {\n title: 'Scenario Results',\n legend: { position: 'none' },\n vAxis: { title: 'Duration (seconds)'},\n backgroundColor: bgColor\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.ColumnChart(document.getElementById('resultChart'));\n chart.draw(data, options);\n\n }", "function generateChartData() {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 100);\n firstDate.setHours(0, 0, 0, 0);\n/// starting number\n var visits = 7.6;\n var hits = 13.4;\n var views = 7;\n\n var myData = {\n Zelenski: [7.6, 9.4, 8, 8.8, 9, 9.4, 10.8, 10.9, 11.9, 14.9, 15.2, 16.4, 17.5, 19.6, 19.9, 20.3, 23.1],\n Timoshenko: [13.4, 14.7, 14, 14.8, 14.2, 14.4, 13.4, 15.5, 15.1, 12.9, 9.6, 11.5, 13.5, 13.8, 13.9, 14],\n Poroshenko: [7, 6.2, 8, 8.1, 8.6, 10.8, 7.7, 8.2, 10.4, 10.1, 10.8, 13.1, 13.1, 13.4, 13.1, 12.4]\n }\n var mynewuselessvar;\n for (var i = 0; i < myData.candidate1.length; i++) {\n chartData.push({\n date: [\"1st Nov\", \"22nd Nov\", \"3rd Dec\",\"14th Dec\", \"18th Dec\", \"29th Dec\", \"3rd Jan\", \"15th Jan\", \"25th Jan\", \"4th Feb\", \"20th Feb\", \"27th Feb\", \"4th March\", \"7th March\", \"14th March\"],\n visits: myData.Zelenski[i],\n hits: myData.Timoshenko[i],\n views: myData.Poroshenko[i]\n });\n }\n\n\n // for (var i = 0; i < 15; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n // var newDate = new Date(firstDate);\n // newDate.setDate(newDate.getDate() + i);\n //\n // visits =\n // hits = Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n // views = Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n\n\n // }\n return chartData;\n}", "function chartBar(){//creating a function which draws the chart when it is called (the code in the function is ran)\n\t\tvar chart = new Chart(ctx, {//creating a new chart\n\t\t type: 'bar',//selecting the type of chart wanted\n\t\t data: dataForChart, //calling dataset\n\t\t\t options:{\n\t\t\t \ttitle:{//adding a title\n\t\t\t \t\tdisplay: true,//displaying a title\n\t\t\t \t\ttext: \"Inquest Conclusions Recorded in England and Wales 2010-2015\",//choosing the text for the title\n\t\t\t \t\tfontSize:20,//changing the font size of the title\n\t\t\t \t}\n\t\t\t },\n\t\t});\n\t}", "function makeChart(selector, func, start, end) {\r\n // Sample the function\r\n var samples = sampleFunc(func, start, end);\r\n\r\n // Compute the Y range\r\n var yRange = computeRange(samples)[1];\r\n\r\n // Compute the precision we should display tooltips over\r\n var xPrec = computePrecision(start, end);\r\n var yPrec = computePrecision.apply(this, yRange);\r\n\r\n // Make the chart\r\n $(selector).highcharts({\r\n chart: {\r\n type: 'line',\r\n backgroundColor: 'none'\r\n },\r\n legend: {\r\n enabled: false\r\n },\r\n tooltip: {\r\n formatter: function () {\r\n return 'x: <b>' + this.x.toFixed(xPrec) + '</b><br />f(x): <b>' + this.y.toFixed(yPrec) + '</b>';\r\n }\r\n },\r\n title: {\r\n text: null\r\n },\r\n xAxis: {\r\n title: {\r\n text: 'x'\r\n }\r\n },\r\n yAxis: {\r\n title: {\r\n text: 'f(x)'\r\n }\r\n },\r\n series: [{\r\n name: 'f(x)',\r\n data: samples,\r\n allowPointSelect: false,\r\n marker: {\r\n enabled: false\r\n },\r\n }]\r\n });\r\n}", "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Country');\r\n data.addColumn('number', 'Population');\r\n data.addColumn('number', 'Area');\r\n data.addColumn('number', 'Occupancy');\r\n data.addRows([\r\n [countrydata.name, countrydata.population,countrydata.area,(countrydata.area/countrydata.population)]\r\n \r\n \r\n ]);\r\n\r\n // Set chart options\r\n var options = {'title':'Population Area Ratio of '+countrydata.name,\r\n 'width':250,\r\n 'height':300};\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.ColumnChart(document.getElementById('bc2'));\r\n chart.draw(data, options);\r\n }", "function dayChart(result){\n var intv = 1;\n chart = new CanvasJS.Chart(\"chartContainer\", {\n animationEnabled: true,\n exportEnabled: true,\n zoomEnabled: true,\n title: {\n text: \"Stock Price\"\n },\n axisX: {\n labelFormatter: function(e){\n return e.label;\n },\n crosshair: {\n enabled: true,\n snapToDataPoint: true\n },\n labelMaxWidth: 80,\n labelWrap: true,\n labelFontSize: 14\n },\n toolTip:{\n enabled: true,\n shared:true,\n content: \"{z}: {y} <br/> Distance: {dist} %\"\n },\n axisY: {\n title: \"Price\",\n includeZero: false,\n prefix: \"Rs.\",\n gridColor: \"#ddd\",\n labelFontSize: 14,\n },\n data: data\n });\n\n \n //console.log(result.length);\n var last_value = 0;\n for(var i = 0; i < result.length; i++){\n var dataSeriesLINE;\n if(i%2==0){\n dataSeriesLINE = { type: \"line\",\n name: \"\",\n color: \"#c91f37\",\n yValueFormatString: \"Rs #####.00\",\n xValueFormatString: \"DD MMM\",\n indexLabelFontSize: 0,\n indexLabelBackgroundColor: \"#f1f2f6\",\n toolTipContent: \"\"\n };\n }else{\n dataSeriesLINE = { type: \"line\",\n name: \"\",\n color: \"#000\",\n yValueFormatString: \"Rs #####.00\",\n xValueFormatString: \"DD MMM\",\n indexLabelFontSize: 0,\n lineThickness: 4.5,\n indexLabelBackgroundColor: \"#f1f2f6\",\n toolTipContent: \"\"\n };\n }\n\n var dt = new Date(result[i].timeStamp);\n var dateString = dt.toLocaleString();\n var dataPointsLINE = [];\n \n if(result[i].GV >= 1){\n var dataPoints = {\n x: intv,\n label: dateString,\n y: result[i].a_value,\n z: result[i].a_type,\n v1: result[i].EnF1,\n v2: result[i].EnF2,\n v3: result[i].EnF3,\n v4: result[i].EnF4,\n v5: result[i].EnF5,\n v6: result[i].EnF6,\n v7: result[i].EnF7,\n p3: result[i].p3,\n p5: result[i].p5,\n p15: result[i].p15,\n p20: result[i].p20,\n indexLabel: result[i].a_type + \" : \" + result[i].a_value,\n comment: (result[i].comment != null) ? result[i].comment : \"No comments\",\n //toolTipContent: \"{z}: {y} <br/> Distance: {dist} %\",\n click: onClick\n };\n if(i!=0){\n dataPoints.dist = (((result[i].a_value - last_value)/last_value)*100).toFixed(3);\n }else{\n dataPoints.dist = 0;\n }\n dataPointsLINE.push(dataPoints);\n last_value = result[i].a_value; \n }\n\n if(result[i].GV >= 2){\n intv++;\n dataPointsLINE.push({\n x: intv,\n label: \" \",\n y: result[i].b_value,\n z: result[i].b_type,\n v1: result[i].EnF1,\n v2: result[i].EnF2,\n v3: result[i].EnF3,\n v4: result[i].EnF4,\n v5: result[i].EnF5,\n v6: result[i].EnF6,\n v7: result[i].EnF7,\n p3: result[i].p3,\n p5: result[i].p5,\n p15: result[i].p15,\n p20: result[i].p20,\n dist: (((result[i].b_value - result[i].a_value)/result[i].a_value)*100).toFixed(3),\n indexLabel: result[i].b_type + \" : \" + result[i].b_value,\n comment: (result[i].comment != null) ? result[i].comment : \"No comments\",\n //toolTipContent: \"{z}: {y} <br/> Distance: {dist} %\",\n click: onClick\n }); \n last_value = result[i].b_value; \n }\n\n if(result[i].GV >= 3){\n intv++;\n dataPointsLINE.push({\n x: intv,\n label: \" \",\n y: result[i].c_value,\n z: result[i].c_type,\n v1: result[i].EnF1,\n v2: result[i].EnF2,\n v3: result[i].EnF3,\n v4: result[i].EnF4,\n v5: result[i].EnF5,\n v6: result[i].EnF6,\n v7: result[i].EnF7,\n p3: result[i].p3,\n p5: result[i].p5,\n p15: result[i].p15,\n p20: result[i].p20,\n dist: (((result[i].c_value - result[i].b_value)/result[i].b_value)*100).toFixed(3),\n indexLabel: result[i].c_type + \" : \" + result[i].c_value,\n comment: (result[i].comment != null) ? result[i].comment : \"No comments\",\n //toolTipContent: \"{z}: {y} <br/> Distance: {dist} %\",\n click: onClick\n }); \n last_value = result[i].c_value; \n }\n\n if(result[i].GV >= 4){\n intv++;\n dataPointsLINE.push({\n x: intv,\n label: \" \",\n y: result[i].d_value,\n z: result[i].d_type,\n v1: result[i].EnF1,\n v2: result[i].EnF2,\n v3: result[i].EnF3,\n v4: result[i].EnF4,\n v5: result[i].EnF5,\n v6: result[i].EnF6,\n v7: result[i].EnF7,\n p3: result[i].p3,\n p5: result[i].p5,\n p15: result[i].p15,\n p20: result[i].p20,\n dist: (((result[i].d_value - result[i].c_value)/result[i].c_value)*100).toFixed(3),\n indexLabel: result[i].d_type + \" : \" + result[i].d_value,\n comment: (result[i].comment != null) ? result[i].comment : \"No comments\",\n //toolTipContent: \"{z}: {y} <br/> Distance: {dist} %\",\n click: onClick\n }); \n last_value = result[i].d_value; \n }\n\n dataSeriesLINE.dataPoints = dataPointsLINE;\n data.push(dataSeriesLINE); \n \n if(i<result.length-1){\n var dataSeriesDOT = {\n type: \"line\",\n lineDashType: \"dot\",\n color: \"#e57373\",\n };\n \n var dataPointsDOT = [];\n dataPointsDOT.push({\n x: intv,\n y: last_value,\n z: \"\",\n toolTipContent: \" \",\n click: onClick\n });\n\n intv++;\n dt = new Date(result[i+1].timeStamp);\n dateString = dt.toLocaleString();\n dataPointsDOT.push({\n x: intv,\n y: result[i+1].a_value,\n z: \"\",\n toolTipContent: \" \",\n click: onClick\n });\n \n dataSeriesDOT.dataPoints = dataPointsDOT;\n data.push(dataSeriesDOT);\n }\n console.log(data);\n }\n chart.render();\n}", "function drawChart1() {\n\n // Create the data table.\n var data1 = new google.visualization.DataTable();\n data1.addColumn('string', 'nombre');\n data1.addColumn('number', 'cantidad');\n data1.addRows(render);\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por escuela sede: '+sede,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data1, options1);\n\n }", "function visualData() {\n $(\"#chart\").remove();\n $(\".containerChart\").append('<canvas id=\"chart\">');\n var canvas = document.getElementById(\"chart\");\n var ctx = canvas.getContext(\"2d\");\n\n Chart.defaults.global.defaultFontColor = \"black\";\n var myChart = new Chart(ctx, {\n type: \"line\",\n data: {\n labels: weeklyDate, //what is listed as the x axis value\n datasets: [\n {\n label: currentCompany,\n data: weeklyValue,\n backgroundColor: \"rgba(0, 0, 0, 1)\",\n borderColor: \"rgba(0, 0, 0, 1)\",\n borderWidth: 3,\n fill: false,\n },\n ],\n },\n options: {\n scales: {\n yAxes: [\n {\n ticks: {\n // beginAtZero: true\n callback: function (value, index, values) {\n return \"$\" + value;\n },\n },\n },\n ],\n },\n },\n });\n }", "function buildChart() {\n barChartData = {\n labels: [],\n datasets: []\n };\n var calculations = [];\n var labelSetup = [];\n for (i in currentChart.outlets) {\n calculations.push(calculateData(currentChart.outlets[i]));\n }\n var lowerBound = moment(currentChart.timePeriod[0]);\n while (lowerBound.isSameOrBefore(currentChart.timePeriod[1])) {\n labelSetup.push(lowerBound.format('YYYY-MM-DD'));\n lowerBound = lowerBound.add(1, 'days');\n }\n for (j in calculations) { //sep method\n switch (currentChart.type) {\n case 'bar':\n case 'doughnut':\n var dataList = {\n label: null,\n backgroundColor: getRandomColor(),\n borderColor: '#000000',\n data: []\n };\n break;\n case 'radar':\n case 'line':\n var dataList = {\n label: null,\n borderColor: getRandomColor(),\n data: []\n };\n break;\n default:\n console.log(\"something went wrong\");\n break;\n }\n for (k in outlets) {\n if (outlets[k].id === currentChart.outlets[j]) {\n dataList.label = outlets[k].name;\n }\n }\n for (var key in calculations[j]) {\n if (calculations[j].hasOwnProperty(key)) {\n if (barChartData.labels.indexOf(key) === -1) {\n if (typeof key !== \"undefined\") {\n barChartData.labels.push(key);\n }\n }\n dataList.data.push(calculations[j][key]);\n }\n }\n\n barChartData.datasets.push(dataList);\n }\n myChart.destroy();\n myChart = new Chart(ctx, {\n type: currentChart.type,\n data: barChartData,\n options: {\n responsive: true,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n}", "function drawCharts() {\n /*TOD0: Implement function;\n Un dato interesante del Webstorm es que al escribir tod0\n o TOD0 y vamos a TOD0 (6, parte de abajo) sale que en\n nuestro proyecto tenemos un TOD0 y automaticamente al\n darle click nos reidirecciona a donde se encuentra\n dicho TOD0. Es una manera de hacer una pausa en lo que\n estamos implementado y cuando regresamos al trabajo de\n frente nos ubicamos en la zona donde estabamos trabajando\n o donde queremos trabajar. Recordar que el TOD0 significa\n \"to do\" (por hacer).\n\n Este metodo (drawCharts) al invocar estas 2 metodos hara que se\n dibujen los 2 graficos. Este metodo drawCharts sera invocado en\n el main.js\n */\n drawPieChart()\n drawAxisTickColors()\n}", "makeChart(name) {\n let data = [];\n let datadict = {};\n const keys = CSRankings.topTierAreas;\n const uname = unescape(name);\n for (let key in keys) { // i = 0; i < keys.length; i++) {\n //\t let key = keys[i];\n if (!(uname in this.authorAreas)) {\n // Defensive programming.\n // This should only happen if we have an error in the aliases file.\n return;\n }\n //\t if (key in CSRankings.nextTier) {\n //\t\tcontinue;\n //\t }\n let value = this.authorAreas[uname][key];\n // Use adjusted count if this is for a department.\n /*\n DISABLED so department charts are invariant.\n \n if (uname in this.stats) {\n value = this.areaDeptAdjustedCount[key+uname] + 1;\n if (value == 1) {\n value = 0;\n }\n }\n */\n // Round it to the nearest 0.1.\n value = Math.round(value * 10) / 10;\n if (value > 0) {\n if (key in CSRankings.parentMap) {\n key = CSRankings.parentMap[key];\n }\n if (!(key in datadict)) {\n datadict[key] = 0;\n }\n datadict[key] += value;\n }\n }\n for (let key in datadict) {\n let newSlice = {\n \"label\": this.areaDict[key],\n \"value\": Math.round(datadict[key] * 10) / 10,\n \"color\": this.color[CSRankings.parentIndex[key]]\n };\n data.push(newSlice);\n }\n new d3pie(name + \"-chart\", {\n \"header\": {\n \"title\": {\n \"text\": uname,\n \"fontSize\": 24,\n \"font\": \"open sans\"\n },\n \"subtitle\": {\n \"text\": \"Publication Profile\",\n \"color\": \"#999999\",\n \"fontSize\": 14,\n \"font\": \"open sans\"\n },\n \"titleSubtitlePadding\": 9\n },\n \"size\": {\n \"canvasHeight\": 500,\n \"canvasWidth\": 500,\n \"pieInnerRadius\": \"38%\",\n \"pieOuterRadius\": \"83%\"\n },\n \"data\": {\n \"content\": data,\n \"smallSegmentGrouping\": {\n \"enabled\": true,\n \"value\": 1\n },\n },\n \"labels\": {\n \"outer\": {\n \"pieDistance\": 32\n },\n \"inner\": {\n //\"format\": \"percentage\", // \"value\",\n //\"hideWhenLessThanPercentage\": 0 // 2 // 100 // 2\n \"format\": \"value\",\n \"hideWhenLessThanPercentage\": 5 // 100 // 2\n },\n \"mainLabel\": {\n \"fontSize\": 10.5\n },\n \"percentage\": {\n \"color\": \"#ffffff\",\n \"decimalPlaces\": 0\n },\n \"value\": {\n \"color\": \"#ffffff\",\n \"fontSize\": 10\n },\n \"lines\": {\n \"enabled\": true\n },\n \"truncation\": {\n \"enabled\": true\n }\n },\n \"effects\": {\n \"load\": {\n \"effect\": \"none\"\n },\n \"pullOutSegmentOnClick\": {\n \"effect\": \"linear\",\n \"speed\": 400,\n \"size\": 8\n }\n },\n \"misc\": {\n \"gradient\": {\n \"enabled\": true,\n \"percentage\": 100\n }\n }\n });\n }", "function drawChart(reactionData) {\n var reactionDataTable = new google.visualization.DataTable();\n reactionDataTable.addColumn('number', 'Time');\n reactionDataTable.addColumn('number', 'Reaction');\n reactionDataTable.addRows(reactionData);\n\n var options = {\n title: 'Reactions over Time',\n curveType: 'function',\n width: 900,\n height: 500,\n legend: 'none',\n hAxis: {title: 'Time'},\n vAxis: {title: 'Reaction'}\n };\n // set the chart handle\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n\n //var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));\n chart.draw(reactionDataTable, options);\n }", "function makeChart() {\n //get the data for the chart and put it in the appropriate places\n //in the chartData and chartOptions objects\n const data = getData(currentSubject, currentMaxWordLength);\n chartData.datasets[0].data = data.BFS;\n chartData.datasets[1].data = data.DFS;\n chartOptions.scales.yAxes[0].scaleLabel.labelString = data.yAxisLabel;\n\n if (resultsChart) {\n resultsChart.destroy();\n }\n\n //create (or recreate) the chart\n const chartContext = $(\"#results-graph\")[0].getContext('2d');\n const chartConfig = {\"type\": \"line\",\n \"data\": chartData,\n \"options\": chartOptions};\n resultsChart = new Chart(chartContext, chartConfig);\n }", "function createChart(options){var data=Chartist.normalizeData(this.data,options.reverseData,true);// Create new svg object\nthis.svg=Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart);// Create groups for labels, grid and series\nvar gridGroup=this.svg.elem('g').addClass(options.classNames.gridGroup);var seriesGroup=this.svg.elem('g');var labelGroup=this.svg.elem('g').addClass(options.classNames.labelGroup);var chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);var axisX,axisY;if(options.axisX.type===undefined){axisX=new Chartist.StepAxis(Chartist.Axis.units.x,data.normalized.series,chartRect,Chartist.extend({},options.axisX,{ticks:data.normalized.labels,stretch:options.fullWidth}));}else {axisX=options.axisX.type.call(Chartist,Chartist.Axis.units.x,data.normalized.series,chartRect,options.axisX);}if(options.axisY.type===undefined){axisY=new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data.normalized.series,chartRect,Chartist.extend({},options.axisY,{high:Chartist.isNumeric(options.high)?options.high:options.axisY.high,low:Chartist.isNumeric(options.low)?options.low:options.axisY.low}));}else {axisY=options.axisY.type.call(Chartist,Chartist.Axis.units.y,data.normalized.series,chartRect,options.axisY);}axisX.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);axisY.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);if(options.showGridBackground){Chartist.createGridBackground(gridGroup,chartRect,options.classNames.gridBackground,this.eventEmitter);}// Draw the series\ndata.raw.series.forEach(function(series,seriesIndex){var seriesElement=seriesGroup.elem('g');// Write attributes to series group element. If series name or meta is undefined the attributes will not be written\nseriesElement.attr({'ct:series-name':series.name,'ct:meta':Chartist.serialize(series.meta)});// Use series class from series data or if not set generate one\nseriesElement.addClass([options.classNames.series,series.className||options.classNames.series+'-'+Chartist.alphaNumerate(seriesIndex)].join(' '));var pathCoordinates=[],pathData=[];data.normalized.series[seriesIndex].forEach(function(value,valueIndex){var p={x:chartRect.x1+axisX.projectValue(value,valueIndex,data.normalized.series[seriesIndex]),y:chartRect.y1-axisY.projectValue(value,valueIndex,data.normalized.series[seriesIndex])};pathCoordinates.push(p.x,p.y);pathData.push({value:value,valueIndex:valueIndex,meta:Chartist.getMetaData(series,valueIndex)});}.bind(this));var seriesOptions={lineSmooth:Chartist.getSeriesOption(series,options,'lineSmooth'),showPoint:Chartist.getSeriesOption(series,options,'showPoint'),showLine:Chartist.getSeriesOption(series,options,'showLine'),showArea:Chartist.getSeriesOption(series,options,'showArea'),areaBase:Chartist.getSeriesOption(series,options,'areaBase')};var smoothing=typeof seriesOptions.lineSmooth==='function'?seriesOptions.lineSmooth:seriesOptions.lineSmooth?Chartist.Interpolation.monotoneCubic():Chartist.Interpolation.none();// Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n// index, value and meta data\nvar path=smoothing(pathCoordinates,pathData);// If we should show points we need to create them now to avoid secondary loop\n// Points are drawn from the pathElements returned by the interpolation function\n// Small offset for Firefox to render squares correctly\nif(seriesOptions.showPoint){path.pathElements.forEach(function(pathElement){var point=seriesElement.elem('line',{x1:pathElement.x,y1:pathElement.y,x2:pathElement.x+0.01,y2:pathElement.y},options.classNames.point).attr({'ct:value':[pathElement.data.value.x,pathElement.data.value.y].filter(Chartist.isNumeric).join(','),'ct:meta':Chartist.serialize(pathElement.data.meta)});this.eventEmitter.emit('draw',{type:'point',value:pathElement.data.value,index:pathElement.data.valueIndex,meta:pathElement.data.meta,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,group:seriesElement,element:point,x:pathElement.x,y:pathElement.y});}.bind(this));}if(seriesOptions.showLine){var line=seriesElement.elem('path',{d:path.stringify()},options.classNames.line,true);this.eventEmitter.emit('draw',{type:'line',values:data.normalized.series[seriesIndex],path:path.clone(),chartRect:chartRect,index:seriesIndex,series:series,seriesIndex:seriesIndex,seriesMeta:series.meta,axisX:axisX,axisY:axisY,group:seriesElement,element:line});}// Area currently only works with axes that support a range!\nif(seriesOptions.showArea&&axisY.range){// If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n// the area is not drawn outside the chart area.\nvar areaBase=Math.max(Math.min(seriesOptions.areaBase,axisY.range.max),axisY.range.min);// We project the areaBase value into screen coordinates\nvar areaBaseProjected=chartRect.y1-axisY.projectValue(areaBase);// In order to form the area we'll first split the path by move commands so we can chunk it up into segments\npath.splitByCommand('M').filter(function onlySolidSegments(pathSegment){// We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\nreturn pathSegment.pathElements.length>1;}).map(function convertToArea(solidPathSegments){// Receiving the filtered solid path segments we can now convert those segments into fill areas\nvar firstElement=solidPathSegments.pathElements[0];var lastElement=solidPathSegments.pathElements[solidPathSegments.pathElements.length-1];// Cloning the solid path segment with closing option and removing the first move command from the clone\n// We then insert a new move that should start at the area base and draw a straight line up or down\n// at the end of the path we add an additional straight line to the projected area base value\n// As the closing option is set our path will be automatically closed\nreturn solidPathSegments.clone(true).position(0).remove(1).move(firstElement.x,areaBaseProjected).line(firstElement.x,firstElement.y).position(solidPathSegments.pathElements.length+1).line(lastElement.x,areaBaseProjected);}).forEach(function createArea(areaPath){// For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n// and adding the created DOM elements to the correct series group\nvar area=seriesElement.elem('path',{d:areaPath.stringify()},options.classNames.area,true);// Emit an event for each area that was drawn\nthis.eventEmitter.emit('draw',{type:'area',values:data.normalized.series[seriesIndex],path:areaPath.clone(),series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,index:seriesIndex,group:seriesElement,element:area});}.bind(this));}}.bind(this));this.eventEmitter.emit('created',{bounds:axisY.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options});}", "function drawChart() {\r\n drawSentimentBreakdown();\r\n drawSentimentTimeline();\r\n drawPopularityTimeline();\r\n}", "function lineChart(state_name,data_cases){\n\t \n\t var dates=[\"03/19/2020\",\"03/20/2020\",\"03/21/2020\",\"03/23/2020\",\"03/24/2020\",\"03/27/2020\",\"03/30/2020\",\"04/01/2020\",\"04/14/2020\",\"04/19/2020\"];\n\t \n\t var dataset_y_confirmed = data_cases.hasOwnProperty(state_name)?data_cases[state_name]['y-confirmed']:data_cases[\"Total\"]['y-confirmed'];\n\t //for i in \n\t genericlinechart(\"line-confirmed\",dates,dataset_y_confirmed,\"#ff0000\",\"Confirmed Cases\");\n\t var dataset_y_active = data_cases.hasOwnProperty(state_name)?data_cases[state_name]['y-active']:data_cases[\"Total\"]['y-active'];\n\t genericlinechart(\"line-active\",dates,dataset_y_active,\"#0000ff\",\"Active Cases\");\n\t var dataset_y_recovered = data_cases.hasOwnProperty(state_name)?data_cases[state_name]['y-recovered']:data_cases[\"Total\"]['y-recovered'];\n\t genericlinechart(\"line-recovered\",dates ,dataset_y_recovered, \"#00ff99\",\"Recovered Cases\" );\n\t var dataset_y_death = data_cases.hasOwnProperty(state_name)?data_cases[state_name]['y-death']:data_cases[\"Total\"]['y-death'];\n\t genericlinechart(\"line-death\",dates,dataset_y_death,\"#bfbfbf\",\"Death Cases\");\n\t //confirmed cases #ff0000\n\t \n }", "function drawChart(result, counter) {\n var data = new google.visualization.DataTable();\n\n var splitResult;\n var splitDate;\n var x;\n var columnIndex = 2;\n\n\n // Declare columns\n data.addColumn('date', 'Date');\n data.addColumn('number', selectedParameter + ' (' + result.data[0].unit + ')');\n\n if (pValue <= .05 && result.data.length > 1) {\n data.addColumn('number', 'Trend');\n columnIndex = columnIndex + 1;\n }\n\n\n for (var i = 0; i < result.data.length; i++) {\n //splitResult = checkedResults[i].value.split(\" \");\n splitDate = result.data[i].date.split(\"-\");\n\n //x = daydiff(parseDate(result.data[0].date), parseDate(result.data[i].date));\n x = daydiff(parseDate(result.data[i].date), parseDate(result.data[0].date));\n \n if (pValue <= .05 && result.data.length > 1) {\n var slopeVal = (senSlope * (x) + senB);\n //slopeVal = slopeVal * -1;\n data.addRow([new Date(splitDate[0], splitDate[1] - 1, splitDate[2]), result.data[i].value, slopeVal]);\n }\n else {\n data.addRow([new Date(splitDate[0], splitDate[1] - 1, splitDate[2]), result.data[i].value]);\n }\n\n }\n\n if ($.isNumeric($(\"#lowThreshChartsInput\").val())) {\n data.addColumn('number', 'Lower Threshold');\n data.setCell(0, columnIndex, $(\"#lowThreshChartsInput\").val());\n data.setCell(result.data.length - 1, columnIndex, $(\"#lowThreshChartsInput\").val());\n columnIndex = columnIndex + 1;\n }\n\n if ($.isNumeric($(\"#upperThreshChartsInput\").val())) {\n data.addColumn('number', 'Upper Threshold');\n data.setCell(0, columnIndex, $(\"#upperThreshChartsInput\").val());\n data.setCell(result.data.length - 1, columnIndex, $(\"#upperThreshChartsInput\").val());\n }\n\n var options = {\n // chartArea: {'width': '67%', 'height': '60%'},\n title: result.location,\n hAxis: { title: 'Date (M/Y)', format: 'M/yy' },\n vAxis: { title: selectedParameter + ' (' + result.data[0].unit + ')' },\n legend: { textStyle: { fontSize: 10 } },\n interpolateNulls: true,\n chartArea: { width: \"60%\", height: \"70%\" },\n series: { 0: { lineWidth: 0, pointSize: 5 }, 1: { lineWidth: 1, pointSize: 0 }, 2: { lineWidth: 1, pointSize: 0 }, 3: { lineWidth: 1, pointSize: 0 } },\n height: 400,\n width: 850\n\n };\n\n $(\"#trendCharts\").append('Location: <b>' + result.location + '</b><br>');\n\n // var tempLi = \"<li data-target='#myCarousel' data-slide-to=\" + counter + \" class='active'></li>\"\n // $(\"#carouselol\").append(tempLi);\n\n // var tempDiv = \"<div class='item' style='height:inherit'><div class='container'><div class='carousel-caption'><div id='carouselCharts\" + result.location + \"'></div></div></div></div>\"\n // $(\"#carouselInner\").append(tempDiv);\n\n $(\"#trendCharts\").append('<div id=\"trendCharts' + result.location + '\"></div>');\n\n var chart = new google.visualization.LineChart(document.getElementById('trendCharts' + result.location));\n chart.draw(data, options);\n\n // var chart = new google.visualization.LineChart(document.getElementById('carouselCharts' + result.location));\n // chart.draw(data, options);\n // $(window).resize(function () {\n // chart.draw(data, options);\n // });\n\n if (result.data.length < 5) {\n $(\"#trendCharts\").append('Cannot do trend analysis on 4 or less values.<br>');\n }else if (pValue <= .05 && result.data.length > 1) {\n //$(\"#trendCharts\").append('The Mann-Kendall test for trend has a p-value of ' + pValue.toFixed(4) + ' and is significant at the 0.05 level. The Theil-Sen estimate of slope is ' + senSlope.toFixed(4) + ' and the intercept is ' + senB.toFixed(4) + '.<br>');\n $(\"#trendCharts\").append('The Mann-Kendall test for trend is significant at the 0.05 level. The Theil-Sen estimate of slope is ' + senSlope.toFixed(4) + ' and the intercept is ' + senB.toFixed(4) + '.<br>');\n }\n //else if (result.data.length == 1) {\n // $(\"#trendCharts\").append('There is only one data point. Need at least two for trend calculations.<br>');\n //}\n else {\n //$(\"#trendCharts\").append('The Mann-Kendall test for trend has a p-value of ' + pValue.toFixed(4) + ' and is not significant at the 0.05 level.<br>');\n $(\"#trendCharts\").append('The Mann-Kendall test for trend is not significant at the 0.05 level.<br>');\n }\n \n //$(\".pvalue\").html(pValue.toFixed(4));\n //$(\".slope\").html(senSlope.toFixed(4));\n //$(\".intercept\").html(senB.toFixed(4));\n}", "function CreateTimeSeries(labels, values) {\n var ctx = document.getElementById('myBestChart').getContext('2d');\n const config = {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: \"Number of Incidents\",\n data: values,\n backgroundColor: 'rgba(0, 188, 242, 0.5)',\n borderColor: 'rgba(0, 158, 73, .75)',\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n },\n plugins: {\n title: {\n display: true,\n text: 'Police Use of Force Incidents by Year'\n }\n }\n }\n }\n \n return new Chart(ctx, config);\n\n}", "function drawChart() {\n\t\t\t\t\tvar data = google.visualization.arrayToDataTable(\n\t\t\t\t\tInventArray, false);\n\t\t\t\t\tconsole.log(data);\n\n\t\t\t\t\t // Optional; add a title and set the width and height of the chart\n\t\t\t\t\tvar options = {'title':'Average Stock', 'width':350, 'height':300, 'chartArea': {'width': '100%', 'height': '80%'}, pieSliceText:'value-and-percentage'};\n\n\t\t\t\t\t// Display the chart inside the <div> element with id=\"piechart\"\n\t\t\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('piechart'));\n\t\t\t\t\tchart.draw(data, options);\n\t\t\t\t}", "function drawChart() {\n\n// n.b. need all these retrieved;\n var chart5_ovs = parseFloat(document.getElementById('chart5_ovs').value);\n var chart5_hormo = parseFloat(document.getElementById('chart5_hormo').value);\n var chart5_chemo_add = parseFloat(document.getElementById('chart5_chemo_add').value);\n var chart5_tram_add = parseFloat(document.getElementById('chart5_tram_add').value);\n var chart10_ovs = parseFloat(document.getElementById('chart10_ovs').value);\n var chart10_hormo = parseFloat(document.getElementById('chart10_hormo').value);\n var chart10_chemo_add = parseFloat(document.getElementById('chart10_chemo_add').value);\n var chart10_tram_add = parseFloat(document.getElementById('chart10_tram_add').value);\n var types=['Year','Survival with no Adjuvant treatment',\n 'Benefit of Adjuvant Hormone therapy'];\n if ( chart5_chemo_add > 0.0001 ) {\n types[types.length]='Additional benefit of Adjuvant Chemotherapy';\n }\n if ( chart5_tram_add > 0.0001 ) {\n types[types.length]='Additional benefit of Trastuzumab';\n }\n types[types.length]= { role: 'annotation' };\n var yr5 = ['Five years', chart5_ovs, chart5_hormo];\n var yr10 = ['Ten years', chart10_ovs, chart10_hormo];\n if ( chart5_chemo_add > 0.0001 ) {\n yr5[yr5.length]= chart5_chemo_add;\n yr10[yr10.length]= chart10_chemo_add;\n }\n if ( chart5_tram_add > 0.0001 ) {\n yr5[yr5.length]= chart5_tram_add;\n yr10[yr10.length]= chart10_tram_add;\n }\n yr5[yr5.length]= '';\n yr10[yr10.length]= '';\n var data = google.visualization.arrayToDataTable([types,yr5,yr10]);\n\n// alternate construction - cant get this to work\n// var data = google.visualization.DataTable();\n// data.addColumn({ type: 'number', label: 'Five years', id: 'year5', role: 'annotation' });\n// data.addColumn({ type: 'number', label: 'Ten years', id: 'year10', role: 'annotation' });\n// data.addRow([10, 24]);\n// data.addRow([16, 22]);\n\n var view = new google.visualization.DataView(data);\n// n.b. view.setColumns() Specifies which columns are visible in this view. Any columns not specified will be hidden\n var setcols=[0,1,{ calc: \"stringify\",sourceColumn: 1,type: \"string\",role: \"annotation\" }];\n// only set the hormo benefit value (column 2) to be displayed if it's > 0.0\n// n.b. hormo value is always in the data array so always index 2\n if ( chart5_hormo > 0.0001 ) {\n setcols[setcols.length]= 2;\n setcols[setcols.length]= { calc: \"stringify\",sourceColumn: 2,type: \"string\",role: \"annotation\" };\n } else {\n// setcols[setcols.length]= 2; # not needed as not displaying ??\n }\n// n.b. if present chemo is always index 3 and traz always index 4 (no traz without chemo)\n if ( chart5_chemo_add > 0.0001 ) {\n setcols[setcols.length]= 3;\n setcols[setcols.length]= { calc: \"stringify\",sourceColumn: 3,type: \"string\",role: \"annotation\" };\n } else {\n// setcols[setcols.length]= 3;\n }\n if ( chart5_tram_add > 0.0001 ) {\n setcols[setcols.length]= 4;\n setcols[setcols.length]= { calc: \"stringify\",sourceColumn: 4,type: \"string\",role: \"annotation\" };\n// setcols[setcols.length]= 5;\n }\n setcols[setcols.length]= types.length - 1;\n view.setColumns(setcols);\n// view.setColumns([0, // this example for labelling of 2 data regimes in bar chart\n// 1,{ calc: \"stringify\",sourceColumn: 1,type: \"string\",role: \"annotation\" },\n// 2,{ calc: \"stringify\",sourceColumn: 2,type: \"string\",role: \"annotation\" },3]);\n\n// n.b. height & width are set as same as in img block\n// legend:{ alignment: 'bottom', textStyle: { fontSize: getFontSize(), overflow: 'auto'} }\n// legend: {position: 'bottom', alignment: 'center', maxLines: 4, textStyle: { overflow: 'none'}},\n// legend is uncontrolable - especially for long labels like we have! so don't use and replace with static png\n// n.b. give chart max y-axis of 105 so top category value label has enough room to display\n// tooltips: {isHtml: true, showColorCode: true},\n// colors: ['#666699','#00ff00','#ff9900','#00aa99'],\n// n.b. since new release of google charts on 23/2/15 for ER -ve (0 hormo) we now need to remove the green\n// from the colours vector as it's being used for the chemo i.e. zero hormo is not being interpretted\n// properly seemingly a bug - corrected 17/3/15 by emd\n var cols = ['#666699'];\n if ( chart5_hormo > 0.001 ) {\n cols[cols.length]= '#00ff00';\n }\n cols[cols.length]= '#ff9900';\n cols[cols.length]= '#00aa99';\n var options = {\n title: 'Overall Survival at 5 and 10 years (percent)',\n colors: cols,\n vAxis: {maxValue: 105, ticks: [0,10,20,30,40,50,60,70,80,90,100]},\n chartArea: {left:40, top:30, width:'70%', height:'65%'},\n legend: {position: 'none'},\n bar: {groupWidth: \"50%\"},\n isStacked: true,\n width: 360,\n height: 460\n };\n\n var chart_div = document.getElementById('chart1');\n var chart = new google.visualization.ColumnChart(chart_div);\n\n// n.b. currently turned off as causes tooltips NOT to be displayed on mouseover -must have tooltips!\n // Wait for the chart to finish drawing before calling the getImageURI() method.\n// google.visualization.events.addListener(chart, 'ready', function () {\n// chart_div.innerHTML = '<img src=\"' + chart.getImageURI() + '\">';\n// console.log(chart_div.innerHTML);\n// });\n\n// chart.draw(data, options); // use this form if not using the view object for labelling\n chart.draw(view, options);\n\n }", "function chart (data) {\n //chartJS : http://www.chartjs.org/docs/#line-chart\n var activities = getActivities(data);\n\n var ctx = document.getElementById('myChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: getDates(data),\n //Object.keys(myDay)\n datasets: [{\n label: 'Mental',\n data: getSurvey(data, 0),\n // data: getChartData(myDay, 0),\n backgroundColor: \"rgba(51,51,51,0.4)\"\n }, {\n label: 'Physical',\n data: getSurvey(data, 1),\n backgroundColor: \"rgba(244,235,66,0.4)\"\n },\n {\n label: 'Psychological',\n data: getSurvey(data, 2),\n backgroundColor: \"rgba(66,244,69,0.4)\"\n }]\n },\n options: {\n title: {\n display: true,\n text: 'Your Daily Life Log'\n },\n tooltips: {\n callbacks: {\n // Custom Tooltip Labels with Activities for every particular day added\n label: function(tooltipItems, labelData) {\n return labelData.datasets[tooltipItems.datasetIndex].label + '\\n' + ': ' + tooltipItems.yLabel + \" (\" + activities[tooltipItems.index].join(',\\n ') + \")\";\n } \n }\n }\n }\n });\n }", "function drawChart() \n {\n\n // Create our data table.\n var data = new google.visualization.DataTable();\n\n \t // Create and populate the data table.\n \t var yearData = google.visualization.arrayToDataTable(yearRowData);\n \t var yearTotalsData = google.visualization.arrayToDataTable(yearTotalsRowData);\n \t var monthData = google.visualization.arrayToDataTable(monthRowData);\n \t var monthTotalsData = google.visualization.arrayToDataTable(monthTotalsRowData);\n \t var weekData = google.visualization.arrayToDataTable(weekRowData);\n \t var weekTotalsData = google.visualization.arrayToDataTable(weekTotalsRowData);\n \t var dayData = google.visualization.arrayToDataTable(dayRowData);\n \t var dayTotalsData = google.visualization.arrayToDataTable(dayTotalsRowData);\n \n // Instantiate and draw our chart, passing in some options.\n \t var chartAreaSize = {width:\"90%\",height:\"80%\"};\n \t var dayChartAreaSize = {width:\"80%\",height:\"80%\"};\n \t var chartHeight = 300;\n \t var chartWidth = 710;\n \t var pieWidth = 370;\n \t var dayWidth = 400;\n \t var fontPxSize = 14;\n \t \n \t \n // day charts\n if(dayDataExist)\n {\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('dayPieChart'));\n\t pieChart.draw(dayTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('dayPieChart'));\n\t pieChart.draw(dayTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('dayStackChart'));\n\t \t columnChart.draw(dayData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('dayStackChart'));\n\t \t columnChart.draw(dayData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('dayBarChart'));\n\t \t columnChart.draw(dayData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('dayBarChart'));\n\t \t columnChart.draw(dayData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n }\n else\n {\n \t $('#dayPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 1 });\n \t $('#dayStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 1 });\n \t $('#dayBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 1 });\n }\n \n if(weekDataExist)\n {\n\t // weekCharts\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('weekPieChart'));\n\t pieChart.draw(weekTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('weekPieChart'));\n\t pieChart.draw(weekTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('weekStackChart'));\n\t \t columnChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('weekStackChart'));\n\t \t columnChart.draw(weekData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('weekBarChart'));\n\t \t columnChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('weekBarChart'));\n\t \t columnChart.draw(weekData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(weekRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('weekLineChart'));\n\t\t lineChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('weekLineChart'));\n\t\t lineChart.draw(weekData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('weekAreaChart'));\n\t\t \t areaChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('weekAreaChart'));\n\t\t \t areaChart.draw(weekData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t } \n\t }\n\t else\n\t {\n\t \t //$(\"#weekLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t //$(\"#weekAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $('#weekLineChartTab').hide();\n\t \t $( '#lineCharts' ).tabs({ selected: 1 });\n\t \t $('#weekAreaChartTab').hide();\n\t \t $( '#areaCharts' ).tabs({ selected: 1 });\n\t }\n }\n else\n {\n \t $('#weekPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 2 });\n \t $('#weekStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 2 });\n \t $('#weekBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 2 });\n \t $('#weekLineChartTab').hide();\n \t $( '#lineCharts' ).tabs({ selected: 1 });\n \t $('#weekAreaChartTab').hide();\n \t $( '#areaCharts' ).tabs({ selected: 1 });\n }\n \n if(monthDataExist)\n {\n\t // month charts\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('monthPieChart'));\n\t pieChart.draw(monthTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('monthPieChart'));\n\t pieChart.draw(monthTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('monthStackChart'));\n\t \t columnChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('monthStackChart'));\n\t \t columnChart.draw(monthData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('monthBarChart'));\n\t \t columnChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('monthBarChart'));\n\t \t columnChart.draw(monthData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(monthRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('monthLineChart'));\n\t\t lineChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('monthLineChart'));\n\t\t lineChart.draw(monthData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('monthAreaChart'));\n\t\t \t areaChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('monthAreaChart'));\n\t\t \t areaChart.draw(monthData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t }\n\t else\n\t {\n\t \t //$(\"#monthLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t //$(\"#monthAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $('#monthLineChartTab').hide();\n\t \t $( '#lineCharts' ).tabs({ selected: 2 });\n\t \t $('#monthAreaChartTab').hide();\n\t \t $( '#areaCharts' ).tabs({ selected: 2 });\n\t }\n }\n else\n {\n \t $('#monthPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 3 });\n \t $('#monthStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 3 });\n \t $('#monthBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 3 });\n \t $('#monthLineChartTab').hide();\n \t $( '#lineCharts' ).tabs({ selected: 2 });\n \t $('#monthAreaChartTab').hide();\n \t $( '#areaCharts' ).tabs({ selected: 2 });\n }\n \n if(yearDataExist)\n {\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('yearPieChart'));\n\t pieChart.draw(yearTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('yearPieChart'));\n\t pieChart.draw(yearTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('yearStackChart'));\n\t \t columnChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('yearStackChart'));\n\t \t columnChart.draw(yearData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('yearBarChart'));\n\t \t columnChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('yearBarChart'));\n\t \t columnChart.draw(yearData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(yearRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('yearLineChart'));\n\t\t lineChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('yearLineChart'));\n\t\t lineChart.draw(yearData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('yearAreaChart'));\n\t\t \t areaChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('yearAreaChart'));\n\t\t \t areaChart.draw(yearData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t }\n\t else\n\t {\n\t \t $(\"#yearLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $(\"#yearAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t }\n }\n else\n {\n \t $(\"#yearPieChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearStackChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearBarChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n }\n \n }", "function fnGetChart(arrX, arrY){\n var ctx = document.getElementById(\"myChart\").getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: arrX,//doublTotal\n datasets: [{\n label: '# IMC',\n data: arrY,//Dates\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n }", "function drawChart() {\n\n // Create our data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ]);\n\n\n\t\t\t// Instantiate and draw our chart, passing in some options.\n\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n\t\t\tchart.draw(data, null);\n\t\t\t}", "function createChart(id, title, dataArray) {\n let chart = new CanvasJS.Chart(id, {\n title: {\n text: title\n },\n axisX: {\n title: \"Value of n\",\n valueFormatString: \"#,###\"\n },\n axisY: {\n title: \"Average runtime (ms)\"\n },\n toolTip: {\n shared: true\n },\n legend: {\n cursor: \"pointer\",\n verticalAlign: \"top\",\n horizontalAlign: \"center\",\n dockInsidePlotArea: true,\n },\n data: dataArray\n });\n return chart;\n}", "function createDiagramMoney(categoriesArr, linesArr, textTitle) {\n // plugin options \n\n Highcharts.setOptions({\n colors: ['green', 'blue', 'red', 'aqua', 'black', 'gray']\n })\n\n $('#container_diagram_money').highcharts({\n plotOptions: {\n series: {\n lineWidth: 3,\n marker: {\n symbol: 'circle',\n\n }\n }\n },\n title: {\n text: textTitle\n },\n chart: {\n type: 'line',\n\n },\n subtitle: {\n\n },\n xAxis: {\n categories: categoriesArr,\n gridLineDashStyle: 'ShortDot',\n gridLineWidth: 1\n },\n yAxis: {\n gridLineDashStyle: 'ShortDot',\n title: {\n text: ''\n }\n },\n tooltip: {\n valueSuffix: ' грн.'\n },\n legend: {\n layout: 'horizontal',\n align: 'center',\n verticalAlign: 'bottom',\n y: 50,\n padding: 3,\n itemMarginTop: 5,\n itemMarginBottom: 5,\n itemStyle: {\n lineHeight: '14px'\n }\n },\n series: linesArr\n });\n }", "function drawChart() {\n \t \t\n \tvar bigArray = [];\n \t\n \t//use a for loop to make an array of arrays out of relevant JSON data \t\n \tfor(var i=0;i<JSONFredData.observations.length;i++){\n \t\t\n \t\tvar smallArray = [];\n \t\t\n \t\tvar FRED1 = JSONFredData.observations[i];\n \t\t\n \t\tsmallArray.push(FRED1.date);\n \t smallArray.push(Number(FRED1.value));\n \t\n \tbigArray.push(smallArray);\n \t\n \t}\n \t\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Date');\n data.addColumn('number', 'Value');\n data.addRows(bigArray);\n\n // Set chart options\n var options = {'title':'How Much Pizza Have I Eaten This Week?',\n 'width':1100,\n 'height':900};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "updateChart () {\n \n }", "function constructChart() {\n var data = chartData = new google.visualization.DataTable();\n\n data.addColumn('datetime', 'time');\n data.addColumn('number', 'consumption');\n data.addColumn('number', 'prediction');\n // to make prediction always dotted\n data.addColumn({type:'boolean',role:'certainty'});\n\n chartOptions = {\n title: 'Consumption predictions',\n height: 600,\n theme: 'maximized',\n pointSize: 3,\n series: [{\n color: 'blue'\n }, {\n color: 'grey',\n lineWidth: 1\n }]\n };\n\n chart = new google.visualization.LineChart(document.getElementById('prediction-chart'));\n\n scrollTo(6, ' .chart');\n\n }", "function generateChart(){\n // make chart width fit with its container\n var ww = selector.attr('width', $(container).width() );\n switch(type){\n case 'Line':\n new Chart(ctx).Line(data, options);\n break;\n }\n // Initiate new chart or Redraw\n\n }", "function chartBuilder(data) {\r\n\r\n\r\n // -------------------- ??CROSSFILTER?? --------------------\r\n // applies a crossfilter so anything using variable 'ndx' will be filtered together\r\n let ndx = crossfilter(data);\r\n let allData = ndx.groupAll(); // allData groups all 'ndx' items for the ??DATACOUNT??\r\n\r\n\r\n // -------------------- ??DATACOUNT?? --------------------\r\n dc.dataCount(\"#total\") // dc.dataCount | add to div id#total\r\n .crossfilter(ndx) // apply the crossfilter\r\n .groupAll(allData); // group allData from the crossfilter\r\n\r\n\r\n // -------------------- ??PARSE??? DATA --------------------\r\n // Loop through data and parse/convert appropriate formats\r\n data.forEach(function (d) {\r\n\r\n //----- parsing NUMBERS\r\n // my .csv/.json files have columns with numbers, so need to parse them\r\n d.Rank = parseInt(d.Rank); // column called 'Rank'\r\n d.Rating = parseFloat(d.Rating); // column called 'Rating'\r\n d.Reviews = parseInt(d.Reviews); // column called 'Reviews'\r\n\r\n //----- parsing DATES\r\n //let fullDateFormat = d3.time.format(\"%a, %d %b %Y %X %Z\");\r\n //let yearFormat = d3.time.format(\"%Y\");\r\n //let monthFormat = d3.time.format(\"%b\");\r\n //let dayOfWeekFormat = d3.time.format(\"%a\");\r\n });\r\n\r\n\r\n\r\n\r\n\r\n // -------------------- ??ARGUMENTS?? FOR CHART FUNCTIONS --------------------\r\n byCuisine(ndx, \"#cuisine\", \"Cuisine\"); // pieChart on div#cuisine from column 'Cuisine' in file\r\n byCity(ndx, \"#city\", \"City\"); // selectMenu on div#city from column 'City' in file\r\n byFood(ndx, \"#food\", \"Cuisine\"); // selectMenu on div#food from column 'Cuisine' in file\r\n byRating(ndx, \"#rating\", \"Rating\"); // rowChart on div#rating from column 'Rating' in file\r\n byStack(ndx, \"#stack\", \"IATA\"); // barChartStack on div#stack from column 'IATA' in file\r\n byScatter(ndx, \"#scatter\", \"Rating\") // scatterPlot on div#scatter from column 'Rating' in file\r\n byName(ndx, \"#restaurants\", \"Rank\"); // dataTable on div#restaurants from column 'Rank' in file\r\n\r\n // -------------------- RENDER CHARTS --------------------\r\n dc.renderAll();\r\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {'title':'Global Share',\n 'width':300,\n 'height':200,\n 'is3D': true,};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawPatientChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'PatientType');\n data.addColumn('number', 'No. of patients');\n data.addRows([\n ['Suspected', 3],\n ['Infected', 3],\n ['Quarantined', 5],\n ['Returnee', 8]\n ]);\n\n // Set chart options\n var options = {'title':'Percentages of Patients by Types'};\n\n // Instantiate and draw our chart, passing in some options.\n var piechart = new google.visualization.PieChart(elements.piechart);\n var linechart = new google.charts.Line(elements.linechart);\n var barchart = new google.charts.Bar(elements.barchart);\n\n barchart.draw(data,options);\n piechart.draw(data, options);\n linechart.draw(data, options);\n\n }", "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['', 'Hours per Day'],\n ['', 8],\n ['', 2],\n ['', 4],\n ['', 2],\n ['', 8]\n ]);\n \n var options = { legend: 'none','width':50, 'height':40};\n \n // var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n // chart.draw(data,options);\n }", "function createDailyChart(id,axisLabelY,data){\n // var data = [];\n // var currentValue = 100;\n // var random = d3.random.normal(0, 20.0);\n\n // for(var i=0; i<100; i++) {\n // var currentDate = new Date();\n // currentDate.setDate(currentDate.getDate() + i);\n \n // data.push([currentDate, currentValue]);\n // currentValue = currentValue + random();\n // }\n // console.log(data);\n\n var drawLineGraph = function(containerHeight, containerWidth, data, yLabel, xLabel) {\n\n var svg = d3.select(`#${id}`).append(\"svg\")\n .attr(\"width\", containerWidth)\n .attr(\"height\", containerHeight);\n\n var margin = { top: 10, left: 50, right: 10, bottom: 50 };\n \n var height = containerHeight - margin.top - margin.bottom;\n var width = containerWidth - margin.left - margin.right;\n\n var xDomain = d3.extent(data, function(d) { return d[0]; })\n var yDomain = d3.extent(data, function(d) { return d[1]; });\n\n var xScale = d3.time.scale().range([0, width]).domain(xDomain);\n var yScale = d3.scale.linear().range([height, 0]).domain(yDomain);\n\n var xAxis = d3.svg.axis().scale(xScale).orient('bottom').ticks(5).tickFormat(d3.time.format(\"%d.%m\"));\n var yAxis = d3.svg.axis().scale(yScale).orient('left').ticks(5);\n\n var line = d3.svg.line()\n .x(function(d) { return xScale(d[0]); })\n .y(function(d) { return yScale(d[1]); });\n\n var area = d3.svg.area()\n .x(function(d) { return xScale(d[0]); })\n .y0(function(d) { return yScale(d[1]); })\n .y1(height);\n\n var g = svg.append('g').attr('transform', 'translate(' + margin.left + ', ' + margin.top + ')');\n\n g.append('path')\n .datum(data)\n .attr('class', 'area')\n .attr('d', area)\n .style(\"fill\", \"url(#mygrad)\");//id of the gradient for fill\n\n g.append('g')\n .attr('class', 'x axis')\n .attr('transform', 'translate(0, ' + height + ')')\n .call(xAxis)\n\t\t\t\t.append('text')\n .attr('transform', 'rotate(0)')\n .attr('x', width/2)\n .attr('dy', '2.71em')\n .attr('text-anchor', 'end')\n\t\t\t\t\t.attr('class','axisX-label')\n .text(xLabel);\n\n g.append('g')\n .attr('class', 'y axis')\n .call(yAxis)\n .append('text')\n .attr('transform', 'rotate(-90)')\n .attr('y', 6)\n .attr('dy', '-3.9em')\n\t\t\t\t\t.attr('dx','-6em')\n .attr('text-anchor', 'end')\n\t\t\t\t\t.attr('class','axisY-label')\n .text(yLabel);\n\n g.append('path')\n .datum(data)\n .attr('class', 'daily-line')\n .attr('d', line);\n\n\n // Gradient - Chart Area\n \n //make defs and add the linear gradient\n var lg = svg.append(\"defs\").append(\"linearGradient\")\n .attr(\"id\", \"mygrad\")//id of the gradient\n .attr(\"x1\", \"0%\")\n .attr(\"x2\", \"0%\")\n .attr(\"y1\", \"0%\")\n .attr(\"y2\", \"100%\")//since its a vertical linear gradient \n ;\n lg.append(\"stop\")\n .attr(\"offset\", \"0%\")\n .style(\"stop-color\", \"rgb(80,203,253)\")//end in red\n .style(\"stop-opacity\", 1)\n\n lg.append(\"stop\")\n .attr(\"offset\", \"90%\")\n .style(\"stop-color\", \"white\")//start in blue\n .style(\"stop-opacity\", 1);\n \n \n \n // focus tracking\n var focus = g.append('g').style('display', 'none');\n \n\t\t\t//lines\n focus.append('line')\n .attr('id', 'focusLineX')\n .attr('class', 'focusLine');\n focus.append('line')\n .attr('id', 'focusLineY')\n .attr('class', 'focusLineDashed');\n //focus point\n\t\t\tfocus.append('circle')\n .attr('id', 'focusCircle')\n .attr('r', 5)\n .attr('class', 'circle focusCircle');\n\t\t\t\n\t\t\t\n\t\t\t//Lebels\n\t\t\t//labels box\n\t\t\tfocus.append('rect')\n\t\t\t\t.attr('id','focusLabelBoxX')\n\t\t\t\t.attr('class','focusLabelBox');\n\t\t\tfocus.append('rect')\n\t\t\t\t.attr('id','focusLabelBoxY')\n\t\t\t\t.attr('class','focusLabelBox');\n\n\t\t\t//labels text\n\t\t\tfocus.append('text')\n\t\t\t\t.attr('id','focusLabelX')\n\t\t\t\t.attr('class','focusLabel');\n\t\t\tfocus.append('text')\n\t\t\t\t.attr('id','focusLabelY')\n\t\t\t\t.attr('class','focusLabel');\n\t\t\t\t\n\n var bisectDate = d3.bisector(function(d) { return d[0]; }).left;\n\n g.append('rect')\n .attr('class', 'overlay')\n .attr('width', width)\n .attr('height', height)\n .on('mouseover', function() { focus.style('display', null); })\n .on('mouseout', function() { focus.style('display', 'none'); })\n .on('mousemove', function() { \n var mouse = d3.mouse(this);\n\t\t\t\t\t\n var mouseDate = xScale.invert(mouse[0]);\n\t\t\t\t\tvar mouseValue=yScale.invert(mouse[1]);\n var i = bisectDate(data, mouseDate); // returns the index to the current data item\n\t\t\t\t\t//console.log(mouseValue);\n var d0 = data[i - 1]\n var d1 = data[i];\n // work out which date value is closest to the mouse\n var d = mouseDate - d0[0] > d1[0] - mouseDate ? d1 : d0;\n\n var x = xScale(d[0]);\n var y = yScale(d[1]);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n focus.select('#focusCircle')\n .attr('cx', x)\n .attr('cy', y);\n focus.select('#focusLineX')\n .attr('x1', x).attr('y1', yScale(yDomain[0]))\n .attr('x2', x).attr('y2', yScale(yDomain[1]));\n focus.select('#focusLineY')\n .attr('x1', xScale(xDomain[0])).attr('y1', mouse[1])\n .attr('x2', xScale(xDomain[1])).attr('y2', mouse[1]);\n\t\n\t\n\t\n\t\t\t\t\t\n\t\t\t\t\t//Label text\n\t\t\t\t\tlet labelOffsetXaxis=15;\n\t\t\t\t\tfocus.select('#focusLabelX')\n\t\t\t\t\t\t.attr('x', x-labelOffsetXaxis)\n\t\t\t\t\t\t.attr('y', yScale(yDomain[0])+labelOffsetXaxis)\n\t\t\t\t\t\t.text(mouseDate.getDate()+'.'+(mouseDate.getMonth()+1))\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlet labelOffsetYaxis=40;\n\t\t\t\t\tfocus.select('#focusLabelY')\n\t\t\t\t\t\t.attr('x', xScale(xDomain[0])-labelOffsetYaxis)\n\t\t\t\t\t\t.attr('y', mouse[1])\n\t\t\t\t\t\t.text(mouseValue.toFixed(2));\n\t\t\t\t\t\n\t\t\t\t\t//Label box\n\t\t\t\t\tlet elementLabelY=document.querySelector('#focusLabelY');\n\t\t\t\t\tlet labelWidthY = elementLabelY.getBBox().width;\n\t\t\t\t\tfocus.select('#focusLabelBoxY')\n\t\t\t\t\t\t.attr('x', xScale(xDomain[0])-labelOffsetYaxis-labelWidthY*0.09)\n\t\t\t\t\t\t.attr('y', mouse[1]-14)\n\t\t\t\t\t\t.attr('width',labelWidthY*1.2);\n\t\t\t\t\t\n\t\t\t\t\tlet elementLabelX=document.querySelector('#focusLabelX');\n\t\t\t\t\tlet labelWidthX = elementLabelX.getBBox().width;\n\t\t\t\t\tfocus.select('#focusLabelBoxX')\n\t\t\t\t\t\t.attr('x', x-labelOffsetXaxis-labelWidthX*0.09)\n\t\t\t\t\t\t.attr('y', yScale(yDomain[0]))\n\t\t\t\t\t\t.attr('width',labelWidthX*1.2);;\n\t\t\t\t\t\n\t\n });\n\n \n };\n const chartWidth=(window.innerWidth<420)?310:390;\n drawLineGraph(246, chartWidth, data, axisLabelY,\"תאריך\");\n return;\n}", "function SVGColumnChart() {\r\n }", "function createChart(name, type, title, datasetLabel, labels, values) {\n let cntx = document.getElementById(name).getContext('2d')\n\n let chart = new Chart(cntx, {\n type: type,\n data: {\n labels: labels,\n datasets: [{\n label: datasetLabel,\n backgroundColor: [\n 'rgba(255, 99, 132, 1)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)'\n ],\n data: values\n }]\n },\n options: {\n title: {\n display: true,\n text: title\n }\n }\n })\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Activity');\n data.addColumn('number', 'Completed');\n data.addRows([\n ['Courses', 3],\n ['Posts', 1],\n ['Job Offers', 1],\n ['Tutorials', 1],\n ['Projects', 2]\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Your activity on Udabuddy',\n 'width': '100%',\n 'height': '100%'\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.ColumnChart(document.getElementById(\n 'chart_div'));\n chart.draw(data, options);\n }", "function generateChart(story,projectName) {\n\t\t$(\"#div1\").show();\n\t\tvar ds;\n\t\tvar finish=0,create=0,working=0;\n\t\t\n\t\tfor (i = 0; i < story.length; i++){\n\t\t\tds = [];\n\t\t\tif (story[i].fields.theme == \"sticky-note-green-theme\")\n\t\t\t\tfinish++;\n\t\t\telse if (story[i].fields.theme == \"sticky-note-blue-theme\")\n\t\t\t\tcreate++;\n\t\t\telse \n\t\t\t\tworking++;\n\t\t\t\n\t\t\t$('#mytitle').html(\"Project : \" + projectName);\n\t\t\tds.push(finish);ds.push(working);ds.push(create);\n\t\t\tconfig.data.datasets.forEach(function(dataset) {dataset.data = ds;});\t\t\t\t\n\t\t\tconfig.data.labels = ['Finish','On Progress','New'];\n\t\t\tmyDoughnut.update();\n\t\t}\t\n\t}", "function getChart() {\n\tmyChart.on('click', function(params) {\n\t\t//alert(params.name);\n\t\tgrids.set({url:\"<%=basePath %>rest/plaProductOrderSeqHourseManageAction/getPlaProductOrderSeqHourse?date=\"+cdate+\"&seqName=\"+cseqName+\"&macCode=\"+encodeURIComponent(encodeURIComponent(params.name))});\n\t});\n\t;\n\tif (getBar() && typeof getBar() === \"object\") {\n\t\tmyChart.setOption(getBar(), true);\n\t}\n\n}", "function SVGRowChart() {\r\n }", "function generateChart(){\n // make chart width fit with its container\n var ww = selector.attr('width', $(container).width() );\n switch(type){\n case 'Line':\n new Chart(ctx).Line(data, options);\n break;\n case 'Doughnut':\n new Chart(ctx).Doughnut(data, options);\n break;\n case 'Pie':\n new Chart(ctx).Pie(data, options);\n break;\n case 'Bar':\n new Chart(ctx).Bar(data, options);\n break;\n case 'Radar':\n new Chart(ctx).Radar(data, options);\n break;\n case 'PolarArea':\n new Chart(ctx).PolarArea(data, options);\n break;\n }\n // Initiate new chart or Redraw\n\n }", "function plot() {\n \n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['activos', 5],\n ['inactivos', 5.8],\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Estado de las alumnas',\n 'width': 450,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "function setupChart() {\n\t\tvar $ = cmg.query,\n\t\t\tdata_list = cmg.display.data[0],\n\t\t\tdata = [];\n\n\t\tif (chart_type == \"bar\") {\n\t\t\tfor (i in data_list) {\n\t\t\t\tvar obj = {\n\t\t\t\t\tcategory: data_list[i][x_axis_column],\n\t\t\t\t\tprice: cmg.display.parse_float_liberally(data_list[i][y_axis_columns])\n\t\t\t\t}\n\t\t\t\tdata.push(obj);\n\t\t\t}\n\t\t} else {\n\t\t\tfor(var i in data_list) data.push(data_list[i]);\n\t\t}\n\n\t\t// SET UP THE SVG FOR THE CHART\n\t\tvis = d3.select(\"#dataVizChart\")\n\t\t\t.append(\"svg\")\n\t\t\t.attr({\n\t\t\t\t\"width\": width,\n\t\t\t\t\"height\": height,\n\t\t\t\t\"preserveAspectRatio\": \"xMinYMid\",\n\t\t\t\t\"viewBox\": \"0 0 \" + width + \" \" + height\n\t\t\t})\n\t\t\t.append('g')\n\t\t\t.attr({\n\t\t\t\t'transform': 'translate(0, 0)'\n\t\t\t})\n\n\t\taspect = chart_container.width() / chart_container.height();\n\n\t\t// SET UP THE LEGEND\n\t\tlegend = d3.select(\"#dataVizLegend\")\n\t\t\t.append(\"div\")\n\t\t\t.attr({\n\t\t\t\t\"class\": \"legend\",\n\t\t\t});\n\n\t\tdrawBarChart(data);\n\t}", "function genChart(ribbonData,curData,prevData,CTY,YEAR){ \r\n\r\n//Preparing Month Array\r\nvar month_arr = [{\"monthN\" : 1, \"month\" : \"Jan\", \"monthName\" : \"January\"},\r\n {\"monthN\" : 2, \"month\" : \"Feb\", \"monthName\" : \"February\"},\r\n\t\t\t\t {\"monthN\" : 3, \"month\" : \"Mar\", \"monthName\" : \"March\"},\r\n\t\t\t\t {\"monthN\" : 4, \"month\" : \"Apr\", \"monthName\" : \"April\"},\r\n\t\t\t\t {\"monthN\" : 5, \"month\" : \"May\", \"monthName\" : \"May\"},\r\n\t\t\t\t {\"monthN\" : 6, \"month\" : \"Jun\", \"monthName\" : \"June\"},\r\n\t\t\t\t {\"monthN\" : 7, \"month\" : \"Jul\", \"monthName\" : \"July\"},\r\n\t\t\t\t {\"monthN\" : 8, \"month\" : \"Aug\", \"monthName\" : \"August\"},\r\n\t\t\t\t {\"monthN\" : 9, \"month\" : \"Sep\", \"monthName\" : \"September\"},\r\n\t\t\t\t {\"monthN\" : 10, \"month\" : \"Oct\", \"monthName\" : \"October\"},\r\n\t\t\t\t {\"monthN\" : 11, \"month\" : \"Nov\", \"monthName\" : \"November\"},\r\n\t\t\t\t {\"monthN\" : 12, \"month\" : \"Dec\", \"monthName\" : \"December\"}]\r\n\r\n//Join and Sort datafiles\r\n\r\nvar ribbondata = join(ribbonData, month_arr, \"month\", \"month\", function(dat,col){\r\n\t\treturn{\r\n\t\t\tfips : col.fips,\r\n\t\t\tmonthN : +dat.monthN,\r\n\t\t\tmonthName : dat.monthName,\r\n\t\t\tmin_ui : col.min_ui/100,\r\n\t\t\tmid_ui : (col.max_ui + col.min_ui)/200,\r\n\t\t\tmax_ui : col.max_ui/100,\r\n\t\t\tmin_yr : col.min_yr,\r\n\t\t\tmax_yr : col.max_yr\r\n\t\t};\r\n\t}).sort(function(a, b){ return d3.ascending(+a['monthN'], +b['monthN']); });\r\n\t\r\n\r\nvar curdata = join(curData, month_arr, \"month\", \"month\", function(dat,col){\r\n\t\treturn{\r\n\t\t\tfips : (col !== undefined) ? col.fips : null,\r\n\t\t\tmonthN : (dat !== undefined) ? +dat.monthN : null,\r\n\t\t\tmonthName : (dat !== undefined) ? dat.monthName : null,\r\n\t\t\tui : (col !== undefined) ? col.ui/100 : null,\r\n\t\t\tyear : (col !== undefined) ? col.year : null\r\n\t\t};\r\n\t}).filter(function(d) {return d.fips != null;})\r\n\t .sort(function(a, b){ return d3.ascending(+a['monthN'], +b['monthN']); });\r\n\r\nvar prevdata = join(prevData, month_arr, \"month\", \"month\", function(dat,col){\r\n\t\treturn{\r\n\t\t\tfips : (col !== undefined) ? col.fips : null,\r\n\t\t\tmonthN : (dat !== undefined) ? +dat.monthN : null,\r\n\t\t\tmonthName : (dat !== undefined) ? dat.monthName : null,\r\n\t\t\tui : (col !== undefined) ? col.ui/100 : null,\r\n\t\t\tyear : (col !== undefined) ? col.year : null\r\n\t\t};\r\n\t}).filter(function(d) {return d.fips != null;})\r\n\t .sort(function(a, b){ return d3.ascending(+a['monthN'], +b['monthN']); });\r\n//Percentage Format\r\nvar formatPercent = d3.format(\".1%\")\r\n\r\n//defining the SVG \r\n margin = ({top: 20, right: 210, bottom: 40, left: 40})\r\n\r\n var width = 900,\r\n\theight = 600,\r\n barHeight = 8,\r\n\tbarSpace = 4,\r\n\taxisShift = 130;\r\n\t\r\n\t\r\nvar maxCur = d3.max(curdata, function(d){return d.ui});\r\nvar maxRib = d3.max(ribbondata, function(d) {return d.max_ui});\r\n\r\nvar maxVal = (maxCur > maxRib) ? maxCur : maxRib;\r\nvar maxVal = maxVal + 0.02;\r\n\r\n\r\nvar xLabel = month_arr.map(d => d.monthName);\r\n\r\nvar config = ({\r\n domain: xLabel, \r\n padding: 0.6, \r\n round: true, \r\n range: [40, Math.min(700, width - 40)] \r\n});\r\n\r\n\r\nvar yLen = 240;\r\n\r\nvar x_axis = d3.scalePoint()\r\n .domain(config.domain)\r\n .range(config.range)\r\n .padding(config.padding)\r\n .round(config.round);\r\n \r\n\r\n\r\nvar y_axis = d3.scaleLinear()\r\n .domain([maxVal,0])\r\n\t .range([0,height - 350]); //Controlling the length of the axis\r\n\r\n//Define the lines\r\n\r\nvar Ribbon = d3.area()\r\n .x(function(d) { return x_axis(d.monthName) })\r\n\t\t.y0(function(d) { return y_axis(d.min_ui)-250 })\r\n\t\t.y1(function(d) { return y_axis(d.max_ui)-250 });\r\n\t\t\r\n\r\nvar MidLine = d3.line() \r\n .x(function(d) { return x_axis(d.monthName) })\r\n\t\t.y(function(d) { return y_axis(d.mid_ui)-250 });\r\n\t\t\r\nvar CurLine = d3.line() \r\n .x(function(d) { return x_axis(d.monthName) })\r\n\t .y(function(d) { return y_axis(d.ui)-250 });\r\n\t\t\r\n\r\nvar PrevLine = d3.line() \r\n .x(function(d) { return x_axis(d.monthName) })\r\n\t .y(function(d) { return y_axis(d.ui)-250 });\r\n\t\t\r\n\r\n//Output code for chart \r\n\r\n//Tooltip initialization \r\nvar curtip = d3.tip() //too;tip for current unemployment line\r\n .attr('class', 'd3-tip') //This is the link to the CSS \r\n .html(function(e,d) { \r\n tipMsg = d.monthName + \", \" + d.year + \"<br> Unemployment Rate: \" + formatPercent(d.ui);\r\n return tipMsg;\r\n }); //This is the tip content\r\n\r\nvar prevtip = d3.tip() //too;tip for current unemployment line\r\n .attr('class', 'd3-tip') //This is the link to the CSS \r\n .html(function(e,d) { \r\n tipMsg = d.monthName + \", \" + d.year + \"<br> Unemployment Rate: \" + formatPercent(d.ui);\r\n return tipMsg;\r\n }); //This is the tip content\r\n\r\nvar mintip = d3.tip() //too;tip for minimum unemployment value of ribbon\r\n .attr('class', 'd3-tip') //This is the link to the CSS \r\n .html(function(e,d) { \r\n tipMsg = d.monthName + \", \" + d.min_yr + \"-\" + d.max_yr + \"<br> Minimum Unemployment Rate: \" + formatPercent(d.min_ui);\r\n return tipMsg;\r\n }); //This is the tip content\r\n\r\nvar midtip = d3.tip() //too;tip for middle unemployment value of ribbon\r\n .attr('class', 'd3-tip') //This is the link to the CSS \r\n .html(function(e,d) { \r\n tipMsg = d.monthName + \", \" + d.min_yr + \"-\" + d.max_yr + \"<br> Midpoint of Unemployment Rate: \" + formatPercent(d.mid_ui);\r\n return tipMsg;\r\n }); //This is the tip content\r\n\r\nvar maxtip = d3.tip() //too;tip for maximum unemployment value of ribbon\r\n .attr('class', 'd3-tip') //This is the link to the CSS \r\n .html(function(e,d) { \r\n tipMsg = d.monthName + \", \" + d.min_yr + \"-\" + d.max_yr + \"<br> Maximum Unemployment Rate: \" + formatPercent(d.max_ui);\r\n return tipMsg;\r\n }); //This is the tip content\r\n\r\n \r\n var graph = d3.select(\"#chart\")\r\n\t .append(\"svg\")\r\n\t\t .attr(\"preserveAspectRatio\", \"xMinYMin meet\")\r\n .attr(\"viewBox\", [0, 0, width, height])\r\n\t\t .call(curtip) //Add Tooltips to Visualuzation\r\n\t\t .call(prevtip)\r\n .call(mintip)\r\n .call(midtip)\r\n .call(maxtip);\r\n\r\n\r\n//Title\r\nvar titStr = \"Unemployment Rate: \" + CTY;\r\ngraph.append(\"text\")\r\n .attr(\"x\", (width / 2)) \r\n .attr(\"y\", margin.top + 10 )\r\n .attr(\"text-anchor\", \"middle\") \r\n .style(\"font\", \"16px sans-serif\") \r\n .style(\"text-decoration\", \"underline\") \r\n .text(titStr);\r\n\r\n\r\n // Add the Ribbon\r\n graph.append(\"path\")\r\n .data([ribbondata])\r\n\t .attr(\"class\",\"ribbon\")\r\n .style(\"fill\", \"#46F7F6\")\r\n .style(\"stroke\", \"steelblue\")\r\n .style(\"stroke-width\", 1.5)\r\n\t .style(\"fill-opacity\",0.2)\r\n\t .attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"d\", Ribbon);\r\n\t \r\n\r\n// Add the Midline\r\ngraph.append(\"path\")\r\n .data([ribbondata])\r\n\t .attr(\"class\",\"midline\")\r\n .style(\"stroke\", \"black\")\r\n\t .style(\"fill\",\"none\")\r\n .style(\"stroke-width\", 1.5)\r\n\t .attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"d\", MidLine);\r\n\t\t\r\n\r\n// Add the CurLine\r\ngraph.append(\"path\")\r\n .datum(curdata)\r\n\t .attr(\"class\",\"curline\")\r\n .style(\"stroke\", \"red\")\r\n\t .style(\"fill\",\"none\")\r\n .style(\"stroke-width\", 1.5)\r\n\t .attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"d\", CurLine);\r\n\t \r\n\r\n// Add the PrevLine\r\ngraph.append(\"path\")\r\n .datum(prevdata)\r\n\t .attr(\"class\",\"prevline\")\r\n .style(\"stroke\", \"brown\")\r\n\t .style(\"fill\",\"none\")\r\n .style(\"stroke-width\", 1.5)\r\n\t .attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"d\", PrevLine);\r\n\t \r\n\r\n//Add the circles to the ribbon\r\ngraph.selectAll(\"MaxCircles\")\r\n .data(ribbondata)\r\n .enter()\r\n .append(\"circle\")\r\n .attr(\"fill\", \"steelblue\")\r\n .attr(\"stroke\", \"none\")\r\n\t\t.attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"cx\", function(d) { return x_axis(d.monthName) })\r\n .attr(\"cy\", function(d) { return y_axis(d.max_ui)-250 })\r\n .attr(\"r\", 3)\r\n\t\t.on('mouseover', function(e,d) { maxtip.show(e,d); }) //the content of the tip is established in the initialization\r\n .on('mouseout', maxtip.hide);\r\n\t\t\t\t\r\ngraph.selectAll(\"MinCircles\")\r\n .data(ribbondata)\r\n .enter()\r\n\t\t.append(\"circle\")\r\n .attr(\"fill\", \"steelblue\")\r\n .attr(\"stroke\", \"none\")\r\n\t\t.attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"cx\", function(d) { return x_axis(d.monthName) })\r\n .attr(\"cy\", function(d) { return y_axis(d.min_ui)-250 })\r\n .attr(\"r\", 3)\r\n\t\t.on('mouseover', function(e,d) { mintip.show(e,d); }) //the content of the tip is established in the initialization\r\n .on('mouseout', mintip.hide);;\r\n\t\t\r\ngraph.selectAll(\"MidCircles\")\r\n .data(ribbondata)\r\n .enter()\r\n\t\t .append(\"circle\")\r\n .attr(\"fill\", \"black\")\r\n .attr(\"stroke\", \"none\")\r\n\t\t.attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"cx\", function(d) { return x_axis(d.monthName) })\r\n .attr(\"cy\", function(d) { return y_axis(d.mid_ui)-250 })\r\n .attr(\"r\", 3)\r\n\t\t.on('mouseover', function(e,d) { midtip.show(e,d); }) //the content of the tip is established in the initialization\r\n .on('mouseout', midtip.hide);\r\n\t\t\r\n\r\n\r\ngraph.selectAll(\"CurCircles\")\r\n .data(curdata)\r\n .enter()\r\n\t\t .append(\"circle\")\r\n .attr(\"fill\", \"red\")\r\n .attr(\"stroke\", \"none\")\r\n\t\t.attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"cx\", function(d) { return x_axis(d.monthName) })\r\n .attr(\"cy\", function(d) { return y_axis(d.ui)-250 })\r\n .attr(\"r\", 3)\r\n\t\t.on('mouseover', function(e,d) { curtip.show(e,d); }) //the content of the tip is established in the initialization\r\n .on('mouseout', curtip.hide);\r\n\r\ngraph.selectAll(\"PrevCircles\")\r\n .data(prevdata)\r\n .enter()\r\n\t\t .append(\"circle\")\r\n .attr(\"fill\", \"brown\")\r\n .attr(\"stroke\", \"none\")\r\n\t\t.attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .attr(\"cx\", function(d) { return x_axis(d.monthName) })\r\n .attr(\"cy\", function(d) { return y_axis(d.ui)-250 })\r\n .attr(\"r\", 3)\r\n\t\t.on('mouseover', function(e,d) { prevtip.show(e,d); }) //the content of the tip is established in the initialization\r\n .on('mouseout', prevtip.hide);\r\n\r\n//X- axis\r\ngraph.append(\"g\")\r\n .attr(\"class\",\"X-Axis\")\r\n .attr(\"transform\", `translate(${margin.left + axisShift - 40},300)`)\r\n .call(d3.axisBottom(x_axis));\r\n\r\n//Y-axis\r\ngraph.append(\"g\")\r\n .attr(\"class\",\"Y-Axis\")\r\n .attr(\"transform\", `translate(${margin.left + axisShift},50)`) //Controls the location of the axis\r\n .call(d3.axisLeft(y_axis).tickFormat(formatPercent));\r\n\t \r\n\r\n\r\n//caption \r\nvar captionStr = captionTxt(yLen + 100);\r\nvar caption = graph.append(\"g\")\r\n\t .attr(\"class\",\"tabobj\");\r\n\t\t \r\ncaption.selectAll(\"text\")\r\n .data(captionStr)\r\n\t\t.enter()\r\n .append(\"text\")\r\n .text(function(d) {return d.captxt})\r\n\t .attr(\"x\", 165) \r\n .attr(\"y\", function(d) {return d.ypos})\r\n .attr(\"text-anchor\", \"right\") \r\n .style(\"font\", \"9px sans-serif\");\r\n\r\n//legend\r\n//Gathering Year Values\r\n\r\nvar curYear = d3.max(curdata, function(d) {return d.year});\r\nvar begYear = d3.max(ribbondata, function(d) {return d.min_yr});\r\nvar endYear = d3.max(ribbondata, function(d) {return d.max_yr});\r\nvar tabArray = legendOut(curYear,begYear,endYear,margin.top + 10);\r\n\r\nvar barHeight = 4;\r\n\r\nvar rectanchorX = 650;\r\n\r\nvar table = graph.append(\"g\")\r\n\t .attr(\"class\",\"tabobj\");\r\n\t\t \r\ntable.selectAll(\"rect\")\r\n .data(tabArray)\r\n\t.enter()\r\n\t.append(\"rect\")\r\n .attr(\"x\", function(d) {return rectanchorX;})\r\n\t.attr(\"y\", function(d) {return d.ypos;})\r\n .attr(\"width\", barHeight)\r\n .attr(\"height\", barHeight)\r\n .attr(\"fill\", function(d) { return d.color;});\r\n\r\ntable.selectAll(\"text\")\r\n .data(tabArray)\r\n\t.enter()\r\n\t.append(\"text\")\r\n .attr(\"x\", function(d) {return rectanchorX + 10;})\r\n\t.attr(\"y\", function(d) {return d.ypos + 6;})\r\n .text( function(d) { return d.text;})\r\n\t.style(\"font\", \"9px sans-serif\");\r\n\t\r\nreturn graph.node();\r\n \r\n}", "function drawChart() {\n const data = new google.visualization.DataTable();\n data.addColumn('string', 'Animal');\n data.addColumn('number', 'Count');\n data.addRows([\n ['2001', 23],\n ['2002', 22],\n ['2003', 23],\n ['2004', 23],\n ['2005', 28],\n ['2006', 28],\n ['2007', 25],\n ['2008', 28],\n ['2009', 27],\n ['2010', 6],\n ['2015', 18],\n ['2016', 18]\n ]);\n\n const options = {\n 'title': 'Distribution of BIONICLE sets per year (2001-2010; 2015-2016)',\n 'width':600,\n 'height':600\n };\n\n const chart = new google.visualization.PieChart(\n document.getElementById('chart-container'));\n chart.draw(data, options);\n}", "function createChart(data, options='')\n{\n if(options == '')\n {\n options = {\n showPoint: true,\n lineSmooth: false,\n height: \"260px\",\n fullWidth: false,\n plugins: [\n Chartist.plugins.tooltip({\n tooltipOffset: {\n x: 30,\n y: 40\n },\n })\n ],\n axisX: {\n showGrid: true,\n showLabel: true,\n },\n axisY: {\n offset: 40,\n },\n };\n }\n Chartist.Line('#chartSale', data, options);\n $('#save-stage').removeClass('hide');\n saveBoardStage();\n $('body').removeClass('loading');\n}", "function createCharts(data, chartAttr, chartType) {\n const months = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec'\n ];\n\n const chartData = data.map((item, monthNum) => {\n console.log(data);\n return {\n label: months[monthNum],\n value: item.data.search.userCount\n };\n });\n const dataSource = {\n chart: chartAttr,\n data: chartData\n };\n let chartConfig = {\n type: chartType,\n width: 800,\n height: 400,\n dataFormat: 'json',\n dataSource\n };\n\n return chartConfig;\n}", "function CreateUsageGraph(usageArray) {\r\n var colorsArray = [\"#acacac\"\r\n , \"#34C6CD\"\r\n , \"#FFB473\"\r\n , \"#2A4380\"\r\n , \"#FFD173\"\r\n , \"#0199AB\"\r\n , \"#FF7600\"\r\n , \"#123EAB\"\r\n , \"#FFAB00\"\r\n , \"#1A7074\"\r\n , \"#A64D00\"\r\n , \"#466FD5\"\r\n , \"#BE008A\"\r\n , \"#B4F200\"\r\n , \"#DF38B1\"\r\n , \"#EF002A\"\r\n ];\r\n var data = new google.visualization.DataTable();\r\n \r\n data.addColumn(\"string\", \"Week Start\");\r\n var frequency = 2 * Math.PI / usageArray[0].length;\r\n // create the headings columns and colors array dynamically\r\n for (var i = 1; i < usageArray[0].length; i++) {\r\n var red = Math.sin(i * frequency + 0) * 127 + 128;\r\n var green = Math.sin(i * frequency + 2) * 127 + 128;\r\n var blue = Math.sin(i * frequency + 4) * 127 + 128;\r\n data.addColumn(\"number\", usageArray[0][i]);\r\n colorsArray.push(RGB2Color(red, green, blue));\r\n }\r\n\r\n // add the data\r\n //data.addColumn({ type: \"number\", role: \"annotation\" });\r\n for (var i = 1; i < usageArray.length; i++) \r\n data.addRows([usageArray[i]]);\r\n\r\n var options = {\r\n backgroundColor: \"#efeeef\",\r\n title: \"Distinct Logins a day by group by week\",\r\n titlePosition: \"out\",\r\n colors: colorsArray,\r\n lineWidth: 3,\r\n width: \"100%\",\r\n height: \"100%\",\r\n curveType: \"function\",\r\n explorer: {},\r\n hAxis: {\r\n textPosition: \"none\",\r\n slantedText: true,\r\n slantedTextAngle: 60\r\n //gridlines: {\r\n // color: \"#111\",\r\n // count: 5//data.getNumberOfRows()\r\n //}\r\n },\r\n legend: {\r\n position: 'top',\r\n textStyle: { fontSize: 13 }\r\n },\r\n chartArea: {\r\n left: 60,\r\n top: 70,\r\n width: \"100%\",\r\n height: \"90%\"\r\n },\r\n animation: {\r\n duration: 1000,\r\n easing: \"out\"\r\n },\r\n //selectionMode: \"multiple\",\r\n vAxis: {\r\n title: \"Distinct Users\"\r\n }\r\n };\r\n \r\n var chart = new google.visualization.LineChart(document.getElementById(\"usageByTime\"));\r\n //google.visualization.events.addListener(chart, \"select\", function () {\r\n // var arr = new Array();\r\n // $(\".grid\").find(\"td\").each(function () {\r\n // arr.push($(this).attr(\"id\"));\r\n // $(this).removeClass(\"graphRowHover\");\r\n // });\r\n // alert(arr);\r\n // var selectedItem = chart.getSelection()[0];\r\n // //alert(\"#cell\" + selectedItem.column + \",\" + (selectedItem.row + 1));\r\n // $(\"#cell\" + selectedItem.column + \",\" + (selectedItem.row + 1)).addClass(\"graphRowHover\");\r\n //});\r\n chart.draw(data, options);\r\n\r\n // create Data Table\r\n var table = document.createElement(\"table\");\r\n $(table).addClass(\"grid\");\r\n for (var i = 0; i < usageArray[1].length; i++) {\r\n var row = document.createElement(\"tr\");\r\n for (var j = 0; j < usageArray.length; j++) {\r\n var cell = document.createElement(\"td\");\r\n if (i == 0)\r\n cell = document.createElement(\"th\");\r\n\r\n \r\n\r\n // start Formatting\r\n $(cell).addClass(\"graphCellHover\");\r\n $(cell).hover(function () {\r\n $(this).closest(\"tr\").addClass(\"graphRowHover\");\r\n }, function () {\r\n $(this).closest(\"tr\").removeClass(\"graphRowHover\");\r\n });\r\n // end formatting\r\n\r\n cell.appendChild(document.createTextNode(usageArray[j][i]));\r\n // if heading, allow filter\r\n if (j === 0) {\r\n var userList = UsersByGroup(usageArray[j][i]);\r\n $(cell).css(\"width\", \"100px\");\r\n \r\n if (i !== 0) $(cell).addClass(\"showing\").addClass(\"rowHeader\").attr(\"id\", \"t\" + i).attr(\"title\", \"Hide/Show on graph \\n\\n\" + \r\n UsersByGroup(usageArray[j][i])\r\n );\r\n (function (d, opt, n) { // the onclick function\r\n $(cell).click(function () {\r\n view = new google.visualization.DataView(d);\r\n if ($(this).hasClass(\"showing\")) {\r\n $(this).closest(\"tr\").find(\"td\").each(function () {\r\n $(this).removeClass(\"showing\").removeClass(\"graphCellHover\").addClass(\"grapCellhHoverNotShow\");\r\n });\r\n } else {\r\n $(this).closest(\"tr\").find(\"td\").each(function () {\r\n $(this).removeClass(\"grapCellhHoverNotShow\").addClass(\"showing\").addClass(\"graphCellHover\");\r\n });\r\n }\r\n\r\n var showColumnsArray = new Array();\r\n // toggle\r\n $(\".rowHeader\").each(function () {\r\n if (!$(this).hasClass(\"showing\"))\r\n showColumnsArray.push(parseInt($(this).attr(\"id\").substr(1, $(this).attr(\"id\").length - 1)));\r\n //view.hideRows([parseInt($(this).attr(\"id\").substr(1, $(this).attr(\"id\").length - 1))]);\r\n });\r\n\r\n view.hideColumns(showColumnsArray);\r\n chart.draw(view, opt);\r\n });\r\n })(data, options, i);\r\n } else {\r\n $(cell).addClass(\"cellNumberTight\");\r\n if (i > 0) {\r\n $(cell).attr(\"id\", \"cell\" + i + \",\" + j);\r\n $(cell).mouseover(function () {\r\n var selectItem = chart.series;\r\n var split = $(this).attr(\"id\").substr(4, $(this).attr(\"id\").length - 4).split(\",\");\r\n });\r\n }\r\n }\r\n row.appendChild(cell);\r\n }\r\n table.appendChild(row);\r\n }\r\n $(\"#graphDetails\").html(table);\r\n \r\n // show the graph in full-screen mode\r\n $(\"#showFullScreen\").on(\"click\", function (e) {\r\n $(\"#usageByTime\").removeClass(\"graph\").css({\r\n \"position\": \"fixed\",\r\n \"left\": 0,\r\n \"top\": 0,\r\n \"z-index\": 5,\r\n \"width\": \"100%\",\r\n \"height\": \"100%\",\r\n \"margin\": 0\r\n });\r\n\r\n $(this).css(\"z-index\", 1);\r\n \r\n // create the Div for closing the full-screen\r\n var closeDiv = document.createElement(\"div\");\r\n $(closeDiv).addClass(\"float-right-absolute\").click(function () { \r\n $(\"#usageByTime\").css({\r\n \"position\": \"\",\r\n \"left\": \"\",\r\n \"top\": \"\",\r\n \"z-index\": \"\",\r\n \"width\": \"\",\r\n \"height\": \"\",\r\n \"margin\": \"\"\r\n }).addClass(\"graph\");\r\n $(\"#closeButtonDiv\").remove();\r\n chart.draw(data, options);\r\n $(\"#showFullScreen\").css(\"z-index\", 10);\r\n }).css({\r\n \"min-width\": \"20px\",\r\n \"min-height\": \"20px\",\r\n \"background-image\": \"url(../Images/x-circle.png)\",\r\n \"background-size\": \"cover\",\r\n \"cursor\": \"pointer\"\r\n }).attr(\"id\", \"closeButtonDiv\");\r\n\r\n closeDiv.appendChild(document.createTextNode(\" \"));\r\n document.body.appendChild(closeDiv);\r\n chart.draw(data, options);\r\n });\r\n}", "function drawChart() {\n\n\t// Create the data table.\n\tvar data = new google.visualization.DataTable();\n\tdata.addColumn('string', 'Topping');\n\tdata.addColumn('number', 'Amt In Dollars');\n\tdata.addRows([\n\t [names.name1, values.expenseNameOne],\n\t [names.name2, values.expenseNameTwo],\n\t [names.name3, values.expenseNameThree],\n\t [names.name4, values.expenseNameFour],\n\t [names.name5, values.expenseNameFive]\n\t]);\n\n\t// Set chart options\n\tvar options = {'title':'MY EXPENSES',\n\t\t\t\t 'width':800,\n\t\t\t\t 'height':500};\n\n\t// Instantiate and draw our chart, passing in some options.\n\tvar chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n\tchart.draw(data, options);\n }", "function generateDateChart(obj) {\n \n var chart, chartGroup, chartWidth, chartHeight,\n dateParser, xScaller, yScaller,\n gHeight, gWidth, max_min;\n\n chart = d3.select(obj.wrapper);\n chartWidth = chart.node().getBoundingClientRect().width;\n chartHeight = (chartWidth * 9) / 16; // generate a rough 16:9 ratio for the height\n \n gWidth = chartWidth - (obj.margins.left + obj.margins.right);\n gHeight = chartHeight - (obj.margins.top + obj.margins.bottom);\n \n dateParser = d3.timeParse(obj.dateParser);\n max_min = getMaxMin(obj.data);\n\n chart = chart.append('div')\n .classed('svg-container', true)\n .append('svg')\n .attr('preserveAspectRatio', 'xMinYMin meet')\n .attr('viewBox', '0 0 '+chartWidth+' '+chartHeight)\n .classed('svg-graph ' + obj.className, true);\n\n chartGroup = chart.append('g')\n .classed('display', true)\n .attr('transform', 'translate('+ obj.margins.left +', '+ obj.margins.top +')');\n\n xScaller = d3.scaleTime()\n .domain(d3.extent(obj.dates, function(d){\n var date = dateParser(d);\n return date;\n }))\n .range([0, gWidth]);\n\n yScaller = d3.scaleLinear()\n .domain([max_min.y.min, max_min.y.max])\n .range([gHeight, 0]);\n \n drawX_Axis.call(chartGroup, {\n scaller: xScaller,\n gHeight: gHeight,\n gWidth: gWidth,\n label: 'Dates'\n });\n\n drawY_Axis.call(chartGroup, {\n scaller: yScaller,\n gHeight: gHeight,\n label: 'Adjusted Close'\n });\n\n generateLines(chartGroup, obj, xScaller, yScaller, dateParser);\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Category');\n data.addColumn('number', 'Amount');\n data.addRows(myData);\n\n // Set chart options\n var options = {'width':500,\n 'height':400};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'FIO');\n data.addColumn('number', 'Count');\n i = 0; \n\n names = document.querySelectorAll('.DName');\n values = document.querySelectorAll('.DCount');\n\n while (i + 1 <= names.length) {\n data.addRows([\n [names[i].innerText, +values[i].innerText]\n ]);\n i++;\n }\n\n // Set chart options\n var options = {\n 'title': 'Кругова діаграма',\n 'width': 500,\n 'height': 500\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawCharts() {\n drawPieChart()\n drawAxisTickColors()\n}", "function drawChart4() {\n\n // Create the data table.\n var data4 = new google.visualization.DataTable();\n data4.addColumn('string', 'nombre');\n data4.addColumn('number', 'cantidad');\n data4.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de pruebas por escuela sede: '+escuela,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data4, options1);\n\n }", "function labFunction(name, graphLabel, graphLocation){\n\n\t// create an array of names\n\tvar indexPull=new Array();\n\tfor (let i = 0; i < labs.length; i++) {\n\t\tindexPull.push(labs[i][0]);\n\t}\n\t//so it wont be case sensitive\n\tvar upname=name.toUpperCase()\n\t//finds the index number\n\tvar nameIndex = indexPull.indexOf(upname);\n\t//this is the variable the rest of the code will \n\t//reference now. It contains the index number as an integer\n\tvar dataIndex =Number(nameIndex);\n\n\n\t// pull data from csv \n\tvar datesPull=new Array();\n\tvar valuesPull =new Array();\n\tfor (let i = 5; i < labDates.length; i++) {\n\t\tdatesPull.push(labDates[dataIndex][i]);\n\t\t// valuesPull.push((Number(values[i][1])).toFixed(2)); with rounding\n\t\tvaluesPull.push((Number(labs[dataIndex][i])));\n\t}\n\n\n\t//assign values to varibles to use in the graphs\n\tvar graphName=labs[dataIndex][1]\n\tvar units=labs[dataIndex][4]\n\tvar rangeMin= Number(labs[dataIndex][2])\n\tvar rangeMax= Number(labs[dataIndex][3])\n\t// var displayMin = rangeMin -20 //not sure if we need\n\t// var displayMax = rangeMax-20\n\tvar dateArray = datesPull\n\tvar data1=valuesPull\n\n\t//convert to real javascript dates \n\tdates = new Array();\n\tdateArray.forEach(function(item,i){\n\t\tdates[i]= new Date(dateArray[i]); \n\t});\n\t// console.log(dates);\n\n\t//simple date for the tooltips on graphs as 00/00/0000\n\t//NOTE: for some reason this is subtracting a day from the actual date\n\tdateTips = new Array(); \n\tdates.forEach(function(item,i){\n\t\tdateTips[i]= moment(dates[i]).format('L')\n\t});\n\n\n\t// Line graph structure \n\t// (reverse the order of the graphs)- this makes the graph go from oldest dates to newer dates,\n\t//if this need changes, simply swap now and yearAgo variable names\n\tvar now = moment()\n\tvar yearAgo = moment(now).subtract(1,'years')\n\n\t//set min and max values\n\tvar type = 'line'\n\tvar data = {\n\t\tlabels: dateTips,\n\t\tdatasets: [{\n\t\t\tdata: data1,\n\t\t\tfill: false,\n\t\t\tborderColor: 'rgba(0, 0, 0, .4)',\n\t\t\tborderWidth:1.5,\n\t\t\tpointHitRadius: 4,\n\t\t\tpointRadius:2,\n\t\t\tlineTension:0\n\t\t}],\n\t}\t\t\n\tvar options = {\n\t\tresponsive: true,\n\t\tmaintainAspectRatio:false,\n\t\tlayout:{\n\t\t\tpadding:{\n\t\t\t\tright:10,\n\t\t\t\tbottom:0,\n\t\t\t\ttop:10\n\t\t\t},\n\t\t},\n\t\tlegend: {\n\t\tdisplay: false\n\t\t}, \n\t\tscales: {\n\t\t\txAxes: [{\n\t\t\t\ttype: \"time\",\n\t\t\t\ttime: {\n\t\t\t\t\tunit: 'month',\n\t\t\t\t\tdisplayFormats: {\n\t\t\t\t\tsecond: 'MM DD'\n\t\t\t\t\t},\n\t\t\t\t\tmin: yearAgo,\n\t\t\t\t\tmax: now\n\t\t\t\t},\n\t\t\t\tgridLines: {\n\t\t\t\t\tdisplay: false,\n\t\t\t\t\tdrawBorder: false,\n\t\t\t\t},\n\t\t\t\tticks:{display:false,\n\t\t\t\t}\n\t\t\t}],\n\t\t\tyAxes: [{\n\t\t\t\tgridLines: {\n\t\t\t\t\tdisplay: false,\n\t\t\t\t\tdrawBorder: false,\n\t\t\t\t\tscaleLabel: {\n\t\t\t\t\t\t\t\tshow: false,\n\t\t\t\t\t\t\t\tlabelString: 'Value'\n\t\t\t\t\t\t\t\t},\n\t\t\n\t\t\t\t},\n\t\t\t\tticks:{\n\t\t\t\t\t// autoSkip:false,\n\t\t\t\t\tfontSize: 8,\n\t\t\t\t\tbeginAtZero: false,\n\t\t\t\t\t////this is where the yscale is created for the graphs, I did not have time to make this work as in the specs\n\t\t\t\t\t// suggestedMin:rangeMin - 1,\n\t\t\t\t\t// suggestedMax:rangeMax + 1,\n\t\t\t\t// \tcallback: function(value) {\n\t\t\t\t// ////fix side labels with some sort of band label-lookup\n\t\t\t\t// \tconsole.log(value);\n\t\t\t\t// \t// var mingoal = rangeMin\n\t\t\t\t// \t// var maxgoal = rangeMax\n\t\t\t\t// \t// var closestmin = value.reduce(function(prev, curr) {\n\t\t\t\t// \t// \treturn (Math.abs(curr - goal) < Math.abs(prev - mingoal) ? curr : prev);\n\t\t\t\t// \t// });\n\t\t\t\t// \t// var closestmax = value.reduce(function(prev, curr) {\n\t\t\t\t// \t// \treturn (Math.abs(curr - goal) < Math.abs(prev - maxgoal) ? curr : prev);\n\t\t\t\t// \t// });\n\t\t\t\t// \t// switch (value) {\n\t\t\t\t// \t// \tcase closestmin:\n\t\t\t\t// \t// \t\treturn rangeMin; \n\t\t\t\t// \t// \tcase closestmax:\n\t\t\t\t// \t// \t\treturn rangeMax; \n\t\t\t\t// \t// }\n\n\t\t\t\t// } \n\t\t\t\t}\n\t\t\t}],\n\t\t},\n\n\t\t//min and max color change of the graph line \n\t\tbands: {\n\t\tyValueMin: rangeMin, \n\t\tyValueMax: rangeMax, \n\n\t\t\t//color of the band lines\n\t\t\tbandLine: {\n\t\t\t\tstroke: 0.5, \n\t\t\t\tcolour: 'rgba(0, 0, 0, 0.4)',\n\t\t\t\ttype: 'dashed', \n\t\t\t\t// label: 'M', \n\t\t\t\tfontSize: '12',\n\t\t\t\tfontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif',\n\t\t\t\tfontStyle: 'normal',\n\t\t\t},\n\n\t\t\t//below the minimum normal value\n\t\t\tbelowMinThresholdColour: [\n\t\t\t\t'rgba(240, 52, 52, 1)'\n\t\t\t],\n\t\t\t//above the maximum normal value\n\t\t\taboveMaxThresholdColour: [\n\t\t\t\t'rgba(240, 52, 52, 1)'\n\t\t\t],\n\t\t},\n\t\ttooltips: {\n\t\tenabled: true,\n\t\tcaretSize: 5,\n\t\tbodyFontSize: 10,\n\t\tposition: 'nearest',\n\t\tdisplayColors: false,\n\t\tcallbacks: {\n\t\t// use label callback to return the desired label\n\t\tlabel: function(tooltipItem,) {\n\t\t\treturn tooltipItem.yLabel+ units +\" - \" + tooltipItem.xLabel;\n\t\t},\n\t\t// remove title\n\t\ttitle: function() {\n\t\t\treturn;\n\t\t}\n\t\t}\n\t\t}\n\t}\n\n\n \n//update the graph labels\n// console.log(graphName);\ndocument.getElementById(graphLabel).innerHTML= graphName;\n\n//instantiate graph\nvar x= document.getElementById(graphLocation);\nnew Chart(x, {\n\t\ttype:type,\n\t\tdata:data,\n\t\toptions:options\n\t});\n\n}", "function drawChart3() {\n var data3\n // Create the data table.\n data3 = new google.visualization.DataTable();\n data3.addColumn('string', 'nombre');\n data3.addColumn('number', 'cantidad');\n data3.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por actividad escuela: '+escuela,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data3, options1);\n\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Tricipital', parseInt(document.getElementById('tricipital').value, 10)],\n ['subescapular', parseInt(document.getElementById('subescapular').value, 10)],\n ['suprailiaca', parseInt(document.getElementById('suprailiaca').value, 10)],\n ['abdominal', parseInt(document.getElementById('abdominal').value, 10)],\n ['quadriceps', parseInt(document.getElementById('quadriceps').value, 10)]\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Percentual de dobras cutâneas em mm³',\n 'margin': 0,\n 'padding': 0,\n 'width': 450,\n 'height': 350\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }" ]
[ "0.75549275", "0.75058764", "0.73437464", "0.72343814", "0.717549", "0.6865518", "0.68653417", "0.6842991", "0.6838302", "0.68046504", "0.67779726", "0.67569363", "0.67406154", "0.6727261", "0.67221355", "0.6712124", "0.67052543", "0.66992074", "0.6698448", "0.66899294", "0.66785574", "0.66766095", "0.66766095", "0.66597205", "0.6639748", "0.6636088", "0.663146", "0.6625828", "0.6619222", "0.6604316", "0.6598667", "0.6574728", "0.6571646", "0.6571604", "0.6560805", "0.6560359", "0.65585375", "0.655632", "0.6552078", "0.6548701", "0.6544734", "0.6537861", "0.6530793", "0.6528315", "0.65218186", "0.6507235", "0.65063685", "0.65015507", "0.6484637", "0.64784", "0.647466", "0.64709914", "0.6458283", "0.64562505", "0.6454462", "0.64537495", "0.6453466", "0.6452929", "0.6450365", "0.64472455", "0.64462847", "0.6441551", "0.6438024", "0.64342797", "0.6431313", "0.64280295", "0.6421995", "0.6405439", "0.64047474", "0.6388663", "0.6388646", "0.6387784", "0.63874996", "0.63829136", "0.63815194", "0.63785833", "0.63675076", "0.63656944", "0.6364645", "0.6355778", "0.63554823", "0.634571", "0.6333403", "0.6324369", "0.63219506", "0.63172907", "0.6313555", "0.63128364", "0.62988275", "0.62946165", "0.6289648", "0.6288181", "0.62806576", "0.6274761", "0.62721014", "0.6267898", "0.6267255", "0.62624085", "0.6261345", "0.62566113", "0.6254887" ]
0.0
-1
Storing Votes n local Storage
function localdata() { for (var i = 0; i < imagesArray.length-1; i++) { TotalSeen += productsArray[i].TimesSeen } for (var i = 0; i < imagesArray.length-1; i++) { if (localStorage.getItem('Votes / Times Seen for ' + imagesArray[i]) === null) { localStorage.setItem('Votes / Times Seen for ' + imagesArray[i], [productsArray[i].TimesClicked, productsArray[i].TimesSeen]) } else { productsArray[i].TimesClicked += JSON.parse(localStorage.getItem('Votes / Times Seen for ' + imagesArray[i])[0]); productsArray[i].TimesSeen += JSON.parse(localStorage.getItem('Votes / Times Seen for ' + imagesArray[i])[2]); localStorage.setItem('Votes / Times Seen for ' + imagesArray[i], [productsArray[i].TimesClicked, productsArray[i].TimesSeen]) //localStorage.setItem('Times Seen for ' + imagesArray[i], productsArray[i].TimesSeen) } } localStorage.setItem('Total Votes', JSON.stringify(TotalClicks)) localStorage.setItem('Total Seen', JSON.stringify(TotalSeen)) if (JSON.parse(localStorage.getItem('Total Votes After Refresh')) === null) { TotalVotesAfterRefresh = JSON.parse(localStorage.getItem('Total Votes')) } else { TotalVotesAfterRefresh = JSON.parse(localStorage.getItem('Total Votes After Refresh')) + JSON.parse((TotalClicks)); } if (JSON.parse(localStorage.getItem('Total Seen After Refresh')) === null) { TotalSeenAfterRefresh = JSON.parse(localStorage.getItem('Total Seen')) } else { TotalSeenAfterRefresh = JSON.parse(localStorage.getItem('Total Seen After Refresh')) + JSON.parse((TotalSeen)); } localStorage.setItem('Total Votes After Refresh', JSON.stringify(TotalVotesAfterRefresh)) localStorage.setItem('Total Seen After Refresh', JSON.stringify(TotalSeenAfterRefresh)) Clicks.push(TotalVotesAfterRefresh) ResultButton.removeEventListener('click', ResultList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function localSaveVotes(){\n var savedProducts = JSON.stringify(products);\n localStorage.setItem('votes', savedProducts);\n}", "function updateVotes() {\n\n var trackVotesArray = [];\n for (var i = 0; i < BusMall.all.length; i++) {\n var trackvotes = BusMall.all[i];\n trackVotesArray.push(trackvotes)\n\n }\n var votesString = JSON.stringify(trackVotesArray);\n localStorage.setItem('votes', votesString);\n\n\n}", "function saveToLocalStorage() {\n let votesData = JSON.stringify(votesArr);\n let viewsData = JSON.stringify(viewsArr);\n\n localStorage.setItem('views', viewsData);\n localStorage.setItem('votes', votesData);\n}", "function localStoreMaker(){\n var productsInStorage=localStorage.getItem('countedVotesStore');\n if (!productsInStorage){\n initializeProducts();\n console.log('initialized', localStorage.length);\n localStorage.setItem('countedVotesStore', JSON.stringify(allProducts));\n }\n else{\n allProducts= JSON.parse(localStorage.getItem('countedVotesStore'));\n }\n}", "function storePokemon(){\n \n localStorage.setItem('wild pokemon', JSON.stringify(wildPokemon));\n localStorage.setItem('caught pokemon', JSON.stringify(caughtPokemon));\n}", "persistData() {\n // Convert the likes array in string before save\n localStorage.setItem('likes', JSON.stringify(this.likes));\n }", "persistData()\n {\n // Convert the likes array to JSON so we\n // can persist it w/ localStorage (setItem() method takes only\n // string arguments!)\n localStorage.setItem('likes', JSON.stringify(this.likes));\n }", "persistData() {\n localStorage.setItem('likes', JSON.stringify(this.likes)); // Convert 'likes' array into a string as localStorage method needs to save as a string.\n }", "function saveToStorage() {\n\tlocalStorage.setItem(\"trackers\", JSON.stringify(trackers));\n}", "store() {\n\t\tlet storeData = this.data.map(wfItem => wfItem.storeVersion());\n\t\tlocalStorage.setItem('data', JSON.stringify(storeData));\n\t}", "function saveKittens() {\r\n\r\n\r\n //save kittens to local storage\r\n window.localStorage.setItem(\"kittens\", JSON.stringify(kittens));\r\n\r\n}", "function Votes() {\n this.votes = {};\n this.players = {};\n this.totalVoters = 0;\n}", "function saveKittens() {\n window.localStorage.setItem(\"kittens\", JSON.stringify(kittens))\n window.localStorage.setItem(\"kittenNameTracker\", JSON.stringify(kittenNameTracker))\n}", "function setPreferencesOnLocalStore(){\n \n kony.store.setItem(\"preferences\", preferencesArray);\n alert(\"Preferences stored successfully: \" + JSON.stringify(kony.store.getItem(\"preferences\")));\n \n}", "function sincroniozarLocalStore( ) {\n\n localStorage.setItem( 'tweets', JSON.stringify( tweets ) );\n}", "function save(){\n\t//saves score from score array in local storage\n\tvar pointsResult = score.reduce((a, b) => a + b, 0);\n\tlocalStorage.setItem(\"points\", pointsResult);\n\t//saves values of questions in assigned local storage\n\t//before saving transforms array elements into JSON\n\t//local storage can store only strings\n\tlocalStorage.setItem(\"qAccSave\",JSON.stringify(qAccepted));\n\tlocalStorage.setItem(\"qRejSave\",JSON.stringify(qRejected));\n}", "function saveAutoUpgrades() {\n //save to local storage\n window.localStorage.setItem('player.autoInventory', JSON.stringify(player.autoInventory));\n\n}", "terzo(){\n localStorage.setItem('points_' + this.props.type + '_3', this.props.points);\n localStorage.setItem('time_' + this.props.type + '_3', this.props.time);\n }", "function storeData(){\r\n localStorage.setItem(\"selections\", JSON.stringify(selections));\r\n}", "function store(qu)\n{\nlocalStorage.ques= JSON.stringify(qu);\n}", "secondo(){\n localStorage.setItem('points_' + this.props.type + '_3', localStorage.getItem('points_' + this.props.type + '_2'));\n localStorage.setItem('time_' + this.props.type + '_3', localStorage.getItem('time_' + this.props.type + '_2'));\n localStorage.setItem('points_' + this.props.type + '_2', this.props.points);\n localStorage.setItem('time_' + this.props.type + '_2', this.props.time);\n }", "primo(){\n localStorage.setItem('points_' + this.props.type + '_3', localStorage.getItem('points_' + this.props.type + '_2'));\n localStorage.setItem('time_' + this.props.type + '_3', localStorage.getItem('time_' + this.props.type + '_2'));\n localStorage.setItem('points_' + this.props.type + '_2', localStorage.getItem('points_' + this.props.type + '_1'));\n localStorage.setItem('time_' + this.props.type + '_2', localStorage.getItem('time_' + this.props.type + '_1'));\n localStorage.setItem('points_' + this.props.type + '_1', this.props.points);\n localStorage.setItem('time_' + this.props.type + '_1', this.props.time);\n }", "function store() {\n let myTask = localStorage.getItem(\"tasks\");\n myTask = JSON.parse(myTask);\n myTask.push(\"This is a new task\");\n myTask = JSON.stringify(myTask);\n localStorage.setItem(\"tasks\", myTask);\n}", "save () {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(this.allMyTrips))\n }", "store() {\n localStorage.setItem(FAVORITES_STORAGE_KEY, JSON.stringify(this.favorites));\n }", "storeGuests() {\n localStorage.setItem('guests', JSON.stringify(this.guests));\n }", "function addData() {\n if (localStorage.length > 0) {\n for (var i = 0; i < imgArr.length; i++) {\n tempArr[i] = JSON.parse(localStorage.getItem(imgArr[i].name));\n imgArr[i].views += tempArr[i].views;\n imgArr[i].votes += tempArr[i].votes;\n }\n }\n}", "function saveClickUpgrades() {\n //save to local storage\n window.localStorage.setItem('player.clickInventory', JSON.stringify(player.clickInventory));\n}", "function storePlayer() {\n localStorage.setItem(\"player names\", JSON.stringify(playerName));\n localStorage.setItem(\"player scores\", JSON.stringify(hiscoreList));\n}", "function save() {\r\n if (supports_html5_storage()){\r\n\t\t\t\r\n\t\tvar save = {\r\n\t\t\tcash: cash,\r\n\t\t\thappyfan: happyfan,\r\n\t\t\tneutralfan: neutralfan,\r\n\t\t\tangryfan: angryfan,\r\n\t\t\tprestige: prestige\r\n\t\t}\r\n \r\n localStorage.setItem(\"save\",JSON.stringify(save));\r\n //console.log(\"Saved! cookies at: \" + cookies);\r\n \r\n }\r\n}", "function saveGolds() {\n localStorage.setItem(\"golds\", golds);\n}", "async _saveData()\n {\n try{\n await AsyncStorage.setItem(\"@JapQuiz:list\",\n JSON.stringify({score: this._currentPoint,\n wrong_list: this._wrong_list,}));\n }\n catch(error)\n {\n console.log(error.toString());\n }\n }", "function set_pointsToAdd(num){\n localStorage[\"pointsToAdd\"] = num;\n}", "function save() {\n localStorage.setItem(\"toys\", toys);\n localStorage.setItem(\"click\", mClickUpgrade.amount);\n localStorage.setItem(\"autoClicker\", mAutoClicker.amount);\n localStorage.setItem(\"multiplier\", mMultiplier.amount);\n localStorage.setItem(\"toyShop\", mToyShop.amount);\n localStorage.setItem(\"toyFactory\", mToyFactory.amount);\n localStorage.setItem(\"hiddenToyLayer\", mHiddenToyLayer.amount);\n}", "function storeArray(a) {\n //check if local storage is set or not\n if (localStorage.getItem(\"quotes\") === null) {\n //if local storage not set, set standardQuotes as quote list in local storage.\n localStorage.setItem(\"quotes\", JSON.stringify(standardQuotes));\n } else {\n //Get stored quotes in array storedQuotes\n let storedQuotes = JSON.parse(localStorage.getItem(\"quotes\"));\n console.log(a);\n //Remove quotes from storage to reset\n localStorage.removeItem(\"quotes\");\n //add new quote to array\n storedQuotes.push(a);\n //set new quote array as local storage array\n localStorage.setItem(\"quotes\", JSON.stringify(storedQuotes));\n\n //show the new quote in the user interface\n document.getElementById(\"answer\").innerHTML =\n storedQuotes[storedQuotes.length - 1];\n }\n}", "function saveData() {\n let recipe = getValues();\n let encodedUrl = encodeURI(url);\n let dataToStore = {};\n dataToStore[encodedUrl] = recipe;\n chrome.storage.local.set(dataToStore, () => { });\n}", "function saveBopsAndHops() {\n localStorage.setItem(\"currentAlcohol\", JSON.stringify(alcohol));\n localStorage.setItem(\"currentArtist\", JSON.stringify(artist));\n}", "function storeLocal() {\n $.get(\"/api/commander\").then(function(results) {\n localStorage.setItem(\"mtgCommanders\", JSON.stringify(results));\n $.get(\"/api/league_data\").then(function(data) {\n localStorage.setItem(\"data\", JSON.stringify(data));\n window.location.replace(\"/setup\");\n });\n });\n }", "function readFromLocalStorage() {\n let stringViews = localStorage.getItem('views');\n let stringVotes = localStorage.getItem('votes');\n\n let normalViews = JSON.parse(stringViews);\n let normalVotes = JSON.parse(stringVotes);\n\n if (normalViews) \n {\n viewsArrTemp = normalViews;\n }\n if (normalVotes) \n {\n votesArrTemp = normalVotes;\n }\n // localStorage.clear();\n console.log('votes', votesArrTemp);\n console.log('views', viewsArrTemp);\n}", "function storeDataInTangle() {\n loadFile().then(function(obj) {\n generateAddress(seed).then(function(address) {\n let tx = createTransactions(obj.buffer, obj.name, address);\n totalPows = tx.length;\n sendTransactions(tx, seed).then(function(result) {\n totalPows = 0;\n pows = 0;\n displayResult(result, obj.name.endsWith('.md'));\n makeProgress(0);\n console.log(result);\n });\n });\n });\n}", "function storeScores() {\n localStorage.setItem(\"storage\", JSON.stringify(scoreStorage));\n}", "function save() {\n localStorage.productData = JSON.stringify(Product.allProducts);\n localStorage.totalCounter = totalCounter;\n}", "backup_to_local_storage(){\n window.localStorage.setItem('vue-mini-shop', JSON.stringify(this.get_all()))\n }", "function saveKittens() {\r\n window.localStorage.setItem(\"kittens\", JSON.stringify(kittens))\r\n window.localStorage.setItem(\"Names\", JSON.stringify(namesArray))\r\n drawKittens()\r\n}", "function storeSettings () {\n // convert app state to settings\n var settings = {\n intervalRange: convertMillisToRange(appState.interval),\n speak: appState.speak,\n notification: appState.notification\n }\n storage.set(vatobeStorage, settings, function (error) {\n if (error) throw error\n })\n}", "function storage(token) {\n // calls autoRefresh everytime token is saved\n autoRefresh();\n for (var key in token) {\n localStorage.setItem(key, token[key]);\n }\n }", "function retrieveVotes() {\n var favoritesRef = firebase.database().ref().child(\"votes\").child(user.uid);\n\n favoritesRef.on(\"child_added\", function (snapshot) {\n votes[snapshot.key] = snapshot.val();\n updateFeedbackForm(snapshot.key);\n });\n\n favoritesRef.on(\"child_changed\", function (snapshot) {\n votes[snapshot.key] = snapshot.val();\n updateFeedbackForm(snapshot.key);\n });\n\n favoritesRef.on(\"child_removed\", function (snapshot) {\n delete votes[snapshot.key];\n updateFeedbackForm(snapshot.key);\n });\n }", "function savePomoData() {\n localStorage.setItem(\"cpid\", currentPomoID);\n localStorage.setItem(\"pomoData\", JSON.stringify(pomoData));\n}", "function storingBottlesaAndState(){\n\n\t\tvar purchaseDetails = {\n\t\t\t\n\t\t\tbottleTotal: quantitySelected(),\n\t\t\tstateChosen: document.getElementById(\"selectStateOption\").value\n\t\t};\n\t\t\n\t\tvar json = JSON.stringify(purchaseDetails);\n\t\tlocalStorage.setItem(\"purchaseDetails\", json);\n\t} // End localStorage ", "async function savePedido(){\n try {\n await AsyncStorage.setItem('@Pedido', JSON.stringify(pedido));\n } catch (error) {\n // Error retrieving data\n }\n }", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function guardarPedidosEnLS() {\n localStorage.setItem(\"pedidos\", JSON.stringify(pedidosPorMesa));\n leerPedidosDeLS();\n}", "function savePromos() {\n localStorage.setItem(\"promos\", JSON.stringify(promos));\n}", "function storeLocal(key, data) {\n window.localStorage.setItem(key, JSON.stringify(data));\n }", "function save_data() {\r\n\tsessionStorage.setItem('pieces', JSON.stringify(Data.pieces))\r\n\tsessionStorage.setItem('stamps', JSON.stringify(Data.stamps))\r\n\tsessionStorage.setItem('categories', JSON.stringify(Data.categories))\r\n\tsessionStorage.setItem('tuto', JSON.stringify(Data.tuto))\r\n}", "function saveAllAnswerDataToLocalStorage() {\n localStorage.setItem(\"listOfItemQA\", JSON.stringify(currentData.listOfItemQA));\n}", "function sincronizarStorage(){\n localStorage.setItem('tweets',JSON.stringify(notas));\n}", "async function storeVote(id, vote) {\n try {\n const response = await fetch(`http://127.0.0.1:8000/posts/vote`, {\n method: \"POST\",\n headers: {\n \"Authorization\": username, \n \"Content-type\":\"application/json\" \n },\n body: JSON.stringify({\"id\": id, \"vote\": vote})\n })\n if (response.ok) {\n let post = await response.json()\n console.log(\"vote stored\", id, vote)\n setVoted(true)\n setRating(post.rating)\n }\n }\n catch (err) {\n console.error(err)\n }\n }", "persist() { \n var investmentsJson = [];\n\n // Serialize everything as a json object\n for(var projectId in this.investments)\n investmentsJson.push(this.investments[projectId].toJson());\n\n // Write to the storage\n localStorage.setItem(this.databaseName, JSON.stringify(investmentsJson));\n }", "function saveOngo(){\n localStorage.setItem(LS_ONGOING, JSON.stringify(ONGOING));\n}", "function saveNoteDataToLocalStorage() {\n\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\n}", "set storage(value) { this._storage = value; }", "readStorage() {\n const storage = JSON.parse(localStorage.getItem('likes'));\n \n // Restauramos los Me Gustas desde localStorage\n if (storage) this.likes = storage;\n }", "function sincronizarStorage() {\n\tlocalStorage.setItem('tweets', JSON.stringify(tweets));\n}", "function sincronizarStorage(){\r\n\r\n localStorage.setItem('Tweets', JSON.stringify(tweets));\r\n\r\n}", "readStorage() {\n const storage = JSON.parse(localStorage.getItem('likes')); \n\n // Restoring like from the localStorage\n if (storage) this.likes = storage;\n }", "function setBot1LossesToLS() {\n bot1Losses = JSON.parse(localStorage.getItem('bot1Losses'));\n bot1Losses +=1;\n localStorage.setItem('bot1Losses', bot1Losses);\n}", "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function saveNoteDataToLocalStorage() {\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\n}", "persistData() {\n localStorage.setItem('favorites', JSON.stringify(this.favorites));\n }", "function storedHighs() {\n localStorage.setItem(\"Scores\", JSON.stringify(highs));\n }", "function save() {\r\n const uname = context.user && context.user.username;\r\n const time = new Date().toLocaleTimeString();\r\n const searchValue = value.length > 0 ? value : \"\";\r\n const newData = { uname, searchValue, time };\r\n if (localStorage.getItem(\"data\") === null) {\r\n localStorage.setItem(\"data\", \"[]\");\r\n }\r\n\r\n var oldData = JSON.parse(localStorage.getItem(\"data\"));\r\n oldData.push(newData);\r\n\r\n localStorage.setItem(\"data\", JSON.stringify(oldData));\r\n }", "function savePriceBtc(price) {\n localStorage.setItem(\"btcUsdPrice\", price)\n}", "function store() {\n\n \n localStorage.setItem('mem', JSON.stringify(myLibrary));\n \n}", "function storeData() {\n\t// This is a little bit of future proofing \n\tif (!submit.key) {\n\t\t// if there is no key, this is a new item and needs a new key\n\t\tvar id = \"ubuVers\" + Math.floor(Math.random()*10000001);\n\t} else {\n\t\t// set the id to the existing key we are editing\n\t\tid = submit.key;\n\t};\n\t\n // I like to give all my form elements their own id's to give myself access\n\t// outside of the form as well as simple access inside of it\n var ubuVersNumValue = ge('ubuVersNum').value,\n ubuVersNameValue = ge('ubuVersName').value,\n\t\tubuVersDict = {version: ubuVersNumValue, release: ubuVersNameValue};\n\t// log out those values as a double check\n console.log(ubuVersNumValue);\n console.log(ubuVersNameValue);\t\n\t\n\t// set the item in localstorage\n\t// note the stringify function\n\tlocalStorage.setItem(id, JSON.stringify(ubuVersDict));\n\t\n\t// log out the whole local storage\n\tconsole.log(localStorage);\n\tge('submit').value = 'Add';\n\n\n}", "function storeScores() {\n localStorage.setItem('names', JSON.stringify(names));\n localStorage.setItem('scores', JSON.stringify(scores));\n localStorage.setItem('times', JSON.stringify(times));\n}", "function saveDistance(dist) {\n localStorage.setItem(\"distance\", dist);\n }", "function saveKittens() {\n console.log(\"enter saveKittens()\");\n window.localStorage.setItem(\"kittens\", JSON.stringify(kittens));\n console.log(\"saveKittens() Success\");\n drawKittens();\n}", "function savePrefs()\n{\n let preferences = collatePrefs( prefs );\n browser.storage.local.set({\"preferences\": preferences});\n}", "function saveVsCurrency(VsChoice) {\n localStorage.setItem('VsCurrency', VsChoice);\n }", "function storeData(data){\n localStorage.data = JSON.stringify(data);\n }", "function save() {\n storage.write(filename, data);\n }", "function gravarLS(key,valor){\n localStorage.setItem(key, valor)\n}", "function storeNotes() {\n // Store the note in the localStorage\n localStorage.setItem(\"note\", JSON.stringify(notesArray));\n }", "function storeQuizArrayToLocalStorage(){\n\t\t//var db = window.localStorage.getItem(localQuizArrayName);\n\t\t//if(db == null || db == \"\"){\n\t\t\t//window.localStorage.setItem(localQuizArrayName,JSON.stringify(quizArray));// quizArray naka include sa taas sa <script></script>\n\t\t\t//alert(localQuizArrayName + \" \\n store to db\");\n\t\t//}\n\t\t//else{\n\t\t\t//alert(\"db \" + localQuizArrayName + \" already exist!\");\n\t\t//}\n\t\t//window.localStorage.setItem(localQuizArrayName,JSON.stringify(quizArray));// quizArray naka include sa taas sa <script></script>\n\t\t\t\n\t\t\n\t}", "_storeState() {\n storage.set(this.itemId, JSON.stringify({\n lastVisit: Date.now(),\n commentCount: this.itemDescendantCount,\n maxCommentId: this.maxCommentId\n }))\n }", "function storeData (key) {\n\t\tif (!key) {\n\t\t\tvar id = Math.floor(Math.random()*1000000);\n\t\t} else {\n\t\t\tvar id = key;\n\t\t}\n\t\tgetTripType();\n\t\t// Object properties contain array with form label and input value\n\t\tvar trip = {};\n\t\t\ttrip.method = [\"Travel Method: \", $('travelMethod').value];\n\t\t\ttrip.type = [\"Trip Type: \", tripTypeValue];\n\t\t\ttrip.dest = [\"Destination: \", $('dest').value];\n\t\t\ttrip.date = [\"Date: \", $('date').value];\n\t\t\ttrip.people = [\"Number of People: \", $('numPeople').value];\n\t\t\ttrip.notes = [\"Notes: \", $('notes').value];\n\t\t\n\t\t// Save data into local storage, use Stringify to convert object to string\n\t\tlocalStorage.setItem(id, JSON.stringify(trip));\n\t\talert(\"Trip Saved!\");\n\t}", "function save_points() {\r\n var update = {\r\n endpoint : 'actualizarPuntos',\r\n method:'POST',\r\n body :{\r\n ID_Facebook : JSON.parse(localStorage.getItem('user_information')).id,\r\n Partidas_Ganadas : $scope.player.totalWins,\r\n Partidas_Empatadas : $scope.player.totalTies,\r\n Partidas_Perdidas : $scope.player.totalLoses\r\n }\r\n };\r\n HttpRequest.player_vs_system(update,function (response) {\r\n //no va hacer nada\r\n });\r\n }", "function storage() {\n let string = JSON.stringify(Product.allProduct);\n localStorage.setItem('product', string)\n\n}", "function storeState() {\n\n localStorage.setItem(STORAGE_KEY, JSON.stringify(data));\n }", "function saveNotes() {\n localStorage.setItem(\"notes\", JSON.stringify(notes));\n localStorage.setItem(\"notesLength\", c);\n}", "save(storage) {\n storage.store({ name: this.name, price: this.price });\n return storage.length;\n }", "function recuperarBaseVehiculo() {\n baseVehiculo = JSON.parse(localStorage.getItem(\"BASEVEHICULO\"));\n}", "function storeNewTokens(tokens, signedPoints) {\n let storableTokens = [];\n for (var i = 0; i < tokens.length; i++) {\n let t = tokens[i];\n storableTokens[i] = getTokenEncoding(t,signedPoints[i]);\n }\n // Append old tokens to the newly received tokens\n if (countStoredTokens() > 0) {\n let oldTokens = loadTokens();\n for (let i=0; i<oldTokens.length; i++) {\n let oldT = oldTokens[i];\n storableTokens.push(getTokenEncoding(oldT,oldT.point));\n }\n }\n const json = JSON.stringify(storableTokens);\n localStorage.setItem(STORAGE_KEY_TOKENS, json);\n localStorage.setItem(STORAGE_KEY_COUNT, storableTokens.length);\n\n // Update the count on the actual icon\n updateIcon(storableTokens.length);\n}", "function saveLocally(key, data){\n\t//https://stackoverflow.com/questions/43116179/localstorage-detect-if-local-storage-is-already-full\n\ttry {\n\t\tlocalStorage.setItem(key, JSON.stringify(data));\n\t\tconsole.log(\"saved locally\");\n \t\t// localStorage.setItem(\"name\", \"Hello World!\"); //saves to the database, \"key\", \"value\"\n\t} catch (e) {\n \t\tif (e.name == 'QUOTA_EXCEEDED_ERR') {\n \t\talert('was unable to save, your local storage seems to be full'); //data wasn't successfully saved due to quota exceed so throw an error\n \t\t}\n\t}\n}", "static storeData(todo){\r\n let todos;\r\n if(localStorage.getItem('todo')=== null){\r\n todos = []\r\n }else{\r\n todos = JSON.parse(localStorage.getItem('todo'))\r\n }\r\n todos.push(todo)\r\n localStorage.setItem('todo',JSON.stringify(todos))\r\n }", "function saveStorage() {\n $('textarea').each(function () {\n let val = $(this).val();\n let id = $(this).attr(\"id\");\n localStorage.setItem(id, val);\n });\n }", "function storeData(key){\n\tcheckValue();\n/* random keygen and gather data for unique local data */\n\tif (!key){\n\t\tvar id \t\t\t= Math.floor(Math.random()*9001);\n\t}else{\n\t\tid = key;\n\t}\n\t\n\tvar item\t\t= {};\n\t\titem.itype = [\"Item Type\", itemType.value];\n\t\titem.iname = [\"Item Name\", whatName.value];\n\t\titem.inumber= [\"How Many\", numberOf.value];\n\t\titem.ihand = [\"Carried By Hand\", handyVal];\n\t\titem.inotes = [\"Notes\", notes.value];\n\t\n/* stringify for local storage */\n\tlocalStorage.setItem (id, JSON.stringify(item)); \t\n\talert(\"Information Submitted\");\n}", "function updateLocalStore() {\n localStorage.setItem(\"TAREAS\", JSON.stringify(list));\n}", "function sincronizarStorage() {\n localStorage.setItem(\"tweets\", JSON.stringify(tweets));\n}" ]
[ "0.7341685", "0.72560143", "0.70115316", "0.650258", "0.6448595", "0.63981044", "0.6336852", "0.62856615", "0.6120321", "0.61123085", "0.61025804", "0.606566", "0.60595584", "0.6050316", "0.60277456", "0.6013646", "0.60063744", "0.5992031", "0.5936435", "0.5892767", "0.5888815", "0.5884683", "0.5863493", "0.5852479", "0.58490175", "0.58474076", "0.5844869", "0.58218783", "0.58211964", "0.5809652", "0.5804348", "0.5801728", "0.5799356", "0.5780403", "0.578032", "0.57650363", "0.5762926", "0.57560444", "0.5748853", "0.574741", "0.5745036", "0.5737429", "0.5735232", "0.5721133", "0.57203376", "0.57136184", "0.57112706", "0.5707986", "0.57049453", "0.56999505", "0.56948525", "0.56855124", "0.5681541", "0.5681169", "0.56801957", "0.5678553", "0.56776", "0.56746864", "0.56735957", "0.5665241", "0.5664657", "0.5660141", "0.56575364", "0.56566125", "0.5654432", "0.5653443", "0.564942", "0.5648133", "0.56469077", "0.56402", "0.56337905", "0.56335914", "0.5632776", "0.5631774", "0.56296885", "0.5628958", "0.5624543", "0.56231624", "0.56140393", "0.5612109", "0.56089187", "0.5604035", "0.56027013", "0.55956584", "0.5593216", "0.5590601", "0.5590047", "0.5587036", "0.55801976", "0.55796134", "0.55759484", "0.55738413", "0.55673736", "0.556398", "0.5554814", "0.55521196", "0.5551529", "0.555043", "0.55497277", "0.5549114" ]
0.5674988
57
Select size input When size is submitted by the user, call makeGrid()
function makeGrid() { // Your code goes here! const height = $("#input_height").val(); const width = $("#input_width").val(); const table = $("#pixel_canvas"); // Remove previous table table.children().remove(); // Set the table for(let r = 0; r < height; r++ ){ let tr = document.createElement("tr"); table.append(tr); for(let w = 0; w < width; w++){ let td = document.createElement("td"); tr.append(td); } } // Submit the form and call function to set the grid $("#sizePicker").submit(function(event){ event.preventDefault(); makeGrid(); }); // Declare clickable mouse event let mouseDown = false; $("td").mousedown(function(event){ mouseDown = true; const color = $("#colorPicker").val(); $(this).css("background", color); // Mouse drag for drawing $("td").mousemove(function(event){ event.preventDefault(); // Check if mouse is clicked and being held if(mouseDown === true){ $(this).css("background",color); }else{ mouseDown = false; } }); }); // Mouse click release $("td").mouseup(function(){ mouseDown = false; }); // Disable dragging when the pointer is outside the table $("#pixel_canvas").mouseleave("td",function(){ mouseDown = false; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectGridSizeFunc() {\n container.innerHTML = \"\";\n const input = prompt(\"Please select a grid resolution. (input 64 for a 64 x 64 sketchpad)\", 16);\n setUpSketch(input);\n}", "function gridSize() {\n size = prompt(\"What size do you want the grid?\");\n createGrid(size, size);\n\n}", "function changeSize() {\n row = prompt(\"Enter the amount of rows you want between 1 and 64.\");\n createGrid(row);\n}", "function customSize() {\n size.textContent = 'Grid Size';\n size.addEventListener('click', () => {\n let input = prompt('Please Enter a Grid Size');\n if (input === null || input < 1) {\n sizeSet();\n makeGrid(16, 16);\n makeGray();\n makeBlack();\n makeRGB();\n } else {\n sizeSet();\n makeGrid(input, input);\n makeGray();\n makeRGB();\n makeBlack();\n }\n })\n buttons.appendChild(size).classList.add('btn');\n}", "function changeSize() {\n const minSize = 2;\n const maxSize = 64;\n let newSize = 0;\n\n while (newSize < minSize || newSize > maxSize) {\n newSize = prompt(`Enter a new size (${minSize}–${maxSize}):`, 0);\n\n // Stop if user cancels\n if (!newSize) {\n return;\n }\n }\n\n clear();\n createGrid(newSize);\n}", "function setGridSize(){\n\t$('#squares-number-button').click(function(){\n\t\tvar gridSize = $('#squares-number-input').val();\n\t\tif(gridSize > 0){\n\t\t\t$('.squares').remove();\n\t\t\tcreateSquares(gridSize);\n\t\t\tcolorHover();\n\t\t\tgridSizeDisplay(gridSize);\n\t\t\t$('#squares-number-input').val('');\n\t\t}\n\t})\n}", "function changeGridSize() {\n $(\"#gridSize\").click(function() {\n userDimension = prompt(\"Enter the grid size (i.e. enter 10 for a 10x10 grid)\")\n while (isNaN(userDimension) === true) {\n userDimension = prompt(\"Please enter a number for the grid size.\");\n }\n createDivs(userDimension, userSize);\n });\n}", "function checkSize(size) {\n\tif (typeof size !== 'number' || size <= 0 || size > 60) {\n\t\tsize = Math.floor(Math.random() * 60);\n\t\tsizeInput.value = `${size}`;\n\t}\n\tcreateGrid(size);\n}", "function changeSize() {\n let newSize = prompt(\"Enter new size\");\n\n if (newSize !== null) {\n newSize = parseInt(newSize);\n if (newSize < 1 || newSize > 100 || Number.isNaN(newSize)) {\n alert(\"Enter a number from 1-100\");\n changeSize();\n } else {\n clearGrid();\n setGridSize(newSize);\n fillGrid(newSize);\n }\n }\n}", "function resizeGrid() {\n do {\n size = prompt(\"Enter a number from 1-125\");\n if (size === null || isNaN(size)) {\n return;\n }\n } while (size > 125);\n container.innerHTML = \"\";\n createGrid(size);\n draw();\n}", "_onChangeSize() {\n\t\t\t\tthis.collection.changeSize(this.model.get('width'), this.model.get('height'));\n\t\t\t\tthis._saveSize(this.model.get('width'), this.model.get('height'));\n\t\t\t\tthis.render();\n\t\t\t}", "function changeSize() {\n let newSize = prompt(\"Enter new size\");\n\n if (newSize !== null) {\n newSize = parseInt(newSize);\n if (newSize < 1 || newSize > 64 || Number.isNaN(newSize)) {\n alert(\"Enter a number from 1-64 range\");\n changeSize();\n } else {\n clearGrid();\n setGridSize(newSize);\n fillGrid(newSize);\n }\n }\n}", "function resize(request) { \n if (request === 'resize') {\n let number = prompt(\"Please enter desired grid size (must be under 100)\", 16);\n }\n if (number <= 100) { \n makeGrid(number);\n } else {\n prompt(\"Invalid response! Grid size must be under 100!\");\n }\n \n}", "function ChangeSize() {\n\t\n var selectedsize = \"\";\n var len = document.SizeForm.size.length;\n var j;\n\t\n for (j = 0; j < len; j++) {\n\t\tif (document.SizeForm.size[j].checked) {\n\t\t\tselectedsize = document.SizeForm.size[j].value;\n\t\t\tbreak;\n\t\t}\n\t}\n\n if (selectedsize == \"small\") {\n\t\tdocument.getElementById(\"displayarea\").style.fontSize = \"7pt\";\n\t} \n else if (selectedsize == \"medium\") {\n\t\tdocument.getElementById(\"displayarea\").style.fontSize = \"12pt\";\n\t}\n else if (selectedsize == \"large\") {\n\t\tdocument.getElementById(\"displayarea\").style.fontSize = \"24pt\";\n\t}\n}", "function SizeCheckBox() {\n guiData.sizeActivated = !guiData.sizeActivated;\n p.getBubbleDrawer().useSize(guiData.sizeActivated);\n if (guiData.sizeActivated)\n {\n $(\"#selectSizeValue\").next(\"input\").autocomplete(\"enable\");\n }\n else\n {\n $(\"#selectSizeValue\").next(\"input\").autocomplete(\"disable\");\n }\n if (!isPlaying)\n refreshDisplay();\n}", "function editor_tools_handle_size()\n{\n editor_tools_store_range();\n\n // Create the size picker on first access.\n if (!editor_tools_size_picker_obj)\n {\n // Create a new popup.\n var popup = editor_tools_construct_popup('editor-tools-size-picker','l');\n editor_tools_size_picker_obj = popup[0];\n var content_obj = popup[1];\n\n // Populate the new popup.\n for (var i = 0; i < editor_tools_size_picker_sizes.length; i++)\n {\n var size = editor_tools_size_picker_sizes[i];\n var a_obj = document.createElement('a');\n a_obj.href = 'javascript:editor_tools_handle_size_select(\"' + size + '\")';\n a_obj.style.fontSize = size;\n a_obj.innerHTML = editor_tools_translate(size);\n content_obj.appendChild(a_obj);\n\n var br_obj = document.createElement('br');\n content_obj.appendChild(br_obj);\n }\n\n // Register the popup with the editor tools.\n editor_tools_register_popup_object(editor_tools_size_picker_obj);\n }\n\n // Display the popup.\n var button_obj = document.getElementById('editor-tools-img-size');\n editor_tools_toggle_popup(editor_tools_size_picker_obj, button_obj);\n}", "function changeSize() {\n let size = this.value;\n if (size == \"medium\") {\n id(\"output\").style.fontSize =\"36pt\";\n } else if (size == \"big\") {\n id(\"output\").style.fontSize =\"48pt\";\n } else {\n id(\"output\").style.fontSize =\"60pt\";\n }\n }", "function getMatrixSize() {\r\n\tchosenSize = document.getElementById(\"matrixSize\").value;\r\n}", "function updateGrid(){\n //num = prompt(\"enter new grid dimensions\");\n clearGrid();\n newSizeGrid(num);\n}", "function getGridSize () {\n let newSize = prompt (\"How many squares per side?\", \"64\");\n if (newSize > 64 || newSize === \" \") {\n warning ();\n // if user doesn't enter new gize, auto generate 16x16 grid \n } else if (newSize === null) {\n clearGrid();\n createGrid(16);\n }\n else {\n clearGrid();\n createGrid(newSize); \n } \n}", "function setsize() {\n\tvar sizes = $(\".well input[name='size']\").val().split(\"x\");\n\t// add properties to object and store for future play\n\tCW.sizex = sizes[0];\n\tCW.sizey = sizes[1];\n\tlocalStorage[\"sizex\"] = sizes[0];\n\tlocalStorage[\"sizey\"] = sizes[1];\n\tlocalStorage[\"black\"] = CW.black;\n\tlocalStorage[\"blank\"] = CW.blank;\n\t$(\".well > h3\").text(\"Generator for \" + CW.sizex + \"x\" + CW.sizey + \" Crossword Puzzle\")\n\t$(\".word\").toggle(\"slow\");\n\t$(\".form-inline\").hide();\n\tevent.preventDefault();\n}", "function captureSize() {\n\tchoice = sizeSelector.value;\n\tproduct.label = product.name + choice;\n\tproduct.size = choice;\n}", "function ChangeSize(value) {\n if (document.getElementById(\"sizeCheckBox\").checked == true) {\n guiData.cursorSize = value;\n if (!isPlaying) {\n refreshBubbles();\n refreshDisplay();\n }\n }\n else {\n p.getBubbleDrawer().setSize(value);\n if (!isPlaying) {\n refreshBubbles();\n refreshDisplay();\n }\n }\n}", "function newSize() {\n\tvar newSize = prompt('Enter a number between 0 and 129.');\n\tif (newSize < 1 || newSize > 128) {\n\t\talert('That is definitely not between 0 and 129!');\n\t}\n\telse {\n\t\tdrawGrid(newSize);\n\t}\n}", "changeSize(params) {\n this.setState({\n size: params.target.value,\n });\n }", "function updateSizeValues(){\n\tswitch (runDialog.sizeConfig.outputPresetInput.selection.index){\n\t\tcase 0:\n\t\t\tsetSizeValues(8.5, 11, 6, 9, 150);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tsetSizeValues(11, 8.5, 9, 6, 150);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tsetSizeValues(11, 14, 8, 12, 150);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tsetSizeValues(14, 11, 12, 8, 150);\n\t\t\tbreak;\n\t}\n}", "function changeSize() {\n var select = document.getElementById(\"sizeList\");\n var size = select.value;\n return size;\n } // end function", "function sizepick(size) {\n currentSize = size;\n}", "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz\n\t .fontSizeMax(function () { return Math.max(30,s[1] * .1) })\n\t .update();\n}", "function gridSize(num){\n\n//if the original value given by the user is within the correct range\nif(num >= 2 && num <=64){\n//create square grid based on the argument assigned to the parameter num\nfor(x = 0; x < num; x++){\n for(let y = 0; y < num; y++){\n const boxDiv = document.createElement(\"div\")\n boxDiv.setAttribute(\"class\", \"boxDiv\")\n container.append(boxDiv)\n }\n } \n//add container id to body so that it can be manipulated using the DOM\n//style the container grid, ensuring the number of rows and columns is equal to the argument value\n body.append(container)\n document.querySelector(\".container\").style.gridTemplateColumns = `repeat(${num}, 1fr)`\n\n//else reprompt the user for a new number that is inbetween the correct range\n} else {\n\n //reprompt user for new argument value that fits within the range\n let updatedInput = prompt('Please choose a number between 2 and 64')\n\n //invoke the gridSize function again with the correct argument value\n gridSize(updatedInput)\n}\n\n\n\n}", "function submitForm() {\n\t$( \"#sizePicker\" ).on( \"submit\", function( evt ) {\n\t\tevt.preventDefault();\n\t\tmakeGrid();\n\t});\n}", "function addChangeSizeEvent(button) {\n button.addEventListener('click', () => {\n let newGridSize = getUserInput();\n resetBackGroundButton(button);\n removeGridChilds();\n generateGridElement(newGridSize);\n addSingleButtonEvents();\n })\n}", "function operate(option) {\n\tif (option == 4) {\n\t\tclear();\n\t\treturn;\n}\npresent_option = option;\nvar size = prompt(\"Enter a Grid Size from 1 - 128.\");\nif ((size > 0) && (size < 128)) {\n\tpresent_size = size;\n\tclear();\n} else {\n\toperate(option);\n}\n}", "setSize(size) {\n this.size = size;\n }", "setSize(size) {\n this.size = size;\n }", "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz.update();\n}", "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz.update();\n}", "function changeSize(){\n\t\t$(\"text-area\").style.fontSize = $(\"size-dropbox\").value;\n\t}", "function changeValue(){\n\tvar newGridValue = prompt(\"Set the new size for the grid! WARNING: Values above 64 may cause lag: \");\n\tif(!isNaN(newGridValue) && newGridValue > 0 && (newGridValue % 1 === 0)){\n\t\tclearGrid();\n\t\tdrawGrid(newGridValue);\n\t\tpixelHover();\n\t} else {\n\t\talert(\"INVALID INPUT. Make sure you're writing a positive whole NUMBER!\");\n\t}\n}", "function handleSize(e) {\n if (stateObject.isRunning) return;\n let value = e.currentTarget.value;\n\n if (window.innerWidth < 800) {\n if (value > 15) {\n value = 15;\n }\n }\n\n scaling[changeSize.id] = value;\n resetAndRenderArray();\n setTimeout(() => {\n for (let i = 0; i < scaling.changeSize; i++) {\n document.getElementById(`arrayBar_${i}`).style.width = scaleWidth(scaling.changeSize);\n }\n }, 100);\n}", "function sizeToFit() {\n gridManager.sizeToFit();\n}", "function populate() {\n\t\tvar temp = \"\";\n\t\tvar div = '<div class=\"squares\"></div>';\n\t\tvar input = parseInt(prompt(\"Choose a new grid size!\"), 10);\n\t\t$('.squares').remove();\n\t\tfor (var i = 1; i <= input * input; i++) {\n\t\t\ttemp += div;\n\t\t};\n\t\t$(\".wrapper\").append(temp);\n\t\tvar height = 640 / input;\n\t\t$('.squares').css('height', height);\n\t\t$('.squares').css('width', height);\n\t}", "function listener(event) {\n event.preventDefault();\n let inputHeight = document.getElementById(\"inputHeight\").value;\n let inputWidth = document.getElementById(\"inputWidth\").value;\n\n makeGrid(inputHeight, inputWidth);\n}", "function formSubmission() {\n event.preventDefault();\n var height = document.getElementById('inputHeight').value;\n var width = document.getElementById('inputWidth').value;\n makeGrid(height, width);\n}", "function sizeIt() {\n newSize = document.getElementById('size').value\n if (newSize < size) {\n delSize = size * (size / newSize + 15)\n size = newSize\n reset()\n } else {\n size = newSize\n delSize = size * 1.45\n reset()\n }\n}", "function refreshGrid(){\n clearGrid();\n makeGrid(document.getElementById(\"input_height\").value, document.getElementById(\"input_width\").value);\n}", "function userInput() {\n let gridSize = 1;\n while (gridSize < 2 || gridSize > 50) {\n gridSize = prompt(\"How many squares per side would you like your grid to have? Maximum of 50.\");\n }\n createChildDivs(gridSize);\n}", "function increaseSize() {\n\tif (selectedShape) {\n\t\tselectedShape.resize(5);\n\t\tdrawShapes();\n\t}\n}", "function change_size(){\n\tvar size = document.getElementById(\"size\").value;\n\tdocument.getElementById(\"myt\").style.fontSize = size;\n}", "function handleMazeSize() {\n \"use strict\";\n var r = document.getElementById(\"height\"),\n c = document.getElementById(\"width\");\n NUM_COLS = parseInt(c.value, 10) || NUM_COLS;\n if (NUM_COLS % 2 !== 1) {\n // Don't want an even number...\n NUM_COLS += 1;\n }\n // Update the width input box..\n c.value = NUM_COLS;\n NUM_ROWS = parseInt(r.value, 10) || NUM_ROWS;\n if (NUM_ROWS % 2 !== 1) {\n NUM_ROWS += 1;\n }\n // Update the height input box..\n r.value = NUM_ROWS;\n}", "function autoSize() {\n gridManager.autoSize();\n}", "function AddSize(){\n specAttribute.style.cssText = \"height: 85px;\";\n \n weight.style.cssText = \"height:0; opacity:0;\";\n dimentions.style.cssText = \"height:0; opacity:0;\";\n size.style.cssText = \"height: 85px; width:100%; opacity:1; overflow: visible;\"; \n size.getElementsByTagName(\"input\")[0].required = true; \n\n weight.getElementsByTagName(\"input\")[0].required = false; \n weight.getElementsByTagName(\"input\")[0].value= \"\"; \n for (let i=0; i<3; i++) {\n dimentions.getElementsByTagName(\"input\")[i].required = false; \n dimentions.getElementsByTagName(\"input\")[i].value= \"\"; \n }\n}", "scale(size) {\n document.getElementById(\"guiArea\").style.width = size + \"px\";\n }", "function onChangeStrokeSize(size) {\n changeCurrMeme('stroke-size', size);\n renderStrokeSize(size);\n renderCanvas();\n}", "function changeSize() {\n\tctx.beginPath();\n\tctx.lineWidth = selectElmt.options[selectElmt.selectedIndex].value;\n\tctx.stroke();\n}", "calSize(num){\n let opt = this.options;\n if(num > 6 && opt.width > 60 && opt.height > 60 && opt['font-size'] > 40){\n this.options.width = 60;\n this.options.height = 60;\n this.options['font-size'] = 40;\n }\n }", "changeSize(width, height) {\n\t\t\t\tthis.each(function (model) {\n\t\t\t\t\tmodel.set({width, height});\n\t\t\t\t});\n\t\t\t}", "handlechangesize(evt) {\n const valuesize = (evt.target.validity.valid) ? evt.target.value : this.state.valuesize;\n\n this.setState({ valuesize });\n }", "handleSizes(newState) {\n\t\t//console.log(\"Cor selecionada: \" + newState.selected);\n\n\t\t// when selecting \"Qualquer\" pass a null so backend do not verify\n\t\tif(newState.selected == \"Qualquer\") {\n\t\t\tthis.setState({ selectedSize: \"\" });\n\t\t}\n\t\telse {\n\t\t\t// save selected genre\n\t\t\tthis.setState({ selectedSize: newState.selected });\n\t\t}\n\t\t\n\t\t// give options for next step\n\t\tthis.setState({ optionsPriceMin: prices });\n\t}", "function sizeChanged () {\n board = new Board(sizeSlider.value())\n board.initView(windowWidth / 2, windowHeight / 2, CENTER_BOARD_SIZE)\n}", "function newSize(){\n\t\tvar input = prompt(\"Enter the number of rows (1-64)\");\n\t\tvar exit = false;\n\t\tdo {\n\t\t\tif((input < 1) || (input > 64)){\n\t\t\t\tinput = prompt(\"Please, enter a valid value or 'exit'\");\t\t\t\n\t\t\t}\n\t\t\telse if(input==\"exit\"){\n\t\t\t\treturn; //exit without change the old values\n\t\t\t}\t\n\t\t\telse{\n\t\t\t\texit = true;\n\t\t\t}\t\t\t\n\t\t}while (!exit)\n\t\tdefaultPixelsQuantity = parseInt(input);// just in case of no integer values\t\n\t\tfillYellowed(defaultPixelsQuantity); //draw new area\n}", "function changeToSmall(e) {\n changeToSize(120);\n }", "function makeGrid() {\n\n // get the table element\n const canvas = document.getElementById('pixelCanvas');\n // reset grid\n while(canvas.firstChild) {\n canvas.removeChild(canvas.firstChild);\n }\n\n\n var width = sizeForm.width.value;\n var height = sizeForm.height.value;\n console.debug(width);\n console.debug(height);\n \n // create grid with height and width inputs\n for(y = 0; y < height; y++) {\n row = canvas.appendChild(document.createElement('TR'));\n for(x = 0; x < width; x++) {\n cell = row.appendChild(document.createElement('TD'));\n }\n }\n\n canvas.addEventListener('click', changeColor);\n\n}", "function newSize(){\n\n var size = prompt(\"Enter a new size! Size MUST be than 2 and less than 50.\");\n\n if((size < 50) && (size > 2)){\n current_size = size;\n clearSquare();\n } else {\n alert(\"Oops! You entered a size too big. Please try again!\");\n newSize();\n }\n}", "handleRow(e) {\n if(!this.state.running){\n let actualSize = this.state.size;\n \n if(e.target.value < 90){\n actualSize[1] = e.target.value;\n } else {\n actualSize[1] = 25;\n }\n \n this.setState({\n size: actualSize\n });\n \n this.renderBoard();\n }\n }", "function AuthorSize() {\nvar sizeTimeValue = document.getElementById(\"sizeAuthor\").value;\n document.getElementById(\"name\").style.fontSize = sizeTimeValue + \"px\";\n}", "function SizeInput() {\n if(sizes.length > 0) {\n return (\n <select className=\"px-4 py-2 mb-4 text-base text-white bg-gray-800 border border-gray-700 rounded focus:outline-none focus:border-indigo-500\" name=\"size\">\n {sizes.map((size, index) => (\n <option key={index} value={size}>{size}</option>\n ))}\n </select>\n )\n } else {\n return <span className='hidden'></span>\n }\n}", "function askForDimensions(){\n\n\t// Create new dialog window\n\tvar w = new Window (\"dialog\", \"Export PNG Scale\");\n\n\t// Group all inputs together\n\tvar scaleInputGroup = w.add(\"group\");\n\n\t// Put all inputs into a column\n\tscaleInputGroup.orientation = \"column\";\n\n\t// Group all width portions\n\tvar widthGroup = scaleInputGroup.add(\"group\");\n\n\t// Puts all width into a row\n\twidthGroup.orientation = \"row\"\n\n\t// Label for width\n\tvar widthLabel = widthGroup.add(\"statictext\", undefined, \"width in px\");\n\n\t// Editable text field for width\n\tvar widthField = widthGroup.add(\"edittext\", undefined, \"200\");\n\n\t// Sets number of characters allowed\n\twidthField.characters = 20;\n\n\t// Allows field to be editable\n\twidthField.active = true;\n\n\t// Group all height portions\n\tvar heightGroup = scaleInputGroup.add(\"group\");\n\n\t// Puts all height into a row\n\theightGroup.orientation = \"row\";\n\n\t// Label for height\n\tvar heightLabel = heightGroup.add(\"statictext\", undefined, \"height in px\");\n\n\t// Editable text field for width\n\tvar heightField = heightGroup.add(\"edittext\", undefined, \"200\");\n\n\t// Sets number of characters allowed\n\theightField.characters = 20;\n\n\t// Allows field to be editable\n\theightField.active = true;\n\t\n\n\t// Puts all buttons into a group\n\tvar buttonGroup = w.add(\"group\");\n\n\t// Sets all buttons into a row\n\tbuttonGroup.orientation = \"row\";\n\n\t// Aligns buttons to the left side\n\tbuttonGroup.alignment = \"left\";\n\n\t// Set confirm button\n\tvar confirmButton = buttonGroup.add(\"button\", undefined, \"OK\");\n\n\t// Create cancel button\n\tbuttonGroup.add(\"button\", undefined, \"Cancel\")\n\t\n\t// Callback to after the button has been clicked\n\tconfirmButton.onClick = function(){\n\n\t\t// Creates the scale for the height export\n\t\tvscale = parseInt(heightField.text)\n\n\t\t// Creates the scale for the width export\n\t\thscale = parseInt(widthField.text)\n\n\t\t// Closes the window\n\t\tw.close()\n\t}\n\t// Shows the window\n\tw.show ();\n}", "function limitSize(form) {\nlet size = $(\"input[name='size-\" + form + \"']\");\nlet unit = $(\"select[name='unit-\" + form + \"']\");\n const minLimit = {\n px: 100,\n mm: 25,\n in: 1\n };\n const maxLimit = {\n px: 3780,\n mm: 1000,\n in: 40\n };\n unit.change(function() {\n size.attr(\"min\", minLimit[unit.val()]);\n size.attr(\"max\", maxLimit[unit.val()]);\n });\n}", "function updateSizeReading(size, unit, target) {\n var emSize = (unit === 'em' ? Math.floor(size * config.bodySize) : size),\n pxSize = (unit === 'em' ? size / config.bodySize : size);\n\n if (target === 'updatePxInput') {\n elSizePx.value = pxSize;\n } else if (target === 'updateEmInput') {\n elSizeEms.value = emSize;\n } else {\n elSizeEms.value = emSize;\n elSizePx.value = pxSize;\n }\n}", "function buttonClicked() {\n \n let getGridSize = prompt(\"Please enter a new grid size (1-100)\");\n if (getGridSize >= 1 && getGridSize <=100){\n Array.from(gridItem_div).forEach(function (e){\n e.classList.remove(\"divChanged\");\n });\n gridSize = getGridSize; //modify global variable\n setGrid(gridSize);\n makeDivs() \n }\n}", "function onChangeFontSize(size) {\n changeCurrMeme('font-size', size);\n renderFontSize(size);\n renderCanvas();\n}", "function popFormNodeSize() {\n\tturnOffOtherForms()\n\tif (document.getElementById('nodeSizeInput')) {\n\t\tdocument.getElementById('nodeSizeInput').style.display = 'block'\n\t}\n\telse {\n\t\tlet myNodeSizeForm = document.createElement('input')\n\t\tmyNodeSizeForm.classList.add('form-control')\n\t\tmyNodeSizeForm.id = 'nodeSizeInput'\n\t\tmyNodeSizeForm.style.display = 'block'\n\t\tmyNodeSizeForm.addEventListener('keydown', function(e) {\n\t\t\tlet enterKeyCode = 13\n\t\t\tif (e.keyCode === enterKeyCode) {\n\t\t\t\tlet newNodeSize = document.getElementById('nodeSizeInput').value\n\t\t\t\tmyNodeSizeForm.style.display = 'none'\n\t\t\t\tif (newNodeSize !== '') {\n\t\t\t\t\tphylogician.changeNodeSize(newNodeSize)\n\t\t\t\t\tretractNavBar()\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tdocument.body.appendChild(myNodeSizeForm)\n\t}\n}", "function clicktextsize() {\n var fontsize = \"\";\n document.getElementById(\"fontsize\").value = fontsize;\n}", "function setGridSize(size) {\n gridContainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function setPaneSize(e) {\n\n}", "function drawGrid(sizeIn) {\n\tvar boxDivs = [];\n\tsize = sizeIn;\n\tboxSize = Math.floor(960/size);\n\n\t$('#grid').off();\n\t$('#grid').html('');\n\n\t$box = \"<div class='box' style='width:\" + boxSize + \"px; height:\" + boxSize+\"px;'></div>\";\n\t$('#grid').css('width', boxSize*sizeIn);\n\tfor (var i = 0; i < sizeIn * sizeIn; i++){\n\t\tboxDivs[i] = $box;\n\t}\n\t$('#grid').append(boxDivs.join(''));\n\n\tclearGrid();\n\tdraw();\n\tgridLines();\n}", "function getNewSize() {\n //input defaults to the previously selected size for user convenience \n let newSize = parseInt(prompt(\"How large would you like your etch-a-sketch to be?\", size));\n //input validation\n\n while (!(typeof newSize === 'number' && newSize > 0 && newSize < 101)) {\n newSize = parseInt(prompt(\"Please enter a number between 1 and 100.\", size));\n }\n size = newSize\n numOfSquares = size * size;\n}", "function choose_size(size) {\n sort_size = size;\n resize_array();\n}", "SetOverallGridSize(value){\n\t\tvar chk = new Checker(\"SetOverallGridSize\");\n\t\tchk.isValidType(value, \"value\", 'number');\n\t\tthis.overallGridSize = value;\n\t\t\n\t}", "onSizeSelect(e) {\n e.preventDefault();\n const minPrice = this.getMinPrice(e.target.value);\n this.setState({selectedSize: e.target.value, selectedSource: minPrice});\n }", "function resizeInput() {\n var valueLength = $(this).prop('value').length;\n //console.log(valueLength);\n // Para que no arroje error si el input se vacía\n if (valueLength > 0) {\n\n $(this).prop('size', valueLength);\n }\n }", "function setGridSize(size) {\n gridContainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function resizeInput() {\n $(this).attr('size', $(this).val().length);\n}", "function toggleSize() {\n _atMaxSize = !_atMaxSize;\n if (_atMaxSize)\n _mapDOM.canvas.classList.add('max');\n else\n _mapDOM.canvas.classList.remove('max');\n\n _updateMarkerSizes();\n _refresh();\n}", "function drawSelGrid(){\n\tvar obj = gridSize();\n\tvar canvas = document.getElementById('sel_grid');\n\t\n\tvar context = canvas.getContext('2d');\n\tcontext.scale(dpr,dpr);\n\t\n\t//Set the canvas size\n\tcanvas.width = (obj.colWidth * obj.cols+0.5)*dpr;\n\tcanvas.height = (obj.rowHeight*obj.rows+0.5)*dpr;\n\t\n\tcanvas.style.width = `${obj.colWidth * obj.cols+0.5}px`;\n\tcanvas.style.height = `${obj.rowHeight*obj.rows+0.5}px`;\n\tcontext.scale(dpr,dpr);\n\n}", "handleColumn(e) {\n if(!this.state.running){\n let actualSize = this.state.size;\n \n if(e.target.value < 90){\n actualSize[0] = e.target.value;\n } else {\n actualSize[0] = 25;\n }\n \n this.setState({\n size: actualSize\n });\n \n this.renderBoard();\n }\n }", "function makeGrid() {\n // Avoid the creation of repeating elements (h3, h4 tags)\n setInitialStates();\n\n const tableHeight = $('#input_height').val();\n const tableWidth = $('#input_width').val();\n\n // clear the old canvas\n myTable.children().remove();\n\n //Set maximum limit for number inputs\n if(tableHeight>50||tableWidth>50){\n alert(\"Please Insert a Number Between 1 and 50 for GRID Height & Width\");\n // Function the removes the unnecessary info tags (at this point)\n setInitialStates();\n // Reset the input values\n $(\"form input[type=number]\").val(\"1\");\n return true;\n }else {\n // Create the table\n for (let n = 1; n<=tableHeight; n++){\n // Create rows\n myTable.append('<tr></tr>');\n for(let m = 1; m<=tableWidth; m++){\n $('tr').last().append('<td></td>');\n }\n }\n // Add the extra info\n addInfo();\n }\n}", "function checkAspectRatio(sw, sh, pw) {\n\n let nearestW = Math.ceil(sw / pw) * pw;\n let nearestH = Math.ceil(sh / pw) * pw;\n\n $('.menu_options__ssize input.w').val(nearestW);\n $('.menu_options__ssize input.w').val(nearestW);\n $('.menu_options__ssize input.h').val(nearestH);\n\n sw = $('.menu_options__ssize input.w').val();\n sh = $('.menu_options__ssize input.h').val();\n\n $('button.s').data('size',`${sw},${sh}`);\n $('button.m').data('size',`${sw * 1.5},${sh * 1.5}`);\n $('button.l').data('size',`${sw * 2},${sh * 2}`);\n $('button.xl').data('size',`${sw * 2.5},${sh * 2.5}`);\n\n drawGrid(sw, sh, pw);\n}", "function changeGrid() {\n\t$( \"#inputHeight\" ).on( \"change\", function( evt ) {\n\t\tGRID.rows = evt.target.value;\n\t\t$(\"#inputHeight\").attr(\"value\", GRID.rows);\n\t\tconsole.log( \"-- Grid rows changed --\" );\n\t\tconsole.log( evt );\n\t\t//console.log( evt.target.value );\n\t\tgetGrid();\n\t});\n\n\t$( \"#inputWeight\" ).on( \"change\", function( evt ) {\n\t\tGRID.columns = evt.target.value;\n\t\t$(\"#inputWeight\").attr(\"value\", GRID.columns);\n\t\tconsole.log( \"-- Grid columns changed --\" );\n\t\tconsole.log( evt );\n\t\t//console.log( evt.target.value );\n\t\tgetGrid();\n\t});\n}", "function ResizeControl() {\n\t\t\t\ttry {\n\t\t\t\t\tiLog(\"ResizeControl\", \"Called\");\n\n\t\t\t\t\t// Do not update elements which have no or wrong size! (hidden)\n\t\t\t\t\tvar w = self.GetWidth();\n\t\t\t\t\tvar h = self.GetHeight();\n\t\t\t\t\tif (w < 1 || h < 1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\tinput.width(w).height(h);\n\t\t\t\t\tspan.width(w).height(h);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"ResizeControl\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "setWidth(){\n var newWidth = prompt(\"Enter a new bitmap width: \", 8);\n if(newWidth != null){\n newWidth = parseInt(newWidth);\n if(newWidth != NaN){\n if(newWidth >= 1 && newWidth <= 72){\n this.COLUMN_COUNT = newWidth;\n this.updatePanelTitle();\n this.renderGrid();\n this.saveLocally();\n this.applyGridSize();\n return true;\n }else{\n alert(\"That width is too large or small (min: 1, max: 72)\");\n return false;\n }\n }\n }\n return false;\n }", "function makeGrid() {\n canvas.find('tablebody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = gridHeight.val();\n let gridCol = gridWeight.val();\n\n // set tablebody to the table\n canvas.append('<tablebody></tablebody>');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n\n }", "function setMapSize() {\n detail = +document.getElementById(\"detail\").value;\n ctx.canvas.width = document.getElementById(\"width_slider\").value;\n ctx.canvas.height = document.getElementById(\"height_slider\").value;\n}", "async setViewportSize(size) {\n await this.inited;\n if (!this.isBrowserUIEnabled) {\n this.toolWindow.setViewportSize(size);\n return;\n }\n\n const { width, height } = size;\n this.updateViewportSize(width, height);\n }", "function InitGraphSize(w, h) {\n document.getElementById(w).value = GetViewportWidth();\n document.getElementById(h).value = GetViewportHeight();\n}", "function changeArraySize()\n{\n arraySize=sizeInput.value;\n generateRandomArray();\n}", "function selectSize(sizeSelector){\n\tif(!sizeSelector.checked)\n\t{\n\t\tsizeSelector.checked = true;\n\t\tsizeSelector.style.backgroundColor = \"#ff9966\";\n\t\t$(sizeSelector).find(\"span\").html(\"Venti\");\n\n\t}else{\n\t\tsizeSelector.checked = false;\n\t\tsizeSelector.style.backgroundColor = \"#66b3ff\";\n\t\t$(sizeSelector).find(\"span\").html(\"Tall\");\n\t}\n}", "function makeGrid() {\n // reset pixel canvas\n $(\"#pixelCanvas\").html(\"\");\n // Select size input\n height = $(\"#inputHeight\").val();\n width = $(\"#inputWeight\").val();\n //loop to add table cells and rows according to user input\n for (let x = 0; x < height; x++) {\n $('#pixelCanvas').append('<tr></tr>');\n }\n for (let y = 0; y < width; y++) {\n $('#pixelCanvas tr').each(function () {\n $(this).append('<td></td>');\n });\n }\n}", "function drawResizedGrid(newGridSize) {\n gridContainer.innerHTML = '';\n drawGrid(newGridSize)\n}" ]
[ "0.752996", "0.74222815", "0.7343776", "0.73155427", "0.7262196", "0.72579473", "0.71997696", "0.7170834", "0.7091701", "0.7061775", "0.69966835", "0.6958301", "0.6853224", "0.68189573", "0.67986304", "0.67369723", "0.6725082", "0.6717656", "0.66267514", "0.6626309", "0.6571253", "0.65678716", "0.6534016", "0.6529428", "0.650852", "0.6477946", "0.6475111", "0.644406", "0.64427114", "0.6436716", "0.64315194", "0.640198", "0.6399847", "0.63931346", "0.638262", "0.63553333", "0.63553333", "0.6332307", "0.63292223", "0.62828034", "0.62755245", "0.6262814", "0.62527627", "0.6250301", "0.6214718", "0.6207311", "0.61976355", "0.6194484", "0.6193915", "0.615823", "0.6120184", "0.6112682", "0.60954446", "0.60922253", "0.6083423", "0.60829824", "0.60777974", "0.60636085", "0.6049235", "0.60445255", "0.6023339", "0.60085964", "0.6005518", "0.59998834", "0.599362", "0.59888923", "0.59789973", "0.5978516", "0.5973505", "0.596358", "0.5954466", "0.59465253", "0.5932445", "0.59292215", "0.592107", "0.59184515", "0.59161043", "0.59089416", "0.58974683", "0.58807063", "0.587624", "0.58665115", "0.58570117", "0.58536774", "0.58513135", "0.58486587", "0.58467555", "0.5828992", "0.5794614", "0.57798743", "0.57791597", "0.5757865", "0.5741089", "0.57393044", "0.5733198", "0.5731505", "0.5728247", "0.5724624", "0.57188183", "0.57181376" ]
0.5782231
89
get session values (logged in or not)
componentDidMount(){ this.UpdateData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSession() {\n return $window.sessionStorage['user'];\n }", "function buscarSessionUser() {\r\n return JSON.parse(sessionStorage.getItem('login'))\r\n}", "function currentUser (){\n return JSON.parse(window.sessionStorage.getItem(\"user_info\"));\n}", "function getSession(){\n \n //.get is shorthand for an ajax call\n $.ajaxSetup({cache: false});\n \n $.get(SESSION_URL, function (data) {\n var session = data;\n \n //if username is set, set the application state to logged in\n if( session.hasOwnProperty(\"username\") ){\n setApplicationState( ApplicationState.LOGGED_IN );\n $(\"#usernameLink\").append( \" \"+session.username )\n \n //otherwise set it to logged out \n } else {\n setApplicationState( ApplicationState.LOGGED_OUT );\n }\n }, \"json\");\n}", "mySession(){\n var session_login = Session.get(\"mySession\");\n // var session_signup = Session.get('mySession_signup');\n return session_login;\n }", "function isLoggedIn() {\n return Boolean(sessionStorage['address']) && Boolean(sessionStorage['password']);\n}", "getSession() {\n const isLoggedIn = App.session.request('loggedIn');\n if (!isLoggedIn) {\n return null;\n }\n return App.session.request('session');\n }", "function isLoggedIn() {\n return getSession()\n }", "getUserData() {\n return JSON.parse(localStorage.getItem(SIMPLEID_USER_SESSION));\n }", "function isLoggedIn() {\n return Boolean(Cookies.get(\"session\")) && Boolean(Cookies.get(\"username\"));\n}", "function getIsAuthenticated() {\n return sessionStorage.getItem('isAuthenticated');\n }", "getLoggedInState(state){\n supabase.auth.session() != null ? (state.loggedIn = true):(state.loggedIn = false)\n return subabase.auth.session() != null\n // return supabase.auth.session == null\n }", "function getLoginDetails() {\n return {\n username: Cookies.get(\"username\"),\n session: Cookies.get(\"session\")\n };\n}", "function getSessionData (req) {\n let token = req.body.token || req.query.token || req.headers.authorization;\n const headerPrefix = 'Bearer ';\n if (token && token !== 'null') {\n if (token.indexOf(headerPrefix) >= 0) {\n token = token.substring(token.indexOf(headerPrefix) + headerPrefix.length)\n }\n let sessionData = null;\n const response = jwt.verify(token, process.env.JWT_STRING, (err, decoded) => {\n if (err) {\n return {loggedIn: false, message: err.message};\n };\n sessionData = decoded;\n sessionData.loggedIn = true;\n return sessionData;\n });\n return response;\n }\n return {loggedIn: false, message: 'No token sent'};\n}", "isLoggedIn() {\n return sessionStorage.getItem('user') != null\n }", "function getSessionData() {\n let sessionStringRaw = localStorage.getItem(sessionStorageKey);\n if (sessionStringRaw) {\n return JSON.parse(sessionStringRaw);\n } else {\n return null;\n }\n}", "function getLoginData() {\r\n var loggedin = sessionStorage.getItem('loggedin');\r\n console.log(loggedin);\r\n // If user is logged in, show log out button\r\n if (loggedin != null) {\r\n document.getElementById(\"logInButton\").style.display = \"none\";\r\n document.getElementById(\"logOutButton\").style.display = \"block\";\r\n document.getElementById(\"adminManage\").style.display = \"block\";\r\n }\r\n // Otherwise show log in button\r\n else {\r\n document.getElementById(\"logInButton\").style.display = \"block\";\r\n document.getElementById(\"logOutButton\").style.display = \"none\";\r\n document.getElementById(\"adminManage\").style.display = \"none\";\r\n }\r\n}", "function retrieveProfileInfo() {\n return JSON.parse(sessionStorage.getItem(\"user\"));\n}", "function getUsername() {\n\treturn sessionStorage.getItem('username');\n}", "function readUserFromSession(req, res) {\n res.send(req.session ? req.session.appUser : {});\n }", "function checksession() {\n $.get(\"/checksession\", (session) => {\n if(session) {\n user_id = session.uid;\n actionWithSession();\n } else {\n user_id = \"\";\n actionWithoutSession();\n }\n });\n }", "static getSession() {\n\n backend.get('user/get_session_user')\n .then(\n function fulfilled(data) {\n const session_user = data;\n\n if (session_user.has_sign_in !== null && session_user.has_sign_in !== undefined) {\n let newExpireTime = Session.getNewExpireTime(Session._getBackendSessionExpireInMs());\n\n document.cookie = \n 'userFirstName=' + session_user.has_sign_in.first_name + \n '; expires=' + newExpireTime + \n '; path=/';\n\n document.cookie = \n 'userId=' + session_user.has_sign_in.id + \n '; expires=' + newExpireTime + \n '; path=/';\n\n document.cookie = \n 'teacher=' + session_user.has_sign_in.teacher +\n '; expires=' + newExpireTime +\n '; path=/';\n\n document.cookie = \n 'student=' + session_user.has_sign_in.student +\n '; expires=' + newExpireTime + \n '; path=/';\n }\n },\n function rejected() {\n console.warn('Could not retrieve session');\n }\n );\n }", "getSessionStorageUser() {\n return JSON.parse(sessionStorage.getItem('user'))\n }", "isUserLoggedIn() {\n return null !== sessionStorage.getItem('username') && null !== sessionStorage.getItem('accessToken')\n }", "function get_session(){\n Logger.log(Session.getActiveUser());\n return Session.getActiveUser();\n}", "function isSignedIn({\n session\n}) {\n // if session is undefined the !! makes it return false\n return !!session;\n} // fromEntries takes an array of key values and turns into an object", "function isUserLoggedIn(){\n var isLoggedIn;\n if (session.username){\n isLoggedIn = true;\n }\n else {\n isLoggedIn = false;\n }\n return isLoggedIn;\n\n }", "function session()\n{\nif (!localStorage.adminUser)\n{\n//default to empty array\nlocalStorage.adminUser = JSON.stringify([]);\n}\nreturn JSON.parse(localStorage.adminUser);\n}", "function u_wasloggedin() {\n return localStorage.wasloggedin;\n}", "isUserLoggedIn() {\n let user = sessionStorage.getItem('user');\n let userId = sessionStorage.getItem('userId');\n let role = sessionStorage.getItem('role');\n return user !== null && userId !== null && role !== null\n }", "function getSessionValue(key) {\n\treturn sessionStorage[key];\n}", "function getSessionData(key) {\n var retval = null;\n if (Modernizr.sessionstorage) {\n retval = sessionStorage.getItem(key);\n if (retval != null && retval.length > 0) {\n retval = JSON.parse(retval);\n }\n }\n\n return retval;\n }", "function _getTokenFromSession() {\r\n return $sessionStorage.getObject('auth_token');\r\n }", "function getSession() {\n const session = JSON.parse(localStorage.getItem(localStorageSessionName));\n\n if (!session || !session.user || !session.token) return null;\n\n return session;\n}", "getSessionInfo(key) {\n return this.session[key.toLowerCase()];\n }", "function getSessionDetails() {\n\t$.get('/info',\n\t\t{'session_key': server_session_key},\n\t\tfunction(message) {\n\t\t\tconsole.log('/getSessionDetails response:' + message);\n\n\t\t\t// hack to get handleServerMessage method to work\n\t\t\tvar temp = new Object();\n\t\t\ttemp.data = message;\n\n\t\t\thandleServerMessage(temp);\n\t\t}\n\t);\n}", "function getSessionToken(){\n\tvar data = localStorage.getItem('SessionToken');\n\tconsole.log(data);\n}", "function isLoggedIn() {\r\n\tif((us_getValue(\"us_username\") == \"\") || (!us_getValue(\"us_username\")) || (us_getValue(\"us_sessionKey\") == \"\") || (!us_getValue(\"us_sessionKey\"))) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "static loadSession() {\n if (typeof window === 'undefined') return\n idCacheByUserId = parseJSON(window.sessionStorage.idCacheByUserId, {})\n itemCacheByUserId = parseJSON(window.sessionStorage.itemCacheByUserId, {})\n userCache = parseJSON(window.sessionStorage.userCache, {})\n\n }", "static isLogged() {\n return document.getCookie('userId') !== undefined && document.getCookie('userFirstName') !== undefined;\n }", "function getLoginStatus(req,res) {\n\tif (req.session.user) {\n\t\tres.json({login:true,username:req.session.user,email:req.session.email});\n\t} else {\n\t\tres.send({login:false});\n\t}\n}", "function get() {\n return sessionStorage.getItem(TOKEN_KEY);\n}", "function getSessionStorage(name){\r\n\t\tvar value = sessionstorage.get(name); \r\n\t\treturn((value!=null&&typeof(value) != undefined)?value:\"\");\r\n\t}", "function detectLogin(){\n /*obtengo los valores*/\n var email_user_=$.session.get(\"EmailUser\");\n var password_user_=$.session.get(\"PasswordUser\");\n var Object_user_=JSON.parse($.session.get(\"ObjectUser\"));\n if(typeof(email_user_)=='string' && typeof(password_user_)==\"string\")\n {\n $(\".email-user\").text(Object_user_.Name)\n\n }else{\n window.location=\"chat-login.html\";\n }\n }", "currentSessionData(state) {\n if (state.sessionList) {\n return state.sessionList.filter(item =>\n item.id === Number(state.currentSessionId))[0]\n }\n return null\n }", "function isLogged(session) {\n return (session.loggedUser != null);\n}", "initSession(cfg) {\n this.set('store', cfg.store);\n let auth_token = Cookies.get('user_session');\n\n if (auth_token) {\n return this._getAndSetCurrentUser(auth_token);\n }\n }", "function getValueFromSession(key){\n\tif (hasStorage()) {\n\t\treturn thisX.eval('__xstorage = ' + sessionStorage.getItem(window.xuser.id + '|' + key) + ';');\n\t}\n\treturn null;\n}", "loggedIn () {\n return !!Vue.$cookies.isKey(\"user_session\")\n }", "function getLogginInfo() {\n const token = jsCookie.get(TOKEN_KEY);\n if (!token)\n return undefined;\n const user = jwtDecode(token);\n return user;\n}", "session() {\n return this._session.validateSession();\n }", "function get_user_email(){ return localStorage['logged_in_as']; }", "function currentUser(req) {\n for (let user in users) {\n if (req.session.user_id === user) {\n return user;\n }\n }\n return \"\";\n}", "function getSessionData(){\n\t\t$.ajax({\n\t\t\ttype:'post',\n\t\t\turl:'../../data/getsessiondata.php',\n\t\t\tdata:{},\n\t\t\tsuccess:function(result){\n\t\t\t\tvar data = JSON.parse(result);\n\t\t\t\tif(data['active']){\n\t\t\t\t\temployeeID = data['userID'];\n\t\t\t\t\tgetKPIList(); // to retrieve KPI list on load\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twindow.location.href = \"../../index.php\";\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}", "_initSession () {\n const session = this.get('session');\n return session.fetch()\n .then(() => {\n debug('User has been automatically logged in... ');\n return {success: true, status: 'authenticated'};\n })\n .catch((ex) => {\n debug(`No cookie/localstorage entry was found, user is anonymous... ${ex}`);\n return {success: true, status: 'anonymous'};\n });\n }", "async getSession(){\n await auth.trackSession((session) => {\n if (!session){\n return;\n } else {\n this.session = session;\n }\n });\n this.getSessionId(this.session);\n }", "getSession(){\n\t\tvar self = this;\n\n\t\tUserHttpService.getSession().then(function (response) {\n\t\t\tself.setState({\n\t\t\t\tloading: false,\n\t\t\t\tuserSession: response.data.user || null\n\t\t\t})\n\t\t});\t\n\t}", "function isLoggedIn() {\n return ($localStorage.user) ? $localStorage.user : false;\n }", "loggedIn() {\n var user = localStorage.getItem('user');\n var isLogged = false;\n /*\n if (user) {\n user = JSON.parse(user);\n if (user.token !== '') {\n isLogged = true;\n }\n }*/\n if (user) {\n isLogged = true;\n }\n return isLogged;\n }", "function checkIfSession() {\n var userCookie = $cookies.getObject('timeshareCookie');\n // console.log($cookies.get('userSession', $rootScope.userSession));\n if (userCookie) {\n return isLoggedIn = true;\n } else {\n return false;\n }\n }", "function alreadyLoggedIn() {\n if(sessionStorage.getItem(\"session\")) {\n const session = JSON.parse(sessionStorage.getItem(\"session\"));\n updateLoggedIn(session.username);\n authToken = session._kmd.authtoken;\n createdRecipes()\n }\n \n}", "function loginUserData(data) {\n var flag = \"active\";\n sessionStorage.setItem(\"LoginJson\", flag);\n sessionStorage.setItem(\"FullName\", data.fname + \" \" + data.mname);//for fname\n sessionStorage.setItem(\"MiddleName\", data.mname);//for mname\n sessionStorage.setItem(\"LastName\", data.lname);//for lname\n sessionStorage.setItem(\"LoginId\", data.loginid);//for loginid\n sessionStorage.setItem(\"CurrentUserId\", data._id.$oid); //for Current User \n sessionStorage.setItem(\"OrgId\", data.orgid);\n// sessionStorage.setItem(\"Privileges\", privileges);\n sessionStorage.setItem(\"RoleNames\", data.roles);\n sessionStorage.setItem(\"UserType\", data.type);\n getOrgName();\n}", "function checkLoggedIn(){\n\t//find the token\n\tvar tk = readCookie(\"tk\");\n\tif(tk)return true;\n\telse return false;\n}", "function checkIfUserIsLogged() {\n let sessionID = getCookie(\"sessionID\");\n if (sessionID != null)\n postCheckIfUserIsLoggedHTTPRequest(sessionID);\n}", "function getSession (html) {\n let start = html.indexOf('jsessionid=') + 'jsessionid='.length\n let end = html.indexOf('?', start)\n return html.substr(start, end - start)\n}", "function getSession() {\n $scope.session = jwtService.getUser();\r\n }", "function forsideStart() {\n console.log(sessionStorage); \n let data = sessionStorage.getItem(\"logind\")\n console.log(data); \n if (sessionStorage.logind == \"yes\") {\nconsole.log(\"yesyes\")\n} else {\nlocation.href = \"index.html\"\n}\n}", "function getSessionItem(key) {\n\treturn sessionStorage.getItem(key);\n}", "getUserSession() {\n return new Promise((resolve, reject) => {\n const user = pool.getCurrentUser();\n if (user !== null) {\n user.getSession((error, session) => {\n if (error) {\n reject(error);\n } else {\n resolve(session);\n }\n });\n } else {\n resolve();\n }\n });\n }", "static getSession(connection) {\n\n\t\tconst cookies = connection.cookies;\n\t\tconst id = cookies._session;\n\t\tconst router = connection._router;\n\n\t\t// Validate session cookies and get the session container\n\t\tif (id) {\n\n\t\t\tconst hash = cookies._hash;\n\t\t\tconst options = router._options.session;\n\n\t\t\treturn options.store.get(id).then((session) => {\n\t\t\t\tif (session && session.hash === hash) {\n\t\t\t\t\treturn session;\n\t\t\t\t} else {\n\t\t\t\t\treturn SessionUtils.generateSession(router);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\treturn SessionUtils.generateSession(router);\n\t\t}\n\t}", "function getSession() {\n\t\tUser || (User = UserPool.getCurrentUser());\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\tif (User === null) {\n\t\t\t\treject('No current session found.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tUser.getSession(function(err, session) {\n\t\t\t\tif (err) {\n\t\t\t\t\treject(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (session.isValid() === false){\n\t\t\t\t\treject('Session is invalid');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar a = session.getIdToken().getJwtToken();\n\t\t\t\t\tvar b = atob(a.split(\".\")[1]);\n\t\t\t\t\tsub = JSON.parse(b).sub;\n\t\t\t\t\t//console.log(JSON.parse(b))\n\t\t\t\t\tvar a = 'cognito-idp.us-west-2.amazonaws.com/'+ USER_POOL_ID;\n\t\t\t\t\tAWS.config.region = 'us-west-2';\n\t\t\t\t\tAWS.config.credentials = new AWS.CognitoIdentityCredentials({\n\t\t\t\t\t\tregion: 'us-west-2',\n\t\t\t\t\t\tIdentityPoolId: 'us-west-2:1a49aa9f-09bc-4052-9e22-7c3cf3d78fe5',\n\t\t\t\t\t\tLogins: {\n\t\t\t\t\t\t\t[a] : session.getIdToken().getJwtToken()\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tresolve();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t})\n\t\t})\n }", "function isLoggedIn() {\n return document.cookie.match(/ twid=/)\n }", "loggedIn() {\n return (!!localStorage.uid && !!localStorage.accessToken && !!localStorage.client);\n }", "function identifyLoginState() {\n\tif (window.sessionStorage.getItem(\"loginUser\") != \"\") {\n\t\t$(\".publish-area\").removeClass(\"hidden-window\", 700);\n\t\t$(\"#shadow\").fadeIn(700);\n\t} else {\n\t\talert(\"請先登入 !\");\n\t\t$(\".login-area\").removeClass(\"hidden-window\", 700);\n\t\t$(\"#shadow\").fadeIn(700);\n\t}\n}", "loggedIn() {\n const token = this.getToken();\n return token ? true : false;\n }", "function getsessionkey(){\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"Get\", apihost+\"/user/getsessionkey\", false);\n\t// xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n\txhr.onload = function(event){\n\t\tif(xhr.status === 200){\n\t\t\t// console.log(xhr.response);\n\t\t\tsessiondata.sessionkey=xhr.response;\n\t\t\tstoresessiondata();\n\t\t\tsendsessiondata();\n\t\t} else {\n\t\t\tconsole.log(xhr.status+\" : \"+xhr.statusText);\n\t\t}\n\t};\n\txhr.send();\n}", "async retrieve_session(){\n return (await this.story.page.cookies());\n }", "loggedIn() {\n\t\tconst token = this.getToken();\n\t\treturn token ? true : false;\n\t}", "showContentIfLoggedIn() {\n // Logged in if token exists in browser cache.\n if (sessionStorage.getItem('auth_token') != null) {\n this.token = sessionStorage.getItem('auth_token');\n this.message = \"The user has been logged in.\";\n this.getSecureData();\n }\n else {\n this.message = \"Not logged in.\";\n this.token = '';\n }\n }", "isLoggedIn() {\n return localStorage.getItem('user') != null\n }", "isLoggedIn() {}", "validateUserSession() {\n // if (sessionStorage.getItem('isLoggedIn') === 'true') {\n // this.props.loggedInStatusChanged(true);\n // } else {\n // this.props.loggedInStatusChanged(false);\n // }\n }", "function sessie (req, res) {\n\tif (req.session.userName) {\n\t\tres.send({\n\t\t\tingelogd : true\n\t\t});\n\t} else {\n\t\tres.send({\n\t\t\tingelogd : false\n\t\t});\n\t}\n}", "function isLoggedIn(){\n const token = window.sessionStorage.getItem(\"jwt\");\n const claims = token ? JSON.parse(atob(token.split('.')[1])) : null;\n return (token && claims && moment().isBefore(moment.unix(claims.exp)))\n}", "function initf() {\n if ($window.sessionStorage[\"userInfo\"]) {\n $rootScope.userInfo = JSON.parse($window.sessionStorage[\"userInfo\"]);\n }\n }", "isLogged()\n {\n if(SessionService.get('token') != null){\n this.authenticated = true;\n return true;\n }else{\n this.authenticated = false;\n return false;\n }\n }", "function getLoggedInUser () {\n\n // If the user is not signed in, don't bother\n if ( ! ( __OMEGA__ && __OMEGA__.user && __OMEGA__.user.id ) ) {\n\n var userCookieValue = docCookies.getItem( \"omega-user-v2\" );\n if ( ! userCookieValue )\n return false;\n\n var userData;\n try {\n userData = JSON.parse( atob( userCookieValue ) );\n if ( ! userData.id ) {\n return false;\n }\n else {\n __OMEGA__ = __OMEGA__ || { };\n __OMEGA__.user = userData;\n return userData;\n }\n } catch ( e ) {\n return false;\n }\n\n }\n else {\n return __OMEGA__.user;\n }\n\n\n}", "getSession() {\n return this.session;\n }", "function is_logged_in() {\n return (get_cookie(\"user\") !== \"\");\n}", "function requestAccess(){\n if (!sessionStorage.getItem(\"auth_token\")){\n const tokenUrl = generateApiUrl('authentication/guest_session/new');\n axios.get(tokenUrl)\n .then((response) => {\n let auth_token = response.data.guest_session_id;\n sessionStorage.setItem(\"auth_token\", auth_token);\n })\n .catch((err)=> {\n console.error(err);\n });\n }\n}", "function getSession() {\n var sessionCookie = document.cookie.replace(/(?:(?:^|.*;\\s*)nreLabsSession\\s*\\=\\s*([^;]*).*$)|^.*$/, \"$1\");\n if (sessionCookie == \"\") {\n sessionId = makeid();\n document.cookie = \"nreLabsSession=\" + sessionId;\n return sessionId;\n }\n return sessionCookie;\n}", "function getAccessToken(){\n return sessionStorage.getItem('accessToken');\n}", "function getSession( create ) {\n return thymol.objects.thHttpSessionObject;\n }", "function isLoggedIn() {\n\treturn(req, res, next) => {\n// \t\tconsole.log(`req.session.passport.user: $(JSON.stringify(req.session.passport)}`);\n\t\tif(req.isAuthenticated()) return next();\n\t\treturn res.redirect('/login');\n\t}\n}", "isSessionActive() {\n return this.isSessionActive_;\n }", "[SESSION_INFO_PULLED] (state, {user, token}) {\n state.pullingSessionInfo = false\n state.userIsLoggedIn = !!user\n state.token = token\n state.user = user\n }", "getSessionId() {\n return this.session && this.session.id;\n }", "showLoggedIn() {\n\t\tvar profile = JSON.parse(localStorage.getItem('profile'));\n\t\tconsole.log(profile)\n\t\treturn profile;\n\t}", "function getSessionList(){\n var ids = [];\n for(var i = 0; i< sessions.length; i++){\n ids.push(sessions[i].id);\n }\n return ids;\n }", "function getSessions(){\n return $http.get('http://localhost:3000/sessions').then(function (data) {\n return data;\n });\n }", "function isLoggedIn(sessionID) {\n if (sessionID) {\n return true;\n }\n return false;\n}" ]
[ "0.7335166", "0.7320769", "0.71433794", "0.7071943", "0.69977605", "0.69943887", "0.6974383", "0.6924709", "0.68505716", "0.6808738", "0.67884123", "0.67695075", "0.6736364", "0.6650335", "0.6638568", "0.6598658", "0.65703654", "0.65366435", "0.65093505", "0.647144", "0.6461263", "0.6441853", "0.6380094", "0.637655", "0.63759726", "0.6368584", "0.63600755", "0.63396615", "0.6336359", "0.63246965", "0.63243985", "0.6323664", "0.6322234", "0.63167036", "0.6297917", "0.62808645", "0.6279308", "0.627704", "0.62681013", "0.6223753", "0.6219787", "0.6196602", "0.6176054", "0.61693877", "0.6154898", "0.61516106", "0.61362535", "0.61297846", "0.61151576", "0.61052066", "0.60910034", "0.6057149", "0.6038967", "0.60344625", "0.6034282", "0.60130376", "0.6011327", "0.6003399", "0.6003117", "0.59948105", "0.59844047", "0.5983673", "0.5968077", "0.59613436", "0.59539557", "0.5950349", "0.5948803", "0.5946386", "0.5946106", "0.59416276", "0.5935556", "0.59337765", "0.59109646", "0.5910074", "0.5904114", "0.59031737", "0.5897689", "0.589429", "0.5892707", "0.5874814", "0.58730906", "0.58702767", "0.58677536", "0.5862945", "0.5860353", "0.58476496", "0.5847459", "0.584643", "0.5843606", "0.58407074", "0.58313435", "0.58281064", "0.5817062", "0.58099425", "0.5808241", "0.5807172", "0.5804966", "0.5788915", "0.57845366", "0.57822305", "0.5780102" ]
0.0
-1
This function updates session data gets called from RequireLogin.js
UpdateData(){ this.setState({ UserLoggedIn: localStorage.getItem('UserLoggedIn') }) this.setState({ UserName: localStorage.getItem('UserName') }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loginUserData(data) {\n var flag = \"active\";\n sessionStorage.setItem(\"LoginJson\", flag);\n sessionStorage.setItem(\"FullName\", data.fname + \" \" + data.mname);//for fname\n sessionStorage.setItem(\"MiddleName\", data.mname);//for mname\n sessionStorage.setItem(\"LastName\", data.lname);//for lname\n sessionStorage.setItem(\"LoginId\", data.loginid);//for loginid\n sessionStorage.setItem(\"CurrentUserId\", data._id.$oid); //for Current User \n sessionStorage.setItem(\"OrgId\", data.orgid);\n// sessionStorage.setItem(\"Privileges\", privileges);\n sessionStorage.setItem(\"RoleNames\", data.roles);\n sessionStorage.setItem(\"UserType\", data.type);\n getOrgName();\n}", "function updateSession (req, res, next) { //user next() for next middleware\n\n console.log('\\n\\n');\n console.log(\"in updateSesion()\");\n console.log('\\n\\n');\n\n if (req.session && req.session.user) {\n User.findOne({ email : req.session.user.email }, function (err, user) {\n if (user) {\n req.user = user;\n delete req.user.password;\n req.session.user = req.user;\n res.locals.user = req.user;\n console.log('session updated');\n }\n console.log('user is false');\n // res.redirect('/dashboard');\n next();\n });\n } else {\n console.log('req.session or req.session.user is false');\n next();\n }\n}", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function updateSession(){\n\tif(getCookie('userid')!='' && getCookie('sid')!='') {\n\t\tvar ss = new Image();\n\t\tss.src=\"http://i.kuwo.cn/US/st/UpdateAccessTime?t=\"+Math.random();\n\t} else {\n\t\tdelCookie('userid');\n\t\tdelCookie('username');\n\t\tdelCookie('uph');\n\t\tdelCookie('sid');\n\t\tdelCookie('mlogdomain');\n\t}\n}", "function updateLoginData(data) {\n console.log(\"updateLoginData : \" + JSON.stringify(data));\n if(data.s !== undefined) {\n _loginData.state = data.s;\n console.log(\"LoginStore: _loginData.state becomes : \" + (data.s));\n }\n if(data.redirectLocation !== undefined) {\n _loginData.redirectLocation = data.redirectLocation;\n console.log(\"LoginStore: _loginData.redirectLocation becomes : \" + (data.redirectLocation));\n }\n // TODO: complete this for all possible values\n}", "async refreshSession() {\n try {\n let user = null;\n if (process.env.STATIC_SITE) {\n // in static export mode we don't have an SSR server\n // so we get the current user info by ourself\n user = await getCurrentUser(\n process.env.API_SERVER,\n await this.getAccessToken()\n );\n } else if (this.isSsr) {\n // in the SSR phase the user info has been fetched already\n user = ((this.req || {}).session || {}).user || null;\n } else {\n // otherwise the SSR server will report the current user info\n // after refreshing the session\n const response = await this.fetch({\n method: \"POST\",\n resource: process.env.APP_SERVER + \"/session\",\n data: {\n accessToken: await this.getAccessToken(),\n refreshToken: await this.getRefreshToken()\n }\n });\n if (response.ok) {\n const data = await response.json();\n if (data.success) user = data.user;\n }\n }\n\n await this.dispatch(appOperations.setUser({ user }));\n } catch (error) {\n console.error(error.message);\n }\n }", "saveSession(userInfo) {\r\n localStorage.setItem('Admin', userInfo.Admin)\r\n let userAuth = userInfo._kmd.authtoken\r\n localStorage.setItem('authToken', userAuth)\r\n let userId = userInfo._id\r\n localStorage.setItem('userId', userId)\r\n let username = userInfo.username\r\n localStorage.setItem('username', username)\r\n\r\n observer.onSessionUpdate()\r\n }", "refreshSession(state, payload)\n {\n state.session = {...state.session,...payload};\n }", "function logIn(req, data) {\n req.session.user = {\n _id: data._id,\n username: data.username\n };\n}", "function loginStart(customerid, first_name, last_name, email, password) {\n var Session = new Object();\n localStorage[config.data[0].storage_key+'_Session'] = null;\n Session[\"customer_id\"] = customerid;\n Session[\"first_name\"] = first_name;\n Session[\"last_name\"] = last_name;\n Session[\"email\"] = email;\n Session[\"password\"] = password;\n Session[\"login_status\"] = \"Active\";\n var current_date = new Date();\n var login_date = current_date.getDate() + \"/\" + (current_date.getMonth() + 1) + \"/\" + current_date.getFullYear();\n var login_time = current_date.getHours() + \":\" + current_date.getMinutes() + \":\" + current_date.getSeconds();\n Session[\"login_date\"] = login_date;\n Session[\"login_time\"] = login_time;\n var JSession = JSON.stringify(Session);\n localStorage[config.data[0].storage_key+'_Session'] = JSession;\n}", "changeLoginState (response) {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(meInfo) {\n\n console.log('Successful login for: ' + meInfo.name);\n let assembledMe = Object.assign({}, meInfo, response);\n this.props.dispatchLoginUser(assembledMe);\n // REQUEST ENDPOINT FOR SAVING USERS\n // 'http://localhost:8000/saveUser'\n // ALSO SET SESSION FROM HERE IN FUTURE\n this.requestForStorage(response);\n\n }.bind(this));\n }", "function updateLocalStorage() {\n localStorage.setItem(\"sessions\", JSON.stringify(sessions));\n}", "function setSessionData(key, data) {\n if (Modernizr.sessionstorage) {\n sessionStorage.setItem(key, JSON.stringify(data));\n }\n }", "updateSession(siteId,payload,callback) {\n \n let sessionId = payload && payload.id && payload.id.length > 0 ? payload.id : null;\n let session = this.getSession(siteId,sessionId);\n if (session) {\n let result = callback(session)\n this.saveSession(session.siteId,session.id,result); \n } \n }", "function updateSession(req, increment) {\n \n //Session Visits\n if (req.session.sessionVisits == undefined) {\n req.session.sessionVisits = 0;\n }\n \n //Session Gifts\n if (req.session.sessionGiftsAdded == undefined) {\n req.session.sessionGiftsAdded = 0;\n }\n \n if (increment) {\n req.session.sessionVisits++;\n }\n}", "function updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n }", "setSession(value){\n localStorage.setItem(this.SESSION, value);\n }", "nextSession() {\n // determine the next session\n const ind = allSessions.findIndex(n => n === this.state.session);\n const session = allSessions[(ind + 1) % allSessions.length];\n\n // put empty object in this session's localStorage if nothing exists there already\n const storageKeys = Object.keys(localStorage);\n if (!storageKeys.includes(session)) {\n localStorage.setItem(session, '{}');\n }\n\n // change the session\n this.setState({session: session});\n }", "function getSession(){\n \n //.get is shorthand for an ajax call\n $.ajaxSetup({cache: false});\n \n $.get(SESSION_URL, function (data) {\n var session = data;\n \n //if username is set, set the application state to logged in\n if( session.hasOwnProperty(\"username\") ){\n setApplicationState( ApplicationState.LOGGED_IN );\n $(\"#usernameLink\").append( \" \"+session.username )\n \n //otherwise set it to logged out \n } else {\n setApplicationState( ApplicationState.LOGGED_OUT );\n }\n }, \"json\");\n}", "function updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || utils.timestampInSeconds();\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : utils.uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}", "validateUserSession() {\n // if (sessionStorage.getItem('isLoggedIn') === 'true') {\n // this.props.loggedInStatusChanged(true);\n // } else {\n // this.props.loggedInStatusChanged(false);\n // }\n }", "function updateUserSession(sessionId, onloadHandler, errorHandler){\n\tvar url = urlroot+'UpdateSession/';\n\t\tvar data;\n\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\tonload: onloadHandler,\n\t\t\tonerror: errorHandler\n\t\t});\n\t\txhr.open('GET', url, true);\n\n\t\tvar data = {id : sessionId};\n\t\txhr.send(data);\n}", "[SESSION_INFO_PULLED] (state, {user, token}) {\n state.pullingSessionInfo = false\n state.userIsLoggedIn = !!user\n state.token = token\n state.user = user\n }", "function updateSessionStorage()\n{\n //save stickman to session as \"stk_man\"\n stk_man = new Stickman();\n sessionStorage.setItem(\"stk_man\", JSON.stringify(stk_man));\n\n //save History to session as \"hist\"\n sessionStorage.setItem(\"hist\", JSON.stringify(hist.toJSON()));\n\n}", "function updateSession(session, context = {}) {\n\t if (context.user) {\n\t if (!session.ipAddress && context.user.ip_address) {\n\t session.ipAddress = context.user.ip_address;\n\t }\n\n\t if (!session.did && !context.did) {\n\t session.did = context.user.id || context.user.email || context.user.username;\n\t }\n\t }\n\n\t session.timestamp = context.timestamp || timestampInSeconds();\n\n\t if (context.ignoreDuration) {\n\t session.ignoreDuration = context.ignoreDuration;\n\t }\n\t if (context.sid) {\n\t // Good enough uuid validation. — Kamil\n\t session.sid = context.sid.length === 32 ? context.sid : uuid4();\n\t }\n\t if (context.init !== undefined) {\n\t session.init = context.init;\n\t }\n\t if (!session.did && context.did) {\n\t session.did = `${context.did}`;\n\t }\n\t if (typeof context.started === 'number') {\n\t session.started = context.started;\n\t }\n\t if (session.ignoreDuration) {\n\t session.duration = undefined;\n\t } else if (typeof context.duration === 'number') {\n\t session.duration = context.duration;\n\t } else {\n\t const duration = session.timestamp - session.started;\n\t session.duration = duration >= 0 ? duration : 0;\n\t }\n\t if (context.release) {\n\t session.release = context.release;\n\t }\n\t if (context.environment) {\n\t session.environment = context.environment;\n\t }\n\t if (!session.ipAddress && context.ipAddress) {\n\t session.ipAddress = context.ipAddress;\n\t }\n\t if (!session.userAgent && context.userAgent) {\n\t session.userAgent = context.userAgent;\n\t }\n\t if (typeof context.errors === 'number') {\n\t session.errors = context.errors;\n\t }\n\t if (context.status) {\n\t session.status = context.status;\n\t }\n\t}", "function UserLogin(res){\n sessionStorage.setItem('id', res.id);\n sessionStorage.setItem('user_type', res.attributes.user_type);\n sessionStorage.setItem('school', res.attributes.school);\n sessionStorage.setItem('username', res.attributes.name);\n sessionStorage.setItem('token', res.getSessionToken());\n window.location = '/';\n}", "function setSession(token, username){\n sessionToken = token;\n session = {\n sessionToken: token,\n username: username\n };\n localStorage.setItem(localStorageSessionName, JSON.stringify(session));\n }", "function initializeSession() {}", "async session(session, user) {\n //setting id on session\n session.id = user.sub;\n\n return session;\n }", "async setSessionStatus (sessions) {\n\t\tthis.sessionsToUpdate = sessions;\n\t\tthis.currentSessions = this.user.get('sessions') || {};\n\t\tthis.op = {};\n\t\tawait this.updateSessions();\t\t// update the sessions data by adding the presence data for this request\n\t\tawait this.removeStaleSessions();\t// remove any stale sessions we find, sessions older than the away timeout\n\t\tawait this.saveSessions();\t\t\t// save the sessions data to the server\n\t}", "async saveSessions () {\n\t\tawait this.request.data.users.updateDirect(\n\t\t\t{ id: this.request.data.users.objectIdSafe(this.user.id) },\n\t\t\tthis.op\n\t\t);\n\t}", "function _update_user_from_login(data) {\n user.app = data.app;\n user.uuid = data.uuid;\n user.icon = data.user_icon;\n user.name = data.user_name;\n user.email = data.user_email;\n user.fullname = data.user_fullname;\n user.signature = data.user_signature;\n user.updatetime = data.updatetime;\n user.is_online = true;\n user.status = data.service_user_status || yvConstants.USER_STATUS.READY;\n \n if (yvSys.in_mobile_app()) {\n user.device_uuid = data.mobile_device_uuid;\n } else {\n user.device_uuid = data.browser_device_uuid;\n }\n \n user.show_badge = !!data.user_show_badge;\n user.is_distributor_user = !!data.is_distributor_user;\n user.mute_notification = !!data.user_mute_notification;\n user.silence_notification = !!data.user_silence_notification;\n user.mute_other_mobile_device = !!data.user_mute_other_mobile_device;\n \n return user;\n }", "function createSessionSuccess(){\n reloadAll();\n}", "setUpdateSessionAndUser(updateSessionAndUser) {\n _updateSessionAndUser = updateSessionAndUser;\n }", "function updateLoginUI() {\n console.log(window.sessionStorage.getItem(\"username\"));\n\n if (window.sessionStorage.getItem(\"username\") == null) {\n $(\"#loginSection\").show();\n $(\"#loggedInSection\").hide();\n } else {\n $(\"#loginSection\").hide();\n $(\"#loggedInSection\").show();\n }\n}", "login(data) {\n // Store the data in local storage for persistent login\n const dataAltered = JSON.stringify(data);\n localStorage.setItem(\"userData\", dataAltered);\n\n // Set authentication data in state for current session\n this.setState({\n userAuthenticated: true,\n userData: data,\n });\n }", "setSession (data, setSessionFromStorage = false, isEntityChange = false) {\n if (setSessionFromStorage) {\n AppStorage.setAuthToken(data['ENCONTA_AUTH_TOKEN'])\n this.setUser(data.user)\n this.setTaxableEntities(data.taxableEntities)\n this.setCurrentEntity(data.currentEntity)\n } else {\n if (!isEntityChange) AppStorage.setAuthToken(data.auth_token)\n this.setUser(data.user)\n this.setTaxableEntities(data.user.taxable_entities)\n this.setCurrentEntity(data.user.current_taxable_entity)\n }\n }", "_addSessionToStorage() {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(this._session));\n }", "mySession(){\n var session_login = Session.get(\"mySession\");\n // var session_signup = Session.get('mySession_signup');\n return session_login;\n }", "function saveSession(session) {\n $window.sessionStorage['user'] = JSON.stringify(session);\n }", "static loadSession() {\n if (typeof window === 'undefined') return\n idCacheByUserId = parseJSON(window.sessionStorage.idCacheByUserId, {})\n itemCacheByUserId = parseJSON(window.sessionStorage.itemCacheByUserId, {})\n userCache = parseJSON(window.sessionStorage.userCache, {})\n\n }", "async function setSession(request,reply){\n request.session.set('user',{username:'alireza',password:'58300'})\n return \"User Session Is Set\"\n}", "storeSession(pathname, nextSessionData) {\n // We use pathname instead of key because the key is unique in the history.\n var sessionData = JSON.parse(sessionStorage.getItem(pathname));\n // Update the session data with the changes.\n sessionStorage.setItem(pathname, JSON.stringify(Object.assign({}, sessionData, nextSessionData)));\n }", "function setSessionCookie(session, update){\n if (update || $.cookie(bbs_type.cookie.session) == null) {\n $.cookie(bbs_type.cookie.session, session, {expires: 14});\n }\n}", "getSession(){\n\t\tvar self = this;\n\n\t\tUserHttpService.getSession().then(function (response) {\n\t\t\tself.setState({\n\t\t\t\tloading: false,\n\t\t\t\tuserSession: response.data.user || null\n\t\t\t})\n\t\t});\t\n\t}", "function setSession(data) {\n if (!data || !data.sid || typeof data.sid !== 'string') { return; }\n var sid = data.sid;\n\n getSession(sid, function(err, session) {\n if (session) {\n // unassign socket from previous sessions\n _.each(socketIndex, function(val) {\n delete val[client.id];\n });\n\n indexSocket(sid, client, session);\n }\n });\n }", "function SessionStartup() {\n}", "static saveSession() {\n if (typeof window === 'undefined') return\n window.sessionStorage.idCacheByUserId = JSON.stringify(idCacheByUserId)\n window.sessionStorage.itemCacheByUserId = JSON.stringify(itemCacheByUserId)\n window.sessionStorage.userCache = JSON.stringify(userCache)\n }", "initSession(cfg) {\n this.set('store', cfg.store);\n let auth_token = Cookies.get('user_session');\n\n if (auth_token) {\n return this._getAndSetCurrentUser(auth_token);\n }\n }", "function alreadyLoggedIn() {\n if(sessionStorage.getItem(\"session\")) {\n const session = JSON.parse(sessionStorage.getItem(\"session\"));\n updateLoggedIn(session.username);\n authToken = session._kmd.authtoken;\n createdRecipes()\n }\n \n}", "[PULL_SESSION_INFO_REQUEST] () {\n state.pullingSessionInfo = true\n state.userIsLoggedIn = false\n state.token = null\n state.user = null\n }", "update (endCallback) {\n\t\tconst now = Date.now ();\n\t\tconst keys = Object.keys (this.sessionMap);\n\t\tfor (const key of keys) {\n\t\t\tconst session = this.sessionMap[key];\n\t\t\tif ((session.sustainCount <= 0) && ((now - session.updateTime) >= App.AuthorizeSessionDuration)) {\n\t\t\t\tdelete (this.sessionMap[key]);\n\t\t\t}\n\t\t}\n\t\tprocess.nextTick (endCallback);\n\t}", "sessionAuthenticated() {\n const nextURL = this.session.data.nextURL;\n this.session.set(\"data.nextURL\", undefined);\n const idToken = this.session.data.authenticated.id_token;\n this.session.set(\"data.id_token_prev\", idToken);\n\n if (nextURL) {\n this.replaceWith(nextURL);\n } else {\n this._super();\n }\n }", "function doSuccess(sess, log='') {\n console.log(log)\n const newAuthObj = { ...getValuesFromSession(sess), username } // just checks correctness and extracts values from session variable\n //setSession(sess)\n //setCognitoUser(sess)\n setAuthStatus(newAuthObj) // this also stores to localStorage\n setUsername(username) // good to have for creating userpools\n console.log('setUserId:', sess.idToken.payload.sub)\n setUserId(sess.idToken.payload.sub) // also present within \"auth\"\n return newAuthObj\n }", "function updateUIOnUserLogin() {\n console.debug(\"updateUIOnUserLogin\");\n\n putStoriesOnPage(); \n\n // $allStoriesList.show();\n\n updateNavOnLogin();\n}", "_cacheSession() {\n if (this._conn.authenticated) {\n if (this._conn.jid && this.rid && this.sid) {\n sessionStorage.setItem(\n 'strophe-bosh-session',\n JSON.stringify({\n 'jid': this._conn.jid,\n 'rid': this.rid,\n 'sid': this.sid,\n })\n );\n }\n } else {\n sessionStorage.removeItem('strophe-bosh-session');\n }\n }", "function initSession() {\r\n ngio.getValidSession(function() {\r\n if (ngio.user) {\r\n /* \r\n * If we have a saved session, and it has not expired, \r\n * we will also have a user object we can access.\r\n * We can go ahead and run our onLoggedIn handler here.\r\n */\r\n onLoggedIn();\r\n } else {\r\n /*\r\n * If we didn't have a saved session, or it has expired\r\n * we should have been given a new one at this point.\r\n * This is where you would draw a 'sign in' button and\r\n * have it execute the following requestLogin function.\r\n */\r\n menuController.onLoggedOut();\r\n }\r\n\r\n });\r\n}", "function reloadSessions() {\n let user = JSON.parse(sessionStorage.getItem(\"user\"));\n getUpcomingSessions(user);\n getCurrentSession(user);\n}", "function login(sessionObject, rememberMe){\r\n\tif(oLocalStorage.get(\"Saved_PI_Servers\") == null){\r\n\t\toLocalStorage.put(\"Saved_PI_Servers\", {servers : []});\r\n\t}\r\n\t//if()\r\n\tif(!oLocalStorage.get(\"Saved_PI_Servers\").servers.contains({protocol : sessionObject.protocol , host : sessionObject.host, port : sessionObject.port})){\r\n\tvar a = oLocalStorage.get(\"Saved_PI_Servers\").servers;\r\n\tconsole.log(a.indexOf({protocol : sessionObject.protocol , host : sessionObject.host, port : sessionObject.port}));\r\n\ta.push({protocol : sessionObject.protocol , host : sessionObject.host, port : sessionObject.port});\r\n\toLocalStorage.put(\"Saved_PI_Servers\", {servers : a});\r\n\t}\r\n\tsessionObject.isLoggedin = true;\r\n\toStorage.put('sessionObject', sessionObject);\r\n\tif(rememberMe)\r\n\tsetCookie('sessionObject', JSON.stringify(sessionObject), 365);\r\n\r\n\t\r\n\t\r\n\tlocation.reload();\r\n}", "setSession (authResult) {\n if (authResult && authResult.accessToken && authResult.idToken) {\n // Set the time that the access token will expire at\n let expiresAt = JSON.stringify(\n authResult.expiresIn * 1000 + new Date().getTime()\n )\n localStorage.setItem('access_token', authResult.accessToken)\n localStorage.setItem('id_token', authResult.idToken)\n localStorage.setItem('expires_at', expiresAt)\n this.authNotifier.emit('authChange', { authenticated: true, admin: this.isAdmin() })\n // navigate to the home route\n // router.push('/home')\n }\n }", "_updateSessionActivity(_lastActivity = new Date().getTime()) {\n if (this.session) {\n this.session.lastActivity = _lastActivity;\n this._maybeSaveSession();\n }\n }", "function sessionWare(req, res, next) {\n // Check authorization token, infuse user info if logged in\n if (req.headers.authorization) {\n var token = req.headers.authorization.replace(\"Bearer \", \"\");\n var s = getSession(token);\n if (s == null) res.header(\"LoggedIn\", false);\n else {\n res.header(\"LoggedIn\", true);\n req.dailyUserName = s.userName;\n req.dailyUserId = s.userId;\n req.dailyToken = token;\n }\n }\n // Infuse current version\n res.header(\"DailyAppVer\", pjson.version);\n // Move on\n next();\n }", "function rememberLogIn() {\n // when dicumetn is ready run this function\n $(document).ready(function() {\n // get authToken from session Storage\n if (sessionStorage.getItem(\"authToken\")) {\n // create ajax POST call\n $.ajax({\n type: \"POST\",\n url: \"/api/auth/refresh\",\n dataType: \"json\",\n contentType: \"application/json\",\n headers: {\n Authorization: `Bearer ${sessionStorage.getItem(\"authToken\")}`\n },\n success: function(res) {\n // log response\n console.log(res);\n // store response authToken in jwt variable\n jwt = res.authToken;\n // set authToken and jwt variable from session Storage\n sessionStorage.setItem(\"authToken\", jwt);\n // create function that gets the username from session Storage\n getUserDashboard(sessionStorage.getItem(\"username\"));\n }\n });\n }\n });\n}", "function setSession(req, res) {\n var name = req.params['name'];\n var value = req.params['value'];\n req.session[name] = value;\n res.send(req.session);\n}", "function startSession(){\n cc('startSession','run');\n setupStorage();\n // setSessionID();\n // setSessionTime();\n setDefaultData();\n}", "async function handleSession() {\n const sessionData = localStorage.getItem(\"mdb_session\");\n\n if (!sessionData) {\n const newSessionData = await getGuestSession();\n\n if (newSessionData) {\n const sessionDataString = JSON.stringify(newSessionData);\n\n localStorage.setItem(\"mdb_session\", sessionDataString);\n showToastBanner();\n return true;\n }\n\n return false;\n } else {\n const parsedSessionData = JSON.parse(sessionData);\n\n if (isSessionExpired(parsedSessionData.expires_at)) {\n localStorage.removeItem(\"mdb_session\");\n await handleSession();\n return true;\n }\n }\n}", "function initf() {\n if ($window.sessionStorage[\"userInfo\"]) {\n $rootScope.userInfo = JSON.parse($window.sessionStorage[\"userInfo\"]);\n }\n }", "function session_update() {\n\t// Loop through all device ID's\n\tfor (var i = 0; i < LUMINAIRE_IDS.length; i++) {\n\tvar device_id = LUMINAIRE_IDS[i];\n\tif(session_id == 73){\n\t// Call Particle to end session\n var fnPr = particle.callFunction({ \n deviceId: device_id,\n name: 'session_str',\n argument: '1', \n auth: token\n });\n }\n else if(session_id == 79){\n\t // Reset all variables\n\t SELECTED_LUMINAIRES = [];\n\t light_id = '0';\n\t luminaire_device_id = '0';\n\t // Call Particle to end session\n\t var fnPr = particle.callFunction({ \n deviceId: device_id,\n name: 'session_end',\n argument: '1',\n auth: token\n });\n } \t\t\n fnPr.then(\n function(data) {\n //console.log('Function called succesfully:', data);\n console.log('Function called succesfully');\n }, function(err) {\n console.log('An error occurred:', err);\n });\n}\n}", "function storesessiondata(){\n\tvar storagedata=JSON.stringify(sessiondata);\n\twindow.localStorage.setItem(cookiename, storagedata);\n}", "function verify_session() {\n console.log(\"Session Checking Starts..\");\n if (localStorage[config.data[0].storage_key+'_Session'] == null) {\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/login.html\";\n window.location = fullPath;\n } else {\n var Session = JSON.parse(localStorage[config.data[0].storage_key+'_Session']);\n if (Session != null) {\n var login_status = Session[\"login_status\"];\n if (login_status != \"Active\") {\n localStorage[config.data[0].storage_key+'_Session'] = null;\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/login.html\";\n window.location = fullPath;\n }\n } else {\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/login.html\";\n window.location = fullPath;\n }\n }\n console.log(\"Session Checking Done..\");\n}", "function storeLoginDetails({ username, session }) {\n Cookies.set(\"username\", username);\n Cookies.set(\"session\", session);\n}", "async session(session, token) {\n session.user = token.user;\n return session;\n }", "setToSession(key, value) {\n // Save data to sessionStorage\n sessionStorage.setItem(key, value);\n // this.set(key, value);\n }", "async function handleSession() {\n\t// ottiene il dato da localStorage\n\tconst sessionData = localStorage.getItem('mdb_session');\n\n\t// se sessionData è undefined\n\tif (!sessionData) {\n\t\t// crea una nuova sessione\n\t\tconst newSessionData = await getGuestSession();\n\n\t\tconsole.log(newSessionData, 'newSessionData');\n\n\t\t// se la chiamata getGuestSession ritorna un valore\n\t\tif (newSessionData) {\n\t\t\t// trasforma in stringa l'oggetto (localStorage può avere solo stringhe)\n\t\t\tconst sessionDataString = JSON.stringify(newSessionData);\n\n\t\t\t// aggiunge il valore nel localStorage\n\t\t\tlocalStorage.setItem('mdb_session', sessionDataString);\n\n\t\t\t// mostra il toastBaner per dare un feedback alll'utente\n\t\t\tshowToast('Hey! Adesso sei registrato come guest');\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t} else {\n\t\t// se sessionData ha un valore\n\n\t\t// trasforma la stringa ottenuta da localSotarge in oggetto o variabile primitiva\n\t\tconst parsedSessionData = JSON.parse(sessionData);\n\n\t\t/**\n\t\t * controlliamo che la sessione non sia scacduta\n\t\t *\n\t\t * la data di scadenza della sessione è contenuta\n\t\t * nell'oggetta della sessione sotto il nome \"expires_at\"\n\t\t *\n\t\t * utilizziamo Date per verificare se la data di scadenza è inferiore\n\t\t * alla data attuale nel momento in cui sta eseguendo questo codice.\n\t\t *\n\t\t * trasformiamo le due date con getTime() in un numero che corrisponde\n\t\t * ai millisecondi compresi tra la data usata e il 1 gennaio 1970\n\t\t * (è uno standard per avere una costante di riferimento)\n\t\t *\n\t\t */\n\t\tconst expiresDate = new Date(parsedSessionData.expires_at).getTime();\n\t\tconst nowDate = new Date().getTime();\n\n\t\t// se expiresDate in millisecondi è inferiore\n\t\t// a nowDate in millisecondi allora la sessione è scaduta\n\t\tif (expiresDate < nowDate) {\n\t\t\t// rimuoviamo i dati della sessione del localStorage\n\t\t\tlocalStorage.removeItem('mdb_session');\n\n\t\t\t// chiamiamo la funzione stessa per gestire la\n\t\t\t// creazione di una nuova sessione e l'inserimento nel localStorage\n\t\t\tawait handleSession();\n\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}\n}", "sset(key, data) {\n const encryptedData = Encrypt.encrypt(data)\n sessionStorage.setItem(key, encryptedData)\n }", "loginSuccess(response) {\r\n console.log('connected')\r\n sessionStorage.setItem('userDetails', JSON.stringify({ username: response.profileObj.name, imageUrl: response.profileObj.imageUrl}));\r\n this.setState({\r\n loggedIN: true\r\n })\r\n }", "setSessionAttrs(attrs) {\n return this.setAttrs(Attributetype_1.AttributeType.SESSION, attrs);\n }", "function checksession() {\n $.get(\"/checksession\", (session) => {\n if(session) {\n user_id = session.uid;\n actionWithSession();\n } else {\n user_id = \"\";\n actionWithoutSession();\n }\n });\n }", "function storeSessionData(session, team, description, shortDescription) {\r\n session.privateConversationData.team = team;\r\n session.privateConversationData.description = description;\r\n session.privateConversationData.shortDescription = shortDescription;\r\n}", "_successfulLogin (data, status, xhr) {\n console.log('_successfulLogin', this)\n this.set('loggedIn', true)\n console.log(data)\n }", "function login(user){\n if(user == \"login\")\n {\n var username = document.getElementById(\"loginEmail\").value;\n var password = document.getElementById(\"loginPassword\").innerHTML;\n sessionStorage.setItem(\"loginUser\", username);\n $(\"#login-signup\").removeClass(\"showBlock\").addClass(\"showNone\");\n document.getElementById(\"loggedIn\").innerHTML = \"Hi \"+ sessionStorage.getItem(\"loginUser\");\n $(\"#loggedIn\").removeClass(\"showNone\").addClass(\"showBlock\");\n document.getElementById(\"loginEmail\").value =\"\";\n document.getElementById(\"loginPassword\").value = \"\";\n }\n else\n {\n $(\"#login-signup\").removeClass(\"showBlock\").addClass(\"showNone\");\n document.getElementById(\"loggedIn\").innerHTML = \"Hi Guest\";\n $(\"#loggedIn\").removeClass(\"showNone\").addClass(\"showBlock\");\n sessionStorage.setItem(\"loginUser\", \"Guest\");\n }\n\n}", "function saveSessioncb(){\r\n\t\tjQuery.ajax({\r\n\t\t\turl: '/application/setSessionDataAjax',\r\n\t\t\tdata: jQuery('#basicWizard').find(\":input:not(:hidden)\").serialize(),\r\n\t\t\tmethod:'post',\r\n\t\t\theaders:{\r\n\t\t\t\t'x-keyStone-nonce': nonce\r\n\t\t\t},\r\n\t\t\tcomplete: function(xhr, str){\r\n\t\t\t\tprocessLead(getHiddenFields());\r\n\t\t\t}\r\n\t\t});\t\t\r\n\t}", "function login() {\n self.isLoggedIn = true;\n }", "function getSessionData(){\n\t\t$.ajax({\n\t\t\ttype:'post',\n\t\t\turl:'../../data/getsessiondata.php',\n\t\t\tdata:{},\n\t\t\tsuccess:function(result){\n\t\t\t\tvar data = JSON.parse(result);\n\t\t\t\tif(data['active']){\n\t\t\t\t\temployeeID = data['userID'];\n\t\t\t\t\tgetKPIList(); // to retrieve KPI list on load\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twindow.location.href = \"../../index.php\";\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}", "function push_in_session(arr) {\n\n\n if (in_the_session.todo_items[0] == \"No Items Present\") {\n in_the_session.todo_items.splice(0, 1);\n var move = JSON.stringify(in_the_session);\n sessionStorage.setItem('current_user', move)\n window.location.reload();\n } else {\n\n console.log(in_the_session);\n var move = JSON.stringify(in_the_session);\n sessionStorage.setItem('current_user', move);\n\n\n\n }\n\n\n}", "successfulLogin(user, authHead) { //\n this.setupAxiosInterceptors(authHead)\n sessionStorage.setItem('authenticatedUserEmail', user.email);\n sessionStorage.setItem('authenticatedUserName', user.name);\n sessionStorage.setItem('authenticatedUserContact', user.contact);\n sessionStorage.setItem('authenticatedUserRole', user.role);\n }", "updateSession({commit,state}, context ) {\n // console.log(this.state.session)\n Axios.post(`${SERVER_URL}/api/sessions/read/active`).then( resp => {\n if (resp.data.length == 0) // Reset current session if \n {\n commit('refreshSession', Session );\n return;\n }\n // Set default state if there are no states\n let session = resp.data[0];\n commit('refreshSession', session);\n let payload = {sessionID: state.session.id} // Data to create a session \n Axios.post( `${SERVER_URL}/api/players/read/currentsession`, payload) // Make request the get players of the current session\n .then(playersResp => { \n commit('refreshSession', {players:playersResp.data}); // Refresh session with players\n }) \n })\n }", "function WriteSessionData(client) {\n\tvar name = 'session' + level.clients.indexOf(client);\n\tvar val = JSON.stringify(client.sess);\n\n\tvar cvar = Cvar.AddCvar(name);\n\tcvar.set(val);\n}", "update(proxy, { data: { login: userData } }) {\r\n context.login(userData);\r\n props.history.push('/');\r\n }", "function storeSession (data) {\n const now = new Date()\n const expirationDate = new Date(now.getTime() + data.expiresIn * 1000)\n localStorage.setItem('expirationDate', expirationDate)\n localStorage.setItem('expiresIn', data.expiresIn * 1000)\n localStorage.setItem('token', data.idToken)\n localStorage.setItem('userId', data.localId)\n localStorage.setItem('refreshToken', data.refreshToken)\n}", "function updateSession(){\n\n $(\"#countersession\").html(SESSIONCOUNTER);\n BASICTIMER = ONEMINUTE * SESSIONCOUNTER;\n\n if(MODE == 'session'){\n REFERENCE = BASICTIMER;\n updatePomodoroView(BASICTIMER);\n }\n}", "static reloadBrowserSession() {\n browser.reloadSession();\n }", "async updateSessions () {\n\t\tconst now = Date.now();\n\t\tconst currentLastActivityAt = this.user.get('lastActivityAt') || 0;\n\t\tlet lastActivityAt = 0;\n\t\tconst awayTimeout = this.sessionAwayTimeout || this.request.api.config.apiServer.sessionAwayTimeout;\n\t\tconst activityAt = now - awayTimeout;\n\n\t\tObject.keys(this.sessionsToUpdate).forEach(sessionId => {\n\t\t\tthis.op.$set = this.op.$set || {};\n\t\t\tthis.op.$set[`sessions.${sessionId}`] = Object.assign(\n\t\t\t\tthis.currentSessions[sessionId] || {},\n\t\t\t\tthis.sessionsToUpdate[sessionId],\n\t\t\t\t{ updatedAt: now }\n\t\t\t);\n\n\t\t\t// update user's lastActivityAt\n\t\t\t// if the user is going online, it is now ...\n\t\t\t// if the user is going away, it is now minus the away timeout, \n\t\t\t// as long as it is more recent than the last known activity\n\t\t\tconst status = this.sessionsToUpdate[sessionId];\n\t\t\tif (status === 'online') {\n\t\t\t\tlastActivityAt = now;\n\t\t\t\t// also clear lastEmailsSent, since user is now assumed to be caught up\n\t\t\t\tthis.op.$unset.lastEmailsSent = true;\n\t\t\t}\n\t\t\telse if (\n\t\t\t\tstatus === 'away' &&\n\t\t\t\tactivityAt > currentLastActivityAt &&\n\t\t\t\tactivityAt > lastActivityAt\n\t\t\t) {\n\t\t\t\tlastActivityAt = activityAt;\n\t\t\t}\n\t\t});\n\n\t\t// update user's lastActivityAt, as needed\n\t\tif (lastActivityAt) {\n\t\t\tthis.op.$set.lastActivityAt = lastActivityAt;\n\t\t}\n\t}", "_sendSessionUpdate() {\n const { scope, client } = this.getStackTop();\n if (!scope) return;\n\n const session = scope.getSession();\n if (session) {\n if (client && client.captureSession) {\n client.captureSession(session);\n }\n }\n }", "function loadSessionStorage()\n{\n //check if the history is in the session if so, load it\n if(sessionStorage.getItem(\"hist\") !== null)\n {\n var new_hist = JSON.parse(sessionStorage.getItem(\"hist\"));\n hist.loadJSON(new_hist);\n }\n\n //check if the stickman is in the session if so, load it\n if(sessionStorage.getItem(\"stk_man\") !== null)\n {\n var str = sessionStorage.getItem(\"stk_man\");\n var stk_man = JSON.parse(str);\n updateBody(stk_man);\n }\n}", "function writeUser() {\n\n const user = JSON.parse(localStorage.getItem('person'));\n const sessionClients = JSON.parse(sessionStorage.getItem('usersClients'));\n const sessionReps = JSON.parse(sessionStorage.getItem('usersReps'));\n\n window.allClients = [];\n window.allReps = [];\n\n if (sessionClients) {\n\n $.each(sessionClients, function (index, client) {\n // add new form data to an existing client\n window.allClients.push(client);\n });\n\n } else { // no client data in session so get it from the user \n $.each(user.clients, function (index, client) {\n\n window.allClients.push(client);\n\n });\n }\n\n if (sessionReps) {\n\n $.each(sessionReps, function (index, rep) {\n // add new form data to an existing rep\n window.allReps.push(rep);\n });\n\n } else { // no rep data in session so get it from the user \n $.each(user.reps, function (index, rep) {\n\n window.allReps.push(rep);\n\n });\n }\n\n\n sessionStorage.setItem('usersClients', JSON.stringify(window.allClients));\n // sessionStorage.setItem('usersMultipleClients', JSON.stringify(window.allClients));\n\n sessionStorage.setItem('usersReps', JSON.stringify(window.allReps));\n\n var firstTimeUser = true;\n if (sessionStorage.getItem('sessionGuid')) {\n firstTimeUser = false;\n }\n\n // count number of clients \n var sessionClientSubmitted = false;\n var sessionRepSubmitted = false;\n\n\n\n if ((window.allClients.length > 0) && (window.allReps.length > 0)) {\n // console.log(' both');\n localStorage.setItem('repFlow', 'both');\n $('.pt-switch-account').show();\n\n if (user.clients) {\n sessionClientSubmitted = true;\n }\n\n } else if (window.allClients.length > 0) {\n localStorage.setItem('repFlow', 'representing');\n if (user.clients) {\n sessionClientSubmitted = true;\n }\n } else if (window.allReps.length > 0) {\n localStorage.setItem('repFlow', 'represented');\n if (user.reps) {\n sessionRepSubmitted = true;\n }\n }\n\n // if (sessionReps) {\n // localStorage.setItem('repFlow', 'representing');\n // if (sessionReps.rep[0].submittedApplication == \"true\") {\n // localStorage.setItem('repFlow', 'representing');\n // var sessionRepSubmitted = true;\n // user.reps.push(sessionReps.rep[0]);\n // }\n\n // if (sessionReps.rep[0].role == \"Cease\") {\n // user.numberOfReps = 0\n // user.reps.length = 0;\n // sessionRepSubmitted = false;\n // localStorage.setItem('repFlow', 'none');\n // sessionStorage.removeItem('usersReps');\n // if (!window.location.hash) {\n // window.location = window.location + '#rep-list';\n // window.location.reload();\n // }\n // }\n\n // }\n\n\n // set\n if ((user.clients.length > 0) || (sessionClientSubmitted === true)) {\n\n if (user.clients.length > 0) {\n user.numberOfClients = user.clients.length;\n } else {\n user.numberOfClients = window.allClients.length;\n }\n\n } else if (user.clients.length < 1) {\n user.numberOfClients = 0;\n }\n\n if ((user.reps.length > 0) || (sessionRepSubmitted === true)) {\n\n if (user.reps.length > 0) {\n user.numberOfReps = user.reps.length;\n } else {\n user.numberOfReps = window.allReps.length;\n }\n } else if (user.reps.length < 1) {\n user.numberOfReps = 0;\n // localStorage.setItem('repFlow', 'newbie');\n }\n\n if (user.claims) {\n user.numberOfClaims = user.claims.length;\n } else {\n user.numberOfClaims = 0;\n }\n\n\n // show hide the switch account buttons\n\n // console.log('sessionClientSubmitted -> ' + sessionClientSubmitted);\n // console.log('window.allClients.length -> ' + window.allClients.length);\n if ((sessionRepSubmitted === true) && (sessionClientSubmitted === true)) {\n localStorage.setItem('repFlow', 'both');\n $('.pt-switch-account').show();\n firstTimeUser = false;\n } else if ((sessionRepSubmitted === true) || (user.numberOfReps > 0)) {\n // localStorage.setItem('repFlow', 'represented');\n firstTimeUser = false;\n } else if ((sessionClientSubmitted === true) || (window.allClients.length > 0)) {\n // localStorage.setItem('repFlow', 'representing');\n $('.pt-switch-account').show();\n firstTimeUser = false;\n } else {\n $('.pt-switch-account').hide();\n // alert('hiding');\n }\n\n if (firstTimeUser) {\n localStorage.setItem('repFlow', 'newbie');\n }\n\n var practitioners = \"\";\n\n $.ajax({\n url: '/docs/data/medical-practitioner.json',\n type: 'GET',\n dataType: 'json',\n async: false\n })\n .done((data) => {\n practitioners = `<ul>`;\n $.each(data.practitioners, (index, pract) => {\n if (user.practitioners.includes(pract._id)) {\n practitioners += `<li>${pract.nameFull}</li>`;\n }\n });\n practitioners += `</ul>`;\n });\n\n\n var userHtml = '';\n var start = '<div class=\"pt-flex-grid\"><div class=\"pt-col\">';\n var end = '</div></div>'\n userHtml += start + 'Name </div><div class=\"pt-col\">' + user.nameFull + end;\n userHtml += start + 'Age </div><div class=\"pt-col\">' + getAge(user.dob) + end;\n userHtml += start + 'Is a veteran </div><div class=\"pt-col\">' + user.veteran + end;\n userHtml += start + 'Practitioners </div><div class=\"pt-col\">' + practitioners + end;\n userHtml += start + 'Currently Serving </div><div class=\"pt-col\">' + user.isCurrentlyServing + end;\n userHtml += start + 'Clients </div><div class=\"pt-col\">' + user.numberOfClients + end;\n userHtml += start + 'Reps </div><div class=\"pt-col\">' + user.numberOfReps + end;\n userHtml += start + 'Last payment </div><div class=\"pt-col\">' + user.lastPayment + end;\n userHtml += start + 'Claims </div><div class=\"pt-col\">' + user.numberOfClaims + end;\n userHtml += start + 'Story </div><div class=\"pt-col\">' + user.story + end;\n\n user.picture = '<img class=\"pt-image-circle\" src=\"' + user.picture + '\">';\n\n\n $('#userContainerId').html(userHtml);\n $('.pt-current-user-name-picture').html(user.picture);\n $('.pt-current-user-name-first').html(user.name.first);\n $('.pt-current-user-name-full').html(user.nameFull);\n $('.pt-current-user-last-payment').html(user.lastPayment);\n $('.pt-current-user-number-of-claims').html(user.numberOfClaims);\n\n\n}", "function init_setup(){\n // TODO: Manage active sessions over different windows\n var init_active = {};\n var last_open = {};\n var init_saved = [];\n\n sessionData = {\n active_session: init_active, \n saved_sessions: init_saved, \n previous_tabs: last_open,\n };\n console.log(JSON.stringify(sessionData));\n\n storage.set({'sessionData': JSON.stringify(sessionData)}, function() {\n console.log(\"Initial data successfully saved.\");\n });\n\n}", "function ReadSessionData(client) {\n\tvar name = 'session' + level.clients.indexOf(client);\n\tvar cvar = Cvar.GetCvar(name);\n\n\tif (!cvar) {\n\t\treturn;\n\t}\n\n\t// Parse string.\n\tvar val = JSON.parse(cvar.get());\n\n\tclient.sess.team = val.team;\n\tclient.sess.spectatorNum = val.spectatorNum;\n\tclient.sess.spectatorState = val.spectatorState;\n\tclient.sess.spectatorClient = val.spectatorClient;\n\tclient.sess.wins = val.wins;\n\tclient.sess.losses = val.losses;\n}", "function setUserData() {\n //TODO: for non-social logins - userService is handling this - not a current issue b/c there is no data for these right after reg, but needs to be consistent!\n authService.setUserCUGDetails();\n authService.setUserLocation();\n authService.setUserPreferences();\n authService.setUserBio();\n authService.setUserBookings();\n authService.setUserFavorites();\n authService.setUserReviews();\n authService.setSentryUserContext();\n authService.setSessionStackUserContext();\n\n //was a noop copied from register controller: vm.syncProfile();\n }" ]
[ "0.7076083", "0.6953998", "0.6824311", "0.6824311", "0.65878445", "0.65720516", "0.6563773", "0.6526395", "0.65236324", "0.6491002", "0.64781386", "0.6455403", "0.64435214", "0.64361686", "0.6432542", "0.64188385", "0.6402803", "0.6368569", "0.6357257", "0.6357032", "0.6355259", "0.63461953", "0.63335025", "0.63086665", "0.6305314", "0.6304116", "0.6279213", "0.62646365", "0.624758", "0.62441474", "0.6241473", "0.6235131", "0.6229751", "0.6219459", "0.62168217", "0.62061226", "0.6201526", "0.61914426", "0.6190566", "0.6178998", "0.6178687", "0.61769336", "0.6175808", "0.6155465", "0.614792", "0.61472845", "0.6144389", "0.61437273", "0.6134577", "0.61335564", "0.61251354", "0.6109538", "0.60870224", "0.60702527", "0.60671645", "0.6059106", "0.6047992", "0.6045613", "0.60441506", "0.6030717", "0.6021975", "0.6012244", "0.6003149", "0.6001731", "0.59932125", "0.5990336", "0.59896547", "0.5985008", "0.59789443", "0.59765047", "0.59707195", "0.59624606", "0.5960178", "0.5946696", "0.5945882", "0.593901", "0.5937528", "0.59208333", "0.5916647", "0.5910714", "0.59096277", "0.59084475", "0.5902536", "0.58999836", "0.5894108", "0.5894072", "0.58860487", "0.58843046", "0.5884017", "0.58804744", "0.5877605", "0.58771586", "0.58721346", "0.5870861", "0.5870475", "0.58643925", "0.58540905", "0.58528966", "0.5852385", "0.58518744" ]
0.594275
75
Stack implemented using LinkedList
function Stack() { this.first = null; this.size = 0; this.push = (data) => { var newNode = new Node(data); newNode.next = this.first; //Special attention this.first = newNode; this.size += 1; } this.pop = () => { if(this.first) { var temp = this.first; this.first = this.first.next; this.size -= 1; return temp; } return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Stack() {\n this.list = new LinkedList();\n }", "function Stack() {\n this.list = new LinkedList();\n }", "function Stack() {\n this.list = new LinkedList_1.default();\n }", "function LinkedListStack() {\n this.head = null;\n}", "function Stack() {\n this.length = 0;\n this.stack = new list();\n //function to add element\n this.push = function(obj) {\n this.stack.add(obj);\n this.length++;\n }\n //function to remove leement\n this.pop=function(){\n var data=this.stack.remove();\n this.length--;\n return data;\n }\n //function to chk stack is empty\n this.isEmpty = function() {\n if (this.length == 0) {\n return true;\n } else return false;\n }\n}", "function Stack() {\n this.index = 0;\n this.list = {};\n}", "function Stack() {\n this.element_list = [],\n this.size = function () {\n return this.element_list.length;\n },\n this.push = function(element) {\n this.element_list[this.element_list.length] = element;\n },\n this.pop = function() {\n var last_element = this.element_list[this.element_list.length-1];\n this.element_list.length--;\n return last_element;\n }\n}", "function SLStack(){\n\tvar head = null;\n}", "function stackPush(stack, val){\n\t// checks if stack has a tail\n\tif (stack.tail){\n\t\tconsole.log(\"Stack cannot have a tail\");\n\t\treturn null;\n\t}\n\t// checks if stack.head is equal to null, i.e. stack has no head\n\telse if (!stack.head){\n\t\tvar myNode = new ListNode(val);\n\t\tstack.head = myNode;\n\t\tconsole.log(stack);\n\t\treturn stack;\n\t}\n\t// runs if stack has one or more nodes\n\telse {\n\t\tvar myNode = new ListNode(val);\n\t\tmyNode.next = stack.head;\n\t\tstack.head = myNode;\n\t\tconsole.log(stack);\n\t\treturn stack;\n\t}\n}", "constructor() {\n this.stack = new SinglyLinkedList();\n }", "function Stack() {\n\n // holds stack data\n var list = [];\n\n this.push = function(obj) {\n //-- pushes object on top of stack\n //--\n\n list.push(obj);\n }\n\n this.pop = function() {\n //-- pops and returns object from top of stack\n //--\n\n return list.pop();\n }\n\n this.top = function() {\n //-- returns top object on stack\n //--\n\n return list[list.length-1];\n }\n\n this.is_empty = function() {\n //-- returns if stack is empty\n //--\n\n return !list.length;\n }\n\n this.count = function() {\n //-- returns size of stack\n //--\n\n return list.length;\n }\n\n this.clear = function() {\n //-- removes all objects from stack\n //--\n\n list = [];\n }\n\n this.data = function() {\n //-- returns raw stack data\n //--\n\n return list;\n }\n\n this.dump = function() {\n //-- pops all objects into an array\n //-- then returns it\n //--\n\n var out = [];\n while(!this.is_empty()) {\n out.push(list.pop());\n }\n return out;\n }\n}//end Stack", "function Stack() {\n this._size = 0;\n this._storage = [];\n}", "push(val) {\n // create a new node\n let newNode = new Node(val);\n // if stack is empty...\n if (!this.first) {\n // set first and last property to be new node\n this.first = newNode;\n this.last = newNode;\n }\n else {\n // store the current first node in the stack\n let temp = this.first;\n // make the new node node the first node in the stack\n this.first = newNode;\n // set the next node to be the old beginning node (so it comes after the new node)\n this.first.next = temp;\n }\n // return size of stack\n return ++this.size;\n }", "function Stack(){\n\tthis.items = [];\n\tthis.length = this.items.length;\n}", "function Stack(){\n\tthis.dataStore = {};\n\tthis.top = 0;\n\tthis.push = push;\n\tthis.pop = pop;\n\tthis.peek = peek;\n\tthis.clear = clear;\n\tthis.length = length;\n}", "function Stack() {\n this.count = 0;\n this.storage = {};\n\n // Adds a value onto the end of the stack\n this.push = function (value) {\n this.storage[this.count] = value;\n this.count++;\n };\n\n // Removes and returns the value at the\n // end of the stack\n this.pop = function () {\n if (this.count === 0) {\n return undefined;\n }\n\n this.count--;\n const result = this.storage[this.count];\n delete this.storage[this.count];\n return result;\n };\n\n this.size = function () {\n return this.count;\n };\n\n // Returns the value at the end of\n // the stack.\n this.peek = function () {\n return this.storage[this.count - 1];\n };\n}", "function Stack() {\n //top represents the next empty position in the array\n this.top = 0;\n this.dataStore = [];\n\n this.push = push;\n this.pop = pop;\n this.peek = peek;\n this.clear = clear;\n this.isEmpty = isEmpty;\n this.display = display;\n this.length = length;\n}", "push(value) {\n\n// * create a new node from the value\n let newNode = new Node(value);\n\n// * point the next to the current `top`.\n newNode.next = this.top;\n\n// * set `top` of the stack to be our new `node`.\n this.top = newNode;\n }", "function Stack() {\n var stack = [];\n\n this.stackCopy = stack;\n\n this.push = function(item) {\n stack.push(item);\n };\n\n this.pop = function() {\n if (stack.length === 0) {\n throw 'Stack underflow exception';\n }\n return stack.pop();\n };\n\n this.peek = function() {\n var size = this.getSize();\n if (size >= 0) {\n return stack[size - 1];\n }\n };\n\n this.getSize = function() {\n return stack.length;\n };\n\n this.cloneStack = function() {\n var clone = new Stack();\n\n for (var item of stack) {\n clone.push(nodeUtils.deepCopy(item));\n }\n\n return clone;\n };\n\n this.reverseElements = function() {\n stack.reverse();\n };\n\n this.isEmpty = function() {\n return stack.length === 0;\n };\n\n // debug.\n this.printAll = function() {\n for (var item of stack) {\n console.log(item);\n console.log();\n }\n }\n }", "function Stack() {\r\n //var items = [];\r\n this.items = [];\r\n this.top = 0;\r\n this.push = push;\r\n this.pop = pop;\r\n this.peek = peek;\r\n this.clear = clear;\r\n this.length = length;\r\n //this.printElement = printStack;\r\n\r\n function push(element) {\r\n this.items[this.top++] = element;\r\n }\r\n\r\n function pop() {\r\n //return this.items[--this.top];\r\n if (this.top === 0) return;\r\n var item = this.items[this.top - 1]\r\n this.items.length = --this.top;\r\n return item;\r\n }\r\n\r\n\r\n\r\n function peek() {\r\n return this.items[this.top - 1];\r\n }\r\n\r\n function clear() {\r\n this.top = 0;\r\n }\r\n\r\n function length() {\r\n return this.top;\r\n }\r\n\r\n\r\n function printStack() {\r\n while (this.top > 0) {\r\n document.writeln(this.pop() + \"&nbsp;&nbsp;\");\r\n }\r\n }\r\n}", "function Stack(){\n\tvar item = [];\n\tthis.push = function(element){\n\t\titem.push(element);\n\t};\n\tthis.pop = function(){\n\t\treturn item.pop();\n\t};\n\tthis.peek = function(){\n\t\treturn item[item.length-1];\n\t};\n\tthis.isEmpty = function(){\n\t\treturn item.length == 0;\n\t};\n\tthis.clear = function(){\n\t\titem = [];\n\t};\n\tthis.size = function(){\n\t\treturn item.length;\n\t}\n\tthis.print = function(){\n\t\tconsole.log(item.toString()):\n\t};\n}", "function Stack() {\n this.stack = [];\n}", "function Stack() {\n this.dataStore = [];\n this.top = 0;\n this.push = push;\n this.pop = pop;\n this.peek = peek;\n this.clear = clear;\n this.length = length;\n}", "function Assign_Stack_Stack() {\r\n}", "function Stack() {\n}", "function Assign_Stack() {\r\n}", "function Stack_R() {\r\n}", "function Stack() {\n this.dataStore = [];\n this.top = 0;\n this.push = push;\n this.pop = pop;\n this.peek = peek;\n this.isEmpty = isEmpty;\n this.clear = clear;\n}", "push(value) {\n\t\tvar new_node = new ListNode(value);\n\t\t// determine if stack is empty or not\n\t\t// add new node at appropriate position\n\t\tif (this.head == null) {\n\t\t\tthis.head = new_node;\n\t\t\tthis.tail = new_node;\n\t\t}\n\t\t\n\t\telse {\n\t\t\tnew_node.next = this.head;\n\t\t\tthis.head = new_node;\n\t\t}\n\t}", "function InsertStack () {\n\t this.stack = [];\n\t this.popIdx = 0;\n\t}", "function Stack_A_R() {\r\n}", "push(element){\n this.stack.push(element);\n this.top = this.stack[this.stack.length-1]\n }", "function Stack(){\n this.elements = [];\n}", "function Stack() {\n var collection = [];\n this.print = function() {\n console.log(collection);\n };\n\n this.push = function(element) {\n // pushes element to top of stack\n return collection.push(element);\n };\n\n this.pop = function() {\n // removes and returns the element on top of the stack\n return collection.pop();\n };\n\n this.peek = function() {\n // looks at the top element in the stack\n return collection[collection.length - 1];\n };\n\n this.isEmpty = function() {\n // checks if the stack is empty\n return collection.length === 0;\n };\n\n this.clear = function() {\n // removes all elements from the stack\n return collection.length = 0;\n };\n}", "push(value) {\n const newNode = new Node(value);\n //validamos si el stack está vacio\n if (this.length === 0) {\n this.top = newNode;\n this.bottom = newNode;\n } else {\n /**\n * al agregar un nuevo elemento, el node que en este momento esta en el top debe dejar de ser el top y el nuevo elemento\n * se convertirá en el top\n */\n const holdingPointer = this.top;\n //el newNode se convierte en el top del stack\n this.top = newNode;\n //top.next representa al nodo que está debajo del top\n this.top.next = holdingPointer;\n }\n\n this.length++;\n\n return this;\n }", "function Stack_A_A_R() {\r\n}", "push(x){\r\n this.stack.push(x);\r\n this.size++;\r\n }", "function Stack( ) {\n//Declaro una variable con un arreglo vacio en donde estaran mis objetos//\nvar personas = [ ];\n\n//Por default declaro la estructura para crear mi pila, nombro mi funcion y declaro su propiedad//\n this.add= add;\n this.pop = pop;\n this.print = print;\n\n function add(elemento) {\n personas.push(elemento);\n };\n\n function pop(elemento) {\n return personas.pop();\n };\n\n function print() {\n console.log(personas.toString());\n };\n\n}", "function Stack(){\n this.items = [];\n}", "push (value) {\n const newNode = new Node(value)\n\n if (this.length === 0) {\n this.top = newNode\n this.bottom = newNode\n } else {\n newNode.next = this.top\n this.top = newNode\n }\n\n this.length++\n // this.printStack()\n }", "function dup() {\r\n this.stack.push(this.stack[this.stack.length - 1]);\r\n}", "constructor(){\n this.stack = [] //intializing the empty stack \n this.len = 0\n }", "push(data) {\n const newNode = new StackNode(data);\n\n if (!this.first) {\n this.first = newNode;\n this.last = newNode;\n } else {\n const temp = this.first;\n this.first = newNode;\n this.first.next = temp;\n }\n this.size++;\n\n return this.size;\n }", "push(data) {\n // If Stack is empty the item will be added to top of stack\n if(this.top === null) {\n this.top = new _Node(data, this.top);\n return this.top;\n }\n // If stack already has nodes add new node to top of stack and point to it\n const node = new _Node(data, this.top);\n this.top = node;\n }", "function push(val) {\n stack[++topp] = val;\n \n}", "function Stack_A() {\r\n}", "function peek(stack) {\n var node = stack.pop();\n stack.push(node);\n return node;\n}", "function Stack(init) {\n var data = init ? [init] : [];\n $.extend(this, {\n size: function() {\n return data.length;\n },\n pop: function() {\n if (data.length === 0) {\n return null;\n } else {\n var value = data[data.length - 1];\n data = data.slice(0, data.length - 1);\n return value;\n }\n },\n push: function(value) {\n data = data.concat([value]);\n return value;\n },\n top: function() {\n return data.length > 0 ? data[data.length - 1] : null;\n }\n });\n }", "function Stack_A_A() {\r\n}", "function Assign_Stack_Other() {\r\n}", "function Stack() {\n let list = [];\n return {\n push: (n) => list.push(n),\n pop: () => list.pop()\n };\n}", "function main() {\n let treky = new Stack;\n treky.push(0);\n treky.push(4);\n treky.push(1);\n treky.push(3);\n\n //treky.pop();\n // treky.pop();\n\n //treky.push(1);\n\n\n // console.log(display(treky));\n // console.log(isPalindrome('racecar'));\n // console.log(isPalindrome('A man, a plan, a canal: Panama'));\n // console.log(balanceParens('1 + 2 + (1 + 3)'));\n console.log(sortStack(treky));\n}", "function convertTreeToStack(ast, stack) {\n estraverse.traverse(ast, {\n enter: function(node) {\n stack.push(node);\n }\n });\n }", "function Assign_Free_Stack() {\r\n}", "function display(stack) {\n let currTop = stack.top;\n\n while (currTop !== null) {\n console.log(currTop.data);\n currTop = currTop.next;\n }\n}", "function Queue() {\n this.size = 0;\n this.inStack = new Stack();\n this.outStack = new Stack();\n}", "function Stack() {\n this.__a = [];\n}", "function Stack_A_A_A() {\r\n}", "push(val) {\n //create a new node by node class and store it\n let newnode = new Node(val)\n //if there is node { EMPTY-list}\n if (!this.head) {\n //point the head to the newly created node\n this.head = newnode;\n //and point the tail to same node\n this.tail = this.head;\n /* like this\n [] ----> if list have no element then\n add a new node to the list [23] \n head=23 and tail=23 // both are points to the same node\n */\n }\n //if there is a node { list have elements }\n else {\n //set the tail.next points the newly created node \n this.tail.next = newnode;\n // and set the tail to the new node\n this.tail = newnode;\n /* like this\n 23 34 ----> if list have element then\n head=23 and tail=34 // both are points to the same node\n */\n }\n //increament the length by 1\n this.length++;\n //return the list by this \n return this;\n }", "function SimpleStack()\n {\n // Private Variables\n var stack = new Array();\n \n // properties\n Object.defineProperty(this, 'size', {\n writeable : false,\n enumerable : false,\n get : function() {\n return stack.length;\n }\n });\n \n // public functions\n this.push = function(obj)\n {\n stack.push(obj);\n }\n \n this.pop = function()\n {\n return stack.pop();\n }\n \n this.popAll = function()\n {\n // pops everything off the stack at once\n var old = this.peekAll();\n \n // create fresh array to use as new stack\n stack = new Array();\n \n // return all \"popped\" elements incase they are wanted\n return old;\n }\n \n this.peekAll = function()\n {\n return stack.join('');\n }\n }", "function sortStack(stack) {\n let newStack = new Stack();\n\n while (!isEmpty(stack)) {\n let temp = stack.pop()\n // console.log(peek(newStack))\n while (!isEmpty(newStack) && (peek(newStack).data > temp)) {\n\n stack.push(newStack.pop())\n }\n newStack.push(temp);\n }\n console.log('string')\n console.log(display(newStack));\n}", "function Assign_Stack_Free() {\r\n}", "function main() {\n const starTrek = new Stack();\n\n starTrek.push('Kirk');\n starTrek.push('Spock');\n starTrek.push('McCoy');\n starTrek.push('Scotty');\n\n console.log('---First in queue---')\n peek(starTrek);\n console.log('---Is the queue empty?---')\n isEmpty(starTrek);\n console.log('---Display queue---')\n display(starTrek);\n\n // Remove McCoy from your stack and display the stack\n starTrek.pop();\n starTrek.pop();\n console.log('---After removing McCoy----')\n display(starTrek);\n\n return starTrek;\n}", "function shared_nodeStackHandler(stack, item, add) {\n if (item) {\n if (add) {\n stack.unshift(item);\n } else {\n stack.shift();\n }\n }\n }", "function Stack() {\n //Make empty array for deck\n this.cards = new Array();\n }", "function Stack() {\n\n // Create an empty array of cards.\n\n this.cards = new Array();\n\n this.makeStack = stackMakeStack; //from deck.js init(), to below\n this.deal = stackDeal;\n this.draw = stackDraw;\n this.addCard = stackAddCard;\n \n}", "function display(stack) {\n while (stack.top !== null) {\n console.log(stack.top.data);\n stack.top = stack.top.next;\n }\n}", "function Stack() {\n // initialize an empty array\n this.items = [];\n}", "function Queue() {\n this.mainStack = [];\n this.tempStack = [];\n}", "function display(stack) {\n let currentNode = stack.top;\n if(isEmpty(stack)) {\n return null;\n }\n //the last value .next will always equal null\n while(currentNode !== null) {\n console.log(currentNode.data);\n //so the while loop doesnt go forever\n currentNode = currentNode.next;\n }\n}", "push(data) {\n const newNode = new Node(data);\n\n // establish the bottom of the stack if empty\n if (this.isEmpty()) {\n this.first = newNode;\n }\n\n // if empty, will point to null\n newNode.next = this.last;\n // if empty, new node is first AND last\n this.last = newNode;\n\n this.size++;\n\n return this;\n }", "function StackSym() {\r\n}", "pop(){\n var oldTop = this.top\n if ( this.top == null ){\n console.log(\"There are no nodes in this stack!\")\n }\n else if ( this.top.next == null ) {\n console.log(this.top.value)\n this.top = null\n return null\n }\n else {\n this.top = this.top.next\n console.log(\"Popped\"+ String( oldTop.value ))\n oldTop = null\n }\n return this.top\n // your code here\n }", "function push(e) {\n topp++;\n stackarr[topp] = e;\n}", "function Stack_A_A_A_A() {\r\n}", "function MinStack() {\n this.contents = [];\n this.mins = [];\n\n this.isEmpty = function() {\n return !this.contents.length;\n }\n\n this.push = function(item) {\n var len = this.contents.length;\n this.contents[len] = item;\n this.mins[len] = !len ? item : Math.min(this.mins[len - 1], item);\n return len;\n }\n\n this.pop = function() {\n if (this.isEmpty()) return null;\n var newLen = this.contents.length - 1;\n var popped = this.contents[newLen];\n this.contents.length = this.mins.length = newLen;\n return popped;\n }\n\n this.min = function() {\n return this.mins[this.mins.length - 1];\n }\n\n this.peek = function(item) {\n return this.contents[this.size - 1];\n }\n}", "function ourStack() {\n var stack = new Array();\n stack.push('Audi');\n stack.push('Skoda');\n stack.push('Opel');\n stack.push('VW');\n\n // in this case VW is at the top of the stack\n // (added as the last)\n\n alert(stack.toString());\n stack.pop(); // get VW\n alert(stack.toString()); // no VW anymore\n\n // add new element\n stack.push('Mercedes');\n alert(stack.toString()); // Mercedes on the top\n}", "push (value) {\n this.stack.push(value)\n\n this.printStack()\n }", "push(el) {\n this.#stack.push(el);\n this.#size++;\n }", "function sortStack(stack) {\n if(!stack.top.next) return stack;\n display(stack)\n let sortStack = new Stack()\n while(stack.top) {\n let temp = stack.pop()\n while(sortStack.top && sortStack.top.data > temp) {\n stack.push(sortStack.pop())\n }\n console.log(sortStack)\n sortStack.push(temp)\n }\n display(sortStack)\n return sortStack\n}", "function addToStack(value){\n prefixstack.push(value);\n display(prefixstack);\n}", "function push(element) {\n // increment top counter\n TOP += 1;\n STACK[TOP] = element;\n}", "function pop() {\r\n this.stack.pop();\r\n}", "push(value){\n var new_node = new SLNode(value);\n new_node.next = this.head;\n this.head = new_node;\n this.length++;\n }", "push(val) {\n // Create a new node with Node constructor.\n let node = new Node(val);\n // Check for head. if not add the node as head and tail;s\n if(!this.head){\n this.head = node; \n this.tail = node; \n }\n else { \n // Else set the next prop on the tail to be the new Node and reassign the tail to be the new Node.\n this.tail.next = node; \n this.tail = node; \n }\n // increment length by one. \n this.length++; \n }", "function Stack() {\r\n var stack = [];\r\n stack.isEmpty = function() { return stack.length == 0; };\r\n stack.top = function() { return stack[stack.length-1]; };\r\n stack.find = function(_testfunc) { return stack[stack.indexWhere(_testfunc)]; };\r\n stack.indexWhere = function(_testfunc) { // undefined if not found\r\n for (var i = stack.length-1; i >= 0; i--) {\r\n if (_testfunc(stack[i]))\r\n return i;\r\n }\r\n };\r\n stack.unwindTo = function(_testfunc) {\r\n while (!_testfunc(stack.top()))\r\n stack.pop();\r\n return stack.top();\r\n };\r\n stack.isHere = function() {\r\n return (stack.length > 0 && stack.top().idx == hereIdx());\r\n };\r\n return stack;\r\n}", "constructor(){\n\t\tthis.stack = [];\n\t}", "function Stack(size) {\n this.array = new Array(size);\n this.index = 0;\n this.size = size;\n}", "function pushn(n) {\r\n this.stack.push(n);\r\n}", "function MatrixStack() {}", "pop() {\n // if stack is empty\n if (!this.first) return null;\n // grab the first node in stack\n let temp = this.first;\n // there's only one item left in stack\n if (this.first === this.last) {\n this.last === null\n }\n // set first to be null, too, if this.last is null. Otherwise set first to be next node.\n this.first = this.first.next;\n this.size--;\n // return value of node that was removed from stack\n return temp.value;\n }", "function Stack(value)\n{\n this.value = value;\n this.frames = [];\n}", "push(element) {\n this.stack.push(element);\n }", "push(value) {\n if (this.size == 0) {\n this.front = new LinkedListNode(value);\n this.back = this.front;\n } else {\n this.back.next = new LinkedListNode(value);\n this.back = this.back.next;\n }\n this.size++;\n }", "function Assign_Stack_Lex() {\r\n}", "function push(stack, item) {\n stack.append(item)\n print(item + \" pushed to stack \")\n}", "push(value) {\n this.stackData.push(value);\n this.length++;\n if (this.length === 1) {\n this.bottom = this.stackData[0];\n }\n this.top = this.stackData[this.length - 1];\n }", "push(val) {\n // make new node from val\n // think about when LL is empty - LL.head & LL.tail = newNode\n // update tails next on LL \n // set newNode.next to null \n\n const newNode = new Node(val); // next defaults to null \n if (this.head === null) {\n this.head = newNode;\n this.tail = this.head;\n } else {\n this.tail.next = newNode;\n this.tail = newNode;\n }\n this.length += 1\n return\n }", "function HistoryStack () {\n var stack = []\n var pointer = -1 // index of current element in stack\n var stackTop = -1 // index of current topmost element in stack\n\n // Clear the history stack\n this.clear = function () {\n stack = []\n pointer = -1\n stackTop = -1\n }\n\n // Push an entry to the history stack.\n this.push = function (href) {\n if (href === null || href === undefined) {\n throw new Error('DropOutHistoryStack.push: href must be defined and non-null')\n }\n pointer += 1\n stack[pointer] = href\n stackTop = pointer // reset stackTop after a push\n stack.splice(stackTop + 1)\n }\n\n // Returns the current href.\n // null if the stack is empty.\n this.current = function () {\n if (pointer >= 0) {\n return stack[pointer]\n } else {\n return null\n }\n }\n\n // Returns the current position in stack.\n // -1 if the stack is empty.\n this.current_position = function () {\n return pointer\n }\n\n // Returns the previous href.\n // null if we're at the bottom of the stack, or if the stack is empty.\n this.prev = function () {\n if (pointer > 0) {\n return stack[pointer - 1]\n } else {\n return null\n }\n }\n\n // Returns the next href.\n // null if we're at the top of the stack, or if the stack is empty.\n this.next = function () {\n if (pointer < stackTop) {\n return stack[pointer + 1]\n } else {\n return null\n }\n }\n\n // Returns the current href, and moves the pointer back one slot.\n // Pointer is not moved if we're at the bottom of the stack, or if the\n // stack is empty. Either case, the return value is null.\n this.back = function () {\n if (pointer > 0) {\n pointer -= 1\n return stack[pointer + 1]\n } else {\n return null\n }\n }\n\n // Returns the current href, and moves the pointer forward one slot.\n // Pointer is not moved if we're at the top of the stack, or if the stack\n // is empty. Either case, the return value is null.\n this.forward = function () {\n if (pointer < stackTop) {\n pointer += 1\n return stack[pointer - 1]\n } else {\n return null\n }\n }\n\n // Checks if href is the next or the previous href in the history stack.\n // If href is not given, check the current window location.\n // If href is the next in the history stack, return 'next';\n // Otherwise, if href is the previous in the history stack, return 'prev';\n // Otherwise, return null.\n this.check = function (href) {\n href = href || window.location.href\n if (this.next() === href) {\n return 'next'\n } else if (this.prev() === href) {\n return 'prev'\n } else {\n return null\n }\n }\n\n this.valueOf = function () {\n return {\n stack: stack.slice(0, stackTop + 1),\n pointer: pointer,\n href: pointer >= 0 ? stack[pointer] : null\n }\n }\n }", "peek() {\r\n if(this.data.isEmpty()) {\r\n console.log(\"This stack is empty\");\r\n return null;\r\n }\r\n return this.data.head;\r\n }" ]
[ "0.7958934", "0.7945678", "0.77234507", "0.7601649", "0.7343377", "0.72961324", "0.72624207", "0.7138196", "0.710708", "0.69803035", "0.6960319", "0.6954564", "0.6900423", "0.6878416", "0.68654346", "0.68646914", "0.68017095", "0.67957187", "0.67842656", "0.67620045", "0.67531466", "0.6751453", "0.6751098", "0.6748711", "0.6743547", "0.67202276", "0.6709092", "0.67035115", "0.66102785", "0.6527317", "0.6510121", "0.64964706", "0.64953935", "0.6463878", "0.6441042", "0.64375156", "0.64272356", "0.64210904", "0.64194703", "0.6384659", "0.63782597", "0.6362405", "0.6328477", "0.6307531", "0.6304087", "0.6284685", "0.6283027", "0.6282997", "0.62798935", "0.62520677", "0.62423754", "0.62401676", "0.6223967", "0.6214227", "0.61986107", "0.61917794", "0.61877203", "0.617878", "0.6152928", "0.6150425", "0.6145534", "0.6137248", "0.6134021", "0.6133147", "0.6125368", "0.6123177", "0.6122128", "0.61110306", "0.6110222", "0.61078113", "0.60959387", "0.60609347", "0.60553414", "0.6041268", "0.60412645", "0.60327923", "0.60136384", "0.6011734", "0.60099995", "0.60097355", "0.60037285", "0.60006994", "0.5998751", "0.5997666", "0.5992923", "0.59769803", "0.5951086", "0.59491104", "0.594852", "0.5946427", "0.5945292", "0.5943153", "0.59421384", "0.5940059", "0.59360236", "0.59280324", "0.5923979", "0.59163916", "0.5911747", "0.58914024" ]
0.7687762
3
Publish on Google drive reports of all subrdinates of the specified LM to the directory with LM name
function publishSubordinateReports(lmId, res, cb) { User.findById(lmId, function(err, lm) { if (err) { return next(new HttpError(400, err.message)); } consultant.exportBulk(lmId, 'pdf', res, function(err, consultantResult, consultantReports) { manager.exportBulk(lmId, 'pdf', res, function(err, managerResult, managerReports) { var reports = consultantReports.concat(managerReports); var validReports = reports.filter(function(report) { return report.status === 'ok' }); var successMessages = []; var errors = []; var reportDirectory = config.get('google:reportDirectory'); gApi.createPath(`${reportDirectory}/${lm.name}`, function(err, directoryId) { if (err) { logger.error('Error during creating of the LM\'s directory: %s', err.message); return cb(err); } var processCounter = 0; validReports.forEach(function(report) { const params = { srcFilepath: report.filepath, destFilename: report.username + '.pdf', destDirectory: directoryId }; gApi.upload(params, function(err) { if (err) { logger.error('Error during publishing of the %s\'s report to LM directory "%s": %s', report.username, lm.name, err.message); errors.push(`Error during publishing of the report of ${report.username}: ${err.message}`); } else { logger.info('Publishing of the %s\'s report to LM directory "%s" was completed successfully', report.username, lm.name); successMessages.push(`Publishing of the report of ${report.username} was completed successfully`); } if (++processCounter === validReports.length) { if (errors.length) { return cb({ message: errors }); } cb(null, successMessages); } }); }); }); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addReportFile(folder, name) {\n var spreadsheet = SpreadsheetApp.create(name, 1, 4);\n var sheet = spreadsheet.getActiveSheet();\n sheet.setName(\"QS history\");\n // Put in the table headings\n sheet.getRange(1, 1, 1, 4).setValues([[\"Campaign\", \"AdGroup\", \"Keyword\", \"ID string\"]]);\n //sheet.getRange(1, 1, 1, 4).setFontWeight(\"bold\");\n sheet.setColumnWidth(4, 1);\n var file = DriveApp.getFileById(spreadsheet.getId());\n folder.addFile(file);\n var parentFolder = file.getParents().next();\n parentFolder.removeFile(file);\n return folder.getFilesByName(name).next();\n}", "function renderToPublic() {\n var dist_directories;\n Filehound.create()\n .path(config.paths.views_dir)\n .directory()\n .find()\n .then((subdirectories) => {\n dist_directories = subdirectories;\n dist_directories.push(config.paths.public_dir);\n let arrayLength = dist_directories.length;\n\n for (var i = 0; i < arrayLength; i++) {\n var shortDir = dist_directories[i].split('pages/')[1];\n if (shortDir !== undefined) {\n var srcdirectory = dist_directories[i] + '/*.@(html|njk)';\n var destdirectory = config.paths.public_dir + '/' + shortDir;\n } else {\n var srcdirectory = config.paths.views_dir + '/*.@(html|njk)';\n var destdirectory = config.paths.public_dir;\n }\n\n gulp.src(srcdirectory)\n .pipe(\n njkRender({\n path: ['pages', 'templates'],\n data: config.njk.templateVars,\n })\n )\n .pipe(gulp.dest(destdirectory));\n }\n });\n\n\n\n\n\n}", "function generate_all_reports()\n{\n report_ToAnswer_emails();\n report_FollowUp_emails();\n report_Work_FollowUp_emails();\n}", "function saveEmail(email, dest_id) {\r\n var folder = DriveApp.getFolderById(dest_id); \r\n var date = new Date(); \r\n folder.createFile('newsletter-wk' + getWeek() + '-' + date.getFullYear() +'.html', email, MimeType.HTML);\r\n}", "function ListFoldersInSpecificFolder(ListDocName, ListDocFullPath, SpecificFolder)\n{\n var DocFiles = GoogleDocsInSpecificFolder(ListDocName, ListDocFullPath);\n \n while(DocFiles.hasNext())\n {\n var docFile = DocFiles.next();\n var docID = docFile.getId();\n var doc = DocumentApp.openById(docID);\n \n var Folders = FoldersInSpecificFolder(SpecificFolder);\n \n var SubFoldersCount = 0;\n \n // Counter would count the writing times of doc.\n // if there are lots data to write, it would save doc file first, then re-open the doc file.\n var Counter = 0;\n while(Folders.hasNext())\n {\n var Folder = Folders.next();\n // Access the body of the document, then add a paragraph.\n if(SpecificFolder == '//')\n {\n doc.getBody().appendParagraph(SpecificFolder + Folder.getName() + '\\t' + Folder.getId());\n }\n else\n {\n doc.getBody().appendParagraph(SpecificFolder + '//' + Folder.getName() + '\\t' + Folder.getId());\n }\n \n SubFoldersCount = SubFoldersCount + 1;\n \n Counter = Counter + 1;\n if(Counter > 10)\n {\n doc.saveAndClose();\n doc = DocumentApp.openById(docID);\n Counter = 0;\n }\n \n }\n doc.saveAndClose();\n }\n return SubFoldersCount;\n}", "function print(master){\n \n var sourceSheet = master;\n var outputSheet = sourceSheet.getSheetByName(\"Master\");\n var parentFolder; //Folder to save PDF in\n var currentDate = new Date();\n \n //Checks if folder exists, if it doesn't, create it\n try {\n //Folder exists\n parentFolder = DriveApp.getFoldersByName('Lab Software Change Reports').next(); \n Logger.log('folder exists');\n }\n catch(e) {\n //Folder doesn't exist, create folder\n parentFolder = DriveApp.createFolder('Lab Software Change Reports');\n Logger.log('folder does not exist, creating folder');\n }\n \n //nane PDF\n var PDFName = \"Lab Software Change Report-\" + currentDate;\n SpreadsheetApp.getActiveSpreadsheet().toast('Creating PDF '+PDFName);\n \n // export url\n var PDFurl = 'https://docs.google.com/spreadsheets/d/'+sourceSheet.getId()+'/export?exportFormat=pdf&format=pdf' // export as pdf\n + '&size=letter' // paper size legal / letter / A4\n + '&portrait=true' // orientation, false for landscape\n + '&fitw=true' // fit to page width, false for actual size\n + '&sheetnames=true&printtitle=true' // hide optional headers and footers\n + '&pagenum=CENTER&gridlines=false' // hide page numbers and gridlines\n + '&fzr=false' // do not repeat row headers (frozen rows) on each page\n + '&top_margin=.75&bottom_margin=.75&left_margin=.25&right_margin=.25' //Narrow margins\n + '&gid='+outputSheet.getSheetId(); // the sheet's Id\n \n //authorize script\n var token = ScriptApp.getOAuthToken();\n \n // request export url\n var response = UrlFetchApp.fetch(PDFurl, {\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n });\n \n //name PDF blob\n var PDFBlob = response.getBlob().setName(PDFName+'.pdf');\n \n // delete pdf if it already exists\n var files = parentFolder.getFilesByName(PDFName);\n while (files.hasNext())\n {\n files.next().setTrashed(true);\n }\n \n // create pdf file from blob\n var createPDFFile = parentFolder.createFile(PDFBlob); \n var folderURL = parentFolder.getUrl();\n emailPDF(PDFBlob, folderURL);\n}", "async function create_main_log_object(folder_id, drive_date) {\n\tlet creds_service_user, googleDriveInstance, gdrive, root_files;\n\ttry {\n\t\tcreds_service_user = require(PATH_TO_CREDENTIALS);\n\t\tgoogleDriveInstance = new NodeGoogleDrive({\n\t\t\tROOT_FOLDER: folder_id\n\t\t});\n\n\t\tgdrive = await googleDriveInstance.useServiceAccountAuth(creds_service_user);\n\t\troot_files = await pull_files(googleDriveInstance, folder_id, false, false);\n\t} catch (error) {\n\t\tconsole.log(\"oh no!\", error);\n\t\treturn;\n\t}\n\n\tconsole.log(folder_id);\n\n\tlet mainlog_sheet_id = \"\";\n\troot_files.files.forEach((item) => {\n\t\tif (edit_dist(item.name.substring(item.name.length - 12).toLowerCase().replace(/[^a-z]/g, \"\"), \"logschedule\") < 3)\n\t\t\tmainlog_sheet_id = item.id;\n\t});\n\n\troot_files = await pull_files(googleDriveInstance, folder_id, true, true);\n\tlet main_logs = await pull_main_logs(googleDriveInstance, folder_id);\n\t// go through main logs and create a connnection to each spreadsheet\n\tlet pull_logs = main_logs.map(async (log, index) => {\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tlet pull_log_doc = new GoogleSpreadsheet(log.id);\n\t\t\t\tawait pull_log_doc.useServiceAccountAuth({\n\t\t\t\t\tclient_email: process.env.CLIENT_EMAIL,\n\t\t\t\t\tprivate_key: process.env.PRIVATE_KEY\n\t\t\t\t})\n\t\t\t\tawait pull_log_doc.loadInfo();\n\n\t\t\t\tmain_logs[index] = {\n\t\t\t\t\tname: log.name,\n\t\t\t\t\tparent_id: log.parents[log.parents.length - 1],\n\t\t\t\t\tdoc: pull_log_doc\n\t\t\t\t}\n\n\t\t\t\tresolve();\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t});\n\tawait Promise.all(pull_logs);\n\n\tlet doc = new GoogleSpreadsheet(mainlog_sheet_id);\n\tawait doc.useServiceAccountAuth({\n\t\tclient_email: process.env.CLIENT_EMAIL,\n\t\tprivate_key: process.env.PRIVATE_KEY\n\t});\n\tawait doc.loadInfo();\n\n\t// pull all of the data from the spreadsheet to then parse through and make a return object\n\tawait doc.sheetsByIndex[0].loadHeaderRow();\n\tif (doc.sheetsByIndex[0].headerValues[doc.sheetsByIndex[0].headerValues.length - 1] != \"Times\") await doc.sheetsByIndex[0].setHeaderRow([...doc.sheetsByIndex[0].headerValues, \"Times\"]);\n\tlet full_row_data = await doc.sheetsByIndex[0].getRows();\n\n\tlet frequency_position;\n\tfor (frequency_position = 0; frequency_position < full_row_data.length; frequency_position++) {\n\t\tif (full_row_data[frequency_position]._rawData[full_row_data[frequency_position]._rawData.length - 2] && edit_dist(full_row_data[frequency_position]._rawData[full_row_data[frequency_position]._rawData.length - 2], \"Frequency\") < 2)\n\t\t\tbreak;\n\t}\n\n\t// 1, 2, 3, 6, 7\n\tlet all_dates = [];\n\n\tlet daily_value = full_row_data[frequency_position + 3]._rawData[full_row_data[frequency_position + 3]._rawData.length - 1].toLowerCase().split(/[ :]+/);\n\tdaily_value[0] = daily_value[1] == \"pm\" ? parseInt(daily_value[0], 10) + 12 : parseInt(daily_value[0], 10) + 0;\n\tall_dates.daily = new Date(drive_date.getFullYear(), drive_date.getMonth(), drive_date.getDate(), daily_value[0]);\n\n\tweekly_value = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), daily_value[0]);\n\twhile (weekly_value.getDay() != 1) {\n\t\tweekly_value = new Date(weekly_value.getFullYear(), weekly_value.getMonth(), weekly_value.getDate() - 1, daily_value[0]);\n\t}\n\tall_dates.weekly = weekly_value;\n\n\t// get first week of this month\n\tlet monthly_value = new Date(moment(drive_date).day(full_row_data[frequency_position + 3]._rawData[full_row_data[frequency_position + 3]._rawData.length - 1]));\n\tmonthly_value = new Date(monthly_value.getFullYear(), monthly_value.getMonth(), Math.round((monthly_value.getDate() + 1) % 7), daily_value[0]);\n\n\tall_dates.monthly = monthly_value;\n\n\tlet season_date = drive_date;\n\tall_dates.seasonal = season(season_date, seasons);\n\t// // find what date season lines up\n\tlet temp_season = all_dates.seasonal;\n\twhile (all_dates.seasonal == temp_season) {\n\t\t// create a new date moved back\n\t\tseason_date = new Date(season_date.getFullYear(), season_date.getMonth(), season_date.getDate() - 1);\n\t\tall_dates.seasonal = season(season_date, seasons);\n\t}\n\tall_dates.seasonal = new Date(season_date.getFullYear(), season_date.getMonth(), season_date.getDate() + 1);\n\n\tfor (let days = 1; days < 8; days++) { // find first monday of year\n\t\tall_dates.annual = new Date(drive_date.getFullYear(), 0, days, daily_value[0]);\n\t\tif (all_dates.annual.getDay() == 1)\n\t\t\tbreak;\n\t}\n\tif (Sugar.Date.isFuture(all_dates.annual).raw) all_dates.annual = new Date(all_dates.annual.getFullYear() - 1, 0, all_dates.annual.getDay(), daily_value[0]);\n\n\tlet preharvest_date = Sugar.Date.create(full_row_data[frequency_position + 6]._rawData[full_row_data[frequency_position + 6]._rawData.length - 1]);\n\tpreharvest_date = new Date(preharvest_date.getFullYear() - 1, preharvest_date.getMonth(), preharvest_date.getDate(), daily_value[0]);\n\twhile (Sugar.Date.isFuture(preharvest_date).raw) {\n\t\tpreharvest_date = new Date(preharvest_date.getFullYear() - 1, preharvest_date.getMonth(), preharvest_date.getDate(), daily_value[0]);\n\t}\n\tall_dates.preharvest = preharvest_date;\n\tall_dates.deliverydays = full_row_data[frequency_position + 7]._rawData[full_row_data[frequency_position + 7]._rawData.length - 1].replace(/[ ]/g, \"\").split(\"and\");\n\n\t// find which delivery day is the most recent (past)\n\tlet recent = 0,\n\t\trecent_date = drive_date,\n\t\tcurr_date;\n\tall_dates.deliverydays.forEach((day, index) => {\n\t\tcurr_date = Sugar.Date.create(day);\n\t\tcurr_date = Sugar.Date(curr_date).isFuture().raw ? new Date(curr_date.getFullYear(), curr_date.getMonth(), curr_date.getDate() - 7, daily_value[0]) : curr_date;\n\t\tif (Sugar.Date(recent_date).isAfter(curr_date).raw && (Sugar.Date(curr_date).isAfter(all_dates.deliverydays[recent]).raw || index == 0)) {\n\t\t\trecent = index;\n\t\t\trecent_date = curr_date;\n\t\t};\n\t});\n\n\tall_dates.deliverydays = recent_date;\n\n\tObject.values(all_dates).forEach((item) => {\n\t\titem = new Date(item.getFullYear(), item.getMonth(), item.getDate(), item.getHours(), item.getMinutes() - item.getTimezoneOffset(), item.getSeconds());\n\t});\n\n\t// 1. daily = 0 ---- every day at 6am (weekends?)\n\t// 2. weekly = 1 ---- mondays at 6am\n\t// 3. monthly = 2 ---- first monday of month at 6am\n\t// 4. seasonal = 3 ---- start of new season (first monday of 6am)\n\t// 5. annual = 4 ---- first monday of new year at 6am\n\t// 6. preharvest = 5 ---- august 10th\n\t// 7. deliverydays = 6 ---- friday and monday at 6am\n\tlet all_sheet_logs = [],\n\t\tdata_keep = [];\n\tlet count = 0;\n\tlet row_awaiting = full_row_data.map((log_row, index) => {\n\t\t// first run through a separate data table and make sure we haven't seen this row before.\n\t\t// This is to ensure that were won't get stuck with mutliple values connected to the same sheet (possibly for different frequencies)\n\t\tif (!log_row._rawData[0] || !log_row._rawData[0].length || !log_row._rawData[2] || !log_row._rawData[2].length)\n\t\t\treturn;\n\n\t\tlet initial_string = log_row._rawData[0].split(\" \");\n\t\tlet check_rowNum = initial_string[0].length < 4 ?\n\t\t\t(initial_string[0] + initial_string[1]).toLowerCase().replace(/[^a-z0-9]/g, \"\") :\n\t\t\tinitial_string[0].toLowerCase().replace(/[^a-z0-9]/g, \"\");\n\t\tlet name_ofRow = initial_string[0].length < 4 ?\n\t\t\tinitial_string.splice(2).join(\" \").split(\".\")[0].toLowerCase() :\n\t\t\tinitial_string.splice(1).join(\" \").split(\".\")[0].toLowerCase();\n\t\tlet i;\n\t\tfor (i = 0; i < data_keep.length; i++) {\n\t\t\t// check our current row against any other rows\n\t\t\t// dist check on check_rowNum against data_keep[i][0] and name_ofRow against data_keep[i][1]\n\n\t\t\tif (Math.abs(check_rowNum.length - data_keep[i][0].length) <= 1 && (check_rowNum == data_keep[i][0] || edit_dist(check_rowNum, data_keep[i][0]) <= 1) &&\n\t\t\t\tMath.abs(name_ofRow.length - data_keep[i][1].length) <= 4 && (name_ofRow == data_keep[i][1] || edit_dist(name_ofRow, data_keep[i][1]) <= 4))\n\t\t\t\t// if this is true, than we've found a duplicate\n\t\t\t\tbreak;\n\t\t}\n\t\tif (data_keep.length && i != data_keep.length)\n\t\t\treturn; // we don't want this value\n\n\t\tdata_keep.push([check_rowNum, name_ofRow]);\n\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\t// run through all the log data\n\t\t\t// find the ones that have at least 3 items (meaning they have enough data to qualify)\n\t\t\tlog_row._rawData[2] = log_row._rawData[2].toLowerCase().replace(/[^a-z]/g, \"\");\n\t\t\t// find what log_row._rawData[2] (the frequency of submission) is closest to (fuzzy wuzzy it)\n\t\t\tlet status = false; // if they still need to turn it in\n\t\t\tlet temporary_item;\n\t\t\tlet lowest_fuzzy = 10000;\n\t\t\tObject.keys(frequency_ofSubmission).forEach((item) => {\n\t\t\t\t// compare item and see which we will choose\n\t\t\t\tlet distance = edit_dist(log_row._rawData[2], item);\n\t\t\t\tif (lowest_fuzzy > distance) {\n\t\t\t\t\ttemporary_item = item;\n\t\t\t\t\tlowest_fuzzy = distance;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlog_row._rawData[2] = temporary_item;\n\n\t\t\t// compare the modifed date with the files date\n\t\t\t// ^^ NEEDS rewriting: Go into the main_log folder (of that said folder, and grab the most recent row filled in\n\t\t\tlet return_file = find_id(root_files, log_row._rawData[0], log_row._rawData[2]);\n\t\t\tlet use_spreadsheet; // save the index of the spreadsheet we're using for this specific file\n\n\t\t\tmain_logs.forEach((log, log_index) => { // find the main log connected to this file\n\t\t\t\tif (log.parent_id == return_file[3]) {\n\t\t\t\t\tuse_spreadsheet = log_index;\n\t\t\t\t}\n\t\t\t});\n\t\t\t// go into this spreadsheet and look at each tab, find the one most closely resembling the tag-ids\n\t\t\tif (main_logs[use_spreadsheet] && return_file[0]) {\n\t\t\t\tawait new Promise((connection_promise) => {\n\t\t\t\t\tconnection.query(\"SELECT farmer_id, frequency FROM status WHERE file_id=? AND ignore_notifier=1\", return_file[0], async (err, ignore_count) => {\n\t\t\t\t\t\tif (err) console.error(err);\n\n\t\t\t\t\t\tif (ignore_count.length && Sugar.Date(new Date(drive_date.getFullYear(), drive_date.getMonth(), drive_date.getDate(), daily_value[0], 0, 0)).is(all_dates[ignore_count[0].frequency]).raw)\n\t\t\t\t\t\t\tstatus = true;\n\n\t\t\t\t\t\tlet ignore_notifier = ignore_count.length && !status ? 1 : 0;\n\n\t\t\t\t\t\t// find the correct index within the document - if we get to the end and still no position, it's a spreadsheet (same functional check, slightly different)\n\t\t\t\t\t\tlet spreadsheet_index_index = -1;\n\t\t\t\t\t\tif (return_file[1] == \"form\")\n\t\t\t\t\t\t\tfor (let run = 0; run < main_logs[use_spreadsheet].doc.sheetsByIndex.length; run++)\n\t\t\t\t\t\t\t\tif (edit_dist(log_row._rawData[0].toLowerCase().replace(/[^a-z0-9]/g, \"\").substring(0, 4), main_logs[use_spreadsheet].doc.sheetsByIndex[run]._rawProperties.title.toLowerCase().replace(/[^a-z0-9]/g, \"\").substring(0, 4)) < 2) {\n\t\t\t\t\t\t\t\t\tspreadsheet_index_index = run;\n\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// don't need to check if it's one of the following:\n\t\t\t\t\t\t/* onincident: 5,\n\t\t\t\t\t\t asneeded: 6,\n\t\t\t\t\t\t\tcorrectiveaction: 7,\n\t\t\t\t\t\t\triskassesment: 8 */\n\t\t\t\t\t\tlet frequency_numCheck = frequency_ofSubmission[log_row._rawData[2]];\n\t\t\t\t\t\tif (frequency_numCheck == 5 || frequency_numCheck == 6 || frequency_numCheck == 7 || frequency_numCheck == 8) {\n\t\t\t\t\t\t\tstatus = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (spreadsheet_index_index != -1) { // we can safely traverse the file and look for our date\n\t\t\t\t\t\t\t\tstatus = await check_status(main_logs, all_dates, log_row._rawData[2], use_spreadsheet, spreadsheet_index_index, index);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tstatus = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tall_sheet_logs[index] = {\n\t\t\t\t\t\t\tfile_name: log_row._rawData[0],\n\t\t\t\t\t\t\tfile_id: return_file[0],\n\t\t\t\t\t\t\tstatus: status,\n\t\t\t\t\t\t\tignore_notifier: ignore_notifier,\n\t\t\t\t\t\t\tfile_type: return_file[1],\n\t\t\t\t\t\t\tfrequency_ofSubmission: log_row._rawData[2],\n\t\t\t\t\t\t\tturn_in_date: all_dates[log_row._rawData[2]]\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn connection_promise();\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t} // otherwise do nothing\n\t\t\tresolve();\n\t\t});\n\t});\n\tawait Promise.all(row_awaiting);\n\treturn all_sheet_logs;\n}", "function generateReport(){\n\t//create reports folder (if it doesn't already exist)\n\tif(!fs.existsSync(\"reports\")){\n\t\tfs.mkdirSync(\"reports\");\n\t}\n\t\n\t//create a file called by timestamp\n\tvar date = new Date();\n\treportfile = \"reports/\"+date.getDate()+\"-\"+date.getMonth()+\"-\"+date.getFullYear()+\"--\"+date.getHours()+\"h\"+date.getMinutes()+\"m.tex\";\n\t\n\twriteReport();\n\tvar err = createPDF();\n\tif(err){\n\t\tconsole.log(\"ERR : Error during creation of PDF report\");\n\t}\n}", "parseReports() {\n fs.readdir(this._reports, (err, items) => {\n for (var i = 0; i < items.length; i++) {\n const fileContent = JSON.parse(fs.readFileSync(this._reports + '/' + items[i], 'utf8'));\n this.parseJSON(fileContent);\n };\n this.generateFinalReport();\n });\n }", "async function mainExport(report, project) {\n await Report.find({ _id: report._id })\n .populate(\"photos\")\n .exec(function (err, report) {\n\n //creating the outputs for the various arrays inside the report\n let purpose = report[0].purposeOfReview\n .map(note => `<li style=\"font-size:18px; margin-top:5px;\">${note}</li>`)\n .join(\"\");\n let deficiencies = report[0].deficienciesNoted\n .map(note => `<li style=\"font-size:18px; margin-top:5px;\">${note}</li>`)\n .join(\"\");\n let miscNotes = report[0].miscellaneousNotes\n .map(note => `<li style=\"font-size:18px; margin-top:5px;\">${note}</li>`)\n .join(\"\");\n let date = report[0].date;\n let time = report[0].time;\n let weather = report[0].weather;\n let reportNumber = report[0].reportNumber;\n let contractors = project.contractors;\n let projectNumber = project.projectNumber;\n let projectName = project.projectName;\n let location = project.location;\n\n let workCompleted = report[0].workCompleted\n .map(\n section =>\n `<li><h3 style='margin-bottom:5px;font-size:20px; text-transform: capitalize;'>${\n section.title\n }</h3><ul style='margin-top: 0; padding-left: 20px;'>${section.notes\n .map(\n note =>\n `<li style=\"font-size: 18px; font-weight:normal\">${note}</li>`\n )\n .join(\"\")}</ul></li>`\n )\n .join(\"\");\n\n const emailBody = `\n <section style='font-family: Arial, Helvetica, sans-serif; color:#202020'>\n <h1 style='margin-bottom: 0;font-size:25px;'>\n Site Visit Report ${reportNumber}\n </h1>\n <div>\n <table>\n <tbody>\n <tr>\n <td style='font-weight: 600; font-size:18px; text-align: right;'>Project:</td>\n <td style='font-size:18px;'>${projectName}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Location:</td>\n <td style='font-size:18px;'>${location}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Date:</td>\n <td style='font-size:18px;'>${date}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Time:</td>\n <td style='font-size:18px;'>${time}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Weather:</td>\n <td style='font-size:18px;'>${weather}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>File Number:</td>\n <td style='font-size:18px;'>${projectNumber}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Contractors:</td>\n <td style='font-size:18px;'>${contractors.join(\", \") ||\n \"Dale Shlass\"}</td>\n </tr>\n </tbody>\n </table>\n\n <section>\n <h2 style='font-size:22px; margin-bottom: 0; text-decoration: underline'>Purpose of Review</h2>\n <ul style='margin-top: 0; padding-left: 20px;'>\n ${purpose ||\n '<li style=\"font-size:18px; margin-top:5px;\">None noted.</li>'}\n </ul>\n </section>\n\n <section>\n <h2 style='font-size:22px; margin-bottom: 0; text-decoration: underline'>Deficiencies Noted</h2>\n <ul style='margin-top: 0; padding-left: 20px;'>\n ${deficiencies ||\n '<li style=\"font-size:18px; margin-top: 5px;\">None noted.</li>'}\n </ul>\n </section>\n\n <section>\n <h2 style=' font-size:22px; margin-bottom: 0; text-decoration: underline'>\n Work Underway/Completed\n </h2>\n ${\n workCompleted\n ? `<ol style='font-weight: 600; font-size: 20px;'>${workCompleted}<ol>`\n : '<ul style=\"margin-top: 0; padding-left: 20px;\"><li style=\"font-size:18px; margin-top: 5px;\">No work in progress at the time of site visit.</li></ul>'\n }\n </section>\n\n <section>\n <h2 style=' font-size:22px; margin-bottom: 0; text-decoration: underline'>Miscellaneous Notes</h2>\n <ul style='margin-top: 0; padding-left: 20px;'>\n ${miscNotes ||\n '<li style=\"font-size:18px; margin-top: 5px;\">None noted.</li>'}\n </ul>\n </section>\n </div>\n <section>\n <h2 style=' font-size:22px; margin-bottom: 0; text-decoration: underline'>Photos</h2>\n <p style='margin-top: 5px; font-size:18px;'>Please see attachments.</p>\n </section>\n <section>\n <p style=\"font-size: 18px; margin-bottom: 20px;\">Should you have any questions, please contact the undersigned.</p>\n <p style=\"font-size: 18px; margin-bottom: 20px;\">Site Assistant Built By:</p>\n <p style=\"font-size: 18px; margin-bottom: 5px;\">Dale Shlass, EIT</p>\n <p style=\"font-size: 18px; margin-bottom: 5px;margin-top: 0px;\">Web Developer</p>\n <a style=\"display: block;font-size: 18px;text-decoration: none;color: rgba(32, 32, 32, 1); \" href='tel:+14169187713'>416-918-7713</a>\n <a style=\"display: block;font-size: 18px;text-decoration: none;color: rgba(32, 32, 32, 1); margin-bottom: 5px;\" href='mailto:[email protected]'>[email protected]</a>\n <a style=\"display: block;font-size: 18px;text-decoration: none; margin-top: 10px;float: left; background: #0077B5;color: white;padding: 5px 20px;border-radius: 20px;\" href='https://www.linkedin.com/in/dshlass/'>LinkedIn</a>\n <a style=\"display: block;font-size: 18px;text-decoration: none; margin-top: 10px;float: left; border: 1px solid #24292E; background: #fff; color: #24292E; padding: 5px 20px; border-radius: 20px; margin-left: 40px;\" href='https://www.github.com/dshlass/'>GitHub</a>\n </section>\n </div>\n </section>`;\n\n let photoSection = [];\n\n for (let image of report[0].photos) {\n var base64data = Buffer.from(image.image, \"binary\").toString(\"base64\");\n photoSection.push({\n filename: `ReportPhoto.png`,\n content: base64data,\n encoding: \"base64\"\n });\n }\n\n var transporter = nodemailer.createTransport({\n service: \"gmail\",\n auth: {\n user: process.env.NODEMAIL_USER,\n pass: process.env.NODEMAIL_PASS\n }\n });\n\n console.log(transporter);\n\n let info = transporter.sendMail({\n from: `\"Site Assistant ✅\" <${process.env.NODEMAIL_USER}>`, // sender address\n to: `${project.recipients}`, // list of receivers\n subject: `${project.projectName} Site Visit ${[\"#\"].toString()}${\n report[0].reportNumber\n }`, // Subject line\n text: \"Your site report\", // plain text body\n html: emailBody,\n attachments: photoSection\n });\n\n console.log(\"Message sent to\", project.recipients.join(\" \"));\n });\n}", "function generaReportErm(){\n\t\n\twindow.location.href= \"/CruscottoAuditAtpoWebWeb/jsonATPO/getReportErmPDF\";\n\t\n}", "exportReport() {\n this.TestReportService.download(this.project.id, this.report.id);\n }", "function append_files_to_list(path, files) {\n var $list = $('#list');\n // Is it the last page of data?\n var is_lastpage_loaded = null === $list.data('nextPageToken');\n var is_firstpage = '0' == $list.data('curPageIndex');\n\n html = \"\";\n let targetFiles = [];\n for (i in files) {\n var item = files[i];\n var p = path + item.name + '/';\n if (item['size'] == undefined) {\n item['size'] = \"\";\n }\n\n item['modifiedTime'] = utc2beijing(item['modifiedTime']);\n item['size'] = formatFileSize(item['size']);\n if (item['mimeType'] == 'application/vnd.google-apps.folder') {\n html += `<a href=\"${p}\" class=\"list-group-item btn-outline-secondary\"><svg width=\"1.5em\" height=\"1.5em\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><linearGradient id=\"WQEfvoQAcpQgQgyjQQ4Hqa\" x1=\"24\" x2=\"24\" y1=\"6.708\" y2=\"14.977\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#eba600\"></stop><stop offset=\"1\" stop-color=\"#c28200\"></stop></linearGradient><path fill=\"url(#WQEfvoQAcpQgQgyjQQ4Hqa)\" d=\"M24.414,10.414l-2.536-2.536C21.316,7.316,20.553,7,19.757,7L5,7C3.895,7,3,7.895,3,9l0,30\tc0,1.105,0.895,2,2,2l38,0c1.105,0,2-0.895,2-2V13c0-1.105-0.895-2-2-2l-17.172,0C25.298,11,24.789,10.789,24.414,10.414z\"></path><linearGradient id=\"WQEfvoQAcpQgQgyjQQ4Hqb\" x1=\"24\" x2=\"24\" y1=\"10.854\" y2=\"40.983\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#ffd869\"></stop><stop offset=\"1\" stop-color=\"#fec52b\"></stop></linearGradient><path fill=\"url(#WQEfvoQAcpQgQgyjQQ4Hqb)\" d=\"M21.586,14.414l3.268-3.268C24.947,11.053,25.074,11,25.207,11H43c1.105,0,2,0.895,2,2v26\tc0,1.105-0.895,2-2,2H5c-1.105,0-2-0.895-2-2V15.5C3,15.224,3.224,15,3.5,15h16.672C20.702,15,21.211,14.789,21.586,14.414z\"></path></svg> ${item.name}<span class=\"badge\"> ${item['size']}</span><span class=\"badge\">${item['modifiedTime']}</span></a>`;\n } else {\n var p = path + item.name;\n const filepath = path + item.name;\n var c = \"file\";\n // README is displayed after the last page is loaded, otherwise it will affect the scroll event\n if (is_lastpage_loaded && item.name == \"README.md\") {\n get_file(p, item, function(data) {\n markdown(\"#readme_md\", data);\n });\n }\n if (item.name == \"HEAD.md\") {\n get_file(p, item, function(data) {\n markdown(\"#head_md\", data);\n });\n }\n var ext = p.split('.').pop().toLowerCase();\n if (\"|html|php|css|go|java|js|json|txt|sh|md|mp4|webm|avi|bmp|jpg|jpeg|png|gif|m4a|mp3|flac|wav|ogg|mpg|mpeg|mkv|rm|rmvb|mov|wmv|asf|ts|flv|pdf|\".indexOf(`|${ext}|`) >= 0) {\n targetFiles.push(filepath);\n p += \"?a=view\";\n c += \" view\";\n }\n html += `<a href=\"${p}\" class=\"list-group-item btn-outline-secondary\"><svg width=\"1.5em\" height=\"1.5em\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><path fill=\"#50e6ff\" d=\"M39,16v25c0,1.105-0.895,2-2,2H11c-1.105,0-2-0.895-2-2V7c0-1.105,0.895-2,2-2h17L39,16z\"></path><linearGradient id=\"F8F33TU9HxDNWNbQYRyY3a\" x1=\"28.529\" x2=\"33.6\" y1=\"15.472\" y2=\"10.4\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#3079d6\"></stop><stop offset=\"1\" stop-color=\"#297cd2\"></stop></linearGradient><path fill=\"url(#F8F33TU9HxDNWNbQYRyY3a)\" d=\"M28,5v9c0,1.105,0.895,2,2,2h9L28,5z\"></path></svg> ${item.name}<span class=\"badge\"> ${item['size']}</span><span class=\"badge\">${item['modifiedTime']}</span></a>`;\n }\n }\n\n /*let targetObj = {};\n targetFiles.forEach((myFilepath, myIndex) => {\n if (!targetObj[myFilepath]) {\n targetObj[myFilepath] = {\n filepath: myFilepath,\n prev: myIndex === 0 ? null : targetFiles[myIndex - 1],\n next: myIndex === targetFiles.length - 1 ? null : targetFiles[myIndex + 1],\n }\n }\n })\n // console.log(targetObj)\n if (Object.keys(targetObj).length) {\n localStorage.setItem(path, JSON.stringify(targetObj));\n // console.log(path)\n }*/\n\n if (targetFiles.length > 0) {\n let old = localStorage.getItem(path);\n let new_children = targetFiles;\n // Reset on page 1; otherwise append\n if (!is_firstpage && old) {\n let old_children;\n try {\n old_children = JSON.parse(old);\n if (!Array.isArray(old_children)) {\n old_children = []\n }\n } catch (e) {\n old_children = [];\n }\n new_children = old_children.concat(targetFiles)\n }\n\n localStorage.setItem(path, JSON.stringify(new_children))\n }\n\n // When it is page 1, remove the horizontal loading bar\n $list.html(($list.data('curPageIndex') == '0' ? '' : $list.html()) + html);\n // When it is the last page, count and display the total number of items\n if (is_lastpage_loaded) {\n $('#count').removeClass('mdui-hidden').find('.number').text($list.find('li.mdui-list-item').length);\n }\n}", "function publishFilesInThisFolder(folderURI)\n{\t\n\tvar indexOfLastBackslash = folderURI.lastIndexOf(\"/\");\n\t\n\tif(indexOfLastBackslash != -1){\n\t\tvar shortFolderName = folderURI.substring(indexOfLastBackslash + 1, folderURI.length);\n\n\t\t//Don't process this folder if it is a hidden folder\n\t\tif(shortFolderName.charAt(0) != \".\"){\n\t\t\t\n\t\t\t//don't process this folder if it is in the folder blacklist\n\t\t\tif(blacklistedFolderNamesAr.indexOf(shortFolderName) == -1){\n\t\t\t\tvar fileURI;\n\t\t\t\tvar shortFileName;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// e.g. arena-lobby.fla\t\t\t\t\t\t\n\t\t\t\tvar fileExtension;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// e.g. arena-lobby.fla -> .fla\n\t\t\t\tvar fileMask = \"*.fla\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Only files that contain this mask will be considered\n\t\t\t\tvar filesInThisFolderAr = FLfile.listFolder(folderURI + \"/\" + fileMask, \"files\");\t\n\t\t\t\tvar numFilesinThisFolder = filesInThisFolderAr.length;\n\n\t\t\t\tfor(var i = 0; i < numFilesinThisFolder; i++){\n\t\t \t\t\tshortFileName = filesInThisFolderAr[i]; \n\t\t\t\t\t\n\t\t\t\t\t//If this file is not a hidden file and is not a blacklisted files\n\t\t\t\t\tif(shortFileName.charAt(0) != \".\" && blacklistedFileNamesAr.indexOf(shortFileName) == -1){\n\t\t\t\t\t\n\t\t\t\t\t\tfileURI = folderURI + \"/\" + shortFileName;\n\n\t\t\t\t\t\tfl.openDocument(fileURI);\n\t\t\t\t\t\tvar DOM = fl.getDocumentDOM();\n\t\t\t\t\t\tvar publishSuccess = publish(DOM, logURI);\n\n\t\t\t\t\t\tif(!publishSuccess){\n\t\t\t\t\t\t\talert(\"Failed to publish \" + shortFileName + \"!\");\n\t\t\t\t\t\t\tfl.trace(\"Failed to publish \" + shortFileName + \"!\\n Checking the errors.txt log for more details...\\n\\n\" + FLfile.read(errorsURI) + \"\\n-------------------------------------------------------------------\\n\");\n\t\t\t\t\t\t\tfailedURI = fileURI;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsuccessLog += (\"published : \" + shortFileName + \"\\n\");\n\t\t\t\t\t\tDOM.close(false);\t//false tells it to not prompt the user to save changes\n\t\t\t\t\t}\n\t\t\t\t} \n\n\t\t\t\tvar foldersInThisFolderAr = FLfile.listFolder(folderURI, \"directories\");\n\t\t\t\tvar numOfFoldersInThisFolder = foldersInThisFolderAr.length;\n\t\t\t\tvar allSubfoldersSuccess = true;\n\t\t\t\tfor(var j = 0; j < numOfFoldersInThisFolder; j++){\n\t\t\t\t\tallSubfoldersSuccess = publishFilesInThisFolder(folderURI + \"/\" + foldersInThisFolderAr[j]);\n\t\t\t\t\tif(! allSubfoldersSuccess){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "downloadFiles(param) {\n let auth = this.auth;\n if (typeof param != \"undefined\") {\n console.error(`This function does not take any parameter`);\n return;\n }\n const drive = google.drive({ version: 'v3', auth });\n drive.files.list({\n pageSize: 10,\n fields: 'nextPageToken, files(id, name)',\n }, (err, res) => {\n if (err) return console.log('The API returned an error: ' + err);\n const files = res.data.files;\n if (files.length) {\n files.map((file) => {\n downloadFile(file.id);\n });\n } else {\n console.log('No files found.');\n }\n });\n }", "function append_search_result_to_list(files) {\n var cur = window.current_drive_order || 0;\n var $list = $('#list');\n // Is it the last page of data?\n var is_lastpage_loaded = null === $list.data('nextPageToken');\n // var is_firstpage = '0' == $list.data('curPageIndex');\n\n html = \"\";\n\n for (i in files) {\n var item = files[i];\n var p = '/' + cur + ':/' + item.name + '/';\n if (item['size'] == undefined) {\n item['size'] = \"\";\n }\n\n item['modifiedTime'] = utc2beijing(item['modifiedTime']);\n item['size'] = formatFileSize(item['size']);\n if (item['mimeType'] == 'application/vnd.google-apps.folder') {\n html += `<a onclick=\"onSearchResultItemClick(this)\" id=\"${item['id']}\" class=\"list-group-item btn-outline-secondary\"><svg width=\"1.5em\" height=\"1.5em\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><linearGradient id=\"WQEfvoQAcpQgQgyjQQ4Hqa\" x1=\"24\" x2=\"24\" y1=\"6.708\" y2=\"14.977\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#eba600\"></stop><stop offset=\"1\" stop-color=\"#c28200\"></stop></linearGradient><path fill=\"url(#WQEfvoQAcpQgQgyjQQ4Hqa)\" d=\"M24.414,10.414l-2.536-2.536C21.316,7.316,20.553,7,19.757,7L5,7C3.895,7,3,7.895,3,9l0,30\tc0,1.105,0.895,2,2,2l38,0c1.105,0,2-0.895,2-2V13c0-1.105-0.895-2-2-2l-17.172,0C25.298,11,24.789,10.789,24.414,10.414z\"></path><linearGradient id=\"WQEfvoQAcpQgQgyjQQ4Hqb\" x1=\"24\" x2=\"24\" y1=\"10.854\" y2=\"40.983\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#ffd869\"></stop><stop offset=\"1\" stop-color=\"#fec52b\"></stop></linearGradient><path fill=\"url(#WQEfvoQAcpQgQgyjQQ4Hqb)\" d=\"M21.586,14.414l3.268-3.268C24.947,11.053,25.074,11,25.207,11H43c1.105,0,2,0.895,2,2v26\tc0,1.105-0.895,2-2,2H5c-1.105,0-2-0.895-2-2V15.5C3,15.224,3.224,15,3.5,15h16.672C20.702,15,21.211,14.789,21.586,14.414z\"></path></svg> ${item.name}<span class=\"badge\"> ${item['size']}</span><span class=\"badge\">${item['modifiedTime']}</span></a>`;\n } else {\n var p = '/' + cur + ':/' + item.name;\n var c = \"file\";\n var ext = item.name.split('.').pop().toLowerCase();\n if (\"|html|php|css|go|java|js|json|txt|sh|md|mp4|webm|avi|bmp|jpg|jpeg|png|gif|m4a|mp3|flac|wav|ogg|mpg|mpeg|mkv|rm|rmvb|mov|wmv|asf|ts|flv|\".indexOf(`|${ext}|`) >= 0) {\n p += \"?a=view\";\n c += \" view\";\n }\n html += `<a onclick=\"onSearchResultItemClick(this)\" id=\"${item['id']}\" gd-type=\"${item.mimeType}\" class=\"list-group-item btn-outline-secondary\"><svg width=\"1.5em\" height=\"1.5em\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><path fill=\"#50e6ff\" d=\"M39,16v25c0,1.105-0.895,2-2,2H11c-1.105,0-2-0.895-2-2V7c0-1.105,0.895-2,2-2h17L39,16z\"></path><linearGradient id=\"F8F33TU9HxDNWNbQYRyY3a\" x1=\"28.529\" x2=\"33.6\" y1=\"15.472\" y2=\"10.4\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#3079d6\"></stop><stop offset=\"1\" stop-color=\"#297cd2\"></stop></linearGradient><path fill=\"url(#F8F33TU9HxDNWNbQYRyY3a)\" d=\"M28,5v9c0,1.105,0.895,2,2,2h9L28,5z\"></path></svg> ${item.name}<span class=\"badge\"> ${item['size']}</span><span class=\"badge\">${item['modifiedTime']}</span></a>`;\n }\n }\n\n // When it is page 1, remove the horizontal loading bar\n $list.html(($list.data('curPageIndex') == '0' ? '' : $list.html()) + html);\n // When it is the last page, count and display the total number of items\n if (is_lastpage_loaded) {\n $('#count').removeClass('mdui-hidden').find('.number').text($list.find('li.mdui-list-item').length);\n }\n}", "function downloadFolder(iFolder , iCourse){\n //create the array of files to download\n var aIds = new Array();\n aIds[0] = iFolder;\n \n \n \n //download the files\n ksDownloadFiles([] , aIds , iCourse);\n \n \n}", "function generateTestReport() {\n var fileName = 'FileSystem - Report.pdf';\n FileMapper.clearAllMappingsInConfig();\n Workbook.setActiveWorkbookPath('c:\\\\user\\\\desktop');\n QUnit.load(testFunctions);\n // Run tests and generate html output\n var htmlOutput = QUnit.getHtml();\n htmlOutput.setWidth(1200);\n htmlOutput.setHeight(800);\n // Display test results\n SpreadsheetApp.getUi().showModalDialog(htmlOutput, fileName);\n // Save test results in Google Drive\n var blob = htmlOutput.getBlob();\n var pdf = blob.getAs('application/pdf');\n DriveApp.createFile(pdf).setName(fileName);\n}", "function main(bucketName = 'my-bucket', folderName = 'my-folder') {\n // [START storage_download_folder_transfer_manager]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The ID of your GCS bucket\n // const bucketName = 'your-unique-bucket-name';\n\n // The ID of the GCS folder to download. The folder will be downloaded to the local path of the executing code.\n // const folderName = 'your-folder-name';\n\n // Imports the Google Cloud client library\n const {Storage, TransferManager} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n\n // Creates a transfer manager client\n const transferManager = new TransferManager(storage.bucket(bucketName));\n\n async function downloadFolderWithTransferManager() {\n // Downloads the folder\n await transferManager.downloadManyFiles(folderName);\n\n console.log(\n `gs://${bucketName}/${folderName} downloaded to ${folderName}.`\n );\n }\n\n downloadFolderWithTransferManager().catch(console.error);\n // [END storage_download_folder_transfer_manager]\n}", "function report(res) {\n if (res) {\n tree[id].push(res);\n }\n nextItemIndex++;\n if (nextItemIndex === length) {\n path.pop();\n callback(tree);\n } else {\n iterator(folder.children[nextItemIndex], report);\n }\n }", "function exportLocationToDOCX() {\n\tdoLocationCustomExport(Ab.grid.ReportGrid.WORKFLOW_RULE_DOCX_REPORT, 'docx');\n}", "download (token, urn, directory) {\n\n var promise = new Promise((resolve, reject) => {\n\n mkdirp(directory, (error) => {\n\n if (error) {\n\n reject(error)\n\n } else {\n\n async.waterfall([\n\n (callback) => {\n\n this.parseViewable(token, directory, urn, true, callback)\n },\n\n (items, callback) => {\n\n this.downloadItems(token, items, directory, 10, callback)\n },\n\n (items, callback) => {\n\n this.parseManifest(items, callback)\n },\n\n (uris, callback) => {\n\n this.downloadItems(token, uris, directory, 10, callback)\n }\n ],\n\n (wfError, items) => {\n\n if (wfError) {\n\n reject(wfError)\n\n } else {\n\n this.readDir(directory).then((files) => {\n\n resolve(files)\n })\n }\n })\n }\n })\n })\n\n return promise\n }", "function writeAppSpecificBucketReport(elem, event) {\n var spinner = $('#presentation_job_spinner');\n $(spinner).show();\n var isLeafletImageSafeBrowser = true; // isLeafletImageEnabledBrowser();\n var imagesContainer = {};\n var appSpecificBuckets = $('div.app-specific-bucket');\n var totalImageCount = appSpecificBuckets.length;\n var showMapBuckets = false;\n PageNavReportingConfig.capturedCount = 0;\n\n // collect all app-specific buckets' properties\n $(appSpecificBuckets).each(function (n) {\n var bucketElement = $(this).parent('.bucket-process');\n var bucketId = $(bucketElement).attr('id');\n var bucketTitle = $(bucketElement).children('h2')[0].innerHTML;\n var isMap = false;\n\n if ($(bucketElement).find('.pgnav-map').length > 0) {\n showMapBuckets = true;\n isMap = true;\n }\n\n imagesContainer[bucketId] = {\n index: n,\n title: bucketTitle,\n isMapBucket: isMap,\n images: {}\n };\n });\n\n // open the app-specific buckets in a dialog if\n // 1) the collection includes a map bucket;\n // 2) the browser is IE > 10, or FF/Chrome/Safari\n if (showMapBuckets && isLeafletImageSafeBrowser && PageNavReportingConfig.includeMapBuckets) {\n $(spinner).hide();\n openAppSpecificReportDialog();\n }\n // else capture all non-map buckets\n else {\n captureReportImages(imagesContainer, totalImageCount);\n }\n}", "async function weeklyReports(){\n // github.fetchData();\n var orgList = await db.listAllOrgId();\n for (var org_id of orgList) {\n var reportLinks = await report.generateReportLinks(org_id);\n // console.log(reportLinks);\n // Send report links\n for (var user in reportLinks) {\n await mattermost.postReports(config.incoming_webhook_url, '@' + user, reportLinks[user]);\n }\n }\n // schedule.scheduleJob('0 56 0 * * 5', async function() {\n // console.log('scheduleCronstyle:' + new Date());\n // // // fetch data from github and store into db\n // await github.fetchData();\n // });\n //\n // schedule.scheduleJob('0 56 0 * * 5', async function() {\n // // generate all weekly reports\n // var orgList = db.listAllOrgId();\n // for (var org_id of orgList) {\n // var reportLinks = report.generateReportLinks(org_id);\n // // console.log(reportLinks);\n // // Send report links\n // for (var user in reportLinks) {\n // mattermost.postReports(config.incoming_webhook_url, '@' + user, reportLinks[user]);\n // }\n // }\n // });\n }", "function createPdfForEachProject(dirName, data) {\n var headers = createHeaders([\"name\", \"link\"]);\n\n var doc = new jsPDF({ putOnlyUsedFonts: true, orientation: \"landscape\" });\n doc.table(1, 1, data.issues, headers);\n doc.save(`./${dirName}/${data.name}.pdf`);\n}", "function createGoogleURL(id){ \n return \"https://drive.google.com/file/d/\" + id + \"/view\";\n }", "function listFolderChildren() {\n const method = 'GET';\n const endpoint = baseUrl + 'api/v0/google/drive/Mod7SourceDocs';\n xhrCall(method, null, endpoint, listFolderChildrenOk, handlerFail);\n appendFeedback('Retrieving list of files to copy');\n}", "function generateReportPDF(absentWorkers, lateWorkers, activeHoursForWorkers, inactiveHoursForWorkers, siteName, clientName) {\n\tabsentWorkers.map(e => delete e.siteDetail);//no needed\n\tlet data = { absentWorkers, lateWorkers, activeHoursForWorkers, inactiveHoursForWorkers };\n\n\tlet day = new Date();\n\tlet fileName = day.getDate() + \"-\" + monthNames[(day.getMonth())] + \"-\" + day.getFullYear();\n\tconst dir = `${global.__base}/reports/${clientName}`;\n\tconst fullPath = `${dir}/${siteName}-${fileName}.json`\n\tif (!fs.existsSync(dir)) {\n\t\tfs.mkdirSync(dir, { recursive: true });\n\t}\n\tfs.writeFile(fullPath, JSON.stringify(data, null, 4), (err) => {\n\t\tif (err) console.log(err);\n\t\telse console.log(`Report Generated ${global.__base}/reports/${siteName}-${fileName}.json`);\n\t}); //enhancemt for JasperReport PDF\n}", "function doFolder(id, sharePublically) {\n var itunesNs = XmlService.getNamespace('itunes', 'http://www.itunes.com/dtds/podcast-1.0.dtd')\n var folder = DriveApp.getFolderById(id);\n var channel = XmlService.createElement('channel');\n var title = XmlService.createElement('title').setText(folder.getName());\n channel.addContent(title);\n // TODO: remove\n var subTitle = XmlService.createElement('subtitle', itunesNs)\n .setText('Generated by drive-podcast');\n channel.addContent(subTitle);\n \n var files = getAudioVideoFiles(folder);\n \n files.forEach(function(file, idx) {\n var item = XmlService.createElement('item');\n var title = XmlService.createElement('title').setText(file.getName().replace(/\\..*?$/, ''));\n item.addContent(title);\n var pubDate = XmlService.createElement('pubDate').setText(indexToFakeDate(idx));\n item.addContent(pubDate);\n var enclosure = XmlService.createElement('enclosure');\n var url = sharePublically ? getPublicUrl(folder, file) : getSharedUrl(file);\n enclosure.setAttribute('url', url);\n enclosure.setAttribute('length', file.getSize());\n enclosure.setAttribute('type', file.getMimeType());\n item.addContent(enclosure);\n channel.addContent(item);\n });\n \n var rss = XmlService.createElement('rss').setAttribute('version', '2.0');\n rss.addContent(channel);\n var outText = XmlService.getPrettyFormat().format(XmlService.createDocument(rss));\n \n var trashFiles = folder.getFilesByName(OUTPUT_FILE_NAME);\n while (trashFiles.hasNext()) {\n trashFiles.next().setTrashed(true);\n }\n \n var outFile = writeOutput(folder, outText);\n \n // set sharing permissions\n // TODO: do something smarter based on the folder's current permissions\n if (sharePublically) {\n folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.VIEW);\n } else {\n folder.setSharing(DriveApp.Access.ANYONE_WITH_LINK, DriveApp.Permission.VIEW);\n }\n \n return sharePublically ? getPublicUrl(folder, outFile) : getSharedUrl(outFile);\n}", "static async all(directory) {\n\n\t\tlet path = `${config.api}/directories/${directory}/documents`;\n\n\t\ttry {\n\n\t\t\tlet response = await fetch(path, {headers: store.state.auth.authHeader()});\n\n\t\t\t// if the api responds with a 404 we'll display a special\n\t\t\t// error page so handle that separately\n\t\t\tif (response.status == 404) {\n\t\t\t\tconsole.warn(`directory ${directory} not found`);\n\t\t\t\tstore.state.documents = null;\n\t\t\t\treturn;\n\t\t\t} else if (!checkResponse(response.status)) {\n\t\t\t\t// something more serious has happend, abort!\n\t\t\t\tthrow(response);\n\t\t\t};\n\n\t\t\tlet json = await response.json();\n\n\t\t\t// if we have the metadata, set up the ActiveDirectory\n\t\t\tif (json.info) {\n\t\t\t\tlet dir = new CMSDirectory(\n\t\t\t\t\tdirectory,\n\t\t\t\t\tjson.info.title,\n\t\t\t\t\tjson.info.description,\n\t\t\t\t\tjson.info.body,\n\t\t\t\t\tjson.info.html\n\t\t\t\t);\n\t\t\t\tstore.commit(\"setActiveDirectory\", dir);\n\t\t\t};\n\n\t\t\t// map documents\n\t\t\tlet docs = json.files.map((file) => {\n\t\t\t\treturn new CMSFile(file);\n\t\t\t});\n\n\t\t\tstore.state.documents = docs;\n\t\t\treturn response;\n\n\t\t}\n\t\tcatch(err) {\n\t\t\tconsole.error(`Couldn't retrieve files from directory ${directory}`);\n\t\t};\n\n\t}", "async function main() {\n const children = await readdir(apiPath);\n const dirs = children.filter(x => {\n return !x.endsWith('.ts') && !x.includes('compute');\n });\n const contents = nunjucks.render(templatePath, { apis: dirs });\n await writeFile(indexPath, contents);\n const q = new p_queue_1.default({ concurrency: 50 });\n console.log(`Generating docs for ${dirs.length} APIs...`);\n let i = 0;\n const promises = dirs.map(dir => {\n return q\n .add(() => execa(process.execPath, [\n '--max-old-space-size=8192',\n './node_modules/.bin/compodoc',\n `src/apis/${dir}`,\n '-d',\n `./docs/${dir}`,\n ]))\n .then(() => {\n i++;\n console.log(`[${i}/${dirs.length}] ${dir}`);\n });\n });\n await Promise.all(promises);\n}", "function downloadFiles(auth, param) {\n if (typeof param != \"undefined\") {\n console.error(`This function does not take any parameter`);\n return;\n }\n const drive = google.drive({ version: 'v3', auth });\n drive.files.list({\n pageSize: 10,\n fields: 'nextPageToken, files(id, name)',\n }, (err, res) => {\n if (err) return console.log('The API returned an error: ' + err);\n const files = res.data.files;\n if (files.length) {\n files.map((file) => {\n downloadFile(auth, file.id);\n });\n } else {\n console.log('No files found.');\n }\n });\n}", "function AbExportAll()\n{\n let directories = MailServices.ab.directories;\n\n while (directories.hasMoreElements()) {\n let directory = directories.getNext();\n // Do not export LDAP ABs.\n if (directory.URI.startsWith(kLdapUrlPrefix))\n continue;\n\n AbExport(directory.URI);\n }\n}", "function createReports() {\r\n var RawDataReport = AdWordsApp.report(\"SELECT Domain, Clicks \" + \"FROM AUTOMATIC_PLACEMENTS_PERFORMANCE_REPORT \" + \"WHERE Clicks > 0 \" + \"AND Conversions < 1 \" + \"DURING LAST_7_DAYS\");\r\n RawDataReport.exportToSheet(RawDataReportSheet);\r\n}", "function hootsuite_saveAsCSV() {///yeah, this doesn't work\n //the developer got this from: https://gist.github.com/mderazon/9655893\n\n ////Hey Chad, do you need this in drive or can it download to your local system when you need it?\n //why not link to the download url instead? show link in a madal window\n //uses the doc name - sheet name\n //Utilities.formatString('https://docs.google.com/spreadsheets/d/%s/export?format=%s&gid=%s', sheet.getParent().getId(), 'csv', sheet.getSheetId())//csv|pdf|odt|doc\n \n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheets = ss.getSheets();\n var folder = DriveApp.getFoldersByName(\"My Drive\");//or specify a folder/fodlername in config and use that\n for (var i in sheets.length) {//this will create a file for each sheet but they all have the same name, derp\n var sheet = sheets[i];\n var fileName = 'Upload to Hootsuite.csv';// don't forget the .csv extension\n var csvFile = convertRangeToCsvFile_(sheet);// convert all available sheet data to csv format\n DriveApp.createFile(fileName, csvFile);// create a file in the Docs List with the given name and the csv data\n }\n Browser.msgBox(\"File has been saved to Google Drive as '\" + fileName + \"'\");///this should supply a link, use a modal\n}", "function report(REPORT_NAME,spreadSheet,COLUMN_NAMES,REPORT_TYPE){\r\n var ACCOUNT = ['463-431-6322']; // comma delimited, single quoted list of account ids from Adwords (not the account names)\r\n var FILTER = \"Impressions > 0\"; \r\n var DATE_RANGE = \"LAST_30_DAYS\"; \r\n var column = COLUMN_NAMES.split(\",\"); \r\n \r\n var accountIterator = MccApp.accounts().withIds(ACCOUNT).get();; \r\n while (accountIterator.hasNext()) { \r\n var account = accountIterator.next(); \r\n MccApp.select(account); \r\n \r\n var mccSheet = spreadSheet.getActiveSheet();\r\n mccSheet.setName(account.getName()); //renames active sheet to account name\r\n mccSheet.clear(); \r\n mccSheet.appendRow(column); \r\n var adwordsSheet = spreadSheet.insertSheet();\r\n\r\n Logger.log(\"Checking for existing file\");\r\n \r\n Logger.log(\"Querying data for \" + account.getName()); \r\n \r\n var REPORT = AdWordsApp.report(\r\n 'SELECT ' + COLUMN_NAMES + \r\n ' FROM ' + REPORT_TYPE + \r\n ' WHERE ' + FILTER + ' DURING ' + DATE_RANGE\r\n ); \r\n\r\n REPORT.exportToSheet(adwordsSheet); \r\n adwordsSheet.deleteRow(1); \r\n var rowNumber = adwordsSheet.getLastRow(); \r\n var rangeToCopy = adwordsSheet.getDataRange(); \r\n mccSheet.insertRowAfter(mccSheet.getLastRow());\r\n rangeToCopy.copyTo(mccSheet.getRange(mccSheet.getLastRow() + 1, 1)); \r\n Logger.log(\"Data successfully added to file (\" + rowNumber + \" rows)\" + account.getCustomerId());\r\n } \r\n spreadSheet.deleteSheet(adwordsSheet); \r\n Logger.log(\"File update complete (\" + (mccSheet.getLastRow()-1) + \" rows) \" + spreadSheet.getUrl());\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n}", "function exportProgramReports( programInstanceId, type )\r\n{\r\n\twindow.location.href='getProgramReportHistory.action?programInstanceId=' + programInstanceId + \"&type=\" + type;\r\n}", "function createGoogleDriveFolderDA(id) {\n try {\n var folderProcessAchat = DriveApp.getFolderById(GOOGLEDRIVE_PROCACHAT_ID);\n var folder_dest = folderProcessAchat.getFoldersByName(id);\n\n /* Verification de l'existence du dossier destination */\n if(!folder_dest.hasNext()){\n folder_dest = folderProcessAchat.createFolder(id);\n } else folder_dest = folder_dest.next();\n // Ajout des droits d'ecriture de l'ensemble des acteurs sur le Google Drive de la DA\n folder_dest.addEditors(getListUserAuthorized());\n return folder_dest.getUrl();\n } catch(e){\n e = (typeof e === 'string') ? new Error(e) : e;\n Log_Severe(\"createGoogleDriveFolderDA\", Utilities.formatString(\"%s %s (line %s, file '%s'). Stack: '%s' . While processing %s.\",e.name||'',e.message||'',e.lineNumber||'',e.fileName||'', e.stack||'', e.processMessage||''));\n throw e;\n }\n}", "function main() {\n const allResults = [];\n fs.readdirSync(constants.OUT_PATH).forEach(siteDir => {\n const sitePath = path.resolve(constants.OUT_PATH, siteDir);\n if (!utils.isDir(sitePath)) {\n return;\n }\n allResults.push({site: siteDir, results: analyzeSite(sitePath)});\n });\n const generatedResults = groupByMetrics(allResults);\n fs.writeFileSync(\n GENERATED_RESULTS_PATH,\n `var generatedResults = ${JSON.stringify(generatedResults)}`\n );\n console.log('Opening the charts web page...'); // eslint-disable-line no-console\n opn(path.resolve(__dirname, 'index.html'));\n}", "function AbExportAll() {\n for (let directory of MailServices.ab.directories) {\n // Do not export LDAP ABs.\n if (!directory.URI.startsWith(kLdapUrlPrefix)) {\n AbExport(directory.URI);\n }\n }\n}", "function exportRoomStandardToDOCX() {\n\tdoRoomStandardCustomExport(Ab.grid.ReportGrid.WORKFLOW_RULE_DOCX_REPORT, 'docx');\n}", "function getDownloadLinks(){\n var files = DriveApp.getFiles(),\n file;\n while (files.hasNext()) {\n file = files.next();\n //replacement is to overcome bug https://code.google.com/p/google-apps-script-issues/issues/detail?id=3794\n Logger.log(file.getDownloadUrl().replace('&gd=true',''));\n }\n}", "function makeFilename(chart_string){\n var date = dateFormat(Date.now(), \"isoDateTime\");\n return \"ResearchPortal_NonSponsoredProject_\" + (chart_string || \"report\") + \".\" + date + \".xlsx\";\n }", "function makeFilename(project_id){\n var date = dateFormat(Date.now(), \"isoDateTime\");\n return \"ResearchPortal_SponsoredProject_\" + (project_id || \"report\") + \".\" + date + \".xlsx\";\n }", "function convert() {\n // var myapp = UiApp.createApplication().setTitle(appName);\n // var mypanel = myapp.createVerticalPanel();\n // myapp.add(mypanel);\n Logger.clear()\n //function to remove old copies of a file in the folder.\n var removeOldCopies = function(dir, fl){\n //ERROR: for some reason gives error as 'getFilesByName is not a function of Folder Class' despite being in the API documentation\n /*var fileList = dir.getFilesByName(fl);\n while(fileList.hasNext()){\n fileList.next().setTrashed(true);\n }*/\n }\n// try {\n var processedJSON = XLSXConverter.processJSONWorkbook(workbookToJson());\n _.each(XLSXConverter.getWarnings(), function(warning) {\n //TODO: Add option to parse the warnings and error strings,\n // and highlight the rows with errors.\n mypanel.add(myapp.createHTML(\"Warning: \" + warning));\n });\n\n //open the correct folder and make sure it has the correct subdirectories\n var folder = DocsList.getFolderById(\"0BxQdlH5mVj3PfkxnZmV2WHZTZ2k2c0dTNTNxSlc3OGR5bTY5eGl3Q2ZDR3gtVkUxYzlVUGs\");\n var now = new Date().toJSON().replace(/:/g,\".\");\n folder = folder.createFolder(\"forms_\"+now);\n var optionsFldr, schemaFldr, file;\n /*var subDir = folder.getFolders();\n for(var k=0;k<subDir.length;k++){\n var fldr = subDir[k];\n if(fldr.getName() == \"schema\"){\n schemaFldr = fldr;\n }\n if(fldr.getName() == \"options\"){\n optionsFldr = fldr;\n }\n }\n if(schemaFldr == undefined){*/\n schemaFldr = folder.createFolder(\"schema\");\n //}\n //if(optionsFldr == undefined){\n optionsFldr = folder.createFolder(\"options\");\n //}\n\n Logger.log(schemaFldr.getName());\n Logger.log(optionsFldr.getName());\n\n //create a file for all of the models\n var languages = ['en', 'sw', 'fr'];\n _.each(languages, function(language) {\n var models = processedJSON[language + '_model'];\n schemaFldrLanguage = schemaFldr.createFolder(language);\n optionsFldrLanguage = optionsFldr.createFolder(language);\n if(models != undefined && models.length != undefined){\n for(var i=0;i<models.length;i++){\n var model = models[i];\n var fileName = model.schema._id+\".json\";\n //check for that filename in both folders and if it exists, remove it\n removeOldCopies(schemaFldr, fileName);\n removeOldCopies(optionsFldr, fileName);\n \n //create the new files\n schemaFldrLanguage.createFile(fileName, JSON.stringify(model.schema,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n optionsFldrLanguage.createFile(fileName, JSON.stringify(model.options,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n } \n }\n \n removeOldCopies(schemaFldrLanguage, \"lists.json\")\n removeOldCopies(optionsFldrLanguage, \"lists.json\")\n\n //create the new copy of lists.json\n var lists = processedJSON[language + '_lists'];\n if(lists != undefined){\n schemaFldrLanguage.createFile(\"lists.json\", JSON.stringify(lists.schema,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n optionsFldrLanguage.createFile(\"lists.json\", JSON.stringify(lists.options,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n }\n\n })\n //remove any existing copies of lists.json\n removeOldCopies(folder, \"lists.json\")\n\n //create the new copy of lists.json\n var lists = processedJSON['lists'];\n if(lists != undefined){\n file = folder.createFile(\"lists.json\", JSON.stringify(lists,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n }\n\n //remove old copies of formDef.json\n removeOldCopies(folder, \"formDef.json\");\n\n //create a file containing everything as a record\n file = folder.createFile(\"formDef.json\", JSON.stringify(processedJSON,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n\n // file = folder.createFile(\"log\", Logger.getLog());\n\n //mypanel.add(myapp.createAnchor(\"Download JSON\", file.getUrl()));\n/* } catch (e) {\n //mypanel.add(myapp.createHTML(\"ERROR:\"));\n //mypanel.add(myapp.createHTML(String(e)));\n\n throw e;\n }*/\n //SpreadsheetApp.getActiveSpreadsheet().show(myapp);\n return;\n}", "function uploadDocVersion(dir, f) {\n \n var this_doc = dir.createFile(f)\n var doc_id = this_doc.getId()\n //var doc_name = this_doc.getName()\n //test\n //Logger.log(DriveApp.Access)\n //var doc_loc = DriveApp.getFileById(\"0B0Ylsx9j8KGqTUFFLWRmMmFiZDY2LTI0ZDctNGJjMy05ZTE0LTBhOTZiMGM0OTRjYw\")\n //var this_doc = DriveApp.getFileById(doc_id)\n //doc_loc.setSharing(DriveApp.Access.ANYONE_WITH_LINK, DriveApp.Permission.VIEW);\n var doc_url = this_doc.getUrl()\n \n return Array(doc_id, doc_url) \n \n}", "function createXMLFile()\n{\n\tvar currentURLToBeWritten, currentListOfOutGoingLinks = new Array(); \n\t\n\tfor (var i=0; i<allTheLinksToBeReported.length; i++)\n\t{\n\t\tcurrentURLToBeWritten = allTheLinksToBeReported[i].URL.toString();\n\t\tcurrentListOfOutGoingLinks = allTheLinksToBeReported[i].LINKS;\n\t\tfs.write('finalResult', 'mainPage @@' + currentURLToBeWritten + \"\\n\", 'a');\n\n\t\tfor (var j=0; j<currentListOfOutGoingLinks.length; j++)\n\t\t\tfs.write('finalResult', 'outGoingLinks @@' + currentListOfOutGoingLinks[j] + \"\\n\", 'a');\n\n\t\tfs.write('finalResult', \"\\n\", 'a');\n\t}\n}", "async function main(){\n validateReportPaths();\n let tabsContents = await fetchAllTabs();\n //no tabs have items or api limit\n if(failedToFetch){\n console.log(\"failed to fetch Items\"); \n return 404;\n }\n failedToFetch = false;\n\n let hortiItems = fetchHortiItems(tabsContents);\n hortiItems = formatCrafts(hortiItems);\n let groupedCrafts = GroupCrafts_FunctionTypeLevel(hortiItems);\n \n toFile(groupedCrafts);\n toDiscordFile(groupedCrafts);\n console.log(\"updated\", new Date().toTimeString())\n}", "function directoryPicker(newfile) {\n var GoogleAuth = gapi.auth2.getAuthInstance();\n if (!GoogleAuth.isSignedIn.get()) {\n // User is not signed in. Start Google auth flow.\n GoogleAuth.signIn();\n }\n var oauthToken = gapi.auth.getToken().access_token;\n gapi.load('picker', {'callback': function(){\n if (oauthToken) {\n var view = new google.picker.DocsView(google.picker.ViewId.FOLDERS)\n .setParent('root') \n .setIncludeFolders(true) \n .setMimeTypes('application/vnd.google-apps.folder')\n .setSelectFolderEnabled(true);\n var picker = new google.picker.PickerBuilder()\n .enableFeature(google.picker.Feature.NAV_HIDDEN)\n .enableFeature(google.picker.Feature.MULTISELECT_DISABLED)\n .setAppId(google_appid)\n .setOAuthToken(oauthToken)\n .addView(view)\n .setTitle(\"Select Destination Folder\")\n .setDeveloperKey(google_apikey)\n .setCallback(function(data) {\n if (data.action == google.picker.Action.PICKED) {\n var dir = data.docs[0];\n if (dir.id) {\n saveGoogleWithName(newfile, dir.id)\n }\n }\n })\n .build();\n picker.setVisible(true);\n }\n }});\n }", "function uploadFile(mimetype, bookname, filedata) {\n var bookname1 = 'dcbook.pdf'; // console.log(bookname,bookname1);\n\n try {\n var response = drive.files.create({\n requestBody: {\n name: bookname,\n mimeType: mimetype\n },\n media: {\n mimeType: mimetype,\n body: fs.createReadStream('./public/books/' + bookname)\n }\n });\n var promises = response.data.id;\n if (filedata === 'myFile1') fille1id = response.data.id;\n if (filedata === 'myFile2') file2id = response.data.id; // console.log(response.data.id);\n\n Promise.all(promises).then(function () {\n generatePublicurl(response.data.id, filedata);\n console.log('File uploaded in drive creating link wait....');\n })[\"catch\"](console.error);\n } catch (error) {\n console.error(error.message);\n }\n} // uploadFile();", "function generateReport(id, name)\r\n{\r\n\t//Tracker#13895.Removing the invalid Record check and the changed fields check(Previous logic).\r\n\r\n // Tracker#: 13709 ADD ROW_NO FIELD TO CONSTRUCTION_D AND CONST_MODEL_D\r\n\t// Check for valid record to execute process(New logic).\r\n \tif(!isValidRecord(true))\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\t//Tracker# 13972 NO MSG IS SHOWN TO THE USER IF THERE ARE CHANGES ON THE SCREEN WHEN USER CLICKS ON THE REPORT LINK\r\n\t//Check for the field data modified or not.\r\n\tvar objHtmlData = _getWorkAreaDefaultObj().checkForNavigation();\r\n\r\n\tif(objHtmlData!=null && objHtmlData.hasUserModifiedData()==true)\r\n {\r\n //perform save operation\r\n objHtmlData.performSaveChanges(_defaultWorkAreaSave);\r\n }\r\n else\r\n {\r\n\t\tvar str = 'report.do?id=' + id + '&reportname=' + name;\r\n \toW('report', str, 800, 650);\r\n }\r\n\r\n}", "function convertResponseToFile(response,callback){\n\tvar files = [];\n\tvar defaultFiles = []; //default files/folders being used by elab if there are any\n\tif (typeof response[0]!='undefined'){\n\t\tfor (var i=0;i<response.length;i++){\n\t\t\tvar thisFile = response[i];\n\n\t\t\t//Check if it has certain preview links\n\t\t\tvar linkToFile = thisFile.alternateLink;\n\t\t\tvar embedLink = thisFile.embedLink;\n\t\t\tvar link_preview;\t\t\t\n\t\t\t//this is the link directly to the google doc editable link. However, because of security issue, there is no concrete to render perfectly the doc in iframe. Therefore, decide to use static content (embedlink_\n\t\t\t//console.log(embedLink)\n\t\t\tif (embedLink){\n\t\t\t\tlink_preview = embedLink;\n\t\t\t}else{\n\t\t\t\tlink_preview= linkToFile;\n\t\t\t}\n\n\t\t\t//Check if it is a folder\n\t\t\tvar isFolder = false;\n\t\t\tif (thisFile.mimeType==\"application/vnd.google-apps.folder\"){\n\t\t\t\tisFolder = true;\n\t\t\t}\n\n\t\t\t//Attributes\n\t\t\tvar file = {\n\t\t\t\t\tid : thisFile.id\n\t\t\t\t\t, title : thisFile.title\n\t\t\t\t\t, size : thisFile.quotaBytesUsed\n\t\t\t\t\t, permission : thisFile.userPermission\n\t\t\t\t\t, createdDate:thisFile.createdDate\n\t\t\t\t\t, modifiedDate : thisFile.modifiedDate\n\t\t\t\t\t, link : link_preview\n\t\t\t\t\t, thumbnailLink : thisFile.thumbnailLink\n\t\t\t\t\t, mimeType: thisFile.mimeType\n\t\t\t\t\t, iconLink: thisFile.iconLink\n\t\t\t\t\t, createdBy:thisFile.ownerNames\n\t\t\t\t\t, isFolder:isFolder\n\t\t\t\t\t, children: new Backbone.Collection()//Only has children\n\t\t\t, parent:thisFile.parents,\t//which project/folder it belong to\n\n\t\t\t};\n\t\t\tif (doesNotContainString(thisFile.title,'#elab.')){\n\t\t\t\t//Push to file array\n\t\t\t\tfiles.push(file);\n\t\t\t}else{\n\t\t\t\tdefaultFiles.push(file);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//return statement\n\treturn callback(files,defaultFiles);\n}", "function emailPDF(PDFBlob, folderURL){\n \n // Send the PDF of the spreadsheet to this email address\n var email = Session.getActiveUser().getEmail(); \n var currentDate = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), \"MMM YYYY\");\n \n \n // Subject of email message\n var subject = \"Lab Software Change Report-\" + currentDate;\n \n // Email Body\n var body = \"This has also been saved to your Google Drive at \"+folderURL;\n \n // If allowed to send emails, send the email with the PDF attachment\n if (MailApp.getRemainingDailyQuota() > 0) \n GmailApp.sendEmail(email, subject, body, {\n htmlBody: body,\n attachments:[PDFBlob] \n }); \n}", "function downloadCorpus(corpId){\n location.href=appRoot()+'/download/'+corpId;\n}", "async report() {\n const { logger, db } = this[OPTIONS];\n const testedPages = await db.read('tested_pages');\n\n logger.info('Saving JSON report');\n const json = new JSONReporter(this[OPTIONS]);\n await json.open();\n await json.write(testedPages);\n await json.close();\n\n logger.info('Saving HTML Report');\n const html = new HTMLReporter(this[OPTIONS]);\n await html.open();\n await html.write(testedPages);\n await html.close();\n }", "static generateReport() {\n let data = [];\n console.info(\"Processing Json Report Files\");\n let files = fs.readdirSync(intermediateJsonFilesDirectory);\n for (let i in files) {\n let f = `${intermediateJsonFilesDirectory}/${files[i]}`;\n console.log(`Processing file ${f}`);\n try {\n let fileContent = fs.readFileSync(f, 'utf-8');\n data.push(JSON.parse(fileContent)[0]);\n }catch (err) {\n if (err) {\n console.error(`Failed to process file ${f}`);\n console.error(err);\n }\n }\n }\n\n console.info(\"Writing consolidated json file\");\n try {\n fs.writeFileSync('./e2e/reports/combinedJSON/cucumber_report.json', JSON.stringify(data));\n } catch (err) {\n if (err) {\n console.error(\"Failed to generate the consolidated json file.\");\n console.error(err);\n throw err;\n }\n }\n\n console.info(\"Generating Final HTML Report\");\n try {\n reporter.generate(cucumberReporterOptions);\n } catch (err) {\n if (err) {\n console.error(\"Failed to generate the final html report\");\n console.error(err);\n throw err;\n }\n }\n }", "function ScanGmail() {\n \n // log sender and the attachment name\n var ss = SpreadsheetApp.getActiveSheet();\n \n // Get the label\n var label = GmailApp.getUserLabelByName(\"Archive to Drive\");\n var threadsArr = getThreadsForLabel(label);\n for(var j=0; j<threadsArr.length; j++) {\n var messagesArr = getMessagesforThread(threadsArr[j]);\n for(var k=0; k<messagesArr.length; k++) {\n var messageId = messagesArr[k].getId();\n var messageDate = Utilities.formatDate(messagesArr[k].getDate(),\n Session.getTimeZone(),\n \"dd/MM/yyyy - HH:mm:ss\");\n var messageFrom = messagesArr[k].getFrom();\n var messageSubject = messagesArr[k].getSubject();\n var messageBody = messagesArr[k].getBody();\n var messageAttachments = messagesArr[k].getAttachments();\n \n if (messageAttachments.length > 0) {\n // Create the new folder to contain the message\n var path = \"Email Archive\" + \"/\" + messageFrom;\n try {\n var senderFolder = DocsList.getFolder(path);\n } catch(e) {\n var baseFolder = DocsList.getFolder(\"Email Archive\");\n var newFolder = baseFolder.createFolder(messageFrom);\n var senderFolder = DocsList.getFolder(path);\n }\n }\n \n // Save attachments\n for(var i = 0; i < messageAttachments.length; i++) {\n var attachmentName = messageAttachments[i].getName();\n var attachmentBlob = messageAttachments[i].copyBlob();\n senderFolder.createFile(attachmentBlob);\n \n ss.insertRows(2);\n ss.getRange(\"A2\").setValue(messageFrom);\n ss.getRange(\"B2\").setValue(attachmentName);\n }\n }\n // Remove Gmail label from archived thread\n label.removeFromThread(threadsArr[j]);\n }\n Browser.msgBox(\"Gmail messages successfully archived to Google Drive\");\n}", "function newp(name) {\n var newfolder = process.cwd() + '/' + name;\n mkdirp(newfolder, function(err){\n if (err) {\n console.log(err.red);\n }\n\n mkdirp(newfolder + '/posts', function(err){\n if(err) {\n console.log(err.red);\n }\n });\n\n // Write template file\n var template = '<!DOCTYPE html> \\\n <html>\\\n <head>\\\n \\\n </head>\\\n <body>\\\n <h1>My Blog</h1>\\\n {{ feed }}\\\n </body>\\\n </html>\\ ';\n fs.writeFileSync(newfolder + '/template.html', template);\n\n // Write index file\n fs.writeFileSync(newfolder + '/index.html', '');\n });\n}", "function exportLocationToXLS() {\n\tdoLocationCustomExport(Ab.grid.ReportGrid.WORKFLOW_RULE_XLS_REPORT, 'xls');\n}", "function writeOut(page) {\n var n = Math.floor(fs.readdirSync(getFolder()).length / subreddits.length);\n n = n === 0 ? 1 : n;\n // save the text version of this page for your viewing pleasure\n fs.writeFile(\n // file name\n getFolder() + String(n) + \"-\" + page.post.title.toCamelCase(18) + \".txt\", \n // file content\n page.header + page.post.content + page.comments, \n // If things went well, add to cache so we don't re-reddget it\n function (err) { fs.appendFileSync(getFolder().slice(0, -9) + '.cache', id + '\\n'); });\n }", "function saveGoogleWithName(newfilename, folderid) {\n if (newfilename != null) {\n // if folderid is empty, user must pick one\n if (! folderid){\n directoryPicker(newfilename);\n }\n var fileMetadata = {\n 'name' : newfilename,\n 'mimeType' : 'text/x-python',\n 'alt' : 'media',\n 'parents' : [folderid,],\n 'useContentAsIndexableText' : true\n };\n gapi.client.drive.files.create({\n resource: fileMetadata,\n }).then(function(response) {\n switch(response.status){\n case 200:\n var file = response.result;\n var UI = bsUI;\n $(UI.FILE_NAME).val(file.name);\n gdrive_fileid_loaded = file.id;\n gdriveSaveFile();\n break;\n default:\n alert(\"Unable to create file in Google Drive\");\n break;\n }\n });\n }\n }", "function UploadToSharePoint(){\n console.log(\"Uploading the files to SharePoint\");\n gulp.src([\"dist/**\"]).pipe(spsave({siteUrl: \"https://ecm.dev.opcw.org/sites/osdtemplate/\",folder: \"Administration\"},null));\n return gulp.src([\"views/**\"]).pipe(spsave({siteUrl: \"https://ecm.dev.opcw.org/sites/osdtemplate/\",folder: \"Administration\"}, null));\n}", "function mergePDFDocumentsUsingPDFco(allURLs){\n\n // Prepare Payload\n const data = {\n \"async\": true, // As we have large volumn of PDF files, Enabling async mode\n \"name\": resultFileName,\n \"url\": allURLs\n };\n\n // Prepare Request Options\n const options = {\n 'method' : 'post',\n 'contentType': 'application/json',\n 'headers': {\n \"x-api-key\": pdfCoAPIKey\n },\n // Convert the JavaScript object to a JSON string.\n 'payload' : JSON.stringify(data)\n };\n \n // Get Response\n // https://developers.google.com/apps-script/reference/url-fetch\n const resp = UrlFetchApp.fetch('https://api.pdf.co/v1/pdf/merge', options);\n\n // Response Json\n const respJson = JSON.parse(resp.getContentText());\n\n if(respJson.error){\n console.error(respJson.message);\n }\n else{\n\n // Job Success Callback\n const successCallbackFn = function(){\n // Upload file to Google Drive\n saveURLToCurrentFolder(respJson.url);\n }\n\n // Check PDF.co Job Status\n checkPDFcoJobStatus(respJson.jobId, successCallbackFn);\n }\n}", "function downloadExcelTracking(_langIdx) {\n\tvar file = ['../excel/budget_en.xls', '../excel/budget_tc.xls'];\n\tvar lang = ['English', 'Traditional Chinese'];\n\t_gaq.push(['_trackEvent', 'Budget Tools', 'Download Excel (Template)', lang[_langIdx]]);\n\tsetTimeout(function () { // to allow time for the hit request to process before taking the user by _self\n\t\twindow.open(file[_langIdx], '_self');\n\t}, 500);\n\n}", "function get_docs(name, server_name)\n{\n if (name != 'leer') {\n var w = window.open();\n w.location = server_name + '/docs/' + name;\n }\n}", "function reports(req,res){\n res.render('admin/general/views/reports');\n}", "printWorksite(id) {\n try {\n return this.request({\n url: `/worksites/${id}/download`,\n method: 'POST',\n responseType: 'blob',\n headers: { Accept: 'application/pdf' },\n save: false,\n });\n } catch (e) {\n // console.error(e)\n }\n }", "function sync() {\n syncDocuments({\n uri: {\n fsPath: path.join(rootPath, dir)\n }\n });\n }", "function getFolderTree() {\n \n var root = DocsList.getRootFolder()\n var first_level = root.getFolders()\n for (var i = 0; i < first_level.length; i++) {\n Logger.log(first_level[i].getName()) \n }\n}", "function getOneups ( startFolder ) {\r\n var folderContents;\r\n folderContents = startFolder.getFiles( );\r\n for ( var y = 0; y < folderContents.length; y ++ ) {\r\n if ( folderContents[ y ].toLocaleString() == \"[object Folder]\" ) {\r\n getOneups ( Folder( folderContents [ y ].path + \"//\" + folderContents [ y ].name ) );\r\n }\r\n if ( folderContents[ y ].name.match( /(\\.pdf)+/ ) ) {\r\n allPDFFiles.push( folderContents[ y ].fullName ); } }\r\n iteratePDFs() }", "function createReport1(tmfile1) {\n\topenfile(tmfile1);\n\tif (reporttype == 0) {\n\t\toframe.ActiveDocument.Application.Run(\"createNormalReport\");\n\t} else {\n\t\toframe.ActiveDocument.Application.Run(\"analyze\");\n\t}\n}", "function MakeDirectories() {\r\n}", "async saveFolder() {\n if (this.state.state !== 'LOADED_PINBOARD') {\n return;\n }\n let folder = this.state.folderBuffer.join('');\n if (this.state.predictedFolder !== 'undefined' && typeof this.state.predictedFolder !== 'undefined') {\n folder += this.state.predictedFolder;\n }\n const store = this.state.store;\n const bookmark = await store.getBookmark(this.state.cursor);\n await store.addFolder(new Folder(bookmark.href, folder));\n }", "function setFolder() {\n var today = new Date();\n\t$.ajax({\n type: 'GET',\n dataType: \"jsonp\",\n url: \"http://www.timeapi.org/utc/now.json?callback=?\",\n success: function(data) {\n\t //Got date from timeapi.org\n today= Date(data.dateString);\n\t},\n error: function(data) {\n //\"Unable to get date. Using machine date\"\n\t}\n});\n\t\t$.each(data.pubdates, function(i, info) {\n\t\t\tvar nmonth = + info.month -1;\n\t\t\tvar ntime = info.time.split(\":\");\n\t\t\tvar x = new Date(info.year, nmonth, info.day, ntime[0],ntime[1],ntime[2],0);\n\n\t\tif (x > today) {\n\t\treturn false;\n\t\t}\n\t\tfileurl = data.urloffiles[0].location + info.location + data.urloffiles[0].prefix ;\n\t\t// Change month to published month (previous month)\n\t\tx.setMonth(x.getMonth()-1);\n\n\t\tvar loc = location.href;\n if (loc.indexOf(\"cofrestrfatir\") !== -1) {\n monthbeingpublished=\"Mis cyfredol (\" +welshmonthNames[x.getMonth()] + \" \" + x.getFullYear()+ \" Data)\";\n\t\t} else {\n\t\t\tmonthbeingpublished=\"Current Month (\" + monthNames[x.getMonth()] + \" \" + x.getFullYear() + \" Data)\";\n\t\t\t}\n\n\t\t});\n\n\n\t\t}", "reportExport(){\n bcdui.component.exports.exportWysiwygAsExcel({rootElement: this.gridRenderingTarget});\n }", "_publishDiagnostics(uri, span = new opentracing_1.Span()) {\n const config = this.projectManager.getParentConfiguration(uri);\n if (!config) {\n return;\n }\n const fileName = util_1.uri2path(uri);\n const tsDiagnostics = config.getService().getSyntacticDiagnostics(fileName).concat(config.getService().getSemanticDiagnostics(fileName));\n const diagnostics = iterare_1.default(tsDiagnostics)\n .filter(diagnostic => !!diagnostic.file)\n .map(diagnostics_1.convertTsDiagnostic)\n .toArray();\n this.client.textDocumentPublishDiagnostics({ uri, diagnostics });\n }", "function doBook( aBook,theFolder ){ \r for ( var i = 0; i < aBook.bookContents.length; i++ ){\r// thnx to Neil77 from HDS\r var content = aBook.bookContents[i];\r var doc = app.open(content.fullName);\r// take the .indd's name and make a .idml from it\r var aName = doc.name;\r var newName = aName.replace(\"indd\",\"idml\");\r var theFile = File(theFolder +\"/\"+ newName );\r// export\r doc.exportFile(ExportFormat.INDESIGN_MARKUP, theFile, false);\r// dont need to save right now\r doc.close(SaveOptions.NO);\r\r }\r}", "downloadPdf() {\n const data = this.chart.getAllDataPoints();\n PdfDownloadService.createDownloadPdf(data);\n }", "function generaAllegatoReportAccessi(){\n\t\n\twindow.location.href= \"/CruscottoAuditAtpoWebWeb/jsonATPO/getAllegatoReportAccessoPDF\";\n\t\n}", "function downloadReports(formats) {\n lib_core.startGroup('Download Reports');\n if (formats.length === 0) {\n lib_core.info('No more formats');\n return;\n }\n const jobUUID = getJobUUID();\n lib_core.debug(jobUUID);\n formats.forEach((format) => {\n lib_core.info(`Get Report as ${format}`);\n const exitCode = getReport(jobUUID, projectName, format).code;\n logExitCode(exitCode);\n });\n lib_core.endGroup();\n}", "function ComposeDownloads()\n{\n var html = '<p>Click on the links to download SD files containing '\n\t + 'the data used to make up this report, which has been '\n\t + 'categorized and processed accordingly. '\n\t + 'Scaffolds are numbered and annotated with R-groups, as shown '\n\t + 'in this report. Molecules matched to these scaffolds use the '\n\t + 'scaffold layout for the core, with R-groups redepicted. The '\n\t + 'matching indexes are recorded. Unmatched molecules are '\n\t + 'presented in their original form.';\n\n html += '<p><ul>';\n \n var fn = 'scaffolds.sdf';\n html += '<li><a href=\"' + fn + '\" target=\"_blank\">' + fn + '</a>: '\n \t + 'each of the scaffolds shown in this report.</li>';\n\t \n for (var n = 1; n <= num_rgsites; n++) {\n \tfn = 'rgroups' + n + '.sdf';\n\thtml += '<li><a href=\"' + fn + '\" target=\"_blank\">' + fn + '</a>: '\n \t + 'unique substituents for R' + n + '.</li>';\n }\n \n for (var n = 1; n <= num_scaffolds; n++) {\n \tfn = 'matched' + n + '.sdf';\n\thtml += '<li><a href=\"' + fn + '\" target=\"_blank\">' + fn + '</a>: '\n \t + 'molecules and activities matched to scaffold ' + n + '.</li>';\n }\n\n if (scaffold_unassigned) {\n\tfn = 'unmatched.sdf';\n\thtml += '<li><a href=\"' + fn + '\" target=\"_blank\">' + fn + '</a>: '\n\t + 'molecules which matched no scaffold.</li>';\n }\n \n fn = 'fragments.sdf';\n html += '<li><a href=\"' + fn + '\" target=\"_blank\">' + fn + '</a>: '\n \t + 'fragment decomposition tree.</li>';\n\n if (HasData(\"predictions\", \"count\")) {\n\tif (GetData(\"predictions\", \"count\") > 0) {\n\t fn = 'suggestions.sdf';\n\t html += '<li><a href=\"' + fn + '\" target=\"_blank\">' + fn + '</a>: '\n\t\t+ 'hypothetical molecules.</li>';\n\t}\n }\n\n html += '</ul>';\n \n return html;\n}", "function exportPdf() {\n // get current doc\n var doc = DocumentApp.getActiveDocument();\n var clearFileName = doc.getName() + '_clear';\n var fileName = doc.getName() + '_pdf';\n \n var articleFolder = getFileFolder(doc);\n if (isFileExists(fileName, articleFolder)) {\n // remove old verstion of file\n // logger.log('Remove ' + fileName + ' from ' + articleFolder + ' folder');\n isFileExists(fileName, articleFolder).setTrashed(true);\n }\n \n // update clear copy\n var clearFile = makeClearCopy(doc, clearFileName);\n \n // make a clear PDF copy\n var copyFile = DriveApp.createFile(clearFile.getAs('application/pdf'));\n var copyId = copyFile.getId();\n copyFile.setName(fileName);\n \n // add file to article folder and remove file from root folder\n var articleFolder = clearFile.getParents().next();\n articleFolder.addFile(copyFile);\n DriveApp.getRootFolder().removeFile(copyFile);\n \n DocumentApp.getUi().alert('New PDF file with the name ' \n + clearFile.getName() \n + ' created in the article folder');\n}", "function renderDirectory() {\n var reg = $('input[name=\"endpoint\"]:checked').val()\n , pkg = $package.val()\n , ver = $version.val()\n , out = 'jspm/registry/package-overrides/' + reg + '/' + pkg;\n out += '@' + ver + '.json';\n out = syntaxHighlight(out);\n $directory_out.html(out);\n}", "function generaReportAccessi(){\n\t\n\twindow.location.href= \"/CruscottoAuditAtpoWebWeb/jsonATPO/getReportAccessoPDF\";\n\t\n}", "function getTargetFiles(root, date) {\n \n var student_upload_folder = DocsList.getFolder(root) // Weekly Comments folder ID tag\n \n // this gets the list of subfolders inside the parent uploads folder, ie. folders for each week \n // naming convention: MM/DD [Faculty Surname] - [Listed Topic]\n var upload_subfolders = student_upload_folder.getFolders();\n \n // iterate through weekly folder names\n for (var i = 0; i < upload_subfolders.length; i++) {\n \n var fname = upload_subfolders[i].getName();\n \n var date_regex = new RegExp(\"^\"+date+\".*\")\n \n // search folder names for one that has our target date\n if (date_regex.exec(fname)) {\n \n // when we have a match (there should be only one), get all of the files from that folder\n // these are the students' individual comment docs\n var target_dir = upload_subfolders[i]\n break;\n }\n }\n \n return target_dir.getFiles();\n}", "async function createLabReport(patient, report, labs) {\n const labReport = new SampleDocument({patient, report, labs}, 'labs');\n console.log(`creating Lab Report ${labReport.id}`);\n createTxt(labReport);\n //await createPdf(labReport);\n}", "function generateReport (data, outputPdfPath) {\n return webServer.start(webServerPortNo, data)\n .then(server => {\n const urlToCapture = \"http://localhost:\" + webServerPortNo;\n return captureReport(urlToCapture, \"svg\", outputPdfPath)\n .then(() => server.close());\n });\n}", "function storeAllFiles() {\n return Q.all(\n files.map(function(f) {\n return file_limit(function() {\n return processFile(f, store, stat_cache).then((chunks) => {\n // Return the single element representation of this entry\n if(f.name === '3rd-party-licenses.txt') {\n console.log(f);\n console.log(chunks);\n }\n if(f.stat.size > 0 && chunks && chunks.length === 0) {\n console.log(\"Not possible to have size and no chunks\");\n console.log(f);\n throw(\"ERROR\");\n }\n return chunks ? (f.name + \"*\" + chunks.join(',')) : null;\n })\n })\n })\n ).then((stored_files) => {\n // Filter out null files\n stored_files = stored_files.filter(function(n) {\n return n !== null\n });\n if(dirname === 'C:\\\\jha\\\\nmap-7.00') {\n console.log(stored_files);\n }\n\n return store.storeDirectory(dirname, stored_dirs, stored_files);\n });\n }", "function validateReportPaths(){\n if (!fs.existsSync(config.DiscordCraftListPath)){\n fs.mkdir(config.DiscordCraftListPath.substring(0,config.DiscordCraftListPath.lastIndexOf(\"/\")+1), { recursive: true }, (err) => {\n if (err) throw err;\n });\n }\n \n if (!fs.existsSync(config.craftListPath)){\n fs.mkdir(config.craftListPath.substring(0,config.craftListPath.lastIndexOf(\"/\")+1), { recursive: true }, (err) => {\n if (err) throw err;\n });\n }\n}", "function walkFolderCollect()\n\t\t{\n\t\t\tfunction collect(element)\n\t\t\t{\n\t\t\t\tpaths.push(element.path);\n\t\t\t}\n\n\t\t\tvar paths = [];\n\t\t\tUtils.walkFolder('{user}', collect);\n\t\t\tlist(paths)\n\t\t}", "function build() {\n //conditional statement that checks if the output directory has been created\n if(!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR)\n\n }\n //validation of dir and path variables\nconsole.log(OUTPUT_DIR, outputPath)\n//this writes the html file\nfs.writeFileSync(outputPath, render(members), \"utf-8\")\n\n}", "function PathSearchResultCollector() {\n\n}", "function createFolderViews(metadata){\n var path;\n var contents = metadata.contents;\n var table = \"<table id='folder_view' class='table table-striped table-hover'><thead><th>Path: \"+metadata.path+\"</th><th></th><th></th></thead><tbody>\";\n var tr = \"<tr path=\\\"\"+metadata.path+\"\\\"><td> <input type=\\\"file\\\" name=\\\"file\\\" id=\\\"upload_file\\\"></td>\";\n tr += \"<td><button class=\\\"btn btn-success\\\" name=\\\"submit\\\" id=\\\"id_submit\\\" >Upload</button></td><td></td><td></td><td></td></tr>\";\n table += tr;\n\n for (var x in contents)\n {\n path = contents[x].path;\n if(contents[x].is_dir == true){\n tr = \"<tr path='\" + path + \"'><td>\";\n tr += path.split('/').pop() + \"</td><td><button class='btn btn-warning folder'>Open Folder</button></td><td></td>\" + \"</tr>\";\n }\n else{\n tr = \"<tr path='\" + path + \"'>\";\n tr += \"<td>\"+path.split('/').pop() + \"</td><td><button class='btn btn-primary download'>Download</button></td>\"\n tr += \"<td><button class='btn btn-warning share'>Share</button></td>\"\n tr += \"<td><button class='btn btn-info revoke'>Revoke</button></td>\"\n tr += \"<td><button class='btn btn-danger delete'>Delete</button></td></tr>\";\n }\n table += tr;\n }\n table += \"</tbody></table>\";\n $(\"#id_content\").html(table);\n\n createSharedView();\n}", "function getDirectorySuccessFn(data, status, headers, config) {\r\n console.log(data.data);\r\n LotVM.lot_directory = data.data;\r\n }", "function createReportChecklist() {\n \n var TEMPLATE_ID = '1KXMSjY6iFZjHoC20n9HJ26TeFY0T7CiIxp0A9OvDL-s' // pickup checklist template\n var FOLDER_ID = '1Ur9LaAUeYzlIFxQ77bO3oj0hJ0UIDULc' // reports go to dry/reports\n var packDate = getPackDateFromFilename()\n var PDF_FILE_NAME = Utilities.formatDate(packDate, \"GMT+12:00\", \"yyyy-MM-dd\") + ' Checklist'\n\n // Set up the docs and the spreadsheet access\n \n var copyFile = DriveApp.getFileById(TEMPLATE_ID).makeCopy(DriveApp.getFolderById(FOLDER_ID)) \n var doc = DocumentApp.openById(copyFile.getId())\n var body = doc.getBody()\n var header = doc.getHeader()\n \n // Get data\n\n var data = getMembersWhoOrdered()\n \n // Document Heading - set the packdate\n header.replaceText('%DATE%', Utilities.formatDate(packDate, \"GMT+12:00\", \"EEEE, d MMMM yyyy\"))\n \n // Create table\n \n var table = body.appendTable(data)\n table.setColumnWidth(0, 25) // for tick box\n table.setColumnWidth(2, 65) // for ID number\n table.setBorderWidth(0) // no table borders\n \n\n\n // Format headers\n \n var headerStyle = {};\n headerStyle[DocumentApp.Attribute.BACKGROUND_COLOR] = '#444444'; \n headerStyle[DocumentApp.Attribute.BOLD] = true; \n headerStyle[DocumentApp.Attribute.FOREGROUND_COLOR] = '#FFFFFF';\n headerStyle[DocumentApp.Attribute.VERTICAL_ALIGNMENT] = DocumentApp.VerticalAlignment.CENTER;\n \n\n var headers = table.getRow(0) \n for (var j=0; j < headers.getNumCells(); j++) {\n headers.getCell(j).setAttributes(headerStyle)\n }\n \n \n // format data\n var bodyStyle = {};\n bodyStyle[DocumentApp.Attribute.VERTICAL_ALIGNMENT] = DocumentApp.VerticalAlignment.CENTER;\n\n for (var i = 1; i < table.getNumRows(); i++){\n var row = table.getRow(i)\n row.getCell(0).setText(String.fromCharCode(9744)).editAsText().setFontSize(12) // tick box\n for (var j=0; j < row.getNumCells(); j++) {\n row.getCell(j).setAttributes(bodyStyle)\n }\n }\n \n \n //------------------------------------------\n // Create PDF from doc, rename it if required and delete the doc\n \n doc.saveAndClose()\n var pdf = DriveApp.getFolderById(FOLDER_ID).createFile(copyFile.getAs('application/pdf')) \n\n if (PDF_FILE_NAME !== '') {\n pdf.setName(PDF_FILE_NAME)\n } \n \n copyFile.setTrashed(true)\n \n \n}", "function treeGrowers(tree){\n\twindow.location.href = \"/reports/trees/\"+tree+\"/growers\";\n\t\n}", "async function generatePatts(folder) {\n try {\n // Get the files as an array\n console.log(folder);\n\n const files = await fs.promises.readdir(folder);\n\n // Loop them all with the new for...of\n for (const file of files) {\n // Get the full paths\n innerImageURL = path.join(folder, file);\n i++;\n console.log(i);\n // Stat the file to see if we have a file or dir\n const stat = await fs.promises.stat(innerImageURL);\n\n if (stat.isFile())\n console.log(\"'%s' is a file.\", innerImageURL);\n else if (stat.isDirectory())\n console.log(\"'%s' is a directory.\", innerImageURL);\n\n THREEx.ArPatternFile.encodeImageURL(innerImageURL, function onComplete(patternFileString) {\n THREEx.ArPatternFile.triggerDownload(patternFileString, \"patt_\" + (imageName || \"marker_\") + i + \".patt\")\n })\n\n } // End for...of\n }\n catch (e) {\n // Catch anything bad that happens\n console.error(\"Couldn't find the folder!\", e);\n }\n\n}", "async function publishToGHPages(distDir, ghPagesConfig) {\n return new Promise((resolve, reject) => {\n ghpages.publish(distDir, ghPagesConfig, (err) => {\n if (err) {\n reject(err);\n }\n resolve();\n });\n });\n}", "function runAppTemplates(folder){\t\n\t//var template_folder=folder+\"/app\";\n\tvar template_folder=folder;\n\tconsole.log('current template_folder: ' + template_folder);\n\trecursive(template_folder, function (err, files) {\n\t\t//files.forEach(generateAppFile);\n\t\tfiles = files || []; \n\t\tfor (var i = 0; i < files.length; i++) {\n\t\t\tconsole.log(\"runAppTemplates \" + template_folder);\n\t\t\tvar n = files[i].indexOf(\"_name\");\n\t\t\tif (n<0){\n\t\t\t\tgenerateAppFile(files[i],template_folder);\n\t\t\t}\t\t\t\n\t\t}\n\t});\t\n}", "async function generateReport()\n{\n\t// Reset the values:\n\tallSVGUri = [];\n\tall_imgs = [];\n\n\t// Finish these functions:\n\tawait SVGUri(\"#mapSvg\");\n\tawait SVGUri(\"#lineGraphSVG\");\n\n\t// console.log(allSVGUri);\n\n\tfor(var i = 0; i < allSVGUri.length; i++){\n\t\t// Wait for this function to finish:\n\t\tawait convertURIToImageData(allSVGUri[i]).then(function(imageData){\n\t\t\t// console.log(\"7: Finished convertURIToImageData called\")\n\n\t\t});\n\t}\n\n\t// await createPDF();\n\tawait generatePDF();\n}" ]
[ "0.53484786", "0.5203295", "0.513397", "0.51130426", "0.5068771", "0.50220376", "0.49349335", "0.49321502", "0.49226052", "0.491312", "0.4912075", "0.49113414", "0.4886892", "0.48855162", "0.4858115", "0.4841191", "0.48392937", "0.4837547", "0.4820589", "0.47809938", "0.47437847", "0.47262794", "0.47251573", "0.4713643", "0.4697926", "0.46635914", "0.46205667", "0.4617726", "0.4614744", "0.46116948", "0.46105415", "0.45973122", "0.4588701", "0.45749626", "0.45699167", "0.45662013", "0.45614472", "0.4561321", "0.4552887", "0.45417118", "0.45322195", "0.45144644", "0.45097947", "0.45041743", "0.44869763", "0.44856307", "0.4479073", "0.44712406", "0.44708234", "0.44627666", "0.4460846", "0.44496036", "0.44494674", "0.4437018", "0.4434389", "0.44308844", "0.44280857", "0.44252965", "0.44141927", "0.4407389", "0.44055182", "0.440091", "0.43999755", "0.4398449", "0.4393586", "0.43920025", "0.43864194", "0.43811554", "0.43805924", "0.4380245", "0.43792728", "0.43752882", "0.43728504", "0.4369944", "0.43694413", "0.43640956", "0.43559942", "0.43469888", "0.43468195", "0.43462455", "0.43460524", "0.4343077", "0.43376556", "0.43316504", "0.43284804", "0.43276137", "0.4326879", "0.43238792", "0.4323738", "0.43208814", "0.4320609", "0.43140888", "0.43127665", "0.43112558", "0.43090677", "0.43050364", "0.4294785", "0.4294344", "0.4291604", "0.42896163" ]
0.6590875
0
function changed newwpaper page
function changeNewspaperPage(new_paper) { newspaper_page = new_paper; console.log(newspaper_page + 'の' + newspaper_page + 'ページを開きました。'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageChanged(newPage) {\n\t\tgetArticles(newPage);\n\t}", "function changePage(page) { \n clearPage();\n extractData(page);\n }", "function pgChange3(){\r\n pageNo = 3\r\n \r\n}", "function pgChange2(){\r\n pageNo = 2\r\n \r\n}", "function modifyPage(search) {\n\n\t//Parse the response text into a JSON\n\tvar data = JSON.parse(search);\n\n\t//Edit the wiki paragraph in the wikibox on the webpage\n\tif (data.parse) {\n\t var text = data.parse.text[\"*\"];\n\t text = text.replaceAll('a href=\\\"', 'a href=\\\"http://www.wikipedia.org');\n\t document.getElementById(\"wikiPara\").innerHTML = text;\n\t} else {\n\t document.getElementById(\"wikiPara\").innerHTML = \"Sorry, the person doesn't have a page on wikipedia...\";\n\t}\n}", "function onPageChange(p) {\n setPage(p);\n }", "function handleChangePage(event, newPage) {\n setPage(newPage);\n }", "function updatePage() {\n \tcountLinks();\n \tgetDropDowns();\n \tquery();\n }", "function changePage(appID, getPage) {\r\n\t\t\tchangeDivContent(\"appLoad.cc?cid=\" + classID + \"&id=\" + appID + \"&appType=\" + appType + \"&page=\" + cleanData(getPage));\r\n\t\t}", "function _page1_page() {\n}", "function copyPage() {\n var $wp = $('.write-pages li'); // the list of book pages\n var $page = $($wp.get(editIndex)); // the current page\n var $copy = $page.clone();\n $page.after($copy);\n setModified();\n $editDialog.dialog('option', 'title', $('.wlPageCopied').html());\n }", "function doNewspaperEdit() {\r\n\tallElements = document.getElementById('editNewspaperForm');\r\n\t\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper name:/,\"报纸名称:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"报纸图标:\");\r\n\ttmp = allElements.childNodes[9];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"文件尺寸小于\");\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"editNewspaper.html\":[\"Edit newspaper\",\"修改报纸信息\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Delete\":[\"Edit newspaper\",\"修改提交\"]\r\n\t});\r\n}", "function changeLocation(newURL, title, navIndex) {\n if (UTIL.idExists(\"jbmnplsWebpage\")) {\n DEBUGGER.refresh();\n $(\"#jbmnplsWebpage\").attr(\"src\", newURL);\n if (title.empty()) {\n title = \"Jobmine Plus\";\n }\n document.title = title;\n setNavSelection(navIndex);\n }\n}", "function getIt(thepage){\n changeView(thepage);\n override();\n $('#footer').fadeIn('slow');\n }", "function newPageLeft(newPage){\n\t\t newPageSides(newPage, false);\n\t\t}", "function pageChanged(newPage){\n\t\t$state.go(\"root.sectionList\" , {pageId:newPage});\n\t}", "function ChangePage( lay )\r\n{\r\n //Set the current page.\r\n curPage = lay;\r\n \r\n //Fade out current content.\r\n if( layWebView.IsVisible() ) layWebView.Animate( \"FadeOut\",OnFadeOut,200 );\r\n if( laySettings.IsVisible() ) laySettings.Animate( \"FadeOut\",OnFadeOut,200 );\r\n}", "function newPageRight(newPage){\n\t\t newPageSides(newPage, true);\n\t\t}", "function newPageSides(newPage, dir){ // dir true = right, false = left\n\t\t\t\n\t\t//\tconsole.log(\"this is the current Page\"+currentPage);\n//\t\t\t$('#wrapper_all').removeClass('accelerator').attr('style','');\n\t\t\t$('#wrapper_all').find('.article-wrapper').removeClass('active');\n\t\t\t$remover = $('#article'+(currentPage));\n\t\t\t$remover.addClass('active');\n\t\t\t$('#wrapper_all').find('.article-wrapper').not($($remover)).addClass('hidder');\n\t\t\t$('.active').removeClass('hidder');\n\t\t\tprevPage = currentPage;\n\t\t\tif (newPage>0) {\n\t\t\t\tcurrentPage = newPage;\n\t\t\t} else {\n\t\t\t\tcurrentPage = prevPage + (dir ? 1 : -1);\n\t\t\t}\n\t\t\t\n\t\t\tif (currentPage > window.maxPage){\n\t\t\t\tcurrentPage = window.maxPage;\n\t\t\t} else if (currentPage < 1){\n\t\t\t\tcurrentPage = 1;\n\t\t\t} else {\n\t\t\t\t$adder = $('#article'+(currentPage));\n\t\t\t\tif ($adder.is(':animated')){\n\t\t\t\t\t$adder.stop(true,true);\n\t\t\t\t}\n\t\t\t\t$adder.removeClass('hidder');\n\t\t\t\t$remover.addClass('remove').removeClass('active').css('style','');\n\t\t\t\t$adder.addClass('active').css('style','');\n\t\t\t\tif (pdContents.position().top<-200){\n\t\t\t\t\tanimateSlide($remover,dir);\n\t\t\t\t} else {\n\t\t\t\t\tshowSlideNow($remover);\n\t\t\t\t}\n\t\t\t//\tlocalStorage.setItem('currentPage',JSON.stringify(currentPage));\n\t\t\t}\n\t\t\tnewPage = 1;\n//\t\t\t$('#wrapper_all').addClass('accelerator');\n\t\t}", "_updateCarpenterPage() {\n // get the page\n const $page = this._$websiteDocument.querySelector('[s-page]');\n // if a page has been found, create a new instance of it\n if ($page) {\n this._page = new __SCarpenterPage($page, this);\n this.requestUpdate();\n }\n }", "function NewRecFromX() {\n refreshPage();\n}", "function changePageNo () {\n $('.browse-pagenumber a').on('click', function () {\n var pageno = $(this).text()\n $('.browse-menu input[name=\"page\"]').val(pageno)\n window.history.replaceState(null, null, window.location.href.replace(/(page=)[0-9]{1,}/, 'page=' + pageno))\n filterAJAXPost()\n $('html, body').animate({\n scrollTop: ($('.browsepage .browse-header').offset().top - 75)\n }, 1000, 'easeInOutExpo')\n })\n }", "function pageChanged(){\n\n $scope.showLoading = true;\n\n if($scope.currentPage > $scope.oldPage){\n var params = urlParamsToObject( $scope.searchMetadata.next_results );\n SearchRestApiService.getTwitts( params ).then( renderTwitts, errorHandler );\n\n $scope.history.push($scope.searchMetadata.max_id_str);\n\n $scope.oldPage = $scope.currentPage;\n }\n else if($scope.currentPage < $scope.oldPage){\n var params = {\n count: count,\n include_entities: \"1\",\n max_id: $scope.history.pop(),\n q: $scope.searchText,\n };\n\n SearchRestApiService.getTwitts( params ).then( renderTwitts, errorHandler );\n\n $scope.oldPage = $scope.currentPage;\n }\n }", "function changePage(n) {\n currentPage = Math.min(Math.max(1, n), totalPages);\n displayVenueList();\n}", "onPageClick(i){\n this.changePage(i);\n }", "setPage(newPage) {\n _data.currentPage = newPage;\n Store.emitChange();\n }", "function handleClick(newPage) {\r\n props.setPage(newPage);\r\n }", "function nextPage() {\n page += 1;\n getURL();\n updateButton();\n\n}", "function afterReload () {\n //based on today date valid our html field(date field)\n valid.dateValidHtml();\n //see last time wich page was active \n let wichPage = localStorage.getItem('page');\n //show actived page with info that has have before\n switch(wichPage) {\n case '1':\n ui.showfirst();\n break;\n case null:\n ui.showfirst();\n break;\n case '2':\n ui.showMid();\n ui.cul();\n ui.addTitle();\n break;\n case '3':\n ui.showLast();\n ui.done();\n break;\n }\n}", "function doNewspaperEdit() {\r\n\tallElements = document.getElementById('editNewspaperForm');\r\n\t\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper name:/,\"Gazete ismi:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Yeni avatar:\");\r\n\ttmp = allElements.childNodes[9];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"max. boyut :\");\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"editNewspaper.html\":[\"Edit newspaper\",\"Gazeteyi d\\u00fczenle\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Delete\":[\"Edit newspaper\",\"Gazeteyi d\\u00fczenle\"]\r\n\t});\r\n}", "static reload(){\n\t\tPage.load(Page.currentPage);\n\t}", "changePageNo(inc){\r\n\r\n\t var currentpageNo=this.state.pageNo+inc;\r\n\t this.getStories(currentpageNo); \t\t\t\t// geting stories of current Page\r\n}", "function changePage(page){\n if (typeof page == 'number') {\n activeNav(page)\n var showArticles = 4*page;\n var allArticles = document.getElementsByClassName('news-container');\n for (var i = 0; i < allArticles.length; i++) {\n allArticles[i].classList.remove(\"active-news\")\n allArticles[i].classList.add(\"hidden\")\n }\n for (var i = showArticles-4; i < showArticles; i++) {\n allArticles[i].classList.add(\"active-news\")\n allArticles[i].classList.remove(\"hidden\")\n }\n } else {\n if (page=='prev') {\n var activePage= document.querySelectorAll('.active.pages');\n changePage(activePage[0].innerHTML-1==0?1:activePage[0].innerHTML-1)\n } else if (page=='next') {\n var activePage= document.querySelectorAll('.active.pages');\n changePage(parseInt(activePage[0].innerHTML)+1>=3?3:parseInt(activePage[0].innerHTML)+1)\n }\n }\n}", "function changePage(){\n\t\twindow.location = \"processing.html\";\n\t}", "function changePage() {\n // re-rendering pager widget\n this\n .render();\n\n // triggering changed event\n this.ui()\n .trigger('pagerChanged', {\n widget: this,\n page: this.currentPage()\n });\n }", "function onPageshow(e){\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t}", "function updateWebpage()\n {\n snackBox();\n }", "function newPage(){\n userInProgress = 1;\n pages = 1\n savePage('pages',pages);\n savePage('options',JSON.stringify(options));\n}", "function updatePageInfo(){\n\t\t\t$(\".pageInfo\").html(articleTitles[article]+\" (\"+pageNumber+\" / \"+parseInt(($(\"body\").find(\"#article_\"+article+\":hidden\").length)+1)+\")\");\n\t\t\tif(parseInt(($(\"body\").find(\"#article_\"+article+\":hidden\").length)+1) > 2){\n\t\t\t\t$(\".status\").stop(true, true).hide().css(\"width\", (pageNumber/parseInt(($(\"body\").find(\"#article_\"+article+\":hidden\").length)+1))*100+\"%\").fadeIn(300);\n\t\t\t}else{\n\t\t\t\t$(\".status\").css(\"width\", \"0%\");\n\t\t\t}\n\t\t}", "function onPageshow(e){\n\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t}", "function changePage (page) {\n\tconst queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n const Cat1 = urlParams.get('Cat1');\n\n $.post(\"incl/browse_items.php\", {Cat1: Cat1, page: page}, function (data) {\n \t$(\"#main-data\").html(data);\n });\n}", "function doNewspaperEdit() {\r\n\tallElements = document.getElementById('editNewspaperForm');\r\n\t\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper name:/,\"Újság neve:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Új avatar:\");\r\n\ttmp = allElements.childNodes[9];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"max. méret :\");\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"editNewspaper.html\":[\"Edit newspaper\",\"Újság szerkesztése\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Delete\":[\"Edit newspaper\",\"Újság szerkesztése\"]\r\n\t});\r\n}", "function onChange() {\n setPage(pageStore.getPage());\n }", "function set_page(page) {\r\n\tselected = page;\r\n}", "function changeDocument(pageName, targetWindow)\r\n{\r\n if(targetWindow == null) targetWindow = window;\r\n targetWindow.location.href=pageName;\r\n}", "changeUrl(pageNumber) \r\n\t{\r\n\t\tUrl.changeParameter(this.settings.url_parameter, pageNumber, this.settings.separator);\r\n\t}", "function pagehtml(){\treturn pageholder();}", "function reload_book_page() {\n\twrapper.reload_book_page();\n}", "function onPageshow(e){\n\t\t\t\t\t\t\t\n\t\t\t}", "function PagesContent() {\n\n}", "function gotonextpage(upperCase){\n clickAnchor(upperCase,getItem(\"more\"));\n}", "function refresh_page() {\n refresh_preview();\n refresh_code();\n}", "function changePage(page) {\n\n\t// Can't change from current page to current page\n\tif( currentPage == page ) {\n\t\treturn;\n\t}\n\n\tconsole.log(\"Changing from page \" + currentPage + \" to page \" + page);\n\n\t// Testing for populating final page\n\tif( page == 9 ) {\n\t\tpopulateFinalPage();\n\t}\n\n\n\t$('.page' + currentPage).collapse('hide');\n\t$('.page' + page).collapse('show');\n\n\tcurrentPage = page;\n}", "function replace_titre_page() {\r\n\tadd_log(3,\"replace_titre_page() > Début.\");\r\n\tvar nouv_titre = \"[\" + document.title.split(\" \")[1].toUpperCase() + \"] \" + var_divers['village_actif_nom'] + \" (\" + var_divers['village_actif_pos'][0] + \"|\" + var_divers['village_actif_pos'][1] + \")\";\r\n\tdocument.title = nouv_titre;\r\n\tadd_log(1,\"replace_titre_page() > Nouveau titre : \" + nouv_titre);\r\n\tadd_log(3,\"replace_titre_page() > Fin.\");\r\n\t}", "function changePage(newIndex) {\n var resultsURL = '#/results/' + $scope.client_name + '/' +\n $scope.forms[newIndex].name + '/' + $scope.client_id +\n '/' + $scope.forms[newIndex].id + '/' + $scope.assessment_id;\n $window.location.assign(resultsURL);\n }", "function updatePageData(){\n // Update current step number\n $(\".kf-current-step\").each(function(index) {\n $(this).text(currentStep);\n });\n }", "function lastPage() {\n \n if (page > 1) {\n page -= 1;\n getURL();\n\n }\n else {\n console.log(\"Already on page 1\");\n\n }\n updateButton();\n \n}", "function newPageLoaded()\r\n{\r\n\ttry {\r\n\t\tscriptLog(\"new page loaded: \" + window.location );\r\n\t\t\r\n\t\tif(isVideoPage()) {\r\n\t\t\tscriptLog(\"video page\");\r\n\t\t\t\r\n\t\t\tif(settings_isFullWindowPlayerEnabled())\r\n\t\t\t\tenableFullWindowPlayer();\r\n\t\t\t\r\n\t\t\tif(settings_isScrollToPlayerEnabled())\r\n\t\t\t\tscrollToElement('#movie_player');\r\n\t\t}\r\n\t}\r\n\tcatch(err) { logError(err); }\r\n}", "function clickPageNumber(pagenumber){\n pageNumber = pagenumber;\n //chang display amount label and write page to next page\n changeDisplayAmount(displayType,pagenumber);\n}", "function moreWisdom() {\n location.reload();\n}", "function datasChange() {\n page = 1;\n eventsChange();\n}", "static changePage(photographer)\n {\n document.querySelector(\".main\").innerHTML = \"\"\n document.querySelector(\"nav\").remove()\n\n ProfilPages.displayInfoProfile(photographer)\n ProfilPages.displayGallery(photographer)\n }", "function changePage(e) {\r\n\te.preventDefault();\r\n\tif (e.target.classList.contains('previous')) {\r\n\t\tif (currentPage > 1) {\r\n\t\t\tcurrentPage = currentPage - 1\r\n\t\t\tshowPage(currentPage)\r\n\t\t}\r\n\r\n\t} else if (e.target.classList.contains('next')) {\r\n\t\tif ((currentPage * 3) < reviewLst.length) {\r\n\t\t\tcurrentPage = currentPage + 1\r\n\t\t}\r\n\t\tshowPage(currentPage)\t\t\r\n\t}\r\n}", "onPageChange(unusedPageId) {}", "function updatePages() {\n $('#borrow-content .curr').html(currPage);\n $('#borrow-content .total').html(allPages);\n}", "function updatePageUrl() {\n // here we have updated the globals so we will take the url data from the history object\n // unless its the list view where we use the default dates\n // (if we were coming from the updated url ones the setPageUrl method would trigger instead of this one)\n if (scheduled.currentView == 'list') {\n scheduled.listDateStart = scheduled.defaultlistDateStart;\n scheduled.listDateEnd = scheduled.defaultlistDateEnd;\n }\n\n var urlParams = createUrl();\n var url = window.location.origin + window.location.pathname + urlParams;\n History.pushState(null, null, url);\n }", "function changePage() {\n const url = window.location.href;\n const main = document.querySelector('main');\n loadPage(url).then((responseText) => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = responseText;\n const oldContent = document.querySelector('.mainWrapper');\n const newContent = wrapper.querySelector('.mainWrapper');\n main.appendChild(newContent);\n animate(oldContent, newContent);\n });\n }", "function goToArticles(update) {\n var json = getAllArticlesBrief();\n\n document.getElementsByTagName('h2')[0].innerHTML = 'Bitte waehlen Sie Ihre Bestellung';\n\n var container = document.getElementsByTagName('article')[0];\n\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n\n for (var i = 0; i < json.articles.length; i++) {\n var img = document.createElement('IMG');\n img.setAttribute('src', json.articles[i].thumb_img_url);\n img.setAttribute('onclick', 'changeToScreen(2, false,' + json.articles[i].id + ')');\n\n var section = document.createElement('SECTION');\n section.setAttribute('id', json.articles[i].id);\n section.setAttribute('class', 'tooltip');\n\n var tooltip = document.createElement('SPAN');\n tooltip.setAttribute('class', 'tooltiptext');\n tooltip.innerHTML = json.articles[i].name;\n section.appendChild(tooltip);\n\n section.appendChild(img);\n container.appendChild(section);\n }\n\n if (update) {\n return;\n }\n\n setNewUrl('/articles', 'articles');\n}", "function pageChange(p) {\n if (p.id === Campaign().get('playerpageid')) {\n const override = checkPage();\n if (override !== STATE.get('PageLoad'))\n pageLoad(override);\n else {\n setTimeout(() => {\n calcAndSetAllBonuses();\n }, 1000);\n }\n }\n }", "function updatePage(page, callback) {\n var putObject = {\n 'wiki_page[body]': page.$.html()\n };\n canvas.put(`/api/v1/courses/${courseId}/pages/${page.url}`, putObject, (err, updatedPage) => {\n if (err) {\n console.log(err);\n }\n callback(null);\n });\n}", "changePage(e) {\n e.preventDefault();\n const page = e.target.dataset.page;\n const $btn = e.target.parentElement.parentElement.parentElement.dataset.id;\n const page_url = `/?page=${page}`;\n\n if ($btn === \"1\") {\n fetch(page_url)\n .then(response => response.text())\n .then(text => {\n const parser = new DOMParser();\n const htmlDocument = parser.parseFromString(text, \"text/html\");\n const section = htmlDocument.documentElement.querySelector(\"div.help--slides:nth-child(3)\").innerHTML;\n e.target.parentElement.parentElement.parentElement.innerHTML = section\n });\n } else if ($btn === \"2\") {\n fetch(page_url)\n .then(response => response.text())\n .then(text => {\n const parser = new DOMParser();\n const htmlDocument = parser.parseFromString(text, \"text/html\");\n const section = htmlDocument.documentElement.querySelector(\"div.help--slides:nth-child(4)\").innerHTML;\n e.target.parentElement.parentElement.parentElement.innerHTML = section\n });\n } else if ($btn === \"3\") {\n fetch(page_url)\n .then(response => response.text())\n .then(text => {\n const parser = new DOMParser();\n const htmlDocument = parser.parseFromString(text, \"text/html\");\n const section = htmlDocument.documentElement.querySelector(\"div.help--slides:nth-child(5)\").innerHTML;\n e.target.parentElement.parentElement.parentElement.innerHTML = section\n });\n }\n }", "function setPageTitle (newTitle) {\n title = newTitle;\n }", "function ofChangePage() {\n\tcurrent = getCurrentFromHash(); \n\tloadCurrentShader();\n\tstartFade();\n\n}", "function newHistory(newWin){\n\t\t// store new url\n\t\tnew_url_temp = newWin.location.href;\n\t\t// create push to change url to new url\n\t\tnewWin.history.pushState( {page: 1}, \"title1\", pass_value);\n\t\tnewWin.history.pushState( {page: 2}, \"title2\", new_url_temp);\n\t}", "function change(){\n document.getElementsByTagName(\"p\")[1].innerHTML = \"new paragraph\";\n}", "function readNewspaper() {\n console.log(newspaper_page + 'の' + newspaper_page + 'ページを読みました。');\n}", "function newAssignmentPage(change) {\r\n //Variables\r\n ///The number of assignments on a page, determined by a select box\r\n var pageSize = $(\"#frm-assignment-page-num\").val();\r\n\r\n ///How many assignments to change by\r\n var changeBy = pageSize * change;\r\n\r\n ///How many assignments are now in previous pages\r\n var offset = userSession.assignmentPageOffset + changeBy;\r\n\r\n\r\n //Change page\r\n ///If the new offset is a valid number\r\n if(offset >= 0 || offset <= userSession.assignmentNum){\r\n ///Change the assignment page\r\n getAssignmentPage(offset); \r\n }\r\n}", "function initNewPage(page)\n\t{\n\t\tpage.addListeners();\n\t\t$(page.module).show();\n\t\tpage.update();\n\t}", "function onPageBeforeShow(e){\n\n\t\t\t\t//updateInfo\n\t\t\t\tupdateInfo();\n\t\t\t\t\n\t\t\t}", "function updatePage(data) {\n var existing, newStuff, i;\n var replacements = '.cwbdv, .bte, #ckey_spirit, #ckey_defend, #togpane_magico, #togpane_magict, #togpane_item, #quickbar, #togpane_log';\n var monsterReplacements = '#mkey_0, #mkey_1, #mkey_2, #mkey_3, #mkey_4, #mkey_5, #mkey_6, #mkey_7, #mkey_8, #mkey_9';\n\n // Replace `replacements` elements on live document with the newly obtained data\n existing = document.querySelectorAll(replacements);\n newStuff = data.querySelectorAll(replacements);\n i = existing.length;\n while (i--) {\n existing[i].parentNode.replaceChild(newStuff[i], existing[i]);\n }\n\n // Replace `monsterReplacements` elements on live document with the newly obtained data\n // Don't update dead monsters\n existing = document.querySelectorAll(monsterReplacements);\n newStuff = data.querySelectorAll(monsterReplacements);\n i = existing.length;\n while (i--) {\n if (existing[i].hasAttribute(\"onclick\") || newStuff[i].hasAttribute(\"onclick\")) {\n existing[i].parentNode.replaceChild(newStuff[i], existing[i]);\n }\n }\n\n var popup = data.getElementsByClassName('btcp');\n var navbar = data.getElementById('navbar');\n\n var popupLength = popup.length; // this is because popup.length is changed after insertBefore() is called for some reason.\n var navbarExists = !!navbar;\n\n // If there's navbar/popup in new content, show it\n if (navbarExists) {\n var mainpane = document.getElementById('mainpane');\n mainpane.parentNode.insertBefore(navbar, mainpane);\n window.at_attach(\"parent_Character\", \"child_Character\", \"hover\", \"y\", \"pointer\");\n window.at_attach(\"parent_Bazaar\", \"child_Bazaar\", \"hover\", \"y\", \"pointer\");\n window.at_attach(\"parent_Battle\", \"child_Battle\", \"hover\", \"y\", \"pointer\");\n window.at_attach(\"parent_Forge\", \"child_Forge\", \"hover\", \"y\", \"pointer\");\n }\n if (popupLength !== 0) {\n // Here we're loading popup to the page regardless of the skipNextRound / popupTime settings\n // even though it is \"skipped\" and not even visible; slightly increasing load time.\n // This is because OnPageReload() will later call scripts,\n // some of which will require popup in the document ( Counter Plus )\n var parent = document.getElementsByClassName('btt')[0];\n parent.insertBefore(popup[0], parent.firstChild);\n }\n\n // Run all script modules again\n OnPageReload();\n\n // Reload page if `skipToNextRound` and it is Round End\n // Round End detection: popup exists and navbar does not\n if ( popupLength !== 0 && !navbarExists ) {\n /*\n if ( settings.mouseMelee ) {\n localStorage.setItem('curX', curX);\n localStorage.setItem('curY', curY);\n }\n */\n // Skip to next round\n if ( settings.skipToNextRound ) {\n if (settings.popupTime === 0) {\n window.location.href = window.location.href;\n } else {\n setTimeout(function() {\n window.location.href = window.location.href;\n }, settings.popupTime);\n }\n }\n }\n\n // Remove counter datas on Game End\n // Game End detection: popup and navbar exists\n if ( popupLength !== 0 && navbarExists ) {\n localStorage.removeItem('record');\n localStorage.removeItem('rounds');\n }\n\n }", "function editPage(e) {\n if (!$editDialog) {\n createPageEditDialog();\n }\n editIndex = $('.write-pages li').index(this);\n\n var $window = $(window),\n ww = $window.width(),\n wh = $window.height(),\n pw = ww/(48 + 4),\n ph = wh/(36 + 10),\n p = Math.min(pw, ph);\n setupEditContent();\n $editDialog.css('font-size', p + 'px');\n $editDialog.dialog('open');\n }", "function onPage (viewer, node){\n console.log(node);\n /*\n * If selected previous:\n * check that not at the very 1st node. if not, just change the counter to the appropriate one and reload the tree.\n * If changed the counter option:\n * change the URL\n * If clicked next:\n * remember old state, change the start node, number of nodes to show. add that to the tree info \n * */\n \n if (node.name == \"prev\"){\n var cnt = viewer.tree.root.children[3].value;\n var actCnt, actStart;\n \n if (!graphViewer.pagedNodeInfo[lastNodeController.taxid]) return;\n \n if (graphViewer.pagedNodeInfo[lastNodeController.taxid].start - cnt < 0){\n actCnt = graphViewer.pagedNodeInfo[lastNodeController.taxid].start;\n actStart = 0;\n }\n else{\n actCnt = cnt;\n actStart = graphViewer.pagedNodeInfo[lastNodeController.taxid].start - cnt;\n }\n graphViewer.pagedNodeInfo[lastNodeController.taxid].end = graphViewer.pagedNodeInfo[lastNodeController.taxid].start;\n graphViewer.pagedNodeInfo[lastNodeController.taxid].start = actStart;\n graphViewer.pagedNodeInfo[lastNodeController.taxid].cnt = actCnt;\n\n vjDS[\"dsTreeChildren\"].reload(vjDS[\"dsTreeChildren\"].url, true);\n }else if (node.name == \"ppager\"){\n var info = nodeToUrl[lastNodeController.taxid];\n var nUrl;\n \n if (!graphViewer.pagedNodeInfo[lastNode.taxid]){\n if (info){\n if (info.cnt == node.value) return;\n \n nUrl = info.url;\n nUrl = urlExchangeParameter(nUrl, \"cnt\", node.value);\n info.url = nUrl;\n info.cnt = node.value;\n }\n else{\n nUrl = \"http://?cmd=ionTaxDownInfo&taxid=\" + lastNodeController.taxid + \"&cnt=\" + node.value;\n nodeToUrl[lastNodeController.taxid] = {url: nUrl, cnt: node.value};\n }\n }\n else{\n var nodeInfo = graphViewer.pagedNodeInfo[lastNodeController.taxid];\n nodeInfo.cnt = node.value;\n \n if (nodeInfo.start + nodeInfo.cnt > lastNodeController.totalChildren)\n nodeInfo.end = lastNodeController.totalChildren;\n else\n nodeInfo.end = nodeInfo.start + nodeInfo.cnt;\n \n nUrl = \"http://?cmd=ionTaxDownInfo&taxid=\" + lastNodeController.taxid + \"&cnt=\" + nodeInfo.cnt + \"&start=\" + nodeInfo.start;\n }\n \n var dsName = \"dsTreeChildren\" + Math.round(Math.random()*1000);\n vjDS.add(\"\", dsName, nUrl);\n vjDS[dsName].register_callback(onTreeChildrenLoaded);\n \n vjDS[dsName].load(); \n }else if (node.name == \"next\"){\n var cnt = viewer.tree.root.children[3].value;\n var actEnd, actCnt, actStart;\n \n if (cnt >= lastNodeController.totalChildren) return;\n \n if (graphViewer.pagedNodeInfo[lastNodeController.taxid]){\n var node = graphViewer.pagedNodeInfo[lastNodeController.taxid];\n \n if (node.end == lastNodeController.totalChildren) return;\n \n actCnt = cnt;\n actStart = node.start + node.cnt;\n \n if (actStart + node.cnt > lastNodeController.totalChildren-1){\n actEnd = lastNodeController.totalChildren;\n }\n else\n actEnd = actStart + node.cnt;\n }else{\n actCnt = cnt;\n graphViewer.pagedNodeInfo[lastNodeController.taxid] = {};\n \n if (2*cnt > lastNodeController.totalChildren-1){\n actEnd = lastNodeController.totalChildren;\n actStart = cnt;\n actCnt = actEnd - actStart;\n }\n else{\n actEnd = 2*cnt;\n actStart = cnt;\n }\n }\n graphViewer.pagedNodeInfo[lastNodeController.taxid].start = actStart;\n graphViewer.pagedNodeInfo[lastNodeController.taxid].cnt = actCnt;\n graphViewer.pagedNodeInfo[lastNodeController.taxid].end = actEnd;\n \n if (graphViewer.pagedNodeInfo[lastNodeController.taxid].totalLoaded >= actEnd)\n return;\n \n var dsName = \"dsTreeChildren\" + Math.round(Math.random()*1000);\n vjDS.add(\"\", dsName, \"http://?cmd=ionTaxDownInfo&taxid=\" + lastNodeController.taxid + \"&cnt=\" + actCnt + \"&start=\" + actStart);\n vjDS[dsName].register_callback(onTreeChildrenLoaded);\n \n vjDS[dsName].load();\n } \n }", "function onDocumentLoadSuccess() {\n setPageNumber(1);\n }", "function setPage ( data ) {\n document.title = data.title;\n $('#logo').html('<img src=\"images/' + data.logo + '\"/>');\n $('h3').css('color', data.mainColor);\n $('#sectOne').css('background-image', data.headerBkg);\n $('#headerText').html( data.header );\n setTwoColumn( data.about );\n $('#sectThree').css('background-image', data.subBkg);\n $('#heading2').html( data.subhead );\n $('#addInfo').html( data.subText );\n $('body').css('background', '#ffffff none');\n getMap( data.address, data.zip );\n currentSect = 5;\n nextForm();\n}", "function serveNewPage(id, page){\n\n//set default page value\nif(!page){ page = 'pages/mainTemplate'; };\n\n setCollectionUP(id);\n var template = HtmlService.createTemplateFromFile(page).evaluate().setTitle('Sam\\'s Research Menu');\n DocumentApp.getUi().showSidebar(template);\n}", "function changePageStyle() {\r\n newWordButton.style.visibility = 'visible';\r\n actionText.style.visibility = 'visible';\r\n mainContainer.style.opacity = '0.2';\r\n allInputs.prop('disabled', true);\r\n }", "function handlePageChange() {\n if ((/.*watch\\?.+list=.+/u).test(location)) {\n autoPauseThisVideo = false;\n } else {\n autoPauseThisVideo = config.autoPauseVideo;\n }\n clearTimeout(markAsSeenTimeout);\n toggleGuide = false;\n // Forces some images to reload...\n window.dispatchEvent(new Event(\"resize\"));\n // If we are on the start page (or feed pages).\n if ((/^(\\/?|((\\/feed\\/)(trending|subscriptions|history)\\/?))?$/iu).test(location.pathname)) {\n setYTStyleSheet(bodyStyleStartpage);\n } else if ((/^\\/?watch$/u).test(location.pathname)) {\n setYTStyleSheet(bodyStyleVideo);\n watchpage();\n } else if ((/^\\/?results$/u).test(location.pathname)) {\n setYTStyleSheet(bodyStyleSearch);\n } else if ((/^\\/?playlist$/u).test(location.pathname)) {\n setYTStyleSheet(bodyStylePlaylist);\n } else {\n setYTStyleSheet(bodyStyleDefault);\n }\n if (player.isPeekPlayerActive()) {\n player.showNativePlayer();\n }\n\n if (1 < location.pathname.length) {\n shownative();\n if ((/^\\/?watch$/u).test(location.pathname)) {\n toggleGuide = true;\n }\n } else {\n hidenative();\n }\n}", "function onPageLoad()\n\t{\n\t\t//Set page size\n\t\tSetSize();\n\t\tloadPreferences();\n\t}", "function changePage(page){\r\n if($('#' + page + 'Page').length === 0 || page === \"profilo\"){\r\n console.log(\"Pagina \" + page + \" caricata\");\r\n addPage(page);\r\n }\r\n $(\".page\").css('display','none');\r\n $(\"#\" + page + \"Page\").css('display','block');\r\n}", "function handleChangePage(e, params) {\n var pageNum = params.page,\n eventOrigin = params.eventOrigin,\n currPage,\n prevMrecIframe = $(\".mod-gallery .mod-ads iframe.mrec\"),\n currMrecIframe,\n refreshAds = false,\n url = 'http://couponbar.coupons.com/adblob.asp?AdSize=300x250&pzn=13306iq3710&req=1347339507201&zip=&did=AMUAAREKS&spage=.com/&npage={pageNum}&mrec={isMREC}';\n\n if (eventOrigin.type === \"click\" && eventOrigin.target === \"selector\" && eventOrigin.dir === \"forward\") {\n\n currPage = $(\".mod-gallery .page\").eq(pageNum);\n refreshAds = true;\n\n } else if (eventOrigin.type === \"click\" && eventOrigin.target === \"selector\" && eventOrigin.dir === \"backward\") {\n\n currPage = $(\".mod-gallery .page\").eq(0);\n refreshAds = true;\n }\n\n if (refreshAds) {\n currMrecIframe = $(\"iframe\", currPage);\n\n prevMrecIframe\n .removeClass(\"mrec\")\n .addClass(\"house-ad\");\n\n prevMrecIframe.attr(\"src\",\n url.replace(\"{pageNum}\", pageNum)\n .replace(\"{isMREC}\", false));\n\n currMrecIframe\n .removeClass(\"house-ad\")\n .addClass(\"mrec\");\n\n currMrecIframe.attr(\"src\",\n url.replace(\"{pageNum}\", pageNum + 1)\n .replace(\"{isMREC}\", true));\n }\n\n }", "function newChapter() {\n //Récupération des données\n var livre = $('#fanficoeuvre').html()\n var titreFf = $('#fanficnom').html()\n var auteur = $('#fanficauteur a').html();\n var type = document.newchapterform.querySelector('input[name=\"type\"]:checked').value;\n var titre = document.newchapterform.titre.value;\n var texte = document.newchapterform.texte.value;\n var numero = null ;\n if(type == 'Prologue') {numero = $('.mw-content-text p .Prologuelink').length}\n if(type == 'Chapitre') {numero = $('.mw-content-text p .Chapitrelink').length}\n if(type == 'Epilogue') {numero = $('.mw-content-text p .Epiloguelink').length}\n numero = numero + 1\n \n //Traitement des données\n var modelechapitrefanfiction= '{{Fanfiction/Parties Multiples/Chapitre \\n|livre = '+ livre + '\\n|titreFf = '+ titreFf + '\\n|auteur = '+ auteur + '\\n|type = '+ type + '\\n|numero = '+ numero + '\\n|titre = '+ titre + '\\n|texte = '+ texte + '\\n}}';\n \n //Envoi des données\n postFanfic(livre + ' : ' + titreFf + '/' + type + ' ' + numero, modelechapitrefanfiction, 'Nouveau Chapitre');\n var usertoken = mw.user.tokens.get( 'editToken' );\n if(numero == 1) {\n $.ajax({\n url: mw.util.wikiScript( 'api' ),\n data: {\n format: 'json',\n action: 'edit',\n title: mw.config.get( 'wgPageName' ),\n section: 'new',\n sectiontitle : type,\n minor:true,\n text: '<span class=\"' + type + 'link\">[[{{PAGENAME}}/' + type + ' ' + numero + '|' + type + ' ' + numero + ']]</span>',\n token: usertoken,\n },\n dataType: 'json',\n type: 'POST',\n });\n }else {\n $.ajax({\n url: mw.util.wikiScript( 'api' ),\n data: {\n format: 'json',\n action: 'edit',\n title: mw.config.get( 'wgPageName' ),\n minor:true,\n appendtext: '<span class=\"' + type + 'link\">[[{{PAGENAME}}/' + type + ' ' + numero + '|' + type + ' ' + numero + ']]</span>',\n token: usertoken,\n },\n dataType: 'json',\n type: 'POST',\n });\n \n }\n}", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "function dd_pushPage(page, page_type) {\n \n if (typeof page_type ==='undefined') {\n page_type = 'external';\n }\n \n if (page_type=='internal') {\n var page_url = 'hash_'+page;\n } else {\n var page_url = 'page_'+page;\n }\n \n var main = document.querySelector(\"main\");\n var current_id = main.id;\n var current_page = main.innerHTML;\n // Hide the current page so the user does not see what is going on\n dd(main).hide(); \n \n // Keep the current page in a seperate container\n var pageContainer = document.querySelector(\"ddpage[url='\"+current_id+\"']\");\n if (!pageContainer) { // If we can't find any container, create one\n var pageContainer = document.createElement(\"ddpage\"); \n pageContainer.style = \"display: none\";\n pageContainer.setAttribute('url',current_id);\n document.querySelector(\"body\").appendChild(pageContainer);\n }\n \n // Then we transfer each element one by one\n // We use this approach because we want to keep the event listeners active\n pageContainer = document.querySelector(\"ddpage[url='\"+current_id+\"']\");\n while (main.hasChildNodes()) { pageContainer.appendChild(main.firstChild); }\n \n // Replace it with this new page\n var newPage = document.querySelector(\"ddpage[url='\"+page_url+\"']\");\n while (newPage.hasChildNodes()) { main.appendChild(newPage.firstChild); }\n \n \n \n // Finally, change the url of the page\n if (page_type == 'internal') {\n page = '#'+page;\n window.history.pushState({page: page}, page, page);\n } else {\n window.history.pushState({page: page}, page, page);\n \n }\n \n // Change the id of this new page\n main.id = page_url;\n \n // Only show when page is ready\n dd(main).fadeIn(500);\n \n\n}", "function pageFirst()\n{\n\tcurrentPage = 1;\n\tviewPage();\n}", "function updatePage() {\n switch (currentState)\n {\n case pageStates.DEFAULT:\n displayDefault();\n break;\n case pageStates.UNITY:\n displayUnity();\n break;\n case pageStates.CUSTOM:\n displayCustom();\n break;\n case pageStates.WEB:\n displayWeb();\n break;\n default:\n displayDefault();\n break;\n }\n}", "function publish_article(articleid)\n{\n change_article_state(articleid, \"publish\", \"pubbtn-a\" + articleid);\n}", "function changeSection() {\n $('.container-page').each(function() {\n if (this.id != newid+'-page') {\n this.style.display = 'none';\n } else {\n var width = $(\"#links-container\").css(\"width\");\n this.style.display = 'inline';\n $(\"#links-container\").css({\"width\": width});\n if (this.id == 'portfolio-page') {\n socket.emit('requestImages');\n }\n if (this.id == 'reels-page') {\n $('#scroll-player').attr('src', reels.clips[0]);\n $('#reel-info').text(reels.summaries[0]);\n }\n }\n });\n }", "changePageIC ({ commit, state }, newPage) {\r\n const pageObject = state.pages[newPage - 1];\r\n if (pageObject) {\r\n if (pageObject.usable) {\r\n commit('setPage', newPage);\r\n }\r\n }\r\n }", "function updatePage() {\n // check page state\n if (staticPage) {\n // add exciting image and text\n body.style.backgroundImage =\n 'url(\"./images/chuttersnap-eH_ftJYhaTY-unsplash.jpg\")';\n headline.innerText = 'A dynamic website looks even better!';\n base.innerText = 'because changes add ';\n highlight.innerText = 'fun!';\n highlight.classList.add('exciting');\n button.textContent = 'Go Back';\n } else {\n // revert to boring image and text\n body.style.backgroundImage =\n 'url(\"./images/borna-bevanda-beCHuGxfBhk-unsplash.jpg\")';\n headline.innerText = 'A static webpage looks nice...';\n base.innerText = 'but it can be ';\n highlight.innerText = 'boring :(';\n highlight.classList.remove('exciting');\n button.textContent = 'Change Things Up!';\n }\n\n // toggle page state\n staticPage = !staticPage;\n}", "function SetPage(pagename)\n{\n for (var i = 0; i < PagesList.length; i++)\n {\n if (PagesList[i][1] == pagename)\n {\n LoadPage(\"./pages/\" + PagesList[i][0]);\n curPage = PagesList[i][1];\n }\n }\n}" ]
[ "0.71076655", "0.69101566", "0.6563448", "0.65278345", "0.64424205", "0.6360666", "0.6359586", "0.63536316", "0.6308589", "0.6275346", "0.625404", "0.62477875", "0.6187116", "0.61481434", "0.61346555", "0.61279297", "0.6120621", "0.6114105", "0.60951114", "0.60929155", "0.6084497", "0.6056296", "0.60421956", "0.6041116", "0.6037524", "0.6031809", "0.6023054", "0.6022838", "0.60226077", "0.60115075", "0.6001833", "0.6000488", "0.5987533", "0.5983256", "0.59668756", "0.5966666", "0.59509254", "0.5949018", "0.5947842", "0.59260654", "0.5922129", "0.5915814", "0.5913968", "0.59105587", "0.5898112", "0.58960366", "0.58955497", "0.58890647", "0.588642", "0.58840775", "0.58738375", "0.58719736", "0.5868199", "0.58643174", "0.5860359", "0.5848892", "0.5838383", "0.5832533", "0.5808464", "0.5795055", "0.5794749", "0.5793436", "0.579108", "0.5785784", "0.57852346", "0.5784532", "0.578314", "0.57826596", "0.57678795", "0.5761609", "0.57524693", "0.5745894", "0.57438165", "0.5742", "0.5733647", "0.57289165", "0.5719283", "0.57051945", "0.56937885", "0.56787086", "0.56777275", "0.56747437", "0.5668949", "0.56624097", "0.56610674", "0.5660323", "0.5658478", "0.5657212", "0.56497955", "0.5643701", "0.56435287", "0.56370735", "0.5636499", "0.5636297", "0.5635914", "0.56319743", "0.5624964", "0.5623926", "0.56236255", "0.56233174" ]
0.7999115
0
function read neww paper
function readNewspaper() { console.log(newspaper_page + 'の' + newspaper_page + 'ページを読みました。'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function justRead () {\n var encoded = fs.readFileSync ('transpile_drawio_to_swipl.drawio', 'utf-8');\n fs.writeFileSync ('_raw3.raw', encoded, null);\n}", "function Paper_format_other(){\n\n}", "function readPgm(filename) {\n var _bytes = snarf(filename, \"binary\"); // Uint8Array\n var loc = 0;\n var { loc, word } = getAscii(_bytes, loc, true);\n if (word != \"P5\")\n\tthrow \"Bad magic: \" + word;\n var { loc, word } = getAscii(_bytes, loc);\n var width = parseInt(word);\n var { loc, word } = getAscii(_bytes, loc);\n var height = parseInt(word);\n var { loc, word } = getAscii(_bytes, loc);\n var maxval = parseInt(word);\n loc++;\n var T = TypedObject.uint8.array(width).array(height);\n var grid = new T;\n for ( var h=0 ; h < height ; h++ )\n\tfor ( var w=0 ; w < width ; w++ ) \n\t try { grid[h][w] = _bytes[loc+h*width+w]; } catch (e) { throw height + \" \" + width + \" \" + e + \" \" + h + \" \" + w }\n return { header: _bytes.subarray(0,loc), grid: grid, width: width, height: height, maxval: maxval };\n}", "function readDailyVerses() {\n //Fatal Jerryscript Error: ERR_OUT_OF_MEMORY -- Looks like even one bible chapter is too much for the watch's memory.\n text3 = readFileSync(\"/mnt/assets/resources/DailyVerse.json\", \"json\");\n}", "function paper_to_html(paper) {\n return '<p class=\"paper-paragraph\">' +\n ' <a href=\"' + paper.link + '\">' + paper.title + '</a>' +\n '</p>' +\n '<a href=\"' + paper.link + '\">' +\n ' <img class=\"paper-thumb\" src=\"' + paper.thumbnail + '\">' +\n '</a>';\n}", "function changeNewspaperPage(new_paper) {\n newspaper_page = new_paper;\n console.log(newspaper_page + 'の' + newspaper_page + 'ページを開きました。');\n}", "function Sread() {\r\n}", "function showPapers(paperlist) {\n let container = document.querySelector('.container'), subcontainer, preview;\n let line, comment;\n for (let i = paperlist.revisions.length - 1; i >= 0; i--) {\n subcontainer = document.createElement('div');\n subcontainer.classList.add('subcontainer');\n subcontainer.classList.add('last');\n preview = document.createElement('embed');\n preview.src = '/' + paperlist.revisions[i].url;\n preview.type = 'application/pdf';\n subcontainer.appendChild(preview);\n let modi = document.createElement('div');\n modi.classList.add('modification');\n for (let j = paperlist.revisions[i].feedback.length - 1; j >= 0; j--) {\n comment = document.createElement('div');\n comment.classList.add('pcomment');\n comment.innerHTML = paperlist.revisions[i].feedback[j].feedback;\n modi.appendChild(comment);\n }\n subcontainer.appendChild(modi);\n container.appendChild(subcontainer);\n if (i != 0) {\n subcontainer.classList.remove('last');\n line = document.createElement('div');\n line.classList.add('line-break');\n container.appendChild(line);\n }\n }\n return paperlist\n}", "function readBooks() {\n //Fatal Jerryscript Error: ERR_OUT_OF_MEMORY -- Looks like even one bible chapter is too much for the watch's memory.\n text1 = readFileSync(\"/mnt/assets/resources/Books.json\", \"json\");\n}", "get paper() {\n return Wick.View.paperScope;\n }", "function savePoem() {\n let c;\n //creates a new p5 instance everytime you press the save button and makes a simple square artwork\n const can = p => {\n var p_elements = document.getElementsByClassName('output-style')[0].innerText;\n var q_elements = document.getElementsByClassName('bodycopy')[0].innerText;\n c = q_elements + \" \" + p_elements;\n console.log(c);\n\n p.setup = function() {\n p.noLoop();\n p.pixelDensity(1);\n let cnv = p.createCanvas(400, 400);\n p.background(255);\n p.textAlign(CENTER);\n p.textFont(myFont);\n p.textSize(20);\n p.text(c, 40, 120, 340, 340);\n p.save(\"canvas.jpg\");\n p.clear();\n };\n };\n new p5(can);\n allClear();\n\n}", "function pwfs() {\n return pdfs('wfFrame' + pdf('CurrentDesk'));\n}", "function printInp() {\r\n html2pdf(document.body, { margin: 10,\r\n filename: 'TADEE_Project_Input.pdf',\r\n image: { type: 'jpeg', quality: 0.98 },\r\n html2canvas: { scale: 1, logging: true, dpi: 192, letterRendering: true },\r\n jsPDF: { unit: 'mm', format: 'a3', orientation: 'portrait' }});\r\n }", "function loadNotes(title) {\n //citeste json si returneaza obiect\n let x= fs.readFileSync(title).toString()\n let y=JSON.parse(x)\n console.log(y);\n return y\n \n}", "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n if (canCreateNote(ransom, magazine)) {\n console.log('Yes');\n } else {\n console.log('No');\n }\n}", "function downloadPNG(){\r\n\tcrackPoint.remove();\r\n\tpaper.view.update();\r\n var canvas = document.getElementById(\"paperCanvas\");\r\n var downloadLink = document.createElement(\"a\");\r\n downloadLink.href = canvas.toDataURL(\"image/png;base64\");\r\n downloadLink.download = simText+'.png';\r\n document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n document.body.removeChild(downloadLink);\r\n\tcrackPoint.insertAbove(concreteObjects[concreteObjects.length-1]);\r\n}", "function readNewick(file) {\n tree = \"\";\n\n // Code to open file and read tree(s)...\n\n return tree;\n}", "function readFile(print) {\n const ERR_MESS_READ = \"TODO: Trouble reading file.\";\n\n var i;\n\n todocl.dbx.filesDownload({\n path: todocl.path\n }).then(function (response) {\n var textBlob, reader;\n\n textBlob = response.fileBlob;\n reader = new FileReader();\n\n reader.addEventListener(\"loadend\", function () {\n var contents = reader.result;\n todocl.textArr = contents.split(NEW_LINE);\n\n setText(todocl.textArr,\n function (callBack) {\n if (callBack && print) {\n displayFile();\n }\n if (callBack) {\n\n }\n });\n });\n reader.readAsText(textBlob);\n }).catch(function (Error) {\n todocl.out.innerHTML = ERR_MESS_READ;\n });\n }", "function from_file(page) {\n let str = require('fs').readFileSync('./tests/cache/' + page.toLowerCase() + '.txt', 'utf-8');\n let r = wtf.parse(str);\n console.log(r.citations);\n return r;\n}", "function newDoc(){\n\tvar img = document.getElementById(\"img3\");\n\tvar path = img.src;\n var index = path.lastIndexOf(\"/\");\n var filename = path;\n var width = img.clientWidth;\n\tvar height = img.clientHeight;\n\tvar weekday = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];\n if(index !== -1) { \n filename = path.substring(index+1,path.length);\n }\n\tdocument.open();\n\tdocument.write(\"<h1>\",filename,\"</h1>\");\n\tdocument.write(\"<p>This image is called \",filename,\". And the path of the image is \",path,\". It is indeed a very beautiful image!!!</p>\");\n\tdocument.write('<img id=\"img3\" width=\"50%\" onclick = \"newDoc()\" src=\"',path,'\">');\n\tdocument.write(\"<p>This image is \",width,\" wide and \",height,\" high.</p>\");\n\tvar thisTime = new Date();\n\tvar date = thisTime.getFullYear()+'-'+(thisTime.getMonth()+1)+'-'+thisTime.getDate();\n\tvar time = thisTime.getHours() + \":\" + thisTime.getMinutes() + \":\" + thisTime.getSeconds();\n\tweekday = weekday[thisTime.getDay()];\n\tvar dateTime = time+' '+date+' '+weekday;\n\tdocument.write(dateTime);\n\tdocument.close();\n}", "function readNotes() {\n return data;\n}", "function read() {\n fs.readFile(\"random.txt\", \"utf8\", function (err, data) {\n if (err) {\n return console.log(err);\n }\n console.log(data);\n song(data);\n });\n}", "function createReader(input, output, name, circle_color) {\n var paper = new paper_lib.PaperScope(),\n reader = {},\n rows = input.height,\n columns = input.width,\n scale = 30,\n padding = 10,\n r = scale * 0.3,\n name = name || \"default_web\",\n source = input.getContext(\"2d\"),\n preview_circles = [];\n\n output.width = input.width * scale;\n output.height = input.height * scale;\n paper.setup(output);\n\n var circle = new paper.Path.Circle({radius: r, fillColor: \"#fff\"});\n\n for (var y = 0; y < rows; y += 1) {\n for (var x = 0; x < columns; x += 1) {\n var c = circle.clone(),\n xp = soso.lerp(x, 0, columns - 1, padding, output.width - padding),\n yp = soso.lerp(y, 0, rows - 1, padding, output.height - padding);\n c.position = [xp, yp];\n\n preview_circles.push(c);\n }\n }\n circle.remove();\n\n function updatePreview(imageData) {\n var data = imageData.data,\n i,\n stride = 4;\n\n for (i = 0; i < (imageData.height * imageData.width); i += 1) {\n var id = i * stride,\n ir = id,\n ig = id + 1,\n ib = id + 2,\n ia = id + 3;\n\n preview_circles[i].fillColor = [data[ir] / 255.0, data[ig] / 255.0, data[ib] / 255.0, data[ia] / 255.0];\n }\n }\n\n function broadcastPixels(imageData) {\n var msg = {\n id: name,\n width: input.width,\n height: input.height\n },\n pixels = [],\n i,\n stride = 4,\n end = (imageData.height * imageData.width * stride),\n data = imageData.data;\n\n for (i = 0; i < end; i += stride) {\n var r = data[i],\n g = data[i + 1],\n b = data[i + 2],\n a = data[i + 3] / 255.0;\n r = Math.floor(r * a);\n g = Math.floor(g * a);\n b = Math.floor(b * a);\n\n pixels.push(r, g, b);\n }\n\n msg.pixels = pixels;\n }\n\n var frame = 0,\n broadcastRate = 2, // Hz\n broadcastInterval = Math.floor(60 / broadcastRate);\n paper.view.onFrame = function (event) {\n var data = source.getImageData(0, 0, input.width, input.height);\n updatePreview(data);\n // Broadcast at a reduced rate\n if(frame % broadcastInterval === 0) {\n broadcastPixels(data);\n }\n frame += 1;\n };\n\n reader.source = source;\n\n return reader;\n}", "function savePaper() {\n\t// get the paper with its annotations from the div\n\t// alert($('mainpage').down(1));\n\t// pass on the comments info\n\tcomments = $('comment').getValue();\n\ttitle = $$('title').reduce().readAttribute('filename');\n\t// alert(titleElem.readAttribute('filename'));\n\t// objJSON={\n\t// \"conceptHash\": conceptHash\n\t// };\n\t// var strJSON = encodeURIComponent(JSON.stringify(objJSON));\n\t//alert('109: ' + subTypeHash.get(109));\n\t//alert('113: ' + subTypeHash.get(113));\n\tvar conceptJSON = Object.toJSON(conceptHash);\n\tvar subtypeJSON = Object.toJSON(subTypeHash);\n\t// alert(\"The strJSON is \" + strJSON);\n\n\tnew Ajax.Request('ART?action=savePaperMode2', {\n\t\tmethod :'post',\n\t\tparameters : {\n\t\t\tname :title,\n\t\t\tcomment :comments,\n\t\t\tconceptJSON :conceptJSON,\n\t\t\tsubtypeJSON :subtypeJSON\n\t\t},\n\t\t// response goes to\n\t\tonComplete :notify('save', null)\n\t});\n\n}", "function readSketchyFile() {\n\ttry {\n\t\tfs.readFile('does_not_exist.txt', function(err, data) {\n\t\t\tif(err) throw err; \n\t\t});\n\t} catch(err) {\n\t\tconsole.log('warning: minor issue occurred, program continuing');\n\t} \n}", "async function readArticle(filePath){\n const file = await readFileAsync(filePath);\n \n const data = matter(file);\n \n const {\n content,\n data: { // gray-matter pakki skilar efni í content og lýsigögnum í data\n title,\n description,\n id,\n href,\n slug,\n image,\n position,\n nafn,\n who,\n },\n } = data;\n \n return {\n content: md.render(content),\n title,\n description,\n id,\n href,\n slug,\n image,\n position,\n nafn,\n who,\n path: filePath,\n };\n}", "function bbsReader(data) {\n var i = 0, match, result = \"\";\n \n var author, title, time, label, board;\n \n if ((match = /^(\\xa7@\\xaa\\xcc:.*)\\n(.*)\\n(.*)\\n/.exec(data))) {\n // draw header \n author = stripColon(match[1]);\n title = stripColon(match[2]);\n time = stripColon(match[3]);\n \n // find board\n var t = splitLabel(author);\n author = t[0];\n label = t[1];\n board = t[2];\n \n // 作者\n result += makeHead(\"\\xa7@\\xaa\\xcc\", author, label, board);\n // 標題\n result += makeHead(\"\\xbc\\xd0\\xc3D\", title);\n // 時間\n result += makeHead(\"\\xae\\xc9\\xb6\\xa1\", time);\n \n // ─\n result += \"<div class='line'><span class='f6'>\" + \"\\xa2w\".repeat(39) + \"</span></div>\";\n \n i += match[0].length;\n }\n \n var span = new Span(7, 0, false),\n pos = 0, cleanLine = false, cjk = false;\n \n result += \"<div class='line'>\";\n \n for (; i < data.length; i++) {\n // Special color\n if (pos == 0) {\n var ch = data.substr(i, 2);\n if (ch == \"\\xa1\\xb0\") {\n // ※\n cleanLine = true;\n span.reset();\n span.f = 2;\n } else if (ch == \": \") {\n // : \n cleanLine = true;\n span.reset();\n span.f = 6;\n }\n }\n if (data[i] == \"\\x1b\") {\n // ESC\n var span2 = extractColor(data, i, span);\n if (!span2) {\n span.text += data[i];\n pos++;\n } else if (cjk && data[span2.i] != \"\\n\") {\n span.text += data[span2.i];\n span.halfEnd = true;\n \n result += span.toString();\n \n span2.text += span.text.substring(span.text.length - 2);\n span2.halfStart = true;\n \n pos++;\n i = span2.i;\n span = span2;\n cjk = false;\n } else {\n cjk = false;\n result += span.toString();\n\t\t\t\tif (span2.i <= i) {\n\t\t\t\t\tthrow new Error(\"bbs-reader crashed! infinite loop\");\n\t\t\t\t}\n i = span2.i - 1;\n span = span2;\n }\n } else if (data[i] == \"\\r\" && data[i + 1] == \"\\n\") {\n continue;\n } else if (data[i] == \"\\r\" || data[i] == \"\\n\") {\n result += span.toString() + \"</div><div class='line'>\";\n span.text = \"\";\n span.halfStart = false;\n span.halfEnd = false;\n cjk = false;\n \n if (cleanLine) {\n span.reset();\n cleanLine = false;\n }\n \n pos = 0;\n } else {\n if (cjk) {\n cjk = false;\n } else if (data.charCodeAt(i) & 0x80) {\n cjk = true;\n }\n span.text += data[i];\n pos++;\n }\n }\n \n result += span.toString() + \"</div>\";\n \n return {\n html: result,\n title: title,\n author: author,\n time: time\n };\n}", "function DNewConvertXML() {\n\n\tvar files = 'abh04t.nrf';\n\tvar length = 7;\n\n\tvar xmlstring = '<?xml version=\"1.0\"?><body><ha><han></han><h0><h0n></h0n><h1><h1n></h1n><h2><h2n></h2n><h3><h3n></h3n><h4><h4n></h4n>';\n\t\n\tvar meta = 0;\n\tvar volume = 0;\n\tvar vagga = 0;\n\tvar sutta = 0;\n\tvar section = 0;\n\tfor(var i = 0; i <= length; i++) {\n\t\t\n\t\tvar bookload = 'tmp/' + files + i + '.xml';\n\t\tvar xmlhttp = new window.XMLHttpRequest();\n\t\txmlhttp.open(\"GET\", bookload, false);\n\t\txmlhttp.send(null);\n\t\t//alert(bookload);\n\t\tvar xd = xmlhttp.responseXML.documentElement;\n\t\t//alert(xmlDoc.textContent);\n\t\t\n\t\tvar x = xd.getElementsByTagName(\"p\");\n\t\tfor (var j = 0; j < x.length; j++) {\n\t\t\txmlstring += (new XMLSerializer()).serializeToString(x[j]).replace(/ed=\"([A-Z])\" n/g,\"$1 asdf\").replace(/ asdf=\"([0-9.]+)\"/g,\"$1\").replace(/<pb ([^ >]+) *\\/>/g,\"^a^$1^ea^\").replace(/<hi rend=\"bold\">([^<]*)<\\/hi>/g,\"^b^$1^eb^\").replace(/<\\/*hi[^<]*>/g,\"\").replace(/<p rend=\"title\">([^<]*)<\\/p>/g,\"</h4></h3></h2></h1><h1><h1n>$1</h1n><h2><h2n></h2n><h3><h3n></h3n><h4><h4n></h4n>\").replace(/<p rend=\"subhead\">([^<]*)<\\/p>/g,\"</h4></h3></h2><h2><h2n>$1</h2n><h3><h3n></h3n><h4><h4n></h4n>\").replace(/<p rend=\"subsubhead\">([^<]*)<\\/p>/g,\"</h4></h3><h3><h3n>$1</h3n><h4><h4n></h4n>\").replace(/<p rend=\"chapter\">([^<]*)<\\/p>/g,\"</h4><h4><h4n>$1</h4n>\").replace(/<p rend=\"bodytext\">/g,\"<p>\").replace(/<p rend=\"bodytext\">/g,\"<p>\");\n\t\t}\n\t}\n\txmlstring += '</h4></h3></h2></h1></h0></ha></body>';\n\twriteToDesktop('temp.xml',xmlstring);\n\t//D_showTempXML();\n}", "function read_work_v1(work)\n{\n let text = `${work.name} ${work.author} ${work.preface} ${work.lines.join(' ')}`;\n read_work(text);\n}", "function doBook( aBook,theFolder ){ \r for ( var i = 0; i < aBook.bookContents.length; i++ ){\r// thnx to Neil77 from HDS\r var content = aBook.bookContents[i];\r var doc = app.open(content.fullName);\r// take the .indd's name and make a .idml from it\r var aName = doc.name;\r var newName = aName.replace(\"indd\",\"idml\");\r var theFile = File(theFolder +\"/\"+ newName );\r// export\r doc.exportFile(ExportFormat.INDESIGN_MARKUP, theFile, false);\r// dont need to save right now\r doc.close(SaveOptions.NO);\r\r }\r}", "function paper(deg1) {\n let d, d1, x, z;\n x = 0;\n z = 0;\n // let ss=\"\";\n for (let i = 1; i < 6; i++) {\n let deg;\n if (i === 1 || i === 6)\n deg = 0;\n else\n // deg = (i/6) * deg1;\n deg = ((i % 2) * 2 - 1) * deg1;\n let radian = deg * Math.PI / 180;\n let s = \"dv\" + i;\n d = document.getElementById(s);\n d1 = document.getElementById(s + i);\n let st;\n st = \"transform: translate3d(\" + x + \"px,0,\" + z + \"px)\" +\n \" rotateY(\" + deg + \"deg) \" +\n \";\" +\n \"transform-origin:\" + 0 + \"px;\";\n d.style = st;\n // d1.style = st;\n if (deg1 === 0) {\n st+=\"opacity:0;\";\n }else{\n st+=\"opacity:0.65;\";\n }\n d1.style=st;\n x += d.offsetWidth * Math.cos(radian);\n z -= d.offsetWidth * Math.sin(radian);\n }\n // document.getElementById(\"print\").innerHTML=ss;\n}", "function extractBookState() {\n //console.log('start extract');\n\n var book = {},\n $write = $('.active-page.write-page');\n book.title = $.trim($write.find('input[name=title]').val());\n book.author = $.trim($write.find('input[name=author]').val());\n book.categories = $write.find('.categories input[type=checkbox]:checked').map(function(i, v) {\n return $(v).prop('value'); }).get();\n book.type = $write.find('select[name=type]').val();\n book.audience = $write.find('select[name=audience]').val();\n book.language = $write.find('select[name=language]').val();\n var tags = $.trim($('input[name=tags]').val());\n tags = tags.replace(/[-.,\\/#!@#$%\\^&*()_=+\\[\\]{};:'\"<>?\\\\|`~]/g, \" \");\n tags = tags.replace(/\\s{2,}/g, \" \");\n book.tags = tags.split(' ');\n book.reviewed = $write.find('input[name=reviewed]:checked').length > 0;\n book.pages = $write.find('.write-pages li').map(function(i, p) {\n var $p = $(p),\n caption = $.trim($p.find('.thr-caption').html()) || '',\n img = $p.find('img.thr-pic'),\n width = parseInt(img.attr('data-width'), 10),\n height = parseInt(img.attr('data-height'), 10);\n return {\n text: caption,\n url: img.attr('src'),\n width: width,\n height: height\n };\n }).get();\n if (book.pages.length > 0) {\n var p = book.pages[0];\n var page = {\n text: book.title,\n url: p.url.replace('.jpg', '_t.jpg'),\n width: p.width > p.height ? 100 : Math.round(100 * p.width / p.height),\n height: p.width > p.height ? Math.round(100 * p.height / p.width) : 100\n };\n book.pages.unshift(page);\n }\n return book;\n }", "function getNotes(){\n try{\n return JSON.parse(fs.readFileSync('notes.txt'));\n }\n catch(err){\n return [];\n }\n}", "function getNewPartitionPaper() {\n\tvar partitionPaper = 'false';\n\ttry {\n\t\t// get the value of a check box given its id\n\t\tpartitionPaper = $(\"#new_partition_paper\").is(\":checked\").toString();\n\t\t//console.log(' partition paper = ' + $(\"#partition_paper\").is(\":checked\") );\n\t} finally {\n\t}\n\treturn partitionPaper; \n }", "function drwPN() {\n\t//_ console.log('drwPN() ; iGav='+pad(nGav0))\n\tcLinBG = bgcolor\n\tvar gID = 'G' + pad(nGav0) \t\t\t\t\t//>\tID da Gaveta\n\ttry {\t\t\t\t\t\t\t\t\t\t\t\t\t//>\tApaga grupo existente\n\t\tdrawSQMA.select('#Pn' + nPn + '_' + gID).remove()\n\t\tdrawSQMA.select('#maskPn' + nPn + '_' + gID).remove()\n\t} catch (error) {} \t\t\t\t\t\t\t\t\n\n\tvar gPn = drawSQMA.group() \t\t\t\t\t\t\t//>\tCria Grupo\n\tgPn.attr({ id: 'Pn' + nPn + '_' + gID }) //>\tAtribui nome\n\n\tlet tmpIE = null\n\tlet vLinPn = []\n\tlet vLinPr = []\n\tlet vLinB = []\n\tvLinPn.push(mG[nGav0][0][0][0])\n\tvLinPn.push(mG[nGav0][0][0][1] - 0.5 * Alt)\t//> Importante. Evita mask clipping.\n\t\n\t//*\tCASO CP EXTERNO\n\tif (nIE == 1) {\n\t\ttmpIE = nIE\n\t\tvLinPn.push(mG[nGav0][0][0][0])\n\t\tvLinPn.push(mG[nGav0][0][0][1] + Alt)\n\t\tvLinPn.push(mG[nGav0][nLado][tmpIE][0])\n\t\tvLinPn.push(mG[nGav0][nLado][tmpIE][1] + Alt)\n\t\t\n\t\t\n\t\tvLinB.push(mG[nGav0][0][0][0])\n\t\tvLinB.push(mG[nGav0][0][0][1] + Alt)\n\t\tvLinB.push(mG[nGav0][nLado][tmpIE][0])\n\t\tvLinB.push(mG[nGav0][nLado][tmpIE][1] + Alt)\n\n\t\tif (nGav0 != nGav) {\n\t\t\ttry {\n\t\t\t\tvLinPr.push(mG[nGav0][nLado][tmpIE][0])\n\t\t\t\tvLinPr.push(mG[nGav0][nLado][tmpIE][1] + Alt)\n\t\t\t\tvLinPr.push(mG[nGav][nLado][tmpIE][0])\n\t\t\t\tvLinPr.push(mG[nGav][nLado][tmpIE][1] + Alt+yOff/4)\t//> Distanciar seta\n\t\t\t\t\n\t\t\t\tvLinB.push(vLinPr[0])\n\t\t\t\tvLinB.push(vLinPr[1])\n\t\t\t\tvLinB.push(vLinPr[2])\n\t\t\t\tvLinB.push(vLinPr[3])\n\t\t\t\t\n\t\t\t} catch (error) {console.log(error)}\n\t\t}\n\n\t\t//_ console.log(vLinPn)\n\t\t//_ console.log(vLinPr)\n\t\t//_ console.log(vLinB)\n\t}\n\n\t//*\tCASO CP INTERNO E LADO != CENTRO\n\tif (nIE == 0 && nLado != 0) {\n\t\tif (nGav0 == nGav) {\n\t\t\ttmpIE = 0\n\t\t} else {\n\t\t\ttmpIE = 1\n\t\t\tvLinPn.push(mG[nGav0][0][0][0])\n\t\t\tvLinPn.push(mG[nGav0][0][0][1] + Alt)\n\t\t\tvLinPn.push(mG[nGav0][nLado][tmpIE][0])\n\t\t\tvLinPn.push(mG[nGav0][nLado][tmpIE][1] + Alt)\n\t\t\t// vLinPn.push(mG[nGav][nLado][tmpIE][0])\n\t\t\t// vLinPn.push(mG[nGav][nLado][tmpIE][1]+Alt)\n\n\t\t\tvLinPr.push(mG[nGav0][nLado][tmpIE][0])\n\t\t\tvLinPr.push(mG[nGav0][nLado][tmpIE][1] + Alt)\n\t\t\tvLinPr.push(mG[nGav][nLado][tmpIE][0])\n\t\t\tvLinPr.push(mG[nGav][nLado][tmpIE][1])\n\t\t\tvLinPr.push(mG[nGav][0][tmpIE][0])\n\t\t\tvLinPr.push(mG[nGav][0][tmpIE][1])\n\n\t\t\tvLinB.push(vLinPn[0])\n\t\t\tvLinB.push(vLinPn[1])\n\t\t\tvLinB.push(vLinPn[2])\n\t\t\tvLinB.push(vLinPn[3])\n\t\t\tvLinB.push(vLinPr[0])\n\t\t\tvLinB.push(vLinPr[1])\n\t\t\tvLinB.push(vLinPr[2])\n\t\t\tvLinB.push(vLinPr[3])\n\t\t\tvLinB.push(mG[nGav][nLado][tmpIE][0] + (mG[nGav][0][tmpIE][0]-mG[nGav][nLado][tmpIE][0])*0.45)\n\t\t\tvLinB.push(mG[nGav][nLado][tmpIE][1] + (mG[nGav][0][tmpIE][1]-mG[nGav][nLado][tmpIE][1])*0.45)\n\t\t}\n\t}\n\n\t//> Se saída por baixo\n\tif (nIE == 0 && nLado == 0 && nGav0 == nGav) {\n\t\tlet vBaixo = []\n\t\tcalcMat(x0, y0 + nGav0 * yOff, Larg)\n\n\t\tvBaixo.push(mP[1][1][0])\n\t\tvBaixo.push(mP[1][1][1] + Alt)\n\t\tvBaixo.push(mP[4][4][0])\n\t\tvBaixo.push(mP[4][4][1] + Alt)\n\t\tvBaixo.push(mP[3][3][0])\n\t\tvBaixo.push(mP[3][3][1] + Alt)\n\n\t\tvBaixo.push(mP[3][3][0])\n\t\tvBaixo.push(mP[3][3][1] + 3 * Alt)\n\t\tvBaixo.push(mP[4][4][0])\n\t\tvBaixo.push(mP[4][4][1] + 3 * Alt)\n\t\tvBaixo.push(mP[1][1][0])\n\t\tvBaixo.push(mP[1][1][1] + 3 * Alt)\n\n\t\tvar r = drawSQMA\n\t\t\t.polygon(vBaixo)\n\t\t\t.attr({ id: 'PnD' + nPn + '_' + gID, fill: patPn })\n\t\t\t.appendTo(drawSQMA.select('#Pn' + nPn + '_' + gID))\n\t}\n\t//> Se em direção ao fundo\n\tif (nIE == 1 && nGav0 != nGav) {\n\t\t\n\t\t\n\t}\n\n\tvSelLin = []\n\tvSelLin.push(vLinPn)\n\ttry {\n\t\tvSelLin.push(vLinPr)\n\t} catch (error) {}\n\t//*\tDESENHAR LINHAS\n\tchkProdColor()\n\t//Linha Branca\n\ttry {\n\t\tvar polyline = drawSQMA\n\t\t\t.polyline(vLinB)\n\t\t\t.attr({\n\t\t\t\tfill: 'none',\n\t\t\t\tstroke: cLinBG,\n\t\t\t\tstrokeWidth: wLinBG * lwid,\n\t\t\t\topacity: oLinBG,\n\t\t\t\t'stroke-linecap': 'round',\n\t\t\t\t'stroke-linejoin': 'round',\n\t\t\t})\n\t\t\t.appendTo(drawSQMA.select('#Pn' + nPn + '_' + gID))\n\t} catch (error) {console.log(error)}\n\n\t//Linha principal (animada)\n\tvar polyline1 = drawSQMA\n\t\t.polyline(vLinPn)\n\t\t.attr({\n\t\t\tid: 'linPn'+nPn+'_' + gID,\n\t\t\tfill: 'none',\n\t\t\tstroke: cLinPN,\n\t\t\tstrokeWidth: 1.6 * lwid,\n\t\t\tstrokeDasharray: strDashPN,\n\t\t\tstrokeDashoffset: 0,\n\t\t\t'stroke-linecap': 'round',\n\t\t\t'stroke-linejoin': 'round',\n\t\t})\n\t\t.appendTo(drawSQMA.select('#Pn' + nPn + '_' + gID))\n\tSnap.animate(\n\t\tAnim0,\n\t\tAnim1,\n\t\tfunction (value) {\n\t\t\tpolyline1.attr({ strokeDashoffset: value })\n\t\t},\n\t\tAnim2\n\t)\n\n\n\t//Linha de produto (animada)\n\tif (nGav0 != nGav) {\n\t\tvar polyline2 = drawSQMA\n\t\t\t.polyline(vLinPr)\n\t\t\t.attr({\n\t\t\t\tid: 'linPr'+nPn+'_' + gID,\n\t\t\t\tfill: 'none',\n\t\t\t\tstroke: cLinPN,\n\t\t\t\tstrokeWidth: 1.5 * lwid,\n\t\t\t\tstrokeDasharray: strDashPR,\n\t\t\t\tstrokeDashoffset: 0,\n\t\t\t\t'stroke-linecap': 'round',\n\t\t\t\t'stroke-linejoin': 'round',\n\t\t\t})\n\t\t\t.appendTo(drawSQMA.select('#Pn' + nPn + '_' + gID))\n\t\tSnap.animate(\n\t\t\tAnim0,\n\t\t\tAnim1,\n\t\t\tfunction (value) {\n\t\t\t\tpolyline2.attr({ strokeDashoffset: value })\n\t\t\t},\n\t\t\tAnim2\n\t\t\t)\n\t}\n\n\t//*\tMÁSCARA (GAVETA)\n\t//_ console.log('nGav0 = ' + nGav0)\n\t//_ console.log('gID = ' + gID)\n\t\n\t\tlet wmask = []\n\t\tlet bmask = []\n\t\tcalcMat(x0, y0 + nGav0 * yOff, Larg)\n\t\tvar gmPn = drawSQMA.group() //Cria Grupo\n\t\tgmPn.attr({ id: 'maskPn'+nPn+'_' + gID }) //Atribui nome\n\t\t\n\t\t//*\tPolígono que mostra\n\t\twmask.push(0)\n\t\twmask.push(0)\n\t\twmask.push(A4x)\n\t\twmask.push(0)\n\t\twmask.push(A4x)\n\t\twmask.push(A4y)\n\t\twmask.push(0)\n\t\twmask.push(A4y)\n\n\t\t//*\tPolígono que oculta\n\t\tbmask.push(mP[0][1][0])\n\t\tbmask.push(mP[0][1][1]+Alt)\n\t\tbmask.push(mP[0][1][0])\n\t\tbmask.push(mP[0][1][1])\n\t\tbmask.push(mP[0][2][0])\n\t\tbmask.push(mP[0][2][1])\n\t\tbmask.push(mP[0][3][0])\n\t\tbmask.push(mP[0][3][1])\n\t\tbmask.push(mP[0][3][0])\n\t\tbmask.push(mP[0][3][1]+Alt)\n\t\tbmask.push(mP[0][4][0])\n\t\tbmask.push(mP[0][4][1]+Alt)\n\t\t//_ console.log(bmask)\n\t\n\t\t//*\tPolígono que mostra\n\t\tvar pmask = drawSQMA\n\t\t\t.polygon(wmask)\n\t\t\t.attr({\n\t\t\t\tfill: 'white',\n\t\t\t\tstroke: 'white',\n\t\t\t\tstrokeWidth: lwid,\n\t\t\t\t'stroke-linecap': 'round',\n\t\t\t\t'stroke-linejoin': 'round',\n\t\t\t})\n\t\t\t.appendTo(drawSQMA.select('#maskPn'+nPn+'_' + gID))\n\n\t\t//*\tPolígono que oculta\n\t\tvar pmask = drawSQMA\n\t\t\t.polygon(bmask)\n\t\t\t.attr({\n\t\t\t\tfill: 'black',\n\t\t\t\topacity: oMskGPF,\n\t\t\t\tstroke: 'black',\n\t\t\t\tstrokeWidth: lwid,\n\t\t\t\t'stroke-linecap': 'round',\n\t\t\t\t'stroke-linejoin': 'round',\n\t\t\t})\n\t\t\t.appendTo(drawSQMA.select('#maskPn'+nPn+'_' + gID))\n\t\t//*\tAplica Máscara\n\t\tgPn.attr({ mask: drawSQMA.select('#maskPn'+nPn+'_' + gID) })\n\t\n\n\n\n\t//* CASO SETA\n\tif (nIE == 1 && nGav0 != nGav) {\n\t\tdrwSeta(vLinPr[2], vLinPr[3], 1.2 * Alt, 2.5 * Alt, cLinPN, '#Pn' + nPn + '_' + gID, 'arwPn'+nPn+'_' + gID)\n\t}\n}", "function read(f) {\n area.value = ''; // clear text area, will get hex content\n var r = new FileReader();\n r.onloadend = function () {\n if (r.error)\n alert(\"Your browser couldn't read the specified file (error code \" + r.error.code + \").\");\n else\n decodeBinaryString(r.result);\n };\n r.readAsBinaryString(f);\n}", "function getScene() {\n var scene = printerInterface.getScene();\n return scene;\n }", "function readNews(){\r\n\tvar readnews = new Nightmare()\r\n\t\r\n}", "function readSie() {\n // trick_output.log will contain the S_sie.resource file\n fs.readFile('./src/trick/logs/trick_output.log', 'utf8', function(err, contents) {\n \n // Remove first line of trick_output.log (non-xml line)\n contents = contents.split('\\n');\n contents.shift();\n\n // Reconstruct into XML string \n var xmlString = \"\";\n contents.forEach(function(v) { \n xmlString += (v + '\\n'); \n });\n \n // Parse XML and store as JSON object\n parser.parseString(xmlString, function (err, result) {\n extractElements(result);\n\t\t\t});\n\t\t\t\n\t\t\tsieIsParsed(true);\n });\n }", "function showTitle(paper) {\n document.querySelector('.title-header').innerHTML =\n `Paper Overview: ${paper.title}`;\n return paper;\n}", "function readDailyPlan() {\n //Fatal Jerryscript Error: ERR_OUT_OF_MEMORY -- Looks like even one bible chapter is too much for the watch's memory.\n text2 = readFileSync(\"/mnt/assets/resources/DailyPlan.json\", \"json\");\n}", "function getNote() {\n\tvar note = notes[randIntInRange(0, notes.length - 1)];\n\tvar multiplier = randIntInRange(1,3);\n\t\n\t//allow for multiple octaves\n\treturn note * (Math.pow(2, multiplier));\n}", "function toRG()\r\n{\r\n\tvar inpuFolder = new Folder(INPUT_FOLDER);\r\n\tfiles = inpuFolder.getFiles(\"*.\" + INPUT_FILE_FORMAT).sort()\r\n\t\t\r\n\tfor(i = 0; i < files.length; i++)\r\n\t{\r\n\t\tvar document = open(files[i]);\r\n\r\n\t\tfor (j = 0; j < document.layers.length; j++)\r\n\t\t\tdocument.layers[j].visible = false;\r\n\t\tfor (j = 0; j < document.layerSets.length; j++)\r\n\t\t\tdocument.layerSets[j].visible = false;\r\n\t\t\r\n\t\tgetNeutralGrayBackgroundLayer();\r\n\r\n\t\tfor (j = document.layerSets.length - 1; j >= 0; j--)\r\n\t\t{\r\n\t\t\tif (document.layerSets[j].name == \"DISP\" || document.layerSets[j].name == \"DISP3\")\r\n\t\t\t{\r\n\t\t\t\tdocument.layerSets[j].visible = true;\r\n\t\t\t\t\r\n\t\t\t\tif (document.layerSets[j].name == \"DISP\")\r\n\t\t\t\t\tvar affixe = \"Lines\";\r\n\t\t\t\telse\r\n\t\t\t\t\tvar affixe = \"Panels\";\r\n\t\t\t\tvar name = files[i].name.split(\".\")[0];\r\n\t\t\t\tvar outputPath = OUTPUT_FOLDER + \"/\" + name + \"_\" + affixe + \".\" + OUTPUT_FILE_FORMAT;\r\n\t\t\t\tfile = new File(outputPath);\r\n \t\t\t\tdocument.saveAs(file, getExportOptions(OUTPUT_FILE_FORMAT)[0], true, Extension.LOWERCASE);\r\n\t\t\t\t\r\n\t\t\t\tdocument.layerSets[j].visible = false;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tdocument.close(SaveOptions.DONOTSAVECHANGES);\r\n\t}\r\n}", "function exportPaper(callback) {\n var format = document.getElementById('method').options[document.getElementById('method').selectedIndex].value;\n\n text = text.replace(/<br>/g, '\\n');\n switch(format) {\n case null:\n throw new Error(\"No Format!\");\n break;\n case 'txt':\n text = text.replace(/#/g, '');\n text = text.replace(/\\*\\*/g, '');\n text = text.replace(/__/g, '');\n text = text.replace(/_/g, '');\n \n fs.writeFile(\"export.txt\", text, (err) => {\n if (err) throw err;\n callback();\n });\n break;\n case 'raw_txt':\n fs.writeFile(\"export.txt\", text, (err) => {\n if (err) throw err;\n callback();\n });\n break;\n case 'md':\n fs.writeFile(\"export.md\", text, (err) => {\n if (err) throw err;\n callback();\n });\n break;\n }\n}", "_read() {\n\n }", "function getNotes() {\n fs.readFile(\"db/db.json\", \"utf8\", function (err, data) {\n if (err) {\n return error(err)\n }else{ savedNotes.push(...JSON.parse(data));}\n });\n}", "read({review}, res) {\n\t\tres.json(review);\n\t}", "function Notes(img, w, h) {\n this.width = w;\n this.height = h;\n this.parse(img);\n return this;\n}", "function getNewBookData(elements){\n let title = elements[0].value;\n let author = elements[1].value;\n let numPages = Number(elements[2].value);\n let haveRead = false;\n if(elements[3].checked){\n haveRead = true;\n }\n addBookToLib(title, author, numPages, haveRead);\n}", "function getNote() {\n\t\t\t// get the first element with class 'note'\n\t\t\tvar elms = s.getElementsByTagName('*');\n\t\t\tfor (var i = 0; i < elms.length; i++) {\n\t\t\t\tif (Kilauea.hasClass(elms[i], 'note')) {\n\t\t\t\t\treturn new Kilauea.Panel(elms[i], null, false, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "getNotes(numberOfMeasures) {\n var listOfMeasures = [];\n let color = 0;\n while (numberOfMeasures > 0) {\n let i = 4;\n let notes = [];\n let index = 1;\n while (i > 0) {\n var rand = Math.random();\n var col;\n if (color % 3 === 0) {\n col = \"b\";\n } else if (color % 3 === 1) {\n col = \"g\";\n } else {\n col = \"p\";\n }\n if (rand > 0.8 || i % 1 === 0.5) {\n if (rand > 0.8) {\n notes.push({\n id: \"note\" + index,\n type: \"note\",\n value: \".125\",\n hit: \"false\",\n src: col + \"4.svg\"\n });\n } else {\n notes.push({\n id: \"rest\" + index,\n type: \"rest\",\n value: \".125\",\n hit: \"false\",\n src: \"eighthRest.svg\"\n });\n }\n i -= 0.5;\n } else if (rand > 0.275) {\n notes.push({\n id: \"note\" + index,\n type: \"note\",\n value: \".25\",\n hit: \"false\",\n src: col + \"1.svg\"\n });\n i -= 1;\n } else {\n notes.push({\n id: \"rest\" + index,\n type: \"rest\",\n value: \".25\",\n hit: \"false\",\n src: \"quarterRest.svg\"\n });\n i -= 1;\n }\n index++;\n color++;\n }\n numberOfMeasures--;\n listOfMeasures.push(notes);\n }\n return listOfMeasures;\n }", "function loadNotes() {\n\t\tfor(var i = 0; i < tuneJSON.tracks.length; i++) {\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {//if not a blank track\n\t\t\t\tfor(var j = 0; j<tuneJSON.tracks[i].notes.length; j++){\n\t\t\t\t\tvar $tab = $('#track' + i);\n\t\t\t\t\tdrawNote(tuneJSON.tracks[i].notes[j],$tab);//calls helper function to draw the note\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t}\n\t}", "function doNewDocument() {\n // close old document first\n var doc = mindmapModel.getDocument();\n doCloseDocument();\n\n var presenter = new mindmaps.NewDocumentPresenter(eventBus,\n mindmapModel, new mindmaps.NewDocumentView());\n presenter.go();\n }", "function read() {\n return JSON.parse(fs.readFileSync('movies.txt', 'utf8'));\n //console.log(JSON.stringify(['Jaws','Jaws 2']))\n}", "function storyPrint(page) {\n leftImage(page.image);\n rightTitle(page.title);\n storyText(page.text);\n playerState(page.state);\n userQuestions(page.questions);\n chapter(page.chapter);\n return page.id == 0 || page.id == 1 ? pageNumber(page.id):pageNumber(parseInt(pageNumberDoc.innerHTML));\n}", "write(addToPaper,onPaper){cov_1rtpcx8cw8.f[1]++;let availableLetters=(cov_1rtpcx8cw8.s[2]++,this.pointDegradation(addToPaper));// Write the letters of the string you can write with the pencil\ncov_1rtpcx8cw8.s[3]++;if(onPaper){cov_1rtpcx8cw8.b[0][0]++;cov_1rtpcx8cw8.s[4]++;return`${onPaper} ${availableLetters}`;}else{cov_1rtpcx8cw8.b[0][1]++;cov_1rtpcx8cw8.s[5]++;return availableLetters;}}", "function painter (pages) {\n\n}", "function getInput() {\n var data = fs.readFileSync('./input/thoughtWorks.txt', 'utf8');\n return data.toString();\n}", "async getPaper(key) {\n let key = this.cpctx.getApi().createCompositeKey(this.prefix, [key]);\n let data = await this.cpctx.getApi().getState(key);\n let cp = Utils.deserialize(data);\n return cp;\n }", "function arrayLoad(){\n var info, qtext, i;\n info = text.split(\"\\n\");//info is an array of every line of text in the file \n var q = [];//primative array (non OOP arrays in js act like java arraylists) of questions for this page\n var arraycounter=0;\n for(i = 0; i<info.length;i++){\n var ans = info[i];\n i++;\n qtext=\"\";\n while((info[i].trim()) !== \"ZzZ\"){\n qtext+=info[i] + \"<br>\";\n i++;\n }\n i++;//to get out of the ZzZ indicator\n\n q[arraycounter] = new quest(ans, qtext, info[i], info[i+1], info[i+2], info[i+3], info[i+4]);\n arraycounter++; \n \n i+=4;\n }\n //all questions from the doc are now in the array q\n q = shuffle(q);\n return q;\n}", "function getPoints(){\n drawing = false;\n // create new font : we use rune\n console.log(params.font);\n f = new Rune.Font(params.font) \n // load the font\n f.load(function(err){ \n path = f.toPath(params.message, 0, 0, params.size) // this is a rune function\n polys = path.toPolygons({ spacing:params.spacing }) // this is anoteher handy function to get polygons coordinates\n // now we can draw\n drawing = true;\n })\n}", "function getTemp() {\n b.readTextFile(w1, printStatus);\n}", "function paper2matter(paperpath) {\r\n\tvar pp;\r\n\r\n\tif(paperpath._class == \"CompoundPath\"){\r\n\t\tpp = paperpath.children[0].clone();\r\n\t}else{\r\n\t\tpp = paperpath.clone();\r\n\t}\r\n\t//paperpath.simplify(1);\r\n\tpp.flatten(4);\r\n\tvar points = [];\r\n\tfor(var i = 0; i<pp.segments.length; i++){\r\n\t\tvar p = pp.segments[i].point;\r\n\t\tvar vert = {\r\n\t\t\tx: p.x,\r\n\t\t\ty: p.y\r\n\t\t};\r\n\t\tpoints.push(vert);\r\n\t}\r\n\tpp.remove();\r\n\treturn points;\r\n}", "function getDoc() {\n return {\n \"blob\": {\n rows: ns.brd.rwMax,\n cols: ns.brd.colMax,\n cells: ns.brd.getCells()\n },\n \"readers\": [\"public\"]\n };\n }", "function paper() {\n if (counter < 2) {\n for (let i = 0; i < width; i += 2) {\n for (let j = 0; j < width; j += 2) {\n fill(random(175, 225), 25);\n rect(i, j, 2, 2);\n }\n }\n counter += 1;\n }\n}", "function openNote() {\n scene.remove(note);\n noteHTML = document.getElementById(\"note\");\n noteHTML.style.display = \"block\";\n isNoteDisplayed = true;\n\n loader.load(\n // resource URL\n 'src/models/gltf/usb/scene.gltf',\n // called when the resource is loaded\n function ( gltf ) {\n usb = gltf.scene;\n currentObject = usb;\n gltf.scene.scale.set( 0.01, 0.01, 0.01 );\t\t\t \n gltf.scene.position.x = 0.7;\t\t\t\t //Position (x = right+ left-) \n gltf.scene.position.y = -1.2;\t\t\t\t //Position (y = up+, down-)\n gltf.scene.position.z = -3.85;\t\t\t\t //Position (z = front +, back-)\t\t\t \n\n scene.add( gltf.scene );\n }\n );\n}", "function read_program(program) {\n var days0 = program[1],\n days1 = program[2],\n even = false,\n odd = false,\n interval = false,\n days = \"\",\n stations = \"\",\n newdata = {};\n\n newdata.en = program[0];\n newdata.start = program[3];\n newdata.end = program[4];\n newdata.interval = program[5];\n newdata.duration = program[6];\n\n for (var n=0; n < window.controller.programs.nboards; n++) {\n var bits = program[7+n];\n for (var s=0; s < 8; s++) { \n stations += (bits&(1<<s)) ? \"1\" : \"0\";\n }\n }\n newdata.stations = stations;\n\n if((days0&0x80)&&(days1>1)){\n //This is an interval program\n days=[days1,days0&0x7f];\n interval = true;\n } else {\n //This is a weekly program \n for(var d=0;d<7;d++) {\n if (days0&(1<<d)) {\n days += \"1\";\n } else {\n days += \"0\";\n }\n }\n if((days0&0x80)&&(days1===0)) {even = true;}\n if((days0&0x80)&&(days1==1)) {odd = true;}\n }\n\n newdata.days = days;\n newdata.is_even = even;\n newdata.is_odd = odd;\n newdata.is_interval = interval;\n\n return newdata;\n}", "function OBJReader () {}", "dumpBiomes () {\n\n }", "function setNotes() {\n var base = 260;\n var board_height = Rooms.findOne().board.height;\n var board_width = Rooms.findOne().board.width;\n var notes = getScaleNotes(SCALE_VALUES.MAJOR, base, board_height);\n for(x = 0; x < board_width; x++) {\n for(y = 0; y < board_height; y++) {\n boardData[x][y].frequency = notes[board_height-x-1];\n boardData[x][y].title = notes[board_height-x-1];\n }\n }\n}", "decode() {\n this.generateIobPips(this.pin, this.tile, this.style, this.pad);\n }", "function Raph(e, w, h) {\n\t\tvar paper = Raphael(e, w, h);\n\t\tpaper.setViewBox(0, 0, w, h, true);\n\t\treturn paper;\n\t}", "function read_program21(program) {\n var days0 = program[1],\n days1 = program[2],\n restrict = ((program[0]>>2)&0x03),\n type = ((program[0]>>4)&0x03),\n start_type = ((program[0]>>6)&0x01),\n days = \"\",\n newdata = {\n repeat: 0,\n interval: 0\n };\n\n newdata.en = (program[0]>>0)&1;\n newdata.weather = (program[0]>>1)&1;\n newdata.is_even = (restrict === 2) ? true : false;\n newdata.is_odd = (restrict === 1) ? true : false;\n newdata.is_interval = (type === 3) ? true : false;\n newdata.stations = program[4];\n newdata.name = program[5];\n\n if (start_type === 0) {\n newdata.start = program[3][0];\n newdata.repeat = program[3][1];\n newdata.interval = program[3][2];\n } else if (start_type === 1) {\n newdata.start = program[3];\n }\n\n if(type === 3){\n //This is an interval program\n days=[days1,days0];\n } else if (type === 0) {\n //This is a weekly program\n for(var d=0;d<7;d++) {\n if (days0&(1<<d)) {\n days += \"1\";\n } else {\n days += \"0\";\n }\n }\n }\n\n newdata.days = days;\n return newdata;\n}", "function writeGEXF(filename, ustat, weeks, withthema) {\n\tconsole.log('writing '+filename);\n\tvar a, aZ, b;\n\tvar now = new Date();\n\n\tvar lines = [\n '<gexf xmlns=\"http://www.gexf.net/1.2draft\" '+\n\t\t'xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" '+\n\t\t'xsi:schemaLocation=\"http://www.gexf.net/1.2draft '+\n\t\t'http://www.gexf.net/1.2draft/gexf.xsd\" '+\n 'version=\"1.2\">',\n\t\t'<meta lastmodifieddate=\"'+now.getFullYear()+'-'+(now.getMonth()+1)+'-'+now.getDate()+'\">',\n\t\t' <creator>dataplus</creator>',\n\t\t' <description>All users and menitons in WA</description>',\n\t\t'</meta>',\n\t\t'<graph defaultedgetype=\"directed\" timeformat=\"dateTime\">',\n ' <attributes class=\"node\">',\n ' <attribute id=\"0\" title=\"Beruf\" type=\"integer\"/>',\n ' <attribute id=\"1\" title=\"Gender\" type=\"integer\"/>',\n ' <attribute id=\"2\" title=\"Partei\" type=\"integer\"/>',\n\t\t' <attribute id=\"3\" title=\"MentionInUsers\" type=\"integer\"/>',\n\t\t' <attribute id=\"4\" title=\"MentionOutUsers\" type=\"integer\"/>',\n\t\t' <attribute id=\"5\" title=\"MentionIn/OutUsers\" type=\"float\"/>',\n\t\t' <attribute id=\"6\" title=\"RetweetsIn\" type=\"integer\"/>',\n\t\t' <attribute id=\"7\" title=\"RetweetsOut\" type=\"integer\"/>',\n\t\t' <attribute id=\"8\" title=\"tweetsTA\" type=\"integer\"/>',\n\t\t' <attribute id=\"9\" title=\"tweetsT0\" type=\"integer\"/>',\n\t\t' <attribute id=\"10\" title=\"tweetsT1\" type=\"integer\"/>',\n\t\t' <attribute id=\"11\" title=\"tweetsT2\" type=\"integer\"/>',\n\t\t' <attribute id=\"12\" title=\"tweetsT3\" type=\"integer\"/>',\n\t\t' <attribute id=\"13\" title=\"tweetsT4\" type=\"integer\"/>',\n\t\t' <attribute id=\"14\" title=\"tweetsT5\" type=\"integer\"/>',\n\t\t' <attribute id=\"15\" title=\"tweetsT6\" type=\"integer\"/>',\n\t\t' <attribute id=\"16\" title=\"tweetsT7\" type=\"integer\"/>',\n\t\t' <attribute id=\"17\" title=\"tweetsT8\" type=\"integer\"/>',\n\t\t' <attribute id=\"18\" title=\"tweetsT80\" type=\"integer\"/>',\n\t\t' <attribute id=\"19\" title=\"tweetsT81\" type=\"integer\"/>',\n\t\t' <attribute id=\"20\" title=\"tweetsT82\" type=\"integer\"/>',\n\t\t' <attribute id=\"21\" title=\"tweetsT83\" type=\"integer\"/>',\n\t\t' <attribute id=\"22\" title=\"tweetsT84\" type=\"integer\"/>',\n\t\t' <attribute id=\"23\" title=\"tweetsT85\" type=\"integer\"/>',\n\t\t' <attribute id=\"24\" title=\"tweetsT86\" type=\"integer\"/>',\n\t\t' <attribute id=\"25\" title=\"tweetsT87\" type=\"integer\"/>',\n\t\t' <attribute id=\"26\" title=\"tweetsT88\" type=\"integer\"/>',\n\t\t' <attribute id=\"27\" title=\"tweetsT89\" type=\"integer\"/>',\n ' </attributes>',\n\t\t'',\n ' <attributes class=\"edge\">',\n ' <attribute id=\"0\" title=\"Mentiontype\" type=\"integer\"/>',\n ' <attribute id=\"1\" title=\"Thema\" type=\"integer\"/>',\n ' </attributes>',\n\t\t'',\n ' <nodes>',\n\t];\n\n\tvar nid = 0;\n\tvar uidK = {};\n\n\tfor(a = 1, aZ = ustat.length; a < aZ; a++) {\n\t\tvar u = ustat[a];\n\t\tvar k = ustatK;\n\t\tvar name = u[k['casename']] || u[k['username']];\n\n\t\tvar mi;\n\t\tvar mo;\n\t\tvar ri;\n\t\tvar ro;\n\t\tif (withthema) {\n\t\t\tmi = 0;\n\t\t\tmo = 0;\n\t\t\tri = 0;\n\t\t\tro = 0;\n\t\t\tfor (b = k['mentionsUsersInT1']; b <= k['mentionsUsersInT89']; b++) {\n\t\t\t\tmi += u[b];\n\t\t\t}\n\t\t\tfor (b = k['mentionsUsersOutT1']; b <= k['mentionsUsersOutT89']; b++) {\n\t\t\t\tmo += u[b];\n\t\t\t}\n\t\t\tfor (b = k['retweetsInT1']; b <= k['retweetsInT89']; b++) {\n\t\t\t\tri += u[b];\n\t\t\t}\n\t\t\tfor (b = k['retweetsOutT1']; b <= k['retweetsOutT89']; b++) {\n\t\t\t\tro += u[b];\n\t\t\t}\n\t\t} else {\n\t\t\tmi = u[k['mentionsUsersInTA']];\n\t\t\tmo = u[k['mentionsUsersOutTA']];\n\t\t\tri = u[k['retweetsInTA']];\n\t\t\tro = u[k['retweetsOutTA']];\n\t\t}\n\n\t\tif (mi > 0 || mo > 0 || ri > 0 | ro > 0) {\n\t\tnid++;\n\t\tuidK[u[k['username']]] = nid;\n\t\tlines.push(\n\t\t' <node id=\"'+nid+'\" label=\"'+name+'\">',\n\t\t' <attvalues>',\n\t\t' <attvalue for=\"0\" value=\"'+u[k['beruf']]+'\"/>',\n\t\t' <attvalue for=\"1\" value=\"'+u[k['gender']]+'\"/>',\n\t\t' <attvalue for=\"2\" value=\"'+u[k['partei']]+'\"/>',\n\t\t' <attvalue for=\"3\" value=\"'+mi+'\"/>',\n\t\t' <attvalue for=\"4\" value=\"'+mo+'\"/>',\n\t\t' <attvalue for=\"5\" value=\"'+(mi/mo)+'\"/>',\n\t\t' <attvalue for=\"6\" value=\"'+ri+'\"/>',\n\t\t' <attvalue for=\"7\" value=\"'+ro+'\"/>',\n\t\t' <attvalue for=\"8\" value=\"'+u[k['tweetsTA']]+'\"/>',\n\t\t' <attvalue for=\"9\" value=\"'+u[k['tweetsT0']]+'\"/>',\n\t\t' <attvalue for=\"10\" value=\"'+u[k['tweetsT1']]+'\"/>',\n\t\t' <attvalue for=\"11\" value=\"'+u[k['tweetsT2']]+'\"/>',\n\t\t' <attvalue for=\"12\" value=\"'+u[k['tweetsT3']]+'\"/>',\n\t\t' <attvalue for=\"13\" value=\"'+u[k['tweetsT4']]+'\"/>',\n\t\t' <attvalue for=\"14\" value=\"'+u[k['tweetsT5']]+'\"/>',\n\t\t' <attvalue for=\"15\" value=\"'+u[k['tweetsT6']]+'\"/>',\n\t\t' <attvalue for=\"16\" value=\"'+u[k['tweetsT7']]+'\"/>',\n\t\t' <attvalue for=\"17\" value=\"'+u[k['tweetsT8']]+'\"/>',\n\t\t' <attvalue for=\"18\" value=\"'+u[k['tweetsT80']]+'\"/>',\n\t\t' <attvalue for=\"19\" value=\"'+u[k['tweetsT81']]+'\"/>',\n\t\t' <attvalue for=\"20\" value=\"'+u[k['tweetsT82']]+'\"/>',\n\t\t' <attvalue for=\"21\" value=\"'+u[k['tweetsT83']]+'\"/>',\n\t\t' <attvalue for=\"22\" value=\"'+u[k['tweetsT84']]+'\"/>',\n\t\t' <attvalue for=\"23\" value=\"'+u[k['tweetsT85']]+'\"/>',\n\t\t' <attvalue for=\"24\" value=\"'+u[k['tweetsT86']]+'\"/>',\n\t\t' <attvalue for=\"25\" value=\"'+u[k['tweetsT87']]+'\"/>',\n\t\t' <attvalue for=\"26\" value=\"'+u[k['tweetsT88']]+'\"/>',\n\t\t' <attvalue for=\"27\" value=\"'+u[k['tweetsT89']]+'\"/>',\n\t\t' </attvalues>',\n\t\t' </node>'\n\t\t);\n\t\t}\n\t}\n\tlines.push(\n\t\t' </nodes>',\n\t\t' <edges>'\n\t);\n\n\tvar eid = 0;\n\tvar tcount = 0;\n\tfor(var n = 1; n <= 4; n++) {\n\t\tvar w = weeks[n];\n\t\tfor(a = 0, aZ = w.length; a < aZ; a++) {\n\t\t\ttcount++;\n\t\t\tvar name = w[a].username;\n\t\t\tif (withthema && w[a].thema === themaK['0']) continue;\n\t\t\tif (!w[a].good) continue;\n\n\t\t\tvar mentions = getMentions(w[a].tweet);\n\t\t\tvar start = gexfDateString(new Date(w[a].timestamp));\n\t\t\tvar end = gexfDateString(new Date(w[a].timestamp+60*1000));\n\n\t\t\tfor(var m = 0, mZ = mentions.length; m < mZ; m++) {\n\t\t\t\tvar men = mentions[m];\n\t\t\t\tvar src = uidK[name];\n\t\t\t\tvar trg = uidK[men.username];\n\t\t\t\tif (typeof(src) === 'undefined') {\n\t\t\t\t\tthrow new Error('src missing: '+name);\n\t\t\t\t}\n\t\t\t\tif (typeof(trg) === 'undefined') {\n\t\t\t\t\tthrow new Error('trg missing: '+men.username);\n\t\t\t\t}\n\n\t\t\t\tlines.push(\n\t\t\t' <edge id=\"'+(eid++)+'\" '\n\t\t\t+\t\t'source=\"'+src+'\" '\n\t\t\t+\t\t'target=\"'+trg+'\" '\n\t\t\t+ 'start=\"'+start+'\" '\n\t\t\t+ 'end=\"'+end+'\">',\n\t\t\t' <attvalues><attvalue for=\"0\" value=\"'+men.type+'\"/></attvalues>',\n\t\t\t' <attvalues><attvalue for=\"1\" value=\"'+parseInt(themaA[w[a].thema])+'\"/></attvalues>',\n\t\t\t' </edge>'\n\t\t\t\t);\n\t\t\t\tif (eid % 10000 === 0) { console.log('mentions: '+eid+' tweets: '+tcount); }\n\t\t\t}\n\t\t}\n\t}\n\n\tlines.push(\n\t\t'</edges>',\n\t\t'</graph>',\n\t\t'</gexf>'\n\t);\n\n\tfs.writeFileSync(filename, lines.join('\\n'), encoding);\n}", "function convert_wet() {\n\tlet file_reader_content = new FileReader();\n\tlet content_str = document.getElementById(\"html_file\").files[0];\n\tfile_reader_content.onload = function(event) {\n\t\tlet html_doc_str = event.target.result.replaceAll(\"\\r\\n\", \"\\n\");\n // get options\n let check_align_center = document.getElementById(\"align_center\").checked;\n let check_span = document.getElementById(\"span\").checked;\n // convert WET version\n if (document.getElementById(\"wet_conversion\").value === \"to_wet4\") {\n html_doc_str = convert_wet3_to_wet4(html_doc_str, check_align_center, check_span);\n } else {\n html_doc_str = convert_wet4_to_wet3(html_doc_str, check_align_center, check_span);\n }\n\t\tdownload(html_doc_str, \"formatted.html\", \"text/html\");\n\t}\n\tfile_reader_content.readAsText(content_str);\n}", "read() {\r\n return new Promise((resolve, reject) => {\r\n fs.readFile(this.file, \"utf-8\", (err, data) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n try {\r\n this.notes = JSON.parse(data);\r\n } catch (e) {\r\n return reject(e);\r\n }\r\n return resolve(this.notes);\r\n });\r\n });\r\n }", "function Doc(ln, filename) {\n var content = fs.readFileSync([ln, filename].join('/'), 'utf8');\n var title = content.match(/^#\\s*(.*?)$/m);\n var p = path(ln, filename);\n return {\n lang: ln,\n id: id(filename),\n filename: filename,\n path: p,\n permalink: permalink(p),\n title: (title ? title[1] : ''),\n content: content\n };\n}", "_read() {}", "_read() {}", "read() {}", "readRandomPart() { \r\n let randomPartIndex = this.random(0, this.addPart.length-1);\r\n \r\n return this.addPart[randomPartIndex].toString();\r\n }", "function writePRGToFile() {\n\tconst fs = require(\"fs\");\n\tfs.open(\"../mario_prg.txt\", \"w+\", (err,fd) => {\n\t\tif(err) throw err;\n\t\tfs.writeSync(fd, data.prg.buffer, 0, data.prg.buffer.length);\n\t\tfs.close(fd);\n\t});\n}", "function evEditorRead(nn, enn, en) {\n\t// start reading the EVs\n\tlearn(nn);\n\tvar req = {direction:'tx', message:':S0FC0NB2'+number2hex4(enn)+number2hex4(en)+'01;'};\n\tconsole.log(\"req=\"+req+\" req.direction=\"+req.direction);\n\tgcSend(req);\n}", "handler(argv){\n notes.readNotes(argv.title);\n }", "static readRandomSentence(theme) {\r\n console.log(Main.firstPartlistImpl.readRandomThemedPart(theme) + Main.secondPartListImpl.readRandomPart() + Main.thirdPartListImpl.readRandomPart()); \r\n }", "function readStuff() \n{ \n\tvar theform = document.theform;\n\n\t// Parse the category list\n\tcat = rewrite(theform.cats);\n\tncat = cat.length;\n\tvar badcats = false;\n\n\t// Make sure cats have structure like V=aeiou\n\tcatindex = \"\";\n\tvar w;\n\tfor (w = 0; w < ncat; w++) {\n\t\t// A final empty cat can be ignored\n\t\tthiscat = cat[w];\n\t\tif (thiscat.charCodeAt(thiscat.length - 1) == 13) {\n\t\t\tthiscat = thiscat.substr(0, thiscat .length - 1);\n\t\t\tcat[w] = thiscat;\n\t\t}\n\t\tif (thiscat.length == 0 && w == ncat - 1) {\n\t\t\tncat--;\n\t\t} else if (thiscat.length < 3) {\n\t\t\tbadcats = true;\n\t\t} else {\n\t\t\tif (find(thiscat , \"=\") == -1) {\n\t\t\t\tbadcats = true;\n\t\t\t} else {\n\t\t\t\tcatindex += thiscat.charAt(0);\n all_categories.push(thiscat);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Parse the sound changes \n\trul = rewrite(theform.rules);\n\tnrul = rul.length;\n \n var db = document.getElementById('db');\n db.style.display = 'none';\n db.innerHTML = '<p style=\"font-weight:bold;color:red\">Bad rules which could not be parsed:</p><ol>';\n \n\t// Remove trailing returns\n\tfor (w = 0; w < nrul; w++) {\n\t\tvar t = rul[w];\n\t\tif (t.charCodeAt(t.length - 1) == 13) {\n\t\t\trul[w] = t.substr(0, t.length - 1);\n\t\t\tt = rul[w];\n\t\t}\n\t\t\n\t\t// Sanity checks for valid rules\n\t\tvar valid = t.length > 0 && find(t, \">\") != -1;\n\t\tif (valid) {\n var pre = t.split('>')[0].replace(/[\\sØ]/g,'');\n if(t.indexOf('/') == -1){var post = '_';}\n else{var post = t.split('/')[1].replace(/\\s/,'');}\n var middle = t.split('>')[1].split('/')[0].replace(/[\\sØ]/,'');\n\n\t var thisrule = [pre,middle,post]; \n \n\t\t\tvalid = thisrule.length > 2 || \n\t\t\t\t(thisrule.length ==2 && \n\t\t\t\t find(thisrule[0], '\\u2192') != -1);\n\t\t\tif (valid) {\n\t\t\t\t// Insertions must have repl & nonuniversal env\n\t\t\t\tif (thisrule[0].length == 0) \n\t\t\t\t\tvalid = thisrule[1].length > 0 &&\n\t\t\t\t\t\tthisrule[2] != \"_\";\n\t\t\t}\n if(valid){all_rules.push(thisrule[0]+'>'+thisrule[1]+'/'+thisrule[2]);}\n\t\t}\n else\n {\n if(t.replace(/\\s/g,'') != '' && t[0] != '%')\n {\n db.innerHTML += '<li><code>'+t+'</code></li>';\n db.style.display = 'block';\n }\n }\n\n\t\t// Invalid rules: move 'em all up\n\t\tif (!valid) {\n\t\t\tnrul--;\n\t\t\tfor (var q = w; q < nrul; q++) {\n\t\t\t\trul[q] = rul[q+1];\n\t\t\t}\n\t\t\tw--;\n\t\t}\n\t}\n db.innerHTML += '</ol><br>';\n\n\t// Error strings\n\tif (badcats) {\n\t\treturn \"Categories are weird.\";\n\t} else if (nrul == 0) {\n\t\treturn \"There are no valid sound changes, so no output can be generated. Rules must be of the form s1/s2/e1_e2. The strings are optional, but the slashes are not.\" ;\n\t} else {\n\t\treturn \"\";\n\t}\n}", "CreateWell() {\n for (let y = this.m_wellBottom; y <= this.m_wellTop; y++) {\n this.SetMaterial(this.m_wellX, y, Fracker_Material.WELL);\n }\n }", "function reformatChords(doc, songName, songArtist, songLyrics){\n // Reformat input with REGEX\n // var songLyrics =\"Cornerstone by Hillsong\\n\\n[Intro]\\n\\n[ch]C[\\/ch] [ch]Am[\\/ch] [ch]F[\\/ch] [ch]G[\\/ch]\\n\\n\\n[Verse 1]\\n\\n[ch]C[\\/ch]\\nMy hope is built on nothing less\\n[ch]F[\\/ch] [ch]G[\\/ch]\\nThan Jesus\\' blood and righteousness\\n[ch]Am[\\/ch]\"\n // remove song intro text\n // var songLyrics2 = songLyrics.replace(/\".+[\\s\\S].+.[\\s\\S].+.[\\s\\S].+.[\\s\\S]/gm, \"\");\n // remove Ð\n // var songLyrics3 = songLyrics2.replace(/\\n\\n\\n/gm, \"\\n\");\n // var songLyrics6 = songLyrics3.replace(/\\n\\n/gm, \"\\n\");\n // remove [ch] & [/ch]\n var songLyrics_v1 = songLyrics.replace(/\\[ch\\]/gm, \"\");\n var songLyrics_v2 = songLyrics_v1.replace(/\\[\\/ch\\]/gm, \"\");\n //remove Ð\n var songLyrics_regex_complete = songLyrics_v2.replace(/\\r\\n/gm, \"\\n\");\n // remove end of song \" mark\n // var songLyrics7 = songLyrics6.replace(/\"/gm, \"\");\n // remove riff tabs (if present)\n // var songLyrics9 = songLyrics7.replace(/.\\|-.*/gm, \"\");\n // remove extra spaces & blank lines\n // var songLyrics9 = songLyrics8.replace(/\\r?\\n\\s*\\n/gm, \"\\r\\n\");\n\n \n // split the text into an array by new line\n var songLyrics_SplitByNewline_Arr = songLyrics_regex_complete.split(/\\n/g);\n\n // Create pages\n doc.addPage({\n // this seems to only affect the first page inserted\n layout: 'portrait',\n margin: 20, \n });\n doc.font('Courier-Bold');\n doc.fontSize(13);\n doc.text(songName + \" - \" + songArtist, {\n columns: 2,\n });\n doc.moveDown();\n doc.fontSize(12);\n // loop through the array of input text and bold lines with chords & brackets \"[\"\n for (let i = 0; i < songLyrics_SplitByNewline_Arr.length; i++){\n // identifies all chords & lines with brackets \"[\" & makes them bold\n if (/\\b([CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|aug|m|add)*[\\d\\/]*(?:[CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|aug|m|add)*[\\d\\/]*)*)(?=\\s|$)(?!\\w)|\\[/gm.test(songLyrics_SplitByNewline_Arr[i])) {\n doc.font('Courier-Bold');\n doc.text(songLyrics_SplitByNewline_Arr[i], {\n columns: 1,\n });\n // leaves lyric text not bold\n } else {\n doc.font('Courier');\n doc.text(songLyrics_SplitByNewline_Arr[i], {\n columns: 1,\n });\n };\n };\n \n // ===== end of reformatChords function =====\n // ==========================================\n}", "function toPPM(buffer, w, h) {\n return `P3 ${w} ${h} 255\\n${buffer.filter((e, i) => i % 4 < 3).toString()}\\n`;\n }", "function generateResume() {\n html2pdf(areaCv, opt)\n }", "function csBSCurriculum() {\n WebBrowser.openBrowserAsync(\n 'https://undergrad.soe.ucsc.edu/sites/default/files/curriculum-charts/2018-07/CS_BS_18-19.pdf'\n );\n}", "function makeBoard(tuning) {\n\tvar board = [];\n\tvar string = [];\n\tfor(var i=0;i<6;i++) {\n\t\tvar note = NOTES[tuning[i]];\n\t\tfor(var j=0;j<15;j++) {\n\t\t\tstring.push([j,(note%12)]);\n\t\t\tnote++;\n\t\t}\n\t\tboard.push(string);\n\t\tstring = [];\n\t}\n\treturn board;\n}", "function createPrintFile(uid, artworkUID, artistName) {\n var curatorStorage = authenticateCurator();\n var artStorage = authenticateArtist();\n\n var pfBucket = curatorStorage.bucket(\"printfiles\");\n var artBucket = artStorage.bucket(\"art-uploads\");\n var artPath = \"portal/\" + uid + \"/uploads/\" + artworkUID;\n var master = artBucket.file(artPath);\n var white = 0xFFFFFFFF; //R G B A in HEXDEC\n\n //NOTE arbitrary spacing variables\n var widthRatio = 4/3; //NOTE width of whiteboard to artwork\n var nameHeight = 50; //50px\n var logoSize = 75; //75px (its a square)\n var maxLabelWidth = 1800; // name shouldnt be wider than artwork\n var maxLabelHeight = 400;\n var minArtworkDim = 1500; // no dimension of an artwork less than {}px\n\n master.download( function (err,artBuffer) {\n if (err) {\n console.log(err);\n res.status(500).send({error:\"Error connecting to Art Bucket file\", e:err});\n }\n\n jimp.read(artBuffer).then(function (artwork) {\n // Set Artwork variables\n var artWidth = artwork.bitmap.width;\n var artHeight = artwork.bitmap.height;\n // Set Whiteboard Variables\n var dims = getPaddingRatio(artWidth,artHeight,widthRatio);\n var whiteWidth = dims[0];\n var whiteHeight = dims[1];\n var wPad = Math.floor((whiteWidth-artWidth)/2); //\n var hPad = Math.floor(((whiteHeight-artHeight)/2));\n\n if (artWidth >= minArtworkDim && artHeight >= minArtworkDim) {\n console.log(\">Image Meets Min Resolution\");\n var placeholder = new jimp(dims[0], dims[1], white, function (err, whiteboard) {\n // console.log(\">Whiteboard Drawn\");\n jimp.loadFont('./font/tekuma128.fnt').then(function (font) {\n // console.log(\">Font Loaded\");\n jimp.read('./img/logo.png').then(function(rawLogo) {\n // console.log(\">Logo Loaded\");\n var placeholder2 = new jimp(maxLabelWidth,maxLabelHeight, function (err,fullLabel) {\n if (err) {console.log(err);}\n // Write the artist name, crop around it, then down scale it.\n var name = fullLabel.clone()\n .print(font, 0,0, artistName)\n .autocrop()\n .resize(jimp.AUTO, nameHeight); // 50px height\n var nameWidth = name.bitmap.width;\n\n // Set Logo Params\n var logo = rawLogo.autocrop().resize(logoSize,logoSize);\n var logoX = nameWidth/2 - logoSize/2;\n var logoY = nameHeight + logoSize/2;\n // Create Label ( name and logo composition )\n var cropHeight = nameHeight + logoSize*2;\n var cropWidth = nameWidth + 5;\n fullLabel.composite(name,0,0)\n .composite(logo,logoX,logoY)\n .crop(0,0, cropWidth, cropHeight);\n\n var labelWidth = fullLabel.bitmap.width;\n var labelHeight = fullLabel.bitmap.height;\n var labelX = (whiteWidth/2) - (labelWidth/2);\n var labelY = (whiteHeight) - (hPad/2) - (labelHeight/2);\n\n console.log(\">Label Made\");\n whiteboard\n .composite(artwork ,wPad, hPad)\n .composite(fullLabel, labelX,labelY)\n .rgba(false)\n .getBuffer(jimp.MIME_PNG, function (err,printBuffer){\n var savePath = uid + '/' + artworkUID;\n var printfile = pfBucket.file(savePath);\n var options = {\n metadata:{\n contentType: 'image/png'\n },\n predefinedAcl:\"projectPrivate\"\n };\n printfile.save(printBuffer,options, function (err) {\n if (!err) {\n console.log(\">>>Printfile Generated Successfully\");\n res.status(200).send(\">Printfile Generated Successfully\")\n } else {\n console.log(\">>>Error:\",err);\n res.status(500).send({error: \">Error uploading to Curator, but file was made\"});\n }\n });\n });\n });\n });\n });\n });\n } else {\n console.log(\">Image Error. Min w or h is \"+minArtworkDim+\" px. Was:\",artWidth,artHeight);\n res.status(400).send({error: \"Requested image does not meet 1800x1800px minimum.\"});\n }\n });\n });\n }", "function ReadC() {\r\n}", "function ExtractText() \r\n{ \r\n\ttry {\r\n\t\tvar p = this.pageNum; \r\n\t\tvar n = this.getPageNumWords(p);\r\n\t\tapp.alert(\"Number of words in the page: \" + n);\r\n\r\n\t\tvar str = \"\";\r\n\t\tfor(var i=0;i<n;i++) {\r\n\t\t\tvar wd = this.getPageNthWord(p, i, false); \r\n\t\t\tif(wd != \"\") str = str + wd; \r\n\t\t}\r\n\r\n\t\t// save the string into a data object\r\n\t\tthis.createDataObject(\"dobj1.txt\",str); \r\n\r\n\t\t// pop up a file selection box to export the data \r\n\t\tthis.exportDataObject(\"dobj1.txt\"); \r\n\t\t \r\n\t\t// clean up\r\n\t\tthis.removeDataObject(\"dobj1.txt\"); \r\n\r\n\t} catch (e) { \r\n\t\tapp.alert(e)\r\n\t}; \r\n}", "function displayFile() {\n var i = 0,\n count = 0;\n\n while (count < (todocl.textArr.length * 5)) {\n if (i == todocl.textArr.length) {\n i = 0;\n }\n if (todocl.textArr[i].substring(0, 3) === '(A)' && count < todocl.textArr.length) {\n todocl.out.innerHTML += \"<span style='color:#A40000; font-weight: 900;'>\" + (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE + \"</span>\";\n }\n\n if (todocl.textArr[i].substring(0, 3) === '(B)' && count > todocl.textArr.length && count <= (todocl.textArr.length * 2)) {\n todocl.out.innerHTML += \"<span style='color:#B24200; font-weight: 900;'>\" + (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE + \"</span>\";\n }\n\n if (todocl.textArr[i].substring(0, 3) === '(C)' && count > (todocl.textArr.length * 2) && count <= (todocl.textArr.length * 3)) {\n todocl.out.innerHTML += \"<span style='color:#FF790C; font-weight: 900;'>\" + (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE + \"</span>\";\n }\n\n if (todocl.textArr[i].substring(0, 3).match(/^([(D-Z)]+)$/) && count > (todocl.textArr.length * 3) && count <= (todocl.textArr.length * 4)) {\n todocl.out.innerHTML += \"<span style='color:#FFFFFF; font-weight: 900;'>\" + (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE + \"</span>\";\n }\n\n if (todocl.textArr[i].substring(0, 3) !== '(A)' && todocl.textArr[i].substring(0, 3) !== '(B)' && todocl.textArr[i].substring(0, 3) !== '(C)' &&\n !todocl.textArr[i].substring(0, 3).match(/^([(D-Z)]+)$/) && count >= (todocl.textArr.length * 4)) {\n todocl.out.innerHTML += (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE;\n }\n count++;\n i++;\n }\n\n todocl.out.innerHTML += \"--\" + NEW_LINE + \"TODO: \" +\n todocl.textArr.length + \" Of \" +\n todocl.textArr.length + \" tasks shown\";\n }", "_read() {\n }", "function noteToSheet(noteName){\n\tnumOfNotes++;\n\t// var image = document.createElement(\"IMG\");\n\t// image.setAttribute(\"src\", \"\" + noteName + \"\");\n\t\n\timage = document.createElement(\"input\");\n\timage.setAttribute(\"src\", \"\" + noteName + \"\");\n\timage.setAttribute(\"type\", \"image\");\n\timage.setAttribute(\"id\", \"note\" + numOfNotes + \"\");\n\timage.setAttribute(\"onclick\", \"deleteNote(\" + numOfNotes + \")\");\n\timage.style.position = \"absolute\";\n\timage.style.height = \"10vh\";\n\timage.style.left = \"\" + (17 * numOfNotes) + \"vw\";\n\timage.style.top = \"\" + (18 + 4.5 * notePosition) + \"%\";\n\t\n\tnoteArray.push(\"C\" + notePosition + \"\");\n\tconsole.log(noteArray);\n\t\n\tif(noteDrawerShow == true){\n\t\tdocument.body.appendChild(image);\n\t\t//closes the note drawer if the note is clicked\n\t\topenNotes(-1);\n\t}\n\telse if(noteDrawerShow == false){\n\t\timage.style.display = \"none\";\n\t}\n\t\n\tif((numOfNotes - 1) % 3 == 0){\n\t\tvar w = document.getElementsByClassName(\"noteDrawer\");\n\t\tvar x = document.getElementsByClassName(\"blackBar\");\n\t\tvar y = document.getElementsByClassName(\"whiteBar\");\n\t\tvar z = document.getElementsByClassName(\"tealBar\");\n\t\tbarWidth++;\n\t\tw[0].style.width = \"\" + (100 + barWidth * 50) + \"%\";\n\t\tfor(var i = 0; i < 5; i++){\n\t\t\tx[i].style.width = \"\" + (100 + barWidth * 50) + \"%\";\n\t\t}\n\t\tfor(var j = 0; j < 4; j++){\n\t\t\ty[j].style.width = \"\" + (100 + barWidth * 50) + \"%\";\n\t\t}\n\t\tfor(var k = 0; k < 2; k++){\n\t\t\tz[k].style.width = \"\" + (100 + barWidth * 50) + \"%\";\n\t\t}\n\t}\n}", "function MarkdownFileToBody(filename)\n{\n var callback = function (text) {\n //html = Showdown(text);\n fillDiv(text, gs_body_id);\n }\n getFile(filename, callback, true);\n}", "function reformatChords(doc, songName, songArtist, songLyrics) {\n // Reformat input with REGEX\n // var songLyrics =\"Cornerstone by Hillsong\\n\\n[Intro]\\n\\n[ch]C[\\/ch] [ch]Am[\\/ch] [ch]F[\\/ch] [ch]G[\\/ch]\\n\\n\\n[Verse 1]\\n\\n[ch]C[\\/ch]\\nMy hope is built on nothing less\\n[ch]F[\\/ch] [ch]G[\\/ch]\\nThan Jesus\\' blood and righteousness\\n[ch]Am[\\/ch]\"\n // remove song intro text\n // var songLyrics2 = songLyrics.replace(/\".+[\\s\\S].+.[\\s\\S].+.[\\s\\S].+.[\\s\\S]/gm, \"\");\n // remove Ð\n // var songLyrics3 = songLyrics2.replace(/\\n\\n\\n/gm, \"\\n\");\n // var songLyrics6 = songLyrics3.replace(/\\n\\n/gm, \"\\n\");\n // remove [ch] & [/ch]\n var songLyrics_v1 = songLyrics.replace(/\\[ch\\]/gm, \"\");\n var songLyrics_v2 = songLyrics_v1.replace(/\\[\\/ch\\]/gm, \"\");\n //remove Ð\n var songLyrics_regex_complete = songLyrics_v2.replace(/\\r\\n/gm, \"\\n\");\n // remove end of song \" mark\n // var songLyrics7 = songLyrics6.replace(/\"/gm, \"\");\n // remove riff tabs (if present)\n // var songLyrics9 = songLyrics7.replace(/.\\|-.*/gm, \"\");\n // remove extra spaces & blank lines\n // var songLyrics9 = songLyrics8.replace(/\\r?\\n\\s*\\n/gm, \"\\r\\n\");\n\n\n // split the text into an array by new line\n var songLyrics_SplitByNewline_Arr = songLyrics_regex_complete.split(/\\n/g);\n\n // Create pages\n doc.addPage({\n // this seems to only affect the first page inserted\n layout: 'portrait',\n margin: 20\n });\n doc.font('Courier-Bold');\n doc.fontSize(13);\n doc.text(songName + \" - \" + songArtist, {\n columns: 2\n });\n doc.moveDown();\n doc.fontSize(12);\n // loop through the array of input text and bold lines with chords & brackets \"[\"\n for (var i = 0; i < songLyrics_SplitByNewline_Arr.length; i++) {\n // identifies all chords & lines with brackets \"[\" & makes them bold\n if (/\\b([CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|aug|m|add)*[\\d\\/]*(?:[CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|aug|m|add)*[\\d\\/]*)*)(?=\\s|$)(?!\\w)|\\[/gm.test(songLyrics_SplitByNewline_Arr[i])) {\n doc.font('Courier-Bold');\n doc.text(songLyrics_SplitByNewline_Arr[i], {\n columns: 1\n });\n // leaves lyric text not bold\n } else {\n doc.font('Courier');\n doc.text(songLyrics_SplitByNewline_Arr[i], {\n columns: 1\n });\n };\n };\n\n // ===== end of reformatChords function =====\n // ==========================================\n}" ]
[ "0.5286311", "0.51197165", "0.5063997", "0.50513774", "0.49747407", "0.4924465", "0.48782453", "0.4837972", "0.47661182", "0.4724458", "0.47161874", "0.47096294", "0.46982267", "0.46962819", "0.46906805", "0.46897358", "0.46868274", "0.46617004", "0.46280894", "0.46228695", "0.46090296", "0.45961633", "0.45919013", "0.45907685", "0.45582274", "0.4534337", "0.45082557", "0.450102", "0.44984663", "0.44770598", "0.44723675", "0.44603977", "0.44440362", "0.44435266", "0.44422343", "0.44249073", "0.4424094", "0.44220805", "0.44188744", "0.44125965", "0.4409162", "0.43869543", "0.43813452", "0.43710825", "0.43707263", "0.4357342", "0.43562448", "0.43488795", "0.43387875", "0.4337775", "0.4330995", "0.43298146", "0.43242344", "0.43160367", "0.43126658", "0.43109274", "0.43071407", "0.43050414", "0.42962694", "0.4286421", "0.42857128", "0.42838877", "0.4283132", "0.42741233", "0.42732337", "0.42710218", "0.42658544", "0.42498246", "0.42413536", "0.42378044", "0.42360443", "0.42347234", "0.4230489", "0.422662", "0.42264616", "0.42226502", "0.42117468", "0.42087525", "0.42087525", "0.42085475", "0.42060846", "0.42052382", "0.42033252", "0.4198254", "0.41975746", "0.41971168", "0.41962627", "0.419373", "0.41906935", "0.4184804", "0.41847476", "0.41820127", "0.41816264", "0.4180616", "0.41790092", "0.41757268", "0.41744766", "0.41727805", "0.41699445", "0.41685212" ]
0.6550977
0
Pass scope to the subscribe() method.
subscribeToMessageChannel() { if (!this.subscription) { this.subscription = subscribe( this.messageContext, locationSelected, (message) => { console.log('---> subscribing to location selected message', 'start') this.handleMessage(message) console.log('---> subscribing to location selected message', 'end') }, { scope: APPLICATION_SCOPE } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subscribe($scope) {\n socket.on('create reach', function (item) {\n listContainer.push(item);\n\n if (typeof(onListChangedFn) !== 'undefined') {\n onListChangedFn(listContainer);\n }\n });\n\n // Clean up.\n if(typeof($scope) !== 'undefined') {\n $scope.$on(\"$destroy\", function () {\n unsubscribe();\n });\n }\n }", "subscribe() {}", "subscribe(fn) {\n return this._subscribe(fn);\n }", "subscribe () {}", "function withScope(callback) {\r\n callOnHub('withScope', callback);\r\n}", "function withScope(callback) {\n callOnHub('withScope', callback);\n}", "function withScope(callback) {\n callOnHub('withScope', callback);\n}", "function withScope(callback) {\n callOnHub('withScope', callback);\n}", "function withScope(callback) {\n callOnHub('withScope', callback);\n}", "subscribe(name, fn) {\n this.events.get(name).subscribe(fn);\n }", "subscribe(fn) {\n const thisSubscribe = this;\n\n thisSubscribe.observer.push(fn);\n }", "subscribe(name, fn) {\r\n this.events.get(name).subscribe(fn);\r\n }", "subscribe(fn) {\r\n return this._subscribe(fn);\r\n }", "_setupScopeListener() {\n const hubScope = core_1.getCurrentHub().getScope();\n if (hubScope) {\n hubScope.addScopeListener(updatedScope => {\n const cloned = core_1.Scope.clone(updatedScope);\n cloned._eventProcessors = [];\n cloned._scopeListeners = [];\n // tslint:disable-next-line:no-object-literal-type-assertion\n this._scopeStore.update((current) => (Object.assign(Object.assign({}, current), cloned)));\n });\n }\n }", "function subscribe() {\n $rootScope.$on('loaded', function() {\n self.loading = false;\n });\n }", "sub(name, fn) {\r\n this.subscribe(name, fn);\r\n }", "sub(name, fn) {\n this.subscribe(name, fn);\n }", "subscribe (OTL) {\n OTL.subscriber.push(this);\n }", "sub(fn) {\r\n return this.subscribe(fn);\r\n }", "sub(fn) {\r\n return this.subscribe(fn);\r\n }", "subscribe() {\n this.subscriptionID = this.client.subscribe(this.channel, this.onNewData)\n this.currencyCollection.subscribe(this.render)\n this.currencyCollection.subscribe(this.drawInitialSparkLine)\n this.currencyCollection.subscribeToSparkLineEvent(this.drawSparkLine)\n }", "sub(fn) {\n return this.subscribe(fn);\n }", "sub(fn) {\n return this.subscribe(fn);\n }", "subscribe() {\n if(this.subscription) {\n return;\n }\n this.subscription = subscribe(this.messageContext, MESSAGE_CHANNEL, (message) => {\n this.handleMessage(message);\n });\n }", "function withScope(callback) {\n getCurrentHub().withScope(callback);\n }", "subscribe(mainWindow: BrowserWindow) {\n mainLog.info('Subscribing to Lightning gRPC streams')\n this.mainWindow = mainWindow\n\n this.subscriptions.channelGraph = subscribeToChannelGraph.call(this)\n this.subscriptions.invoices = subscribeToInvoices.call(this)\n this.subscriptions.transactions = subscribeToTransactions.call(this)\n }", "function subscribe(subEventCallback){\n\n mySolace.subscribe(subEventCallback);\n \n }", "function withScope(callback) {\n\t getCurrentHub().withScope(callback);\n\t}", "subscribe(s) { return dispatcher.subscribe(s); }", "subscribe(fn) {\n\t\tthis.subscribers.push(fn);\n\t}", "function _subscribe() {\n\n _comapiSDK.on(\"conversationMessageEvent\", function (event) {\n console.log(\"got a conversationMessageEvent\", event);\n if (event.name === \"conversationMessage.sent\") {\n $rootScope.$broadcast(\"conversationMessage.sent\", event.payload);\n }\n });\n\n _comapiSDK.on(\"participantAdded\", function (event) {\n console.log(\"got a participantAdded\", event);\n $rootScope.$broadcast(\"participantAdded\", event);\n });\n\n _comapiSDK.on(\"participantRemoved\", function (event) {\n console.log(\"got a participantRemoved\", event);\n $rootScope.$broadcast(\"participantRemoved\", event);\n });\n\n _comapiSDK.on(\"conversationDeleted\", function (event) {\n console.log(\"got a conversationDeleted\", event);\n $rootScope.$broadcast(\"conversationDeleted\", event);\n });\n\n }", "function withScope(callback) {\n hub.getCurrentHub().withScope(callback);\n}", "subscribe (fn) {\n this.subscribers.push(fn);\n }", "watchOnScope($scope, propName){\n\t\t// for init watching\n\t\tif(curr !== undefined){\n\t\t\t// compare current with this collection to determine the change\n\t\t\tif(curr !== collection){\n\t\t\t\t$scope.$apply(() => {\n\t\t\t\t\t$scope[propName] = this\n\t\t\t\t})\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$scope[propName] = this;\n\t\tlet connector = this.getConfig('connector');\n\t\tif(!connector){\n\t\t\tthrow new Error('Connector is not configured for this model')\n\t\t}\n\t\tvar model = this;\n\t\tvar unsubscribe = connector.$subscribe(() => {\n\t\t\tconnector.$isChanged(model).then((isChanged) => {\n\t\t\t\tif(isChanged){\n\t\t\t\t\t$scope.$apply(() => {\n\t\t\t\t\t\t$scope[propName] = isChanged\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t\t// unsubscribe on $scope destroy event\n\t\t$scope.$on(\"$destroy\", unsubscribe);\n\t\treturn unsubscribe;\n\t}", "function tweetArrived (scope) {\n\n\t\t\t\treturn function (sock, msg) {\n\t\t\t\t\tscope.messages.push(msg);\n\t\t\t\t\tscope.$apply();\n\t\t\t\t};\n\t\t\t}", "onClientSubscribed(callback) {\n this.subCallback = callback;\n }", "function subscribe(scope, callback) {\n var handler = $rootScope.$on('usersFactoryUserChanged', callback);\n scope.$on('$destroy', handler);\n }", "set scope(scope) {\n this.store.set(\"scope\", scope);\n }", "bind() {\n if (!this._bound) {\n this._bound = true;\n this.track(this.subscribe());\n }\n return this;\n }", "function subscribe(scope, callback) {\n var handler = $rootScope.$on('userFactoryUserChanged', callback);\n scope.$on('$destroy', handler);\n }", "function subscribe(){\n performance.mark('subscribing');\n client.subscribe('payload/empty', function (err) {});\n performance.mark('subscribed');\n performance.measure('subscribing to subscribed', 'subscribing', 'subscribed');\n}", "on (channel, cb) {\n this.subClient.subscribe(channel)\n super.on(channel, cb)\n }", "subscribeToChannels() {\n Object.values(CHANNELS).forEach(channel => {\n this.subscriber.subscribe(channel);\n });\n }", "function bindScope(env, scope) {\n env.scope = scope;\n}", "subscribeToMessageChannel() {\n if (!this.subscription) {\n this.subscription = subscribe(\n this.messageContext,\n sObjectSelected,\n (message) => this.handleMessage(message),\n { scope: APPLICATION_SCOPE }\n );\n }\n }", "static subscribe(channelName, eventName, callback) {\n const channel = this.pusherInstance.subscribe(channelName);\n channel.bind(eventName, data => callback(data));\n }", "subscribe(f) {\n this.observers.push(f);\n }", "subscribe(f) {\n this.observers.push(f);\n }", "subscribe(){\n\t\treturn this.table.eventBus.subscribe(...arguments);\n\t}", "subscribe() {\n // We default to unsubscribing the events. This handles when a grammar\n // changes from one we handle to one we don't.\n this.unsubscribe();\n // Figure out the current grammar of the editor. We also determine if\n // it is the list of grammars we are listening to.\n const grammar = this.editor.getGrammar().scopeName;\n const pluginGrammars = atom.config.get(\"autocorrect.grammars\");\n const isAttachable = _.contains(pluginGrammars, grammar);\n // If we aren't attaching, then we don't care about the events.\n if (!isAttachable) {\n return;\n }\n // We are going to attach to the editor and listen to additional events.\n this.bufferSubscriptions.add(this.editor.onDidStopChanging((args) => {\n this.onBufferChange(args);\n }));\n }", "_notifyScopeListeners() {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }", "_notifyScopeListeners() {\n\t // We need this check for this._notifyingListeners to be able to work on scope during updates\n\t // If this check is not here we'll produce endless recursion when something is done with the scope\n\t // during the callback.\n\t if (!this._notifyingListeners) {\n\t this._notifyingListeners = true;\n\t this._scopeListeners.forEach(callback => {\n\t callback(this);\n\t });\n\t this._notifyingListeners = false;\n\t }\n\t }", "subscribe() {\n this.unsubscribe();\n this.sub_list.map(\n (value) => this.subscriptions.push(\n this.eventbus.subscribe(value[0], value[1])\n ));\n }", "_notifyScopeListeners() {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }", "subscribe (channel, fn, context) {\n if (!this.channels[channel]) {\n this.channels[channel] = [];\n }\n\n this.channels[channel].push({ context: context || this, callback: fn });\n\n return this;\n }", "function _subscribe(type, opts) {\n sc.subscribe(type, opts, (err, data) => {\n onCallback(\"Subscribe\", type, err, data);\n });\n\n setListener(type);\n}", "addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }", "subscribe(subscriber, propertyToWatch) {\n let subscribers = this.subscribers[propertyToWatch];\n if (subscribers === void 0) {\n this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source);\n }\n subscribers.subscribe(subscriber);\n }", "addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }", "function configureScope(callback) {\r\n callOnHub('configureScope', callback);\r\n}", "get scope() {\n return this._scope;\n }", "subscribe(subscriber, propertyToWatch) {\n var _a;\n\n if (propertyToWatch) {\n let subscribers = this.subscribers[propertyToWatch];\n\n if (subscribers === void 0) {\n this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source);\n }\n\n subscribers.subscribe(subscriber);\n } else {\n this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source);\n this.sourceSubscribers.subscribe(subscriber);\n }\n }", "initSubscription() {\n this.subscribe('OPERAND_INPUT', calculatorStore.reduce.bind(calculatorStore));\n this.subscribe('OPERATOR_INPUT', calculatorStore.reduce.bind(calculatorStore));\n this.subscribe('EVALUATE', calculatorStore.reduce.bind(calculatorStore));\n this.subscribe('DISPLAY_RESULT', calculatorStore.reduce.bind(calculatorStore));\n }", "handleSubscribe() {\n // Callback invoked whenever a new event message is received\n const messageCallback = (response) => {\n console.log('Segment Membership PE fired: ', JSON.stringify(response));\n // Response contains the payload of the new message received\n this.notifier = JSON.stringify(response);\n this.refresh = true;\n // refresh LWC\n if(response.data.payload.Category__c == 'Segmentation') {\n this.getData();\n }\n \n\n\n };\n\n // Invoke subscribe method of empApi. Pass reference to messageCallback\n subscribe(this.channelName, -1, messageCallback).then(response => {\n // Response contains the subscription information on subscribe call\n console.log('Subscription request sent to: ', JSON.stringify(response.channel));\n this.subscription = response;\n this.toggleSubscribeButton(true);\n });\n }", "_subscribe (event, callback)\n {\n diva.Events.subscribe(event, callback, this.settings.ID);\n }", "async subscribe (room, fn) {\n await this.connecting()\n this.connection.client.send(JSON.stringify({\n action: 'SUBSCRIBE',\n room\n }))\n this.connection.subscriptions.push({ room, fn })\n }", "subscribe(sub, handler) {\n this.subscribers[this.GetOrCreateKey(sub, handler)] = {\n handler: handler.bind(sub),\n subref: sub\n };\n }", "subscribe(fn) {\n this.sub = this.source.onInterrupt.subscribe(fn);\n }", "function accountSubscriptionPipe() {\r\n accountSubscription();\r\n}", "subscribe(callback) {\n this._subscribers.add(callback);\n }", "function configureScope(callback) {\n callOnHub('configureScope', callback);\n}", "function configureScope(callback) {\n callOnHub('configureScope', callback);\n}", "function configureScope(callback) {\n callOnHub('configureScope', callback);\n}", "function configureScope(callback) {\n callOnHub('configureScope', callback);\n}", "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "static subscribe(callback) {\r\n ViewportService.subscribers.push({callback});\r\n }", "subscribe(fn) {\n if (fn) {\n this._subscriptions.push(this.createSubscription(fn, false));\n }\n\n return () => {\n this.unsubscribe(fn);\n };\n }", "bind(_scope, lifecycleHook) {\n this.topic.grantPublish(lifecycleHook.role);\n return { notificationTargetArn: this.topic.topicArn };\n }", "function setScope(scope){ _scope = scope || 'all' }", "function setScope(scope){ _scope = scope || 'all' }", "function setScope(scope){ _scope = scope || 'all' }", "function setScope(scope){ _scope = scope || 'all' }", "function setScope(scope){ _scope = scope || 'all' }", "function setScope(scope){ _scope = scope || 'all' }", "function setScope(scope){ _scope = scope || 'all' }", "function setScope(scope){ _scope = scope || 'all' }", "addScopeListener(callback) {\n\t this._scopeListeners.push(callback);\n\t }", "subscribeToMessageChannel() {\n this.subscription = subscribe(\n this.messageContext,\n RECORD_SELECTED_CHANNEL,\n (message) => {\n console.log(message);\n this.handleMessage(message); \n }\n );\n \n\n }", "subscribe(c) {\n this.observers.push(c);\n }", "bind() {\n super.bind();\n this.track(this.changes.subscribe());\n return this;\n }", "subscribe(path, initialDataGetter = defaultDataGetter, cleanup) {\n if (this.subscriptions.has(path)) {\n throw new Error('duplicate persistent subscription: ' + path)\n }\n\n this.subscriptions = this.subscriptions.set(path, {\n getter: initialDataGetter,\n cleanup,\n })\n for (const socket of this.sockets) {\n this.nydus.subscribeClient(socket, path, initialDataGetter(this, socket))\n }\n }", "function configureScope(callback) {\n\t getCurrentHub().configureScope(callback);\n\t}", "subscribe(fn) {\r\n if (fn) {\r\n this._subscriptions.push(this.createSubscription(fn, false));\r\n }\r\n return () => {\r\n this.unsubscribe(fn);\r\n };\r\n }", "function setupSubscribers(mediator, $scope) {\n // Workflow CRUDL subscribers\n mediator.subscribe(CONSTANTS.WORKFLOWS.CREATE, function(data) {\n data.workflowToCreate = JSON.parse(angular.toJson(data.workflowToCreate));\n data.workflowToCreate.id = data.topicUid;\n sampleWorkflows.push(data.workflowToCreate);\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKFLOWS.CREATE + ':' + data.topicUid, data.workflowToCreate);\n });\n\n mediator.subscribeForScope(CONSTANTS.WORKFLOWS.READ, $scope,function(data) {\n var obj = _.find(sampleWorkflows, function(obj) {\n return obj.id == data.topicUid;\n });\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKFLOWS.READ + ':' + data.topicUid, obj)\n });\n\n mediator.subscribe(CONSTANTS.WORKFLOWS.UPDATE, function(data) {\n sampleWorkflows.forEach(function(obj) {\n if(obj.id === data.topicUid) {\n obj = data.workflowToUpdate;\n }\n });\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKFLOWS.UPDATE + ':' + data.topicUid, data.workflowToUpdate);\n });\n\n mediator.subscribe(CONSTANTS.WORKFLOWS.DELETE, function(data) {\n sampleWorkflows = sampleWorkflows.filter(function(obj) {\n return obj.id !== data.topicUid;\n });\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKFLOWS.DELETE + ':'+ data.topicUid, data.topicUid);\n });\n\n mediator.subscribe(CONSTANTS.WORKFLOWS.LIST, function() {\n console.log('>>>>>>>DATA', sampleWorkflows);\n console.log('>>>>>>>RESULTS', sampleResults);\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKFLOWS.LIST, sampleWorkflows)\n });\n\n\n //Subscribers for results, workorders and appforms\n mediator.subscribe(CONSTANTS.RESULTS.LIST, function() {\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.RESULTS.LIST, sampleResults);\n });\n\n mediator.subscribe(CONSTANTS.WORKORDERS.LIST, function() {\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKORDERS.LIST, sampleWorkorders);\n });\n\n mediator.subscribe(CONSTANTS.APPFORMS.LIST, function() {\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.APPFORMS.LIST, []);\n });\n\n //Subscribers for Workflow process\n mediator.subscribe(CONSTANTS.WORKFLOWS.STEP.SUMMARY, function(data) {\n var result = _.find(sampleResults, function(obj) {\n return obj.workorderId === data.workorderId;\n });\n\n if(!result) {\n result = {};\n result.id = shortid.generate();\n result.workorderId = data.workorderId;\n result.nextStepIndex = 0;\n result.stepResults = {};\n result.status = 'New';\n }\n\n var workorder = _.find(sampleWorkorders, function(obj) {\n return obj.id === data.workorderId;\n });\n\n var workflow = _.find(sampleWorkflows, function(obj) {\n return obj.id === workorder.workflowId;\n });\n\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKFLOWS.STEP.SUMMARY + ':' + data.topicUid, {\n workorder: workorder,\n workflow: workflow,\n status: result.status,\n nextStepIndex: result.nextStepIndex,\n result: result\n })\n });\n\n mediator.subscribe(CONSTANTS.WORKFLOWS.STEP.BEGIN, function(data) {\n //TODO\n var result = _.find(sampleResults, function(obj) {\n return obj.workorderId === data.workorderId;\n });\n\n if(!result) {\n result = {};\n result.workorderId = data.workorderId;\n result.nextStepIndex = 0;\n result.stepResults = {};\n result.status = 'In Progress';\n\n sampleResults.push(result);\n }\n\n\n var workorder = _.find(sampleWorkorders, function(obj) {\n return obj.id === data.workorderId;\n });\n\n var workflow = _.find(sampleWorkflows, function(obj) {\n return obj.id === workorder.workflowId;\n });\n\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKFLOWS.STEP.BEGIN + ':' + data.topicUid, {\n workorder: workorder,\n workflow: workflow,\n result: result,\n nextStepIndex: result.nextStepIndex,\n step: result.nextStepIndex > -1 ? workflow.steps[result.nextStepIndex] : workflow.steps[0]\n });\n });\n\n mediator.subscribe(CONSTANTS.WORKFLOWS.STEP.COMPLETE, function(data) {\n var result = _.find(sampleResults, function(obj) {\n return obj.workorderId === data.workorderId;\n });\n\n var workorder = _.find(sampleWorkorders, function(obj) {\n return obj.id === data.workorderId;\n });\n\n var workflow = _.find(sampleWorkflows, function(obj) {\n return obj.id === workorder.workflowId;\n });\n\n result.nextStepIndex = _.findIndex(workflow.steps, function(obj) { return obj.code === data.stepCode}) + 1;\n result.stepResults[data.stepCode] = data.submission;\n\n if(result.nextStepIndex >= workflow.steps.length) {\n result.status = 'Complete';\n }\n\n mediator.publish(CONSTANTS.DONE_PREFIX + CONSTANTS.WORKFLOWS.STEP.COMPLETE + ':' + data.topicUid, {\n workorder: workorder,\n workflow: workflow,\n result: result,\n nextStepIndex: result.nextStepIndex,\n step: result.nextStepIndex > -1 ? workflow.steps[result.nextStepIndex] : workflow.steps[0]\n })\n\n });\n}", "function configureScope(callback) {\n hub.getCurrentHub().configureScope(callback);\n}", "_subscribe(subscription) {\n return new Promise((resolve, reject) => {\n let watcherInfo = this._getWatcherInfo(subscription);\n\n // create the 'bare' options w/o 'since' or relative_root.\n // Store in watcherInfo for later use if we need to reset\n // things after an 'end' caught here.\n let options = watcherInfo.watchmanWatcher.createOptions();\n watcherInfo.options = options;\n\n // Dup the options object so we can add 'relative_root' and 'since'\n // and leave the original options object alone. We'll do this again\n // later if we need to resubscribe after 'end' and reconnect.\n options = Object.assign({}, options);\n\n if (this._relative_root) {\n options.relative_root = watcherInfo.relativePath;\n }\n\n options.since = watcherInfo.since;\n\n this._client.command(\n ['subscribe', watcherInfo.root, subscription, options],\n (error, resp) => {\n if (error) {\n reject(error);\n } else {\n resolve(resp);\n }\n }\n );\n });\n }", "subscribe(observer) {\n var _a;\n this._observers = (_a = this._observers) !== null && _a !== void 0 ? _a : new Set();\n this.setupEventHandlersIfNeeded();\n this._observers.add(observer);\n return new ContextSubscription(this.context, observer);\n }", "connectedCallback() {\n // Callback function to be passed in the subscribe call after an event is received.\n // This callback prints the event payload to the console.\n // A helper method displays the message in the console app.\n var self = this;\n const messageCallback = function(response) {\n self.onReceiveEvent(response);\n };\n // Subscribe to the channel and save the returned subscription object.\n subscribe(this.channelName, -1, messageCallback).then(response => {\n this.subscription = response;\n });\n }", "function Scope() {\r\n this._disposables = {};\r\n this._lastDisposableId = 0;\r\n }" ]
[ "0.6734875", "0.6104429", "0.59388775", "0.59088534", "0.58997136", "0.5842393", "0.5842393", "0.5842393", "0.5842393", "0.5831821", "0.5828253", "0.5816915", "0.5797574", "0.57807684", "0.5771273", "0.5723127", "0.56957865", "0.56933177", "0.5606732", "0.5606732", "0.5603132", "0.5552539", "0.5552539", "0.55286556", "0.5524074", "0.55196375", "0.54992723", "0.54940385", "0.5489471", "0.5486651", "0.5478155", "0.5477019", "0.5471953", "0.5440339", "0.54335994", "0.53988653", "0.5376008", "0.5360575", "0.53448343", "0.53351927", "0.53344834", "0.5332513", "0.5302412", "0.5272507", "0.52628595", "0.5256527", "0.5243111", "0.52396226", "0.5229717", "0.52252895", "0.5218229", "0.5210221", "0.52014494", "0.51996225", "0.51889724", "0.51811576", "0.51670414", "0.5166554", "0.5140237", "0.51046425", "0.5101791", "0.5095479", "0.5080146", "0.50773853", "0.50729686", "0.50643003", "0.5056782", "0.5051675", "0.5044339", "0.50428045", "0.5039378", "0.5039378", "0.5039378", "0.5039378", "0.5036682", "0.5036682", "0.5036682", "0.503418", "0.5033289", "0.50307226", "0.5018375", "0.5018375", "0.5018375", "0.5018375", "0.5018375", "0.5018375", "0.5018375", "0.5018375", "0.50045633", "0.49990895", "0.49986628", "0.49759233", "0.49754396", "0.4966215", "0.49556527", "0.49487165", "0.49438813", "0.49435622", "0.49381563", "0.4935828", "0.49305862" ]
0.0
-1
Handler for message received by component
handleMessage(message) { console.log('---> location message received in home session component', message) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function receivedMessage(event) {\n messageHandler.handleMessage(event);\n }", "onMessageReceive() {}", "onMessage() {}", "onMessage() {}", "function handleMessage(event) {\r\n\t\t//console.log('Received message: ' + event.data);\r\n\t\tvar data = JSON.parse(event.data);\r\n\t\thandleReceiveData(data);\r\n\t}", "onMessageChange(event){\n\n}", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "handleMessage(message) {\n console.log('Came to handleMessage in SubscriberLWC. Message: ' + message.textMessage);\n this.receivedMessage = message.textMessage;\n }", "function messageHandler(event) {\n try {\n _messageHandler(event);\n } catch (ex) {\n Cu.reportError(\"FrameWorker: Error handling client port control message: \" + ex + \"\\n\" + ex.stack);\n }\n }", "function handleReceiveMessage(event) {\n console.log(event.data);\n}", "function handleOnMessage(event) {\n const { data } = event;\n if (!data) {\n return;\n }\n \n // Handle the action\n switch (data.action) {\n case 'CONFIG':\n config(data);\n break;\n case 'DRAW':\n draw(data);\n break;\n }\n }", "onMessage(event) {\n try {\n const data = JSON.parse(event.data);\n // data.event is used to lookup which registered listener to call\n this.ee.emit(data.event, data);\n } catch (error) {\n this.ee.emit('error', error);\n }\n }", "function onMessageReceived(event){\n\t\ttry{\n\t\t\tvar message = event.data;\n\t\t\tvar json = JSON.parse(message);\n\t\t\t\n\t\t\tif(json.errorMessage){\n\t\t\t\tconsole.log(\"Error message received from server (control unit), error message was: \" + json.errorMessage);\n\t\t\t}else if(json.propertyName && json.propertyValue !== undefined){\n\t\t\t\tsetPropertyValue(json.propertyName, json.propertyValue);\n\t\t\t}else if(json.methodName && json.methodParameters){\n\t\t\t\tcallMethod(json.methodName, json.methodParameters);\n\t\t\t}else{\n\t\t\t\tconsole.log(\"Invalid incoming data from server, expected data to contain propertyName and propertyValue\");\n\t\t\t}\n\t\t}catch(e){\n\t\t\tconsole.log(\"onMessageReceived, Exception occured with message: \" + e.message);\n\t\t\tconsole.log(e.stack);\n\t\t}\n\t}", "function receivedMessageRead(event) {\n messageHandler.receivedMessageRead(event);\n }", "handleMessage(message) {\r\n console.log('Received message', message.payloadString);\r\n this.callbacks.forEach((callback) => callback(message));\r\n }", "function onMessageReceived(e) {\n console.log('message received');\n console.log(e);\n var msg = JSON.parse(e.data);\n console.log(msg.event);\n switch (msg.event) {\n case 'ready':\n onReady();\n break;\n case 'finish': \n onFinish();\n break;\n };\n }", "function messageListener(event) {\r\n //console.log(event.data);\r\n }", "handleMessage(myMessage) { \n this.message = myMessage;\n this.showMode=true; \n }", "handleMessage(message) {\n console.log('lmsDemo2: message received:' + JSON.stringify(message));\n if(message.FromWhom == 'lmsdemo1'){\n this.msgrcvd = message.ValuePass;\n }\n }", "function handleMessage(e) {\n\t\tif (!e.data) return;\n\n\t\tvar payload;\n\t\ttry {\n\t\t\tpayload = JSON.parse(e.data);\n\t\t} catch (e) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!payload) return;\n\n\t\tvar handler = handlers[payload.event];\n\t\tif (handler) {\n\t\t\thandler(e.source, payload);\n\t\t}\n\t}", "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n\n switch (data.event) {\n case 'ready':\n onReady();\n break;\n\n case 'playProgress':\n onPlayProgress(data.data);\n break;\n\n case 'pause':\n onPause();\n break;\n\n case 'finish':\n onFinish();\n break;\n }\n }", "function handleMessage(message_event) {\n var data = message_event.data;\n if ((typeof(data) === 'string' || data instanceof String)) {\n check_if_pexe_7778_working(data);\n common.logMessage(data);\n }\n else if (data instanceof Object)\n {\n var pipeName = data['pipe']\n if ( pipeName !== undefined )\n {\n // Message for JavaScript I/O pipe\n var operation = data['operation'];\n if (operation == 'write') {\n $('pipe_output').value += ArrayBufferToString(data['payload']);\n } else if (operation == 'ack') {\n common.logMessage(pipeName + \": ack:\" + data['payload']);\n } else {\n common.logMessage('Got unexpected pipe operation: ' + operation);\n }\n }\n else\n {\n // Result from a function call.\n var params = data.args;\n var funcName = data.cmd;\n var callback = funcToCallback[funcName];\n if (!callback)\n {\n common.logMessage('Error: Bad message ' + funcName + ' received from NaCl module.');\n return;\n }\n delete funcToCallback[funcName];\n callback.apply(null, params);\n }\n } else {\n common.logMessage('Error: Unknow message `' + data + '` received from NaCl module.');\n }\n}", "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n \n switch (data.event) {\n case 'ready':\n onReady();\n break;\n \n case 'playProgress':\n onPlayProgress(data.data);\n break;\n \n case 'finish':\n onFinish();\n break;\n }\n \t}", "messageHandler(self, e) {\n let msg = ( (e.data).match(/^[0-9]+(\\[.+)$/) || [] )[1];\n if( msg != null ) {\n let msg_parsed = JSON.parse(msg);\n let [r, data] = msg_parsed;\n self.socketEventList.forEach(e=>e.run(self, msg_parsed))\n }\n }", "onMessage(handler) {\n return this.on('Message', handler);\n }", "function handleMessage(message_event) {\n var data = message_event.data;\n if ((typeof(data) === 'string' || data instanceof String)) {\n common.logMessage(data);\n } else if (data instanceof Object) {\n var pipeName = data['pipe']\n if (pipeName !== undefined) {\n // Message for JavaScript I/O pipe\n var operation = data['operation'];\n if (operation == 'write') {\n $('pipe_output').value += ArrayBufferToString(data['payload']);\n } else if (operation == 'ack') {\n common.logMessage(pipeName + \": ack:\" + data['payload']);\n } else {\n common.logMessage('Got unexpected pipe operation: ' + operation);\n }\n } else {\n // Result from a function call.\n var params = data.args;\n var funcName = data.cmd;\n var callback = funcToCallback[funcName];\n\n if (!callback) {\n common.logMessage('Error: Bad message ' + funcName +\n ' received from NaCl module.');\n return;\n }\n\n delete funcToCallback[funcName];\n callback.apply(null, params);\n }\n } else {\n common.logMessage('Error: Unknow message `' + data +\n '` received from NaCl module.');\n }\n}", "_eventHandler(message) {\n // push to web client\n this._io.emit('service:event:' + message.meta.event, message.payload)\n this._io.emit('_bson:service:event:' + message.meta.event,\n this._gateway._connector.encoder.pack(message.payload))\n }", "function handleMessage(event) {\n const { data } = event;\n const { type, payload } = data;\n\n switch (type) {\n case 'SANDBOX.DISPATCH.MODIFY':\n dispatch({ type: 'MODIFY', payload });\n break;\n case 'SANDBOX.STATE.REQUEST':\n postUpdate();\n break;\n case 'SANDBOX.DISPATCH.SELECT':\n dispatch({ type: 'SELECT', payload });\n break;\n default:\n console.log('WARNING: Unsupported message.');\n }\n }", "dispatchMessageEvent(){\n const detail = this.getMessage();\n const event = new CustomEvent('message', {detail});\n this.dispatchEvent(event);\n }", "_handleMessage(message) {\n // command response\n if (message.id) {\n const callback = this._callbacks[message.id];\n if (!callback) {\n return;\n }\n // interpret the lack of both 'error' and 'result' as success\n // (this may happen with node-inspector)\n if (message.error) {\n callback(true, message.error);\n } else {\n callback(false, message.result || {});\n }\n // unregister command response callback\n delete this._callbacks[message.id];\n // notify when there are no more pending commands\n if (Object.keys(this._callbacks).length === 0) {\n this.emit('ready');\n }\n }\n // event\n else if (message.method) {\n const {method, params, sessionId} = message;\n this.emit('event', message);\n this.emit(method, params, sessionId);\n this.emit(`${method}.${sessionId}`, params, sessionId);\n }\n }", "handleMessage(message){\n console.log(COMPONENT +' handleMessage()', message);\n if(message.TYPE === 'OrderItems' ){\n this.handleAddProduct(message.Array);\n }else if(message.TYPE === 'Confirmation'){\n this.disabled = true;\n\n /* Refresh record data. */\n refreshApex(this.getRecordResponse);\n }\n }", "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n \n switch (data.event) {\n case 'ready':\n onReady();\n break;\n \n case 'playProgress':\n onPlayProgress(data.data);\n break;\n \n case 'pause':\n onPause();\n break;\n \n case 'finish':\n onFinish();\n break;\n }\n}", "function receiveMessage(event) {\n // Parse the message.\n var msg = JSON.parse(event.data);\n \n switch (msg.messageType) {\n case 1: // Add\n addModel(msg.modelHandle, msg.floatArrayData, msg.stringData);\n break;\n case 2: // Remove\n removeModel(msg.modelHandle);\n onCurrentModelChange();\n break;\n case 3: // Move\n moveModel(msg.modelHandle, msg.floatArrayData);\n break;\n case 4: // Rotate\n rotateModel(msg.modelHandle, msg.floatArrayData);\n break;\n case 5: // Scale\n scaleModel(msg.modelHandle, msg.floatArrayData);\n break;\n default: // Unknown message\n console.log(\"Invalid Message.\");\n }\n}", "messageHandler(event){\n const message = event.data;\n switch(message.method){\n case 'goto':\n this.goto(message.args);\n break;\n case 'playAudio':\n this.playAudio();\n break;\n case 'toggleAutoplay':\n this.toggleAutoplay();\n break;\n case 'toggleTranscript':\n this.toggleTranscript();\n break;\n\n }\n }", "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n \n switch (data.event) {\n case 'ready':\n onReady();\n break;\n \n case 'playProgress':\n onPlayProgress(data.data);\n break;\n \n case 'play':\n onPlay();\n break;\n \n case 'pause':\n onPause();\n break;\n \n case 'finish':\n onFinish();\n break;\n }\n}", "function onMessageArrived(message) {\n // console.log(\"onMessageArrived\");\n // console.log(\"onMessageArrived:\" + message.payloadString);\n\n payload = JSON.parse(message.payloadString);\n\n handleMessage( // in updateDom.js\n JSON.stringify(\n payload.state.desired\n )\n );\n\n\n} // close onMessageArrive", "onClientMessage(message) {\n try {\n // Decode the string to an object\n const { event, payload } = JSON.parse(message);\n\n this.emit(\"message\", event, payload);\n } catch {}\n }", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\" + message.payloadString);\n write(message.payloadString);\n}", "function messageHandler (msg) {\n\ttry {\n\t var command = JSON.parse(msg.getData());\n\t switch (command.Name) {\n\t\tcase 'SetTemperature':\n\t\t var temperatura = command.Parameters.Temperatura;\n\t\t console.log (\"\")\n\t\t console.log (\">>>>>> Receiving command <SetTemperature>. Toggling the relay\");\n\t\t console.log (\"\")\n\t\t relayDevice.toggle ()\n\t\t client.complete(msg, printErrorFor('complete'));\n\t\t break;\n\t\tdefault:\n\t\t console.error('Unknown command: ' + command.Name);\n\t\t client.reject(msg, printErrorFor('complete'));\n\t\t break;\n\t }\n\t}\n\tcatch (err) {\n\t printErrorFor('parse received message')(err);\n\t client.reject(msg, printErrorFor('reject'));\n\t}\n}", "function onMessage(data) {\n // EventBridge message from HTML script.\n // Check against EVENT_NAME to ensure we're getting the correct messages from the correct app\n if (!data.type || data.type.indexOf(CONFIG.APP_NAME) === -1) {\n if (DEBUG) {\n print(\"Event type event name index check: \", !data.type, data.type.indexOf(CONFIG.APP_NAME) === -1);\n }\n return;\n }\n data.type = data.type.replace(CONFIG.APP_NAME, \"\");\n\n if (DEBUG) {\n print(\"onMessage: \", data.type);\n print(\"subtype: \", data.subtype);\n }\n\n switch (data.type) {\n case CONFIG.EVENT_BRIDGE_OPEN_MESSAGE:\n onOpened();\n updateUI();\n break;\n case CONFIG.EVENT_UPDATE_AVATAR:\n switch (data.subtype) {\n case CONFIG.EVENT_CHANGE_AVATAR_TO_AVI_AND_SAVE_AVATAR:\n saveAvatarAndChangeToAvi();\n break;\n case CONFIG.EVENT_RESTORE_SAVED_AVATAR:\n restoreAvatar();\n break;\n case CONFIG.EVENT_CHANGE_AVATAR_TO_AVI_WITHOUT_SAVING_AVATAR:\n changeAvatarToAvi();\n break;\n default:\n break;\n }\n updateUI(STRING_STATE);\n break;\n case CONFIG.EVENT_CHANGE_TAB:\n switchTabs(data.value);\n updateUI(STRING_STATE);\n break;\n case CONFIG.EVENT_UPDATE_MATERIAL:\n // delegates the method depending on if \n // event has name property or updates property\n if (DEBUG) {\n print(\"MATERIAL EVENT\" , data.subtype, \" \", data.name, \" \", data.updates);\n }\n switch (data.subtype) {\n case CONFIG.MATERIAL_EVENTS_SUBTYPE.STRING_MODEL_TYPE_SELECTED:\n applyNamedMaterial(CONFIG.STRING_DEFAULT);\n dynamicData[STRING_MATERIAL].selectedTypeIndex = data.updates;\n break;\n case CONFIG.MATERIAL_EVENTS_SUBTYPE.STRING_NAMED_MATERIAL_SELECTED: \n applyNamedMaterial(data.name);\n break;\n case CONFIG.MATERIAL_EVENTS_SUBTYPE.STRING_UPDATE_PROPERTY:\n\n var propertyName = data.updates.propertyName;\n var newMaterialData = data.updates.newMaterialData;\n var componentType = data.updates.componentType;\n var isPBR = data.updates.isPBR;\n\n console.log(\"update Property\" + propertyName + JSON.stringify(newMaterialData));\n updateMaterialProperty(propertyName, newMaterialData, componentType, isPBR);\n break;\n }\n updateUI(STRING_MATERIAL);\n break;\n\n case CONFIG.EVENT_UPDATE_BLENDSHAPE:\n if (data.name) {\n applyNamedBlendshapes(data.name);\n } else {\n updateBlendshapes(data.updates);\n }\n updateUI(STRING_BLENDSHAPES);\n break;\n case CONFIG.EVENT_UPDATE_FLOW:\n switch (data.subtype) {\n case CONFIG.FLOW_EVENTS_SUBTYPE.STRING_DEBUG_TOGGLE:\n if (DEBUG) {\n print(\"TOGGLE DEBUG SPHERES \", data.updates);\n }\n addRemoveFlowDebugSpheres(data.updates, true);\n break;\n case CONFIG.FLOW_EVENTS_SUBTYPE.STRING_COLLISIONS_TOGGLE:\n addRemoveCollisions(data.updates);\n break;\n case CONFIG.FLOW_EVENTS_SUBTYPE.STRING_HAIR: \n updateFlow(data.updates, CONFIG.FLOW_EVENTS_SUBTYPE.STRING_HAIR);\n break;\n case CONFIG.FLOW_EVENTS_SUBTYPE.STRING_JOINTS: \n updateFlow(data.updates, CONFIG.FLOW_EVENTS_SUBTYPE.STRING_JOINTS);\n break;\n default: \n console.error(\"Flow recieved no matching subtype\");\n break;\n }\n updateUI(STRING_FLOW);\n break;\n default:\n break;\n }\n }", "function handleMessage(request) {\n log.log('[' + id + '] handle message:', request, request.type);\n if (request.type == 'recording') {\n recording = request.value;\n } else if (request.type == 'params') {\n updateParams(request.value);\n } else if (request.type == 'wait') {\n checkWait(request.target);\n } else if (request.type == 'propertyReplacement') {\n\tpropertyReplacement(request);\n } else if (request.type == 'type') {\n\ttype(request);\n } else if (request.type == 'select') {\n\tselect(request);\n } else if (request.type == 'copy') {\n\tcopy(request);\n } else if (request.type == 'paste') {\n\tpaste(request);\n } else if (request.type == 'event') {\n simulate(request);\n } else if (request.type == 'snapshot') {\n port.postMessage({type: 'snapshot', value: snapshotDom(document)});\n } else if (request.type == 'reset') {\n reset();\n } else if (request.type == 'url') {\n port.postMessage({type: 'url', value: document.URL});\n }\n}", "received(message) {\n // Called when there's incoming data on the websocket for this channel\n return store.dispatch(addMessage(message));\n\n }", "function handleMessage(event){\n var data = JSON.parse(event.data);\n log(\"Received:\" +\" Latitude: \"+ data.lat +\n \" Longitude: \" + data.lon);\n}", "socketMessage(message) {\n\n let msg = JSON.parse(message.data);\n if (!msg.event) throw \"Invalid message format: \" + msg;\n\n switch (msg.event) {\n case 'startApp':\n console.log('Application launched')\n this.viewHandler.onStartApplication();\n break;\n\n case 'appDisconnected':\n console.log('app disconnected');\n\n GlobalVars.reset();\n this.reset();\n break;\n\n case 'bodyJoints':\n this.eventsHandler.onReceiveBodyJoints(msg);\n break;\n }\n }", "_addMessageListener({\n eventHandler,\n eventName,\n frameId\n }) {\n\n if (typeof eventHandler === 'function') {\n\n handlers.add({\n componentId: this.componentId,\n eventName: eventName,\n eventHandler: eventHandler,\n frameId,\n });\n\n }\n\n }", "function handleMessage(msgEvent) {\n var ev, h;\n\n try {\n ev = JSON.parse(msgEvent.data);\n } catch (e) {\n $log.error('Message.data is not valid JSON', msgEvent.data, e);\n return null;\n }\n if (fs.debugOn('txrx')) {\n $log.debug(' << *Rx* ', ev.event, ev.payload);\n }\n\n if (h = handlers[ev.event]) {\n try {\n h(ev.payload);\n } catch (e) {\n $log.error('Problem handling event:', ev, e);\n return null;\n }\n } else {\n $log.warn('Unhandled event:', ev);\n }\n\n }", "function handleMessage(event) {\n var msg = JSON.parse(event.data);\n\n console.log(msg);\n\n currentStatus = msg.status;\n\n promptRender(msg.status);\n\n if (msg.status.hasStarted) {\n view.start();\n }\n\n switch (msg.type) {\n case \"draw\":\n view.draw(msg.player);\n break;\n case \"win\":\n view.winner(msg.player);\n break;\n case \"start\":\n view.start();\n break;\n case \"redraw\":\n view.redraw();\n break;\n case \"reset\":\n view.reset();\n break;\n }\n }", "handleSocketMessage(event) {\n console.log(event);\n //let response = JSON.parse(event.data);\n //console.log(response.type);\n\n //this.emit(response.type, response.value);\n }", "handleBusMessages() {\n const bus = this.runtime.bus();\n\n Object.values(REQUESTS).forEach((msgType) => {\n bus.on(msgType, (msgData) => {\n this.sendCommMessage(msgType, msgData);\n });\n });\n }", "handleChannelDataSocketConnectedMessage(message) {\n // Pass on this information to the upper controls\n this.top.getDisplayer()\n .getUpperControls()\n .onChannelDataSocketConnectedMessageReceived();\n }", "function callback(msg) {\n print(\"Server response - Msg -> \" + msg.data);\n print(\"\");\n var data = jQuery.parseJSON(msg.data);\n handle_event(data);\n}", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\", message);\n }", "function handleMessage(msg) {\n // var msg = JSON.parse(event.data);\n\n console.log(msg);\n\n currentStatus = msg.status;\n\n promptRender(msg.status);\n\n if (msg.status.hasStarted) {\n view.start();\n }\n\n switch (msg.type) {\n case \"draw\":\n view.draw(msg.player);\n break;\n case \"win\":\n view.winner(msg.player);\n break;\n case \"start\":\n view.start();\n break;\n case \"redraw\":\n view.redraw();\n break;\n case \"reset\":\n view.reset();\n break;\n }\n }", "handleText(event) {\n this.message = event.target.value;\n }", "function onMessage(event) {\n\n\t\tvar msg = JSON.parse(event.data);\n\n\t\tswitch(msg.type) {\n\n\t\tcase 'chat':\n\t\t\tdisplayChatMessage(event);\n\t\t\tbreak;\n\n\t\tcase 'attendeeCount':\n\t\t\tdisplayAttendeeCount(event);\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'kudosCount':\n\t\t\tdisplayKudosCount(event);\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'fanCount':\n\t\t\tdisplayFanCount(event);\n\t\t\tbreak;\n\n\t\t}\n\t}", "onMessage( message ) {\n\t\tconsole.log(`Received message from client: ${ message.toString() }`);\n\t}", "handleMessages(messages) {\n\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "function receiveMessage(e) {\n\teval( e.data );\n}", "function onMessageArrived(message) {\n\tconsole.log(\"onMessageArrived:\"+message.payloadString); \n}", "function messageHandler (msg) {\n console.log('Id: ' + msg.messageId + ' Body: ' + msg.data);\n client.complete(msg, printResultFor('completed'));\n}", "function messageHandler (msg) {\n console.log('Id: ' + msg.messageId + ' Body: ' + msg.data);\n client.complete(msg, printResultFor('completed'));\n}", "function onMessage(event) {\n const echartsData = JSON.parse(event.nativeEvent.data);\n // 判断监听类型\n if (echartsData.type == \"datazoom\") {\n props.onDataZoom?.();\n } else if (echartsData.type == \"legendselectchanged\") {\n props.legendSelectChanged?.(echartsData.name);\n } else if (echartsData.type == \"tooltipEvent\") {\n props.tooltipEvent?.(echartsData.params);\n } else {\n props.onPress?.(JSON.parse(event.nativeEvent.data));\n }\n }", "function handleReceive() {\n console.log(\n '%c handle receive!!',\n 'font-size: 30px; color: purple'\n );\n }", "messageReceived(message){\n\t\tLogger.info(\"Message received:\");\n\t\tLogger.info(`name: ${message.name}`);\n\t\tLogger.info(`data: ${message.data}`);\n\n\t\tif(!message.name) {\n\t\t\tLogger.warn(\"Message received without a name. Ignoring.\");\n\t\t\treturn null;\n\t\t}\n\n\t\tif(!this[message.name]) {\n\t\t\tLogger.warn(`Message received with name [${message.name}] which is not a method on the MessageClient class.`);\n\t\t\treturn null;\n\t\t}\n\n\t\tthis[message.name](message.data);\n\t}", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n }", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n }", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n}", "bindEvent() {\n chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {\n switch (request.eventName) {\n case 'parse':\n this.parse()\n break\n case 'revert':\n this.revert()\n break\n case 'switchThemeName':\n this.switchTheme(request.themeName)\n this.setThemeName(request.themeName)\n break\n case 'switchLangsPrefer':\n this.setLangsPrefer(request.langsPrefer)\n break\n }\n });\n }", "function onMessageArrived(message) {\r\n Men2Recv=message.payloadString;\r\n console.log(Men2Recv);\r\n accion(Men2Recv);\r\n}", "processMessage(msg) {\n super.processMessage(msg);\n this._view.processPhosphorMessage(msg);\n }", "function listener(string) {\n var command = io.JSON.parse(string),\n data = command.data;\n\n if (command.target === \"p\" || command.target === \"p&c\") {\n switch (command.type) {\n case \"send\":\n if (data.parentId == self.guid) {\n if (data.eventType === \"subscribeUserMsg\") {\n var msgHandlerName = data.data.app;\n var rt = registerMsgChild(\n msgHandlerName,\n data.data.token,\n data.childId\n );\n if (rt) {\n var handler = self.msgHandlers[msgHandlerName];\n if (!handler) {\n self.socket.send(data.eventType, data.data);\n }\n }\n } else if (data.eventType === \"subscribeTopicMsg\") {\n var msgHandlerName = data.data.appTopic;\n var rt = registerMsgChild(\n msgHandlerName,\n data.data.token,\n data.childId\n );\n if (rt) {\n var handler = self.msgHandlers[msgHandlerName];\n if (!handler) {\n self.socket.send(data.eventType, data.data);\n }\n }\n } else if (\n data.eventType === \"unSubscribeUserMsg\" ||\n data.eventType === \"unSubscribeTopicMsg\"\n ) {\n var rt = unRegisterMsgChild(data.data, data.childId);\n if (rt) {\n var handler = self.msgHandlers[data.data];\n if (!handler) {\n self.socket.send(data.eventType, data.data);\n }\n }\n } else {\n self.socket.send(data.eventType, data.data);\n }\n }\n break;\n case \"localMessage\":\n if (data.fromId != self.guid) {\n self.dealLocalMsg(data.eventType, data.data);\n }\n break;\n case \"clildClose\":\n unRegisterMsgChildAll(data.data);\n break;\n }\n }\n }", "function handleMessage(msg) { // process message asynchronously\n setTimeout(function () {\n messageHandler(msg);\n }, 0);\n }", "function entityMessageReceiver(event) {\n // validate that this is an entityMessage\n if (-1 === event.data.indexOf('entityMessage')) return\n var message = JSON.parse(event.data)\n var uuid = message.uuid\n var entity = entities[uuid]\n switch (message.type) {\n case 'error':\n var value = message.value\n setEntityState(entity,'error')\n console.log('an entity threw an error -',uuid,value)\n break\n case 'setPosition':\n var value = message.value\n setPosition(entity,value)\n break\n case 'setRotation':\n var value = message.value\n setRotation(entity,value)\n break\n case 'move':\n var value = message.value\n move(entity,value)\n break\n case 'rotate':\n var value = message.value\n rotate(entity,value)\n break\n }\n }", "function xcoffee_handle_msg(msg)\r\n{\r\n console.log('xcoffee msg',msg);\r\n\r\n events_div.insertBefore(xcoffee_format_msg(msg),events_div.firstChild);\r\n\r\n switch (msg[\"event_code\"])\r\n {\r\n case \"COFFEE_REMOVED\":\r\n set_state_removed(msg);\r\n break;\r\n\r\n case \"COFFEE_GRINDING\":\r\n case \"COFFEE_BREWING\":\r\n set_state_brewing(msg);\r\n break;\r\n\r\n case \"COFFEE_POURED\":\r\n case \"COFFEE_NEW\":\r\n case \"COFFEE_REPLACED\":\r\n set_state_running(msg);\r\n break;\r\n\r\n case \"COFFEE_STATUS\":\r\n handle_status(msg);\r\n default:\r\n break;\r\n }\r\n}", "function receiveMessage(event) {\n\n fileName = ab2str(event.data[0]);\n fileContents = ab2str(event.data[1]);\n\n setName();\n setupLegend();\n\n}", "_received(data) {\n console.log('This is getting called...');\n // const element = this.statusTarget\n // element.innerHTML = data\n }", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n}", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n}", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n}", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n}", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n}", "function handleChangedValue(event) {\r\n \t let decoder = new TextDecoder('utf-8');\r\n \t let value = event.target.value\r\n \t var now = new Date()\r\n \t console.log('> ' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + ' Received message is: ' + decoder.decode(value) );\r\n\t mDebugMsg1(1,'> ' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + ' Received message is: ' + decoder.decode(value) );\r\n \t receivedValue=value;\r\n\t serial.onReceive(receivedValue);\r\n //\t MessageReceived = receivedValue;\r\n mDebugMsg1(1,\"CONNECTED, Acquiring data\");\r\n \t isBTConnected = true;\r\n }", "HandleMessage( msg ) {\n return false;\n }", "function onSendMessage(data){\n\t//TODO \n}", "_onRecieveMessage() {\n this.client.on(\"data\", data => {\n console.log(data.toString());\n });\n }", "function messageChanged(event) {\r\n var value = (event ? event.target.value : undefined);\r\n // Update data\r\n updateMessage(value);\r\n // Update settings\r\n settings.msg = value;\r\n piSaveSettings();\r\n }", "function handleMessage(client, message)\n{\n\n if(message.component && components[message.component]) {\n //check if component is registered in the components array\n if(components[message.component]) {\n messageLogger.debug(\"from \" + client.id + \": \" + stringifyWithoutPassword(message));\n components[message.component].handleMessage(client, message);\n }\n } else {\n messageLogger.error(\"Can't route the message:\" + stringifyWithoutPassword(message));\n }\n}", "function handleMessage(message_event) {\n var msg = message_event.data;\n\n var cmd = msg.cmd;\n var result = msg.result;\n var newDict = msg.dict;\n\n // cmd will be empty when the module first loads and sends the contents of\n // its dictionary.\n //\n // Note that cmd is a String object, not a primitive, so the comparison cmd\n // !== '' will always fail.\n if (cmd != '') {\n common.logMessage(\n 'Function ' + cmd + ' returned ' + JSON.stringify(result));\n }\n\n var dictEl = document.getElementById('dict');\n dictEl.textContent = JSON.stringify(newDict, null, ' ');\n}", "function receiveMessage(e) {\n\n\t\tconsole.log(\"e: \" + JSON.stringify(e, null, 2));\n\t\tconsole.log(\"e.origin: \" + JSON.stringify(e.origin, null, 2));\n\t\tconsole.log(\"e.data: \" + JSON.stringify(e.data, null, 2));\n\n\t\t// Check to make sure that this message came from the correct domain.\n\t\t// if (e.origin !== \"http://localhost\") {\n\t\t// \treturn;\n\t\t// } else {\n\t\t// \t// Update the div element to display the message.\n\t\t// \tmessageEle.innerHTML += e.data + \"\\n\";\n\t\t// }\n\n\t\tmessageEle.innerHTML += e.data + \"\\n\";\n\n\t\t// If message was sent from modal, close the modal dialog\n\t\t// There must be a better way to detect the message was received from modal\n\t\t// without doing a regex search but I'll figure it out later\n\t\tif (e.data.search(/modal/i)) {\n\t\t\tdialog.close();\n\t\t}\n\t}", "function messageHandler(sMessage) {\n console.debug(\"message handler called with text: \" + sMessage);\n updateChatArea(\"Broker: \" + sMessage);\n\n return;\n }", "onMessageEnd() { }", "emitMessage (event) {\n this.emit('on-message', event)\n }", "function _onDataLoaderMessage(message, channel) {\n\t\t// Check the channel on which the message was posted\n\t\tswitch (channel) {\n\t\tcase 'dataloader:download-completed':\n\t\t\t// The loader was able to download all the data we need, we can proceed\n\t\t\t// with intializing the data store and analyzing the code\n\t\t\tDataStore.init(ajaxLoader.getData());\n\t\t\t_listApis();\n\t\t\tbreak;\n\t\t}\n\n\t\t// Unsubscribe from message from the data loader\n\t\tIntermediary.unsubscribe('dataloader', dataLoaderHandler);\n\t\t// Relaease the data loader and its handler\n\t\tdataLoaderHandler = null;\n\t\tajaxLoader = null;\n\t}", "function messagereceivedHandler(e) {\n var messageSize = e.detail.length;\n for (var i = 0; i < messageSize; i++) {\n for (var key in e.detail[i].data) {\n switch (key) {\n case Messages.ServerStarted:\n serverStarted = true;\n break;\n case Messages.MyMusicIsPlaying:\n isMusicPlaying = true;\n smtc.playbackStatus = MediaPlaybackStatus.playing;\n break;\n case Messages.CurrentSongName:\n\n document.getElementById(\"curr-song-name\").innerText = e.data.first().current.value;\n break;\n case Messages.CurrentSong:\n updateCurrentSong(e.detail[i].data[key]);\n break;\n }\n }\n }\n}", "function messageHandler(event) {\n // We will ignore all messages destined for otherType.\n let data = event.data;\n let portid = data.portId;\n let port;\n if (!data.portFromType || data.portFromType === \"worker\") {\n // this is a message posted by ourself so ignore it.\n return;\n }\n switch (data.portTopic) {\n case \"port-create\":\n // a new port was created on the \"client\" side - create a new worker\n // port and store it in the map\n port = new WorkerPort(portid);\n ports[portid] = port;\n // and call the \"onconnect\" handler.\n onconnect({ports: [port]});\n break;\n\n case \"port-close\":\n // the client side of the port was closed, so close this side too.\n port = ports[portid];\n if (!port) {\n // port already closed (which will happen when we call port.close()\n // below - the client side will send us this message but we've\n // already closed it.)\n return;\n }\n delete ports[portid];\n port.close();\n break;\n\n case \"port-message\":\n // the client posted a message to this worker port.\n port = ports[portid];\n if (!port) {\n // port must be closed - this shouldn't happen!\n return;\n }\n port._onmessage(data.data);\n break;\n\n default:\n break;\n }\n }", "onMessage (event) {\n const action = JSON.parse('{' + event.data + '}')\n const requestAction = typeof action.t === 'string'\n ? responseActionsMap[action.t]\n : responseActionsMap.GameStateUpdateAction\n if (requestAction) {\n requestAction.handler(action)\n }\n }", "onMessageStart() { }" ]
[ "0.75221837", "0.7263803", "0.7151968", "0.7151968", "0.71241885", "0.6972168", "0.6959935", "0.6959935", "0.6959935", "0.693945", "0.6891903", "0.6888057", "0.68730676", "0.6843233", "0.68329126", "0.6812576", "0.6811467", "0.67926407", "0.67817706", "0.67095065", "0.6687046", "0.66792613", "0.66310745", "0.6612247", "0.6601531", "0.659781", "0.65977174", "0.6595998", "0.6593519", "0.65906245", "0.6584435", "0.6571721", "0.6533954", "0.652777", "0.6498116", "0.64785373", "0.6459669", "0.64242965", "0.64057887", "0.6390984", "0.6389276", "0.63736284", "0.63694507", "0.63661504", "0.63605374", "0.6354427", "0.63509166", "0.6349284", "0.6347434", "0.6344868", "0.63267267", "0.6303243", "0.62983984", "0.62817883", "0.62693894", "0.6269191", "0.6268259", "0.6267416", "0.6266443", "0.62430763", "0.62294054", "0.6228793", "0.6228533", "0.6228533", "0.62136084", "0.62071776", "0.62047344", "0.6202459", "0.6202459", "0.619896", "0.61967933", "0.61953354", "0.61930513", "0.61843234", "0.6179551", "0.61779886", "0.6176236", "0.616996", "0.6156994", "0.6144835", "0.6144835", "0.6144835", "0.6144835", "0.6144835", "0.6133016", "0.6118605", "0.6116893", "0.6116042", "0.61117893", "0.6108983", "0.6105748", "0.6105464", "0.6105459", "0.61032826", "0.610152", "0.6101113", "0.60948336", "0.60858893", "0.6072939", "0.60695887" ]
0.6194577
72
include x, y, suggest to use getter and setter to react the new values
constructor(shape=null,pos=null){ this.fsm = createDragStateMachine(); this.fsm.observe({ onLeftMouseMove:this.onLeftMouseMove.bind(this), onLeftMouseDown:this.onLeftMouseDown.bind(this), onEnterSelected:this.onEnterSelected.bind(this) }); if(!shape || !pos){ return; } this.install(shape,pos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set data ({x, y}){\n this._x = x\n this._y = y\n }", "update() {\n this.x\n this.y\n }", "set(x = null,y = null){\n //12.3 or \"12.3\"\n if(typeof x === 'number' || typeof x === 'string'){\n this.x = parseFloat(x);\n if(y !== null){\n this.y = parseFloat(y);\n }else{\n this.y = x;//so, based on one value.\n }\n }else if (Array.isArray(x)) {\n let point = x; //readability\n this.x = parseFloat(point[0]);\n this.y = parseFloat(point[1]);\n }else if(typeof x === 'object'){//we (Point) or any other object having x,y properties\n let point = x; //readability\n this.x = point.x;\n this.y = point.y;\n }else{//apparently user wants an empty object, or something.\n this.x = this.y = 0;\n }\n return this; \n }", "function getValues(x, y) {\n this.X = x;\n this.Y = y;\n }", "set(x,y){ this.x=x; this.y=y; return this;}", "update(x, y){\n this.location.x = x\n this.location.y = y\n }", "get data (){\n return {\n x: this.x,\n y: this.y\n }\n }", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "function dragObject_setXY(x,y){\n this.x=x+this.ofsX\n this.y=y+this.ofsY\n}", "get position() {\n return {x: this.x, y: this.y}\n }", "constructor(x, y) { //takes coordinates\n\t\tthis.set(x, y); // and set it here\n\t}", "set point(value) {}", "setXY(x,y)\n {\n this.x = x;\n this.y = y;\n this.drawx = x;\n this.drawy = y;\n\n this.vis = {\n\t\tdx : 0,\n\t\tdy : 0,\n\t\tx : this.x,\n\t\ty : this.y\n\t\t};\n\n }", "setPos(x,y){\n\t\tthis.setX(x);\n\t\tthis.setY(y);\n\t}", "get origin() {\n return { x: this.x, y: this.y };\n }", "setX(val) {\r\n this.x=val;\r\n }", "constructor(x, y) {\n this.position = { x: x, y: y };\n this.size = {x: 5, y:5};\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n this.x = x;\n this.y = y;\n }", "get coords() {\n return [this.x, this.y];\n }", "constructor(x,y) {\r\n this.x = x\r\n this.y = y\r\n }", "update(x, y, point) {\n\t \tlet constructor = this;\n\t\tmoveAt(x, y, point); \t\n\t\tfunction moveAt(x, y, point) {\n\t\t\tif (point == \"start\") {\n\t\t\t constructor.x1 = x;\n\t\t\t constructor.y1 = y;\n\t\t\t constructor.line.setAttribute('x1', x);\n\t\t\t constructor.line.setAttribute('y1', y);\n\t\t\t}\n\t\t\telse {\n\t\t\t constructor.x2 = x;\n\t\t\t constructor.y2 = y;\n\t\t\t\tconstructor.line.setAttribute('x2', x);\n\t\t\t constructor.line.setAttribute('y2', y);\n\t\t\t}\n\t\t}\n\t}", "constructor(x, y) {\n this.x = x\n this.y = y\n }", "constructor(x, y, value) {\n this.x = x\n this.y = y\n this.l = createVector(x,y)\n this.value = value\n }", "set x(value) {this._x = value;}", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "function pointv1(x, y) {\n return {\n getX: function () {\n return x;\n },\n \n setX: function (val) {\n x = val;\n },\n \n getY: function () {\n return y;\n },\n \n setY: function (val) {\n y = val;\n }\n };\n}", "constructor(x,y){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "updatePos(x2, y2) {\n this.xPos = parseInt(x2, 10);\n this.yPos = parseInt(y2, 10);\n console.log(\"new position \", this.xPos, this.yPos);\n }", "setX(x) {\n this.setXY(toInt(x), this.position[1]);\n }", "get values() {\n return {\n x: this.x,\n y: this.y,\n scaleX: this.scaleX,\n scaleY: this.scaleY,\n rotation: this.rotation,\n opacity: this.opacity\n };\n }", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "init() {\n this.x = 200;\n this.y = 410; \n }", "constructor(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "constructor(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "setTo(x, y)\n\t{\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "setX(x){ this.x = x; }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "set y(value) {this._y = value;}", "constructor(x = 0,y = null){\n this.set(x,y);\n }", "setY(val) {\r\n this.y=val;\r\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n // this.x = x;\n // this.y = y;\n }", "setPosition(x, y) {\n this.x = x\n this.y = y\n }", "constructor(x_, y_) {\n this.x = x_;\n this.y = y_;\n }", "set x(x){ this.spine.x = x; }", "_set_point(pos_x, pos_y) {\n if (typeof pos_x !== 'number') {\n console.error(\"[ERROR] invalid parameter: 'pos_x' sholud be a number\");\n }\n if (typeof pos_y !== 'number') {\n console.error(\"[ERROR] invalid parameter: 'pos_y' sholud be a number\");\n }\n\n return {\n x : pos_x,\n y : pos_y,\n };\n }", "constructor(x = 0, y = 0) {\n\n this.set(x, y);\n }", "function setOriginCoords(x, y) {\n\t\tthis.originX = eval(x);\n\t\tthis.originY = eval(y);\n\t}", "set posX(value){\n this._posX = value;\n }", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "set setX (x) {\n this.x = x;\n }", "constructor(x, y) {\n\n super();\n this.x = x;\n this.y = y;\n\n }", "setX(x)\n {\n this.x=x;\n }", "setPosition(x, y) {\n this.pos.x = x;\n this.pos.y = y;\n }", "function saveXYValues () {\r\n demo = true;\r\n savedOldPositionY = oldPositionY;\r\n savedOldPositionX = oldPositionX;\r\n savedNewPositionY = newPositionY;\r\n savedNewPositionX = newPositionX;\r\n }", "function set_player_loc(x, y) {\n player['x'] = x;\n player['newx'] = x;\n player['y'] = y;\n player['newy'] = y\n}", "constructor(x_pos, y_pos) {\n this.x_pos = x_pos;\n this.y_pos = y_pos;\n }", "function setpos (object, x, y) {\n object.setAttribute('x', x + '');\n object.setAttribute('y', y + '');\n}", "getStartingPosition(){\n return [this.x,this.y];\n }", "set(options) {\n\n if (\"point1\" in options) {\n var copyPoint = options[\"point1\"];\n this.point1.set({x: copyPoint.getX(), y: copyPoint.getY()});\n }\n if (\"point2\" in options) {\n var copyPoint = options[\"point2\"];\n this.point2.set({x: copyPoint.getX(), y: copyPoint.getY()});\n }\n if (\"line\" in options) {\n var copyLine = options[\"line\"];\n this.point1.set({x: copyLine.getPoint1().getX(), y: copyLine.getPoint1().getY()});\n this.point1.set({x: copyLine.getPoint2().getX(), y: copyLine.getPoint2().getY()});\n }\n }", "set x(value) {\n var _a, _b;\n // value = Math.round(value);\n this._x = value;\n this.position.x = value;\n (_b = (_a = this.entity) === null || _a === void 0 ? void 0 : _a.gameObject) === null || _b === void 0 ? void 0 : _b.setPosition(value, this.y);\n }", "constructor(x, y) {\n\t\tthis.x = x; // current coordinate (0..24)\n\t\tthis.y = y; // current coordinate (0..24)\n\t\t\n\t\tthis.previousX = x;\n\t\tthis.previousY = y;\n\t}", "update () {\n this.position = [this.x, this.y];\n }", "display(){\r\n point(this.x,this.y);\r\n }", "get xPosition() { return this._xPosition; }", "function Coord(x, y) {\n this.x = x;\n this.y = y;\n}", "function Position(x,y){\n this.x = x;\n this.y = y;\n}", "function Position(x,y){\n this.x = x;\n this.y = y;\n}", "componentWillUpdate(e, state) {\n if (state.x) {\n this.xElement.innerHTML = ' x: ' + state.x\n } \n if (state.y) {\n this.yElement.innerHTML = ' y: ' + state.y\n } \n }", "get value() {\n return {\n 'offsetX': this._offsetX,\n 'offsetY': this._offsetY,\n 'scale': this._scale\n };\n }", "function setFinalCoords(x, y) {\n\t\tthis.finalX = eval(x);\n\t\tthis.finalY = eval(y);\n\t}", "function Coords(x, y) {\n this.x = x;\n this.y = y;\n}", "function Coordinates(x, y)\n{\n this.x = x;\n this.y = y;\n}", "getY() { return this.y; }", "moveTo(x, y) {\n this.x = x;\n this.y = y;\n }", "set setY (y) {\n this.y = y;\n }", "setOrigin(x:number, y:number) {\n\t\tif(this.isValidNumber(x) && this.isValidNumber(y)) {\n\t\t\tthis.origin = {x: x, y: y};\n\t\t}\n\t}", "moveTo(x, y) {\n this.params.x = x\n this.params.y = y\n this.updateParams()\n }", "function Position(x, y){\n this.x = x;\n this.y = y;\n}", "constructor(x = 0, y = 0) {\n this.x = x;\n this.y = y;\n }", "ref(x, y) {\n return this.attr('refX', x).attr('refY', y);\n }", "update_xyz_circle(){\n let x_px = this.meters_to_x_px(this.xyz[0])\n let y_px = this.meters_to_y_px(this.xyz[1])\n //let z_px = dui2.meters_to_x_px(xyz[2]) //don't do as range slider has its min and max\n selector_set_in_ui(\"#\" + this.show_window_elt_id + \" [id=xy_2d_slider] [cx]\", x_px)\n selector_set_in_ui(\"#\" + this.show_window_elt_id + \" [id=xy_2d_slider] [cy]\", y_px)\n selector_set_in_ui(\"#\" + this.show_window_elt_id + \" [name=z_slider] [value]\", this.xyz[2])\n }", "processFrame() {\n\n if (this.vx.value()) {\n\n this.x.value(this.x.value() + this.vx.value());\n }\n\n if (this.vy.value()) {\n\n this.y.value(this.y.value() + this.vy.value());\n }\n\n super.processFrame();\n }", "function getCoords () {\n return {\n x: 10,\n y: 22\n }\n }", "function Coordinate(x,y){\n this.x = x;\n this.y = y;\n}", "function setPoint (p, i, x, y) {\n p[i] = {u: x, v: y}; // Objekt mit Koordinaten der Ecke\n }", "constructor(x,y) {\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t}", "serializeForMapUpdate() {\n return {\n x: this.x,\n y: this.y,\n };\n }", "function movesXY(x, y){\n this.x = x;\n this.y = y;\n}", "get y() {return this._y;}", "setDir(a,b){\n this.xdir = a;\n this.ydir = b;\n }", "function getCoords() {\n return {\n x: 10,\n y: 22\n };\n}", "function setPosition(object, x, y)\n{\n this.object = object;\n this.x = x || null;\n this.y = y || null;\n if (this.x != null);\n\n {\n this.object.position.x = this.x;\n }\n\n if (this.y != null);\n\n {\n this.object.position.y = this.y;\n }\n\n}", "getX() {\r\n return this.x;\r\n }", "constructor(startX, startY) {\r\n this.x = startX;\r\n this.y = startY;\r\n }", "constructor ()\n\t{\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}", "getCoords(){\n return this.ballY;\n }", "add(x, y){\n let point = new Point(x,y); //this will handle the 'x' being numbers, array, a simple object, or another Point \n this.x += point.x;\n this.y += point.y;\n return this;\n }", "calculatePositions() {\n this.x1 = this.from.getCenterX()\n this.y1 = this.from.getCenterY()\n this.x2 = this.to.getCenterX()\n this.y2 = this.to.getCenterY()\n }", "function Point(x, y) {\n this.x = x;\n this.y = y;\n // this.x = x;\n // this.y = y;\n }" ]
[ "0.79151386", "0.7465439", "0.72924715", "0.72706246", "0.72542244", "0.71578693", "0.71382135", "0.71327084", "0.7059859", "0.70480525", "0.7035327", "0.69963026", "0.69265723", "0.6884375", "0.6836651", "0.68305486", "0.6829569", "0.68255496", "0.68097895", "0.67587507", "0.6740177", "0.67324555", "0.6706746", "0.6701932", "0.6671339", "0.66687596", "0.6666103", "0.66597533", "0.66577774", "0.6640535", "0.6628473", "0.66276956", "0.6625797", "0.6625797", "0.6622253", "0.6620142", "0.66166997", "0.66166997", "0.66166997", "0.6609892", "0.6606198", "0.6589327", "0.6578821", "0.65460926", "0.6536947", "0.65349066", "0.65205425", "0.65167505", "0.6516729", "0.6515847", "0.6496281", "0.6493412", "0.6478568", "0.6476244", "0.64538556", "0.6450418", "0.64274716", "0.642677", "0.6423874", "0.64215386", "0.6419171", "0.63855445", "0.6385372", "0.6382804", "0.6380722", "0.6377557", "0.6365079", "0.6360454", "0.6360454", "0.6356265", "0.6353343", "0.63476", "0.63433254", "0.6342349", "0.633582", "0.63050735", "0.6291753", "0.62715656", "0.6270695", "0.62645954", "0.6252042", "0.6251084", "0.6241228", "0.6238933", "0.62216336", "0.6220978", "0.6218659", "0.62085956", "0.62046844", "0.6203426", "0.61977464", "0.6183138", "0.61808634", "0.6170855", "0.61627966", "0.61615205", "0.61595076", "0.6156297", "0.6149239", "0.6143412", "0.612958" ]
0.0
-1
Start from the first quote
start() { this.do("start") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startsWith(c){ return c==this.quotation }", "firstToken({token, counter}) {\n\t\tif (['quote'].includes(token.name)) {\n\t\t\tthis.openQuote = token.value;\n\t\t\tthis.listener.candidates = this.listener.candidates.filter(c=> c.name === 'string');\n\t\t\tthis.listener.checking = 'middleTokens';\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function first() {\n index = 0;\n c = dot.charAt(0);\n }", "function first() {\n index = 0;\n c = dot.charAt(0);\n }", "function first() {\n index = 0;\n c = dot.charAt(0);\n }", "function getFirstChar() {\n index = 0;\n c = expr.charAt(0);\n }", "function first() {\n index = 0;\n c = dot.charAt(0);\n}", "parseSingleString() {\n\t\t\tif ( this.char === CHAR_APOS ) {\n\t\t\t\treturn this.next( this.parseLiteralMultiStringMaybe );\n\t\t\t} else {\n\t\t\t\treturn this.goto( this.parseLiteralString );\n\t\t\t}\n\t\t}", "function cursorToStart(elem) {\n var range;\n if (elem.createTextRange) {\n range = elem.createTextRange();\n range.move(\"character\", 0);\n range.select();\n } else if (elem.selectionStart) {\n elem.focus();\n elem.setSelectionRange(0, 0);\n }\n }", "function fixStart(text){\n var first = text[0]; //'a'\n var result = first;\n for( var i=1; i<text.length; i++ ){\n var curr = text[i];\n if(curr == first){\n result += '*'\n }else{\n result += text[i]\n }\n }\n return result \n}", "function upliftingQuote() {\r\n // Example quotes:\r\n // \"The first step is you have to say that you can.\"\r\n // \"Rise above the storm and you will find the sunshine.\",\r\n // BEGIN CODE \r\n \r\n // END CODE\r\n}", "parseSingleString() {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiStringMaybe);\n } else {\n return this.goto(this.parseLiteralString);\n }\n }", "parseSingleString () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiStringMaybe)\n } else {\n return this.goto(this.parseLiteralString)\n }\n }", "skipToNextChar() {\n this.consume();\n this.skipSpaces();\n }", "function startsp() {\r\n\tnextWord(false);\r\n}", "function isAtStart(string, index) {\n var before = string.substring(0, index).trim();\n return before.length === 0 || before.search(/[({,]$/) !== -1;\n}", "function soothingQuote() {\r\n // Example quotes: \r\n // \"For every minute you are angry you lose sixty seconds of happiness.\"\r\n // \"Don’t waste your time in anger, regrets, worries, and grudges. Life is too short to be unhappy.\"\r\n // BEGIN CODE \r\n \r\n // END CODE\r\n}", "function startFrom(value) { }", "function inspiringQuote() {\r\n // Example quotes: \r\n // \"If opportunity doesn't knock, build a door.\"\r\n // \"The best way out is always through.\"\r\n // BEGIN CODE \r\n \r\n // END CODE\r\n}", "function first() {\n index = 0;\n c = expression.charAt(0);\n nesting_level = 0;\n conditional_level = null;\n }", "function first() {\n index = 0;\n c = expression.charAt(0);\n nesting_level = 0;\n conditional_level = null;\n }", "function fixStart(word) {\n var firstLetter = word.charAt(0);\n console.log(firstLetter + word.slice(1).replace(new RegExp(firstLetter, 'g'), '*'));\n return fixStart;\n}", "function first(input) {\n return input.substring(0, 1);\n}", "function firstChar(name) {\n let clearName = name.trim();\n let fChar = clearName.charAt(0);\n return fChar\n}", "function initializeQuote() {\n clearQuote()\n printQuote()\n}", "function getQuote() {\n const firstLetter = lastName.substring(0,1).toUpperCase()\n console.log(firstLetter)\n const quote = sciQuotes[firstLetter]\n return quote\n }", "get BackQuote() {}", "startsWith(t) { return this.check_symbol(t, this.LEFT) }", "_caretAtStart() {\n\t\ttry {\n\t\t\treturn this.input.selectionStart === 0 && this.input.selectionEnd === 0;\n\t\t} catch(e) {\n\t\t\treturn this.input.value === '';\n\t\t}\n }", "sBegin() {\n // We are essentially peeking at the first character of the chunk. Since\n // S_BEGIN can be in effect only when we start working on the first chunk,\n // the index at which we must look is necessarily 0. Note also that the\n // following test does not depend on decoding surrogates.\n // If the initial character is 0xFEFF, ignore it.\n if (this.chunk.charCodeAt(0) === 0xFEFF) {\n this.i++;\n this.column++;\n }\n this.state = S_BEGIN_WHITESPACE;\n }", "function fixStart (str) {\n\tvar firstLetter = str.charAt(0);\n\tvar remainder = str.slice(1, str.length);\n\tvar replaced = remainder.replace(RegExp(firstLetter, 'g'), '*');\n\tvar result = firstLetter.concat(replaced);\n\tdocument.write(result + '<br>');\n}", "function trimStart (chr, string) {\n let output = string\n while (output[0] === chr) {\n output = output.splice(0, 1)\n }\n return output\n}", "function first (str='', len) {\n var result = ''\n for (i = 0; i < len; i++) {\n result = result + str[i]\n }\n return result\n}", "sPIFirstChar() {\n const c = this.getCodeNorm();\n // This is first because in the case where the file is well-formed this is\n // the branch taken. We optimize for well-formedness.\n if (this.nameStartCheck(c)) {\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n }\n else if (c === QUESTION || isS(c)) {\n this.fail(\"processing instruction without a target.\");\n this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY;\n }\n else {\n this.fail(\"disallowed character in processing instruction name.\");\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n }\n }", "advance() {\n this.currentToken = ''; // reset\n const input = this.input;\n\n const isWhitespaceChar = c => {\n return /\\s/.test(c);\n };\n\n const skipWhitespaces = () => {\n while (this.pos < this.length && isWhitespaceChar(input[this.pos])) {\n this.pos++;\n }\n };\n\n skipWhitespaces();\n\n if (input[this.pos] === '\"') {\n this.currentToken += input[this.pos];\n this.pos++; // start quote character\n while (this.pos < this.length && input[this.pos] !== '\"') {\n this.currentToken += input[this.pos];\n this.pos++;\n }\n this.currentToken += input[this.pos];\n this.pos++; // ending quote character\n } else if (LexicalElements.isSymbol(input[this.pos])) {\n this.currentToken += input[this.pos];\n this.pos++;\n } else {\n while (this.pos < this.length && !isWhitespaceChar(input[this.pos])) {\n if (LexicalElements.isSymbol(input[this.pos])) {\n break;\n }\n this.currentToken += input[this.pos];\n this.pos++;\n }\n }\n\n // move to the next non-whitespace character\n skipWhitespaces();\n }", "function _trimStartEndQuotes(str){\r\n if(str && str.indexOf('\"') === 0 && str.lastIndexOf('\"') === str.length - 1){\r\n return str.substring(1, str.length - 1);\r\n } else {\r\n return str;\r\n }\r\n }", "isSelectionOnFirstLine() {\n return this.getLineIndex(this.start) === 0;\n }", "function get_first(str) {\n return ('000' + str).substr(-3);\n }", "function stringNext() {\n var character = arguments[0];\n \tif (character) {\n \t\tif (charNow !== character) throwError('Unexpected token ' + charNow);\t\n \t}\n \t\n\t index += 1;\n\n\t charNow = index < len ? json.charAt(index) : undefined;\n\t\treturn charNow;\n }", "function fixStart(s) {\n var c = s.charAt(0);\n return c + s.slice(1).replace(new RegExp(c, 'g'), '*');\n }", "isParagraphFirstLine(widget) {\n if (isNullOrUndefined(widget.paragraph.previousSplitWidget) &&\n widget === widget.paragraph.firstChild) {\n return true;\n }\n return false;\n }", "getLineStartLeft(widget) {\n let left = widget.paragraph.x;\n let paragraphFormat = widget.paragraph.paragraphFormat;\n if (this.isParagraphFirstLine(widget) && !paragraphFormat.bidi) {\n left += HelperMethods.convertPointToPixel(paragraphFormat.firstLineIndent);\n }\n if (widget.children.length > 0) {\n left += widget.children[0].margin.left;\n }\n return left;\n }", "function cutFirst(par){\n var m=par.substring(1,par.length)\n return m\n}", "function isFirstLetter(letter, string) {\n\n}", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function excerptStart(mention) {\n var i = sentenceRe.lastIndex = Math.max(mention.section.i, mention.i - 80), match;\n while (match = sentenceRe.exec(mention.section.speech.text)) {\n if (match.index < mention.i - 20) return match.index + match[0].length;\n if (i <= mention.section.i) break;\n sentenceRe.lastIndex = i = Math.max(mention.section.i, i - 20);\n }\n return mention.section.i;\n }", "function getFirstWord(selection) {\n if (selection.indexOf(' ') === -1)\n return selection;\n else\n return selection.substr(0, selection.indexOf(' '));\n }", "_checkQuotes() {\n const str = aStr.string;\n if (str.length >= 2\n && str[0] == str[str.length - 1]\n && (str[0] == \"'\" || str[0] == '\"')) {\n this.isQuoted = true;\n this.quote = str[0];\n return;\n }\n\n this.isQuoted = false;\n this.quote = \"\";\n }", "get selectionStart() { return this.selectionStartIn; }", "function startAtNum(str) {\r\n str = str || ''\r\n var match = str.match(/[0-9]/)\r\n return match ? str.slice(match.index).trim() : ''\r\n}", "function readQuote() {\n\treturn sc_cons(sc_SYMBOL_PREFIX + \"quote\", sc_cons(this.read(), null));\n }", "function generateRandomQuote()\n{\n let startCount = Math.floor(Math.random() * beginning.length);\n let middleCount = Math.floor(Math.random() * middle.length);\n let endCount = Math.floor(Math.random() * ending.length);\n\n return `${beginning[startCount]} ${middle[middleCount]} ${ending[endCount]}.\\n`;\n}", "function firstStrongChar(str){var match=REGEX_STRONG.exec(str);return match==null?null:match[0];}", "_readStartingBom(input) {\n return input.startsWith('\\ufeff') ? input.substr(1) : input;\n }", "*_forEachUnquotedChar(input, start) {\n let currentQuote = null;\n let escapeCount = 0;\n for (let i = start; i < input.length; i++) {\n const char = input[i];\n // Skip the characters inside quotes. Note that we only care about the outer-most\n // quotes matching up and we need to account for escape characters.\n if (isQuote(input.charCodeAt(i)) && (currentQuote === null || currentQuote === char) &&\n escapeCount % 2 === 0) {\n currentQuote = currentQuote === null ? char : null;\n }\n else if (currentQuote === null) {\n yield i;\n }\n escapeCount = char === '\\\\' ? escapeCount + 1 : 0;\n }\n }", "*_forEachUnquotedChar(input, start) {\n let currentQuote = null;\n let escapeCount = 0;\n for (let i = start; i < input.length; i++) {\n const char = input[i];\n // Skip the characters inside quotes. Note that we only care about the outer-most\n // quotes matching up and we need to account for escape characters.\n if (isQuote(input.charCodeAt(i)) && (currentQuote === null || currentQuote === char) &&\n escapeCount % 2 === 0) {\n currentQuote = currentQuote === null ? char : null;\n }\n else if (currentQuote === null) {\n yield i;\n }\n escapeCount = char === '\\\\' ? escapeCount + 1 : 0;\n }\n }", "function first(word) {\n return word[0];\n}", "function find_start_line() {\n // TODO:\n return 0\n}", "function fixStart(word) {\n var len = word.length;\n var first_letter = word.charAt(0);\n for (i=1;i<len;i++) {\n var word = word.replace(first_letter, \"*\");\n }\n console.log(word.replace(word[0], first_letter));\n}", "function moveSymbolsToBeginning() {\n var place = null, i;\n for (i = 0; i < symbolFonts.length; i++) {\n place = fontArray.indexOf(symbolFonts[i]);\n fontArray.move(symbolFonts[i], -place);\n }\n }", "function first(input) {\n var firstChar = input.charAt(0);\n return firstChar;\n}", "set start(value) {}", "function next() {\n ch = json.charAt(at);\n at += 1;\n return ch;\n }", "startsWith(t) { return t.type == StringParser.TAG }", "function cutFirst(sentence){\n sentence = sentence.substring(2);\n return sentence\n }", "peekAheadBy(numChars) {\n let numCharsLeft = this._text.length - this._pos;\n let endIdx = this._pos + Math.min(numChars, numCharsLeft);\n return this._text.substring(this._pos, endIdx);\n }", "function startWith(s3) {\n var startString = s3.startsWith(\"Skoda\");\n console.log(startString);\n}", "function singleWord(){\n var s = ch;\n while (next() && \": \\t\\n\\r-+={(}[])'\\\"\".indexOf(ch)==-1) {s+= ch}\n return s;\n }", "startsWith(t) { return true }", "function fixStart(str)\n{\n //var firstChar = str.slice(0,1);\n var str1 = str.split(\"\");\n // var re = new RegExp(/(?!^)${firstChar}/,\"g\");\n // var str1 = str.replace(re,'*');\n for (var i = 1; i < str.length; i+=1)\n {\n if (str[i] === str[0])\n {\n str1[i] = '*';\n }\n }\n str1 = str1.join(\"\");\n console.log(str,\" is replaced : \",str1);\n return str1;\n}", "function first(word) {\n return word[0];\n}", "static atStart(doc2) {\n return findSelectionIn(doc2, doc2, 0, 0, 1) || new AllSelection(doc2);\n }", "function startLine(token) {\n return token.startLine || token.line;\n }" ]
[ "0.6544238", "0.6311368", "0.6280852", "0.6280852", "0.6280852", "0.6168013", "0.60332423", "0.59699833", "0.595173", "0.5900412", "0.5890977", "0.58689946", "0.5835912", "0.57884854", "0.5784368", "0.5753255", "0.5655399", "0.56397986", "0.5597602", "0.5591066", "0.5591066", "0.5573382", "0.55630726", "0.5562377", "0.5536661", "0.5518143", "0.54683393", "0.54610306", "0.54604954", "0.54526", "0.5437908", "0.5364494", "0.536188", "0.53526574", "0.5345886", "0.5340785", "0.5336354", "0.5336326", "0.53256726", "0.53146094", "0.5288516", "0.5267423", "0.5220069", "0.5207375", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5186116", "0.5183669", "0.5182202", "0.5176166", "0.51595515", "0.5157999", "0.5155006", "0.5154768", "0.5146545", "0.51462543", "0.51462543", "0.5138297", "0.5134466", "0.51283425", "0.51233155", "0.5109783", "0.5105848", "0.5103301", "0.510322", "0.5101992", "0.50952804", "0.50846004", "0.50723726", "0.5069182", "0.50664645", "0.50603795", "0.5058293", "0.50421333" ]
0.0
-1
Create a quote from the bot
createQuoteBot(node) { let self = this window.setTimeout(function () { //creo i div di conversazione let quote = document.createElement('div') quote.classList.add('freud-quote', '__bot') let sentence = document.createElement('div') sentence.classList.add('freud-sentence') //ecco il blocco di frasi quote.appendChild(sentence) //appendo tutto al div contenitore self._el.appendChild(quote) node.sentence.map((v) => { let mexParse = v.mex let element = document.createElement('div') element.classList.add('__elem') // sostituisco i placeholder {{}} con il valore della variabile richiesto let m, findgr while ((m = self._regex.exec(v.mex)) !== null) { // per evitare loop infiniti se non trova match if (m.index === self._regex.lastIndex) { regex.lastIndex++; } // eseguo i risultati, quando il gruppo e 0 trova {{nome}} mentre a gruppo 1 trova "nome" m.forEach((match, groupIndex) => { if (groupIndex === 0) { // trovo il placeholder completo findgr = match; } else { //sostituisco il placeholder con la variabile mexParse = mexParse.replace(findgr, self.getVar(match)) } }); } // faccio l'append del messaggio element.innerHTML = mexParse; sentence.appendChild(element) window.setTimeout(function () { element.style.transform = "scale(1)" }, v.wait) }) let element = document.createElement('div') element.classList.add('__r') if (node.r !== undefined) { switch (node.r.type) { case 'button': node.r.el.map(v => { let btn = document.createElement('a') btn.classList.add('freud-btn') switch (v.type) { case 'nav': btn.onclick = () => { element.style.transform = "scale(0)" element.style.display = 'none' self.createQuoteHuman(v.label) self.do(v.value) } break case 'action': btn.onclick = () => { element.style.transform = "scale(0)" element.style.display = 'none' v.value() } break default: btn.setAttribute('href', v.value) btn.setAttribute('target', "__blank") break } btn.innerHTML = v.label; element.appendChild(btn) }) sentence.appendChild(element) break; case 'input': node.r.el.map(v => { let input = document.createElement('input') input.classList.add('freud-input') input.setAttribute('placeholder', v.label); input.setAttribute('type', 'text'); input.setAttribute('value', ''); input.onkeypress = function (e) { if (!e) e = window.event; var keyCode = e.keyCode || e.which; if (keyCode == '13') { v.fn(this.value); element.style.transform = "scale(0)" element.style.display = 'none' self.createQuoteHuman(this.value) return false; } } element.appendChild(input) }) sentence.appendChild(element) break; default: break; } } window.setTimeout(function () { element.style.transform = "scale(1)" }, node.r.wait) let box = quote.getBoundingClientRect(); let freudtop = self._el.getBoundingClientRect() document.getElementById('bot-icon').style.top = (box.top - freudtop.top) + "px" window.scrollTo(0, document.body.scrollHeight); //self._el.scrollTo(0, self._el.scrollHeight); }, node.wait) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function newQuote() {\n let url = 'http://quotes.rest/qod.json';\n\t\tconst result = await fetch(url);\n\t\tif(!result.ok) {\n\t\t\tthrow new Error(`status: ${result.status}`);\n\t\t}\n\t\treturn await result.json();\n }", "function makingQuote(quoteOb) {\n message = makingTags(quoteOb.tags);\n message += '<p class=\"quote\">' + quoteOb.quote + '</p>';\n message += '<p class=\"source\">' + quoteOb.source;\n message += makingProperty(quoteOb.citation, 'citation');\n message += makingProperty(quoteOb.year, 'year');\n message += '</p>';\n return message;\n}", "function addQuotes () {\r\n\r\n // ask the user to input the author and then the quote\r\n inquirer.prompt([\r\n {\r\n type: \"input\",\r\n message: \"Who said this quote?\",\r\n name: \"author\"\r\n },\r\n {\r\n type: \"input\",\r\n message: \"What is the quote?\",\r\n name: \"quote\"\r\n }\r\n ]).then(function(res) {\r\n \r\n\r\n // add the new quote with the corresponding author into our quote storage\r\n quotes.push(\r\n {\r\n author: res.author,\r\n quote: res.quote\r\n })\r\n })\r\n}", "createQuotes() {\n if (this.quotesType === 'Van Damme') {\n for (let i = 0; i < this.numQuotes; i++) {\n const quote = this.pickQuote(vandam);\n const author = 'Jean-Claude Van Damme';\n this.quotes.push({ quote: quote, author: author });\n }\n } else if (this.quotesType === 'Aléatoire') {\n for (let i = 0; i < this.numQuotes; i++) {\n const quote = this.pickQuote(alea);\n const author = this.pickAuthor();\n this.quotes.push({ quote: quote, author: author });\n }\n }\n }", "function generateQuote() {\n if (quoteNumber == 0 || quoteTheme == -1) {\n setRobotSentence(\"Tu dois séléctionner des options pour continuer\");\n } else {\n setRobotFeeling(1);\n setRobotSentence(\"Génération des phrases..\");\n quoteResult = [];\n for (let i = 0; i < quoteNumber; i++) {\n do {\n let themeString = themeData[quoteTheme];\n quoteResult[i] = getRandomPart(quoteDataBegin[themeString].items) + \" \";\n quoteResult[i] += getRandomPart(quoteDataBody[themeString].items) + \" \";\n quoteResult[i] += getRandomPart(quoteDataEnd[themeString].items);\n } while (checkInBlacklist(quoteResult[i]));\n }\n setTimeout(function() {\n setRobotFeeling(0);\n setRobotSentence(\n \"Terminé ! Montre moi les phrases fausses en cliquant dessus\"\n );\n displayQuote();\n }, 1500);\n }\n}", "function getRandomQuote() {\n const randomIndex = Math.floor(Math.random() * quotes.length - 1) + 1;\n // returns a random quote object\n return quotes[randomIndex];\n}", "static async insert({ quote, author })\n {\n const { rows } = await pool.query(\n `INSERT INTO quotes (quote, author)\n VALUES ($1, $2)\n RETURNING *`,\n [quote, author]\n );\n\n return new Quote(rows[0]);\n }", "function generateQuote(){\nconst random = Number.parseInt(Math.random() * arrayOfQuotes.length + 1);\ndocument.querySelector('#quoteOutput').textContent = `\\'${arrayOfQuotes[random].quote}'`;\ndocument.querySelector('#authorOutput').textContent = `--${arrayOfQuotes[random].author}`;\n}", "function generateNewQuote() {\n do {\n randomquote = Math.floor(Math.random() * quotes.length);\n } while (randomquote === previousquote);\n \n quote = quotes[randomquote][0];\n author = quotes[randomquote][1]; \n}", "function createQuote(){\n $.ajax({\n headers: {\n \"X-Mashape-Key\": \"OivH71yd3tmshl9YKzFH7BTzBVRQp1RaKLajsnafgL2aPsfP9V\",\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n url: 'https://andruxnet-random-famous-quotes.p.mashape.com/cat=',\n success: function(response) {\n var r = JSON.parse(response);\n currentQuote = r.quote;\n currentAuthor = r.author;\n $('.quote-text').text(r.quote);\n $('.author-text').html(r.author);\n }\n });\n }", "function buildQuoteCard(quote) {\n const newQuote = document.createElement('li')\n newQuote.className = 'quote-card'\n \n const quoteBlock = document.createElement('BLOCKQUOTE')\n quoteBlock.className = 'blockquote'\n \n const createP = document.createElement('p')\n createP.className = 'mb-0'\n createP.innerText = quote.quote\n \n const createFooter = document.createElement('FOOTER')\n createFooter.className = 'blockquote-footer'\n createFooter.innerText = quote.author\n \n const likeBtn = document.createElement('button')\n likeBtn.className = 'btn-success'\n likeBtn.innerText = \"Likes:\"\n likeBtn.span = 0\n \n const deleteBtn = document.createElement('button')\n deleteBtn.className = 'btn-danger'\n deleteBtn.innerText = \"Delete\"\n \n newQuote.appendChild(quoteBlock)\n newQuote.appendChild(createP)\n newQuote.appendChild(createFooter)\n newQuote.appendChild(likeBtn)\n newQuote.appendChild(deleteBtn)\n quoteList.appendChild(newQuote)\n\n //deletes the quote - refers to \"deleteQuote\" method above\n deleteBtn.addEventListener(\"click\", () => {\n deleteQuote(quote);\n newQuote.remove();\n });\n }", "function registerQuotes() {\n addQuote(\n \"Some days are just bad days, that's all. You have to experience sadness to know happiness, and I remind myself that not every day is going to be a good day, that's just the way it is!\",\n \"Dita Von Teese\",\n \"Dancer\",\n \"BrainyQuote\",\n \"1989\",\n [\"Bad Days\", \"Sadness\", \"Remind\"]\n );\n\n addQuote(\n \"I don't go by or change my attitude based on what people say. At the end of the day, they, too, are judging me from their perspective. I would rather be myself and let people accept me for what I am than be somebody who I am not, just because I want people's approval.\",\n \"Karan Patel\",\n \"Actor\",\n \"BrainyQuote\",\n \"1995\",\n [\"Accept\", \"Approval\", \"Rather\"]\n );\n\n addQuote(\n \"Every day I feel is a blessing from God. And I consider it a new beginning. Yeah, everything is beautiful.\",\n \"Prince\",\n \"Musician\",\n \"BrainyQuote\",\n \"1978\",\n [\"Beautiful\", \"Blessing\", \"Baby Jesus\"]\n );\n\n addQuote(\n \"I am happy every day, because life is moving in a very positive way.\",\n \"Lil Yachty\",\n \"Musician\",\n \"BrainyQuote\",\n \"2017\",\n [\"Postive\", \"Good\", \"Happy\"]\n );\n\n addQuote(\n \"Nobody on this earth is perfect. Everybody has their flaws; everybody has their dark secrets and vices.\",\n \"Juice WRLD\",\n \"God\",\n \"BrainyQuote\",\n \"2018\",\n [\"Secrets\", \"Jesus\", \"Flaws\"]\n );\n}", "async function getQuote() {\n const url = `https://type.fit/api/quotes`;\n const result = await fetch(url);\n const data = await result.json();\n const randomQuote = Math.floor(Math.random() * data.length);\n\n blockquote.textContent = data[randomQuote].text;\n quoteCaption.textContent = `${data[randomQuote].author}`;\n}", "function getRandomQuote() {\n const randomNumber = Math.floor(Math.random () * quotes.length);\n const randomQuoteObject = quotes[randomNumber];\n return randomQuoteObject\n}", "function addRandomQuote() {\n const quotes =\n [\"You should enjoy the little detours to the fullest. Because that's where you'll find the things more important than what you want. -Yoshihiro Togashi\",\n \"I don’t want what another man can give me. If he grants me anything, then it’s his to give and not my own. -Kentaro Miura\",\n \"Sometimes good people make bad choices. It doesn't mean they are bad people. It means they're human. -Sui Ishida\",\n \"Why is it that when one man builds a wall, the next man immediately needs to know what's on the other side? -George R.R. Martin\"];\n\n // Pick a random greeting.\n const quote = quotes[Math.floor(Math.random() * quotes.length)];\n\n // Add it to the page.\n const quoteContainer = document.getElementById('quote-container');\n quoteContainer.innerText = quote;\n}", "newQuote() {\n this.quotes = [];\n this.pickColor();\n this.createQuotes();\n }", "function quoteGenerator() {\r\n var quoteNum = Math.floor(Math.random()*quotesList.length);\r\n\r\n var quotes = quotesList[quoteNum];\r\n\r\n textQuote.textContent = quotes.quote;\r\n textAuthor.textContent = quotes.author;\r\n}", "function Quote(text, author, tags) {\n this.text = text;\n this.author = author;\n this.tags = tags || [];\n }", "function composeQuote(response) {\n quote.text = response.quoteText;\n response.quoteAuthor === \"\" ? quote.author = \"Unknown\" : quote.author = response.quoteAuthor;\n //Show here directly the quote\n $(\"blockquote p\").text(quote.text);\n $(\"blockquote cite\").text(quote.author);\n}", "function newQuote(){\nshowLoadingSpinner();\n // pick random quote\n const quote = apiQuotes[Math.floor(Math.random()*apiQuotes.length)];\n\n// check if author unknown\n if(!quote.author){\nauthorText.textContent = \"Unkown\" \n} else {\n authorText.textContent = quote.author;\n }\n// check quote length for styling\n if(quote.text.length > 100){\n quoteText.classList.add('long-quote');\n }else{\n quoteText.classList.remove('long-quote');\n }\n// add quote, remove loader\nquoteText.textContent = quote.text;\nremoveLoadingSpinner();\n}", "handleQuoteClick() {\n fetch('https://quota.glitch.me/random')\n .then(response => response.json())\n .then(data => {\n this.setState({\n text: \"\\\"\" + data.quoteText + \"\\\"\",\n author: '-' + data.quoteAuthor\n });\n });\n }", "async function addQuote(quote) {\n console.log(\"✍ Adding quote\", quote)\n return await transaction(\n fs.write,\n fs.appPath([ \"Collection\", `${quote.id}.json` ]),\n toJsonBlob(quote)\n )\n}", "function storeQuote(message, args){\n \targs.splice(0, 1); // Remove @name from quote to be saved\n \tlet quote = args.join(\" \");\n\n \t// Store quote\n\t fs.readFile('cache.json', 'utf8', function readFileCallback(err, data){\n\t if (err){\n\t console.log(err);\n\t message.reply(\"Cache failure. Please try again.\");\n\t } else {\n\t \t// get existing user quotes\n\t obj = JSON.parse(data);\n\t let target_user = message.mentions.users.first();\n\n\t // Don't store quotes for bots\n\t if(target_user.bot){\n\t \tmessage.reply(\"I can't store quotes for bots!\");\n\t \treturn;\n\t }\n\n\t let user_id = target_user.id;\n\t let guild_id = message.guild.id;\n\t let quotes = obj.quotes;\n\t let guild_quotes = quotes[guild_id];\n\t let user_quotes = guild_quotes[user_id];\n\n\t if(typeof user_quotes == \"undefined\"){\n\t \tuser_quotes = [];\n\t }\n\n\t // Add a new quote to the array\n\t let stamp = Math.floor(new Date() / 1000);\n\t user_quotes.push({\"stamp\":stamp, \"quote\":quote});\n\t obj.quotes[guild_id][user_id] = user_quotes;\n\n\t // Save array back to cache\n\t json = JSON.stringify(obj);\n\t fs.writeFile('cache.json', json, 'utf8', function(){\n\t message.reply(\"Quote saved.\");\n\t });\n\t }\n\t });\n \t}", "function generatequote() {\n // Load the thoughts from the JSON file\n fetch(\"quotes.json\")\n .then(response => response.json())\n .then(data => {\n // Get a random thought from the thoughts array\n const randomIndex = Math.floor(Math.random() * data.length);\n const randomquote = data[randomIndex];\n \n // Update the quote and source elements with the new thought\n quoteElement.textContent = `\"${randomquote.quote}\"`;\n sourceElement.textContent = `- ${randomquote.source}`;\n })\n .catch(error => console.log(error));\n }", "async function nextRandomQuote() {\n // Random quote\n const reply = await fetch(\"https://api.quotable.io/random\");\n const info = await reply.json();\n if (reply.ok) {\n // Update quote and author\n quote.textContent = info.content;\n citation.textContent = info.author;\n } else {\n quote.textContent = \"Error! No Information Received!\";\n console.log(info);\n }\n }", "function getRandomQuote (){\n i = Math.floor(Math.random() * quotes.length);\n randomQuote = quotes[i];\n return randomQuote\n}", "function buildCard(quote) {\n //creating the HTML elements\n let li = document.createElement('li')\n let blockquote = document.createElement('blockquote')\n let p = document.createElement('p')\n let footer = document.createElement('footer')\n let br = document.createElement('br')\n\n //get the data for the text to populate the card\n let {author, id, quote:text} = quote\n\n //adding tags to the elements\n li.className = 'quote-card'\n li.id = `li-${id}`\n blockquote.className = 'blockquote'\n blockquote.id = `block-${id}`\n p.className = 'mb-0'\n footer.className = 'blockquote-footer'\n\n //add text data to the card elements\n p.textContent = text\n footer.textContent = author\n\n //building the card\n blockquote.append(p, footer, br)\n li.append(blockquote)\n quoteList.append(li)\n likeButton(quote)\n deleteButton(quote)\n}", "function writeQuote(){\n generateQuote();\n var quoteText = displayQuote.quote;\n var authorText = displayQuote.author;\n quote.textContent = quoteText;\n author.textContent = authorText;\n}", "function getRandomQuote () {\n let randomNumber = Math.floor(Math.random() * quotes.length); \n let randomQuote = quotes[randomNumber]; \n return randomQuote;\n}", "function newQuote(){\n\n loading();\n const quote = apiQuote[Math.floor(Math.random() * apiQuote.length)]; \n authorText.textContent = quote.author;\n \n if(quote.text.length > 50){\n quoteText.classList.add('long-quote');\n }else{\n quoteText.classList.remove('long-quote');\n } \n quoteText.textContent = quote.text;\n completado()\n\n}", "function getRandomQuote (){\n const randomNumber = Math.floor(Math.random() * quotes.length);\n const randomQuote = quotes[randomNumber];\n return randomQuote;\n \n\n}", "function getRandomQuote() \n{\n let num = Math.floor(Math.random() * quotes.length);\n let randomQuote = quotes[num];\n return randomQuote;\n}", "function generate_quotes(quotes){\n if(quotes.error){\n return \"\"\n }\n let head = \"<h1>Quotes</h1><div>\"\n let tail = \"</div>\"\n quotes.forEach( (quote, i) => {\n if(i >= 5) return;\n let char_quote = quote.quote.replace(\"\\n\", \"<br>\");\n let h2 = `<h2 class=\"quote\">${char_quote}<br>- ${quote.character}</h2><br>`;\n head += h2;\n })\n\n return head + tail;\n}", "function getRandomQuote () { \n let randomQuote = Math.floor(Math.random() * quotes.length); \n return quotes[randomQuote];\n}", "function getRandomQuote () {\n let randomNum = Math.floor(Math.random() * quotes.length);\n return quotes[randomNum];\n\n}", "function getRandomQuote() {\n const randomNumber = Math.floor(Math.random() * quotes.length);\n const randomQuote = quotes[randomNumber];\n return randomQuote;\n}", "function newQuote(){\n $.getJSON('https://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?', function(data){\n quoteText = data.quoteText;\n quoteAuthor = data.quoteAuthor;\n \n $('#quote-text').html(quoteText);\n $('#quote-author').html(quoteAuthor);\n });\n }", "function getRandomQuote(){\n const randomQuote = quotes[Math.floor(Math.random() * quotes.length )];\n return randomQuote;\n \n}", "function getRandomQuote() {\n let rand = Math.floor(Math.random() * quotes.length);\n return quotes[rand];\n}", "function getRandomQuote ( ) {\n randomQuote = quotes[(Math.floor(Math.random() * quotes.length))];\n}", "function getRandomQuote(quotes){\n let randomNum = Math.floor( Math.random() * quotes.length );\n return quotes[randomNum];\n}", "function getRandomQuote() {\n\tlet quoteIndex = Math.floor(Math.random() * quotes.length);\n\treturn quotes[quoteIndex];\n}", "function doquote(objID,strAuthor){\r\n\tdocument.inputform.message.value += \"[quote=\"+strAuthor+\"] \"+document.getElementById(objID).innerText+\" [/quote]\\n\";\r\n\twindow.location.hash=\"comment\";\r\n}", "function createQuote(req, res, next) {\n const data = dropProperties(req.body, immutables);\n\n if (req.user.role === Roles.Admin) data.type = Types.Public;\n else {\n data.type = Types.Private;\n data.owner = req.user.id;\n }\n\n Quote.create(data)\n .then(quote => res.status(HTTPStatus.OK).send(quote))\n .catch(err => next(err));\n}", "function getRandomQuote () {\n const randomNumber = (Math.floor(Math.random() * quotes.length + 1) - 1); // 1 is substracted because the first element in the quotes object array has a refence of 0\n const randomQuote = quotes[randomNumber]; \n return randomQuote;\n}", "function getRandomQuote() {\n let random = Math.floor(Math.random() * (quotes.length));\n return quotes[random];\n}", "function initializeQuotes(quote) {\n let quoteCard = document.createElement('li')\n quoteCard.classList.add('quote-card')\n quoteCard.innerHTML = `\n <blockquote class=\"blockquote\">\n <p class=${quote.id}>${quote.quote}</p>\n <footer class=\"blockquote-footer\">${quote.author}</footer>\n <br>\n <button class='btn-success'>Likes: <span>${quote.likes.length}</span></button>\n <button class='btn-danger'>Delete</button>\n </blockquote>`\n quoteList.append(quoteCard)\n}", "function getRandomQuote() {\n let randNum;\n function getRandomNum() {\n randNum= (Math.floor(Math.random()*60))-1;\n return randNum;\n }\n getRandomNum();\n function printQuote(message) {\n document.getElementById(\"quote-box\").innerHTML= message;\n }\n let output = \"<p class='quote'>\"+\"“\"+quotes[getRandomNum()].quote+\"</p> <p class='source'>\"+quotes[randNum].source+\", tag: \"+quotes[randNum].tag;\n // *add year if available\n if (quotes[randNum].year){\n output += \", year: \"+quotes[randNum].year;\n }\n output +=\"<span class='citation'><a href='https://litemind.com/best-famous-quotes/'>Litemind</a></span></p>\";\n printQuote(output);\n}", "function getRandomQuote() {\r\n let randomQuote = Math.floor(Math.random() * quotes.length );\r\n \r\n return quotes[randomQuote];\r\n}", "function getRandomQuote() {\n let randomNumber = Math.floor(Math.random() * quotes.length);\n return (\n quotes[randomNumber]\n );\n}", "function createOrder() {\n prompt(questions).then(answers => {\n const [_, name, price] = /(.*)\\s\\(\\₦(.*)\\)/.exec(answers.name);\n const order = {\n name,\n price: Number(price.replace(',', '')),\n quantity: Number(answers.quantity)\n };\n Cart.add(order);\n if (answers.performAnotherTransaction) {\n //creates another order if user chooses to purchase another item\n createOrder();\n } else {\n //make payment\n Cart.displayCart();\n }\n });\n}", "function getRandomQuote() {\n let randomNumber = Math.floor(Math.random() * (quotes.length));\n return quotes[randomNumber]\n}", "function getRandomQuote(quotes) {\n let allQuotesNum = quotes.length;\n\n let randomNum = Math.floor(Math.random() * (allQuotesNum));\n return quotes[randomNum];\n}", "function getRandomQuote()\n{\n let randNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randNumber];\n}", "function getRandomQuote() {\n let randomNum = Math.floor(Math.random() * quotes.length);\n return quotes[randomNum];\n}", "function getRandomQuote() {\n return fetch(\"http://api.quotable.io/random\")\n .then((response) => response.json())\n .then((data) => data.content);\n}", "function getRandomQuote() {\n let randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "function getRandomQuote() {\n let randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "function getRandomQuote() {\n return quotes[Math.floor(Math.random() * quotes.length)];\n}", "function getQuote() {\n\t$.getJSON(\"https://gist.githubusercontent.com/jbmartinez/6982650ade1ee5e9527f/raw/e7099c184abec96b9d3c63ecb1fa44170eaf5299/quotes.json\", function(json){\n \t\tvar ranNum = Math.floor(Math.random() * json.length);\n \t\tvar randomQuote = json[ranNum];\n \t\t$(\".qouteText\").text('\"'+ randomQuote.text + '\"');\n \t$(\".author\").text(\"— \" + randomQuote.author);\n \t});\n}", "function getRandomQuote () {\n const randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "function getRandomQuote() {\n return quotesData[Math.floor(Math.random() * quotesData.length)]\n}", "function getRandomQuote() {\n var randomQuote = quotes[Math.floor(Math.random() * quotes.length)];\n return randomQuote;\n}", "function getRandomQuote() {\n let numberOfQuotes = quotes.length;\n let randomNumber = Math.floor(Math.random() * numberOfQuotes);\n return quotes[randomNumber];\n \n}", "function Quote() {\n _classCallCheck(this, Quote);\n\n Quote.initialize(this);\n }", "function sayQuote(txt,chan)\n{\n\tvar q = txt.replace(commandTag+\"quote \",\"\");\n\tvar g = parseInt(q);\n\tsendMessage(quotes[g],chan);\n}", "function getRandomQuote() {\n let randomQuote = Math.floor(Math.random() * quotes.length);\n let returnedQuote = quotes[randomQuote];\n return returnedQuote;\n}", "function handleNewQuoteRequest(response) {\n // Get a random space quote from the space quotes list\n var quoteIndex = Math.floor(Math.random() * QUOTES.length);\n var randomQuote = QUOTES[quoteIndex];\n\n // Create speech output\n var speechOutput = \"Here's your quote: \" + randomQuote;\n var cardTitle = \"Your Quote\";\n response.tellWithCard(speechOutput, cardTitle, speechOutput);\n}", "function getRandomQuote() {\n let randomQuote = Math.floor(Math.random() * quotes.length);\n return quotes[randomQuote];\n}", "function getRandomQuote() {\nconst number = Math.floor(Math.random() * 5);\nconst randomQuote = quotes[number];\nconst source = quotes[number].source;\n\n\nreturn randomQuote;\n}", "function getQuote (){\r\n // quotes and authors -- \r\n var quotes = [ \"Try to be a rainbow in someone's cloud.\", \r\n\t\"Health is the greatest gift, contentment the greatest wealth, faithfulness the best relationship.\",\r\n\t\"I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel.\",\r\n\t\"If you look at what you have in life, you'll always have more. If you look at what you don't have in life, you'll never have enough.\",\r\n\t\"I can't change the direction of the wind, but I can adjust my sails to always reach my destination.\", \r\n\t\"Believe you can and you're halfway there.\",\r\n\t\"Do or do not. There is no try.\",\r\n\t\"Strive not to be a success, but rather to be of value.\",\r\n\t\"The most common way people give up their power is by thinking they don’t have any.\",\r\n\t\"It is during our darkest moments that we must focus to see the light.\",\r\n\t\"Change your thoughts and you change your world.\", \r\n\t\"You can't use up creativity. The more you use, the more you have.\",\r\n\t\"I have learned over the years that when one's mind is made up, this diminishes fear.\", \r\n\t\"A person who never made a mistake never tried anything new.\",\r\n\t\"What's money? A man is a success if he gets up in the morning and goes to bed at night and in between does what he wants to do.\",\r\n\t\"If you want to lift yourself up, lift up someone else.\",\r\n\t\"Just because you are happy, it does not mean that the day is perfect, but that you have looked beyond its imperfections.\",\r\n\t\"Don't gain the world and lose your soul, wisdom is better than silver or gold.\", \r\n\t\"Money is numbers and numbers never end. If it takes money to be happy, your search for happiness will never end.\",\r\n\t\"A man who stands for nothing will fall for anything.\",\r\n\t\"Education is our passport to the future, for tomorrow belongs to the people who prepare for it today.\", \r\n\t\"We cannot think of being acceptable to others until we have first proven acceptable to ourselves.\", \r\n\t\"It always seems impossible until it's done.\",\r\n\t\"As we let our own light shine, we unconsciously give other people permission to do the same.\",\r\n\t\"Be yourself; everyone else is already taken.\",\r\n\t\"Be the change that you wish to see in the world.\",\r\n\t\"To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.\",\r\n\t\"For every minute you are angry you lose sixty seconds of happiness.\"]; \r\n \r\n\t\r\n\t\r\n\t\r\n\t\r\n\tvar authors = [\"Maya Angelou\",\r\n\t\"buddha\", \r\n\t\"Maya Angelou\",\r\n\t\"Oprah Winfrey\", \r\n\t\"Jimmy Dean\",\r\n\t\"Theodore Roosevelt\",\r\n\t\"Yoda\",\r\n\t\"Albert Einstein\",\r\n\t\"Alice Walker\",\r\n\t\"Aristotle Onassis\", \r\n\t\"Norman Vincent Peal\", \r\n\t\"Maya Angelou\", \r\n\t\"Rosa Parks\",\r\n\t\"Albert Einstein\",\r\n\t\"Bob Dylan\", \r\n\t\"Booker T. Washington\", \r\n\t\"Bob Marley\", \r\n\t\"Bob Marley\", \r\n\t\"Bob Marley\", \r\n\t\"Malcolm X\",\r\n\t\"Malcolm X\", \r\n\t\"Malcolm x\", \r\n\t\"Nelson Mandela\", \r\n\t\"Nelson Mandela\",\r\n\t\"Oscar Wilde\",\r\n\t\"Mahatma Gandhi\",\r\n\t\"Ralph Waldo Emerson\",\r\n\t\"Ralph Waldo Emerson\"];\r\n \r\n\t \r\n\t \r\n\t \r\n\t //key variable for randomization-- \r\n randomNum = Math.floor(Math.random()*quotes.length);\r\n //Assign random variable to author and quote--\r\n randomQuote = quotes[randomNum];\r\n author = \" - \" + authors[randomNum];\r\n /*calls quotes and respective author to location in html--*/ \r\n $(\".quote\").text(randomQuote);\r\n $(\".author\").text(author);\r\n}", "function getQuote() {\n return new Promise(function(resolve, reject) {\n request('http://ron-swanson-quotes.herokuapp.com/v2/quotes', function(error, response, body) {\n quote = body;\n\n resolve(body);\n });\n });\n}", "function getRandomQuote() {\n let randomQuote = Math.floor(Math.random() * quotes.length);\n\n return quotes[randomQuote];\n}", "function getRandomQuote(){\n const randomNumber = Math.floor(Math.random()*quotes.length);\n return quotes[randomNumber];\n}", "function renderQuote(quote){\n return `<li class='quote-card'>\n <blockquote class=\"blockquote\">\n <p class=\"mb-0\">${quote.quote}</p>\n <footer class=\"blockquote-footer\">${quote.author}</footer>\n <br>\n <button data-like-id=${quote.id} class='btn-success'>Likes: <span>${quote.likes.length}</span></button>\n <button data-delete-id=${quote.id} class='btn-danger'>Delete</button>\n </blockquote>\n </li>`\n }", "function getQuote(){\n loading();\n fetch(\"https://api.whatdoestrumpthink.com/api/v1/quotes/random\")\n .then(data => data.json())\n .then(data => {\n message.innerHTML = data.message\n author.innerHTML = 'TRUMP'\n })\n\n //loading();\n // const apiURL = 'https://api.whatdoestrumpthink.com/api/v1/quotes/random';\n // try {\n // const response = await fetch(apiURL);\n // const data = await response.json();\n // // If Author is blank add unknown\n // if (data.author === ''){\n // authorText.innerText = 'TRUMP';\n // } else {\n // authorText.innerText = data.quoteAuthor;\n // }\n // // Reduce font size for long quotes \n // if( data.message.length > 120) {\n // quoteText.classList.add('long-quote');\n\n // } else {\n // quoteText.classList.remove('long-quote');\n // }\n // quoteText.innerText = data.message;\n //Stop loader, show quote\n complete();\n}", "function getRandomQuote() {\n // Generates a random number starting at 0 and going to the end of the quotes array\n const randomNumber = Math.floor(Math.random() * quotes.length);\n // Uses random number to get item from the array\n const randomQuote = quotes[randomNumber];\n\n return randomQuote\n}", "function getRandomQuote(){\n const randomIndex = Math.floor(Math.random() * quotes.length); //random index\n return quotes[randomIndex]; //returns quote at random index\n}", "function getRandomQuote()\n{\n var randomQuote = quotes[Math.floor(Math.random()*quotes.length)];\n return randomQuote;\n}", "function getRandomQuote(quotes) {\n let arrayQuote = Math.floor(Math.random() * quotes.length);\n\n let randomQuoteResult = quotes[arrayQuote];\n\n return randomQuoteResult;\n}", "function inspiringQuote() {\r\n // Example quotes: \r\n // \"If opportunity doesn't knock, build a door.\"\r\n // \"The best way out is always through.\"\r\n // BEGIN CODE \r\n \r\n // END CODE\r\n}", "function getRandomQuote(){\n let randomNum = Math.floor((Math.random() * (quotes.length)));\n return quotes[randomNum]; \n}", "function getRandomQuote() {\n return quotes[Math.floor(Math.random() * quotes.length)];\n}", "function returnRandomQuote(quotes) {\n if (quotes) {\n return new BPromise(function(resolve, reject) {\n var quote = quotes[\n Math.floor(Math.random() * quotes.length)\n ];\n resolve('\"' + quote.quote + '\" - ' + quote.origin);\n });\n } else {\n throw 'utility.returnRandomQuote - No quotes';\n }\n }", "function generate_quote() {\n //named variable for jSON api link\n $api_link =\n \"https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?\";\n $.getJSON($api_link, function(data) {\n //set variables for quote and author pulled from jSON\n var quote = data.quoteText;\n var author = data.quoteAuthor;\n //sets the element to the quote and author\n $(\".quoteOutput\").html(quote);\n $(\".quoteAuthor\").html(author);\n //button to tweet a quote\n $(\".twitter-share-button\").attr(\n \"href\",\n \"https://twitter.com/intent/tweet?text=\" + quote + \"- \" + author\n );\n });\n }", "function getRandomQuote() {\n var theQuoteAndAuthor = quotesArray[Math.floor(Math.random() * quotesArray.length)]\n document.getElementById(\"quote\").innerHTML = '\" ' + theQuoteAndAuthor[0];\n document.getElementById(\"author\").innerHTML = '- ' + theQuoteAndAuthor[1];\n }", "function tweetQuote() {\n var tweetUrl = ' https://twitter.com/intent/tweet?text=' + encodeURIComponent(generatedQuote);\n window.open(tweetUrl);\n}", "function printQuote(){\n //calls the getRandomQuote() function, then stores returned object into a variable\n getRandomQuote();\n //construct the string containing the different quote properties using HTML template\n}", "function getRandomQuote() {\n ranNum = Math.floor(Math.random() * quotes.length);\n return quotes[ranNum];\n}", "function tweetQuote() {\n\tconst quotee = quote.innerText;\n\tconst authorr = author.innerText;\n\tconst twitterUrl = `https://twitter.com/intent/tweet?text=${quotee} - ${authorr}`;\n\twindow.open(twitterUrl, '_blank')\n}", "function getQuote(json) {\n var tweetUrl = \"https://twitter.com/intent/tweet?text=\";\n var quote = \"<i class='fa fa-quote-left' aria-hidden=true></i> \" + json.quoteText;\n var author = json.quoteAuthor;\n\n if(author === \"\") author = \"unknown\";\n\n var tweet = tweetUrl + json.quoteText + \" -\" + author + \" #quoteOfTheDay\";\n\n $(\".quote\").html(quote);\n $(\".name\").text(author);\n $(\"a\").attr(\"href\", tweet);\n}", "function getRandomQuote(){\n let math = Math.floor(Math.random() * quotes.length);\n let quotePicker = quotes[math];\n return quotePicker;\n }", "function makeQuote () {\t\n\tclearInterval(intervalId);\n\tprintQuote(shuffleQuotesList[index++]);\n\tbackgroundChange();\t\n\tif (index >= shuffleQuotesList.length) {\n\t\tindex = 0;\n\t\tshuffle(shuffleQuotesList);\n\t}\n\tintervalId = setInterval(makeQuote, 6000); \n}", "async function addRandomQuote() {\n const response = await fetch(\"/random\");\n const quote = await response.text();\n document.getElementById(\"quote-container\").innerText = quote;\n}", "function getRandomQuote() {\n var randomNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randomNumber];\n}", "function getRandomQuote(){\n // Generates a random number starting at 0 and going to the end of the quotes array\n const randomNumber = Math.floor( Math.random() * quotes.length );\n // Uses random number to get item from the array\n const randomQuote = quotes[randomNumber];\n \n return randomQuote\n}", "generateQuotes() {\n this.pickColor();\n this.createQuotes();\n this.showQuotes = true;\n }", "function getRandomQuote() { \n var quoteIndex = Math.floor(Math.random() * quotes.length); \n return quotes[quoteIndex]; \n}", "function getRandomQuote() {\n {\n let randomNumber = Math.floor(Math.random() *quotes.length);\n \n \n var quote = quotes[randomNumber].quote;\n var source = quotes[randomNumber].source;\n var citation = quotes[randomNumber].citation;\n var year = quotes[randomNumber].year;\n // return quotes[randomNumber];\n \n \n /*** <p class = 'quote'> </p> \n <p class ='source'> </p>\n <p class = 'citation'> </p>\n <p class = 'year'> </p> ***/\n\n const outQuote= (quote + source + citation + year)\n return outQuote;\n\n // I had my variables backwards before help.\n \n }\n}", "function setQuote() {\n quoteText.innerHTML = quoteList[index].quote;\n quoteAuthor.innerHTML = \"-- \"+quoteList[index].author;\n }", "function getRandomQuote() {\n var Quote = Math.floor(Math.random() * (quotes.length));\n return quotes[Quote];\n}" ]
[ "0.6614835", "0.6558999", "0.6527881", "0.6478681", "0.6382853", "0.6340497", "0.6327054", "0.6304614", "0.630021", "0.629175", "0.628352", "0.6274607", "0.6238084", "0.62326705", "0.62222904", "0.6174516", "0.6169922", "0.61635524", "0.614904", "0.61440116", "0.61421514", "0.6119484", "0.6103499", "0.6095305", "0.60773623", "0.6066999", "0.6064645", "0.6052829", "0.6052244", "0.6046065", "0.60459876", "0.6040383", "0.60376024", "0.6023898", "0.60186774", "0.6014271", "0.60091263", "0.60056955", "0.6005599", "0.60021573", "0.6000384", "0.5991393", "0.5974989", "0.59662193", "0.59622115", "0.59581393", "0.5956646", "0.5954373", "0.5953757", "0.594999", "0.5947386", "0.5945753", "0.59417397", "0.5940284", "0.5933069", "0.5929453", "0.59272856", "0.59272856", "0.5913767", "0.59117585", "0.5909267", "0.5903252", "0.5902699", "0.5897675", "0.5895313", "0.5885285", "0.5884544", "0.58762187", "0.58750474", "0.5869035", "0.5866202", "0.5863116", "0.585796", "0.58506304", "0.5849009", "0.58279747", "0.58269626", "0.5822421", "0.5821098", "0.58207965", "0.58095026", "0.5808332", "0.5805082", "0.58026785", "0.57930684", "0.57892555", "0.5788924", "0.5778869", "0.57639444", "0.5761405", "0.5760973", "0.57578766", "0.5757226", "0.57500786", "0.57394737", "0.5738497", "0.57321346", "0.5731952", "0.572808", "0.57262015", "0.572345" ]
0.0
-1
Create a quote from the user
createQuoteHuman(v) { let quote = document.createElement('div') quote.classList.add('freud-quote') let sentence = document.createElement('div') sentence.classList.add('freud-sentence') quote.appendChild(sentence) let element = document.createElement('div') element.classList.add('__elem') element.innerHTML = v; sentence.appendChild(element) this._el.appendChild(quote) window.setTimeout(function () { element.style.transform = "scale(1)" }, v.wait) let box = quote.getBoundingClientRect(); let freudtop = this._el.getBoundingClientRect() document.getElementById('user-icon').style.opacity = '1' document.getElementById('user-icon').style.top = (box.top - freudtop.top) + "px" window.scrollTo(0, document.body.scrollHeight); //this._el.scrollTo(0, this._el.scrollHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addQuotes () {\r\n\r\n // ask the user to input the author and then the quote\r\n inquirer.prompt([\r\n {\r\n type: \"input\",\r\n message: \"Who said this quote?\",\r\n name: \"author\"\r\n },\r\n {\r\n type: \"input\",\r\n message: \"What is the quote?\",\r\n name: \"quote\"\r\n }\r\n ]).then(function(res) {\r\n \r\n\r\n // add the new quote with the corresponding author into our quote storage\r\n quotes.push(\r\n {\r\n author: res.author,\r\n quote: res.quote\r\n })\r\n })\r\n}", "function createQuote(req, res, next) {\n const data = dropProperties(req.body, immutables);\n\n if (req.user.role === Roles.Admin) data.type = Types.Public;\n else {\n data.type = Types.Private;\n data.owner = req.user.id;\n }\n\n Quote.create(data)\n .then(quote => res.status(HTTPStatus.OK).send(quote))\n .catch(err => next(err));\n}", "static async insert({ quote, author })\n {\n const { rows } = await pool.query(\n `INSERT INTO quotes (quote, author)\n VALUES ($1, $2)\n RETURNING *`,\n [quote, author]\n );\n\n return new Quote(rows[0]);\n }", "createQuotes() {\n if (this.quotesType === 'Van Damme') {\n for (let i = 0; i < this.numQuotes; i++) {\n const quote = this.pickQuote(vandam);\n const author = 'Jean-Claude Van Damme';\n this.quotes.push({ quote: quote, author: author });\n }\n } else if (this.quotesType === 'Aléatoire') {\n for (let i = 0; i < this.numQuotes; i++) {\n const quote = this.pickQuote(alea);\n const author = this.pickAuthor();\n this.quotes.push({ quote: quote, author: author });\n }\n }\n }", "function createOrder() {\n prompt(questions).then(answers => {\n const [_, name, price] = /(.*)\\s\\(\\₦(.*)\\)/.exec(answers.name);\n const order = {\n name,\n price: Number(price.replace(',', '')),\n quantity: Number(answers.quantity)\n };\n Cart.add(order);\n if (answers.performAnotherTransaction) {\n //creates another order if user chooses to purchase another item\n createOrder();\n } else {\n //make payment\n Cart.displayCart();\n }\n });\n}", "function createQuote(){\n $.ajax({\n headers: {\n \"X-Mashape-Key\": \"OivH71yd3tmshl9YKzFH7BTzBVRQp1RaKLajsnafgL2aPsfP9V\",\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n url: 'https://andruxnet-random-famous-quotes.p.mashape.com/cat=',\n success: function(response) {\n var r = JSON.parse(response);\n currentQuote = r.quote;\n currentAuthor = r.author;\n $('.quote-text').text(r.quote);\n $('.author-text').html(r.author);\n }\n });\n }", "function registerQuotes() {\n addQuote(\n \"Some days are just bad days, that's all. You have to experience sadness to know happiness, and I remind myself that not every day is going to be a good day, that's just the way it is!\",\n \"Dita Von Teese\",\n \"Dancer\",\n \"BrainyQuote\",\n \"1989\",\n [\"Bad Days\", \"Sadness\", \"Remind\"]\n );\n\n addQuote(\n \"I don't go by or change my attitude based on what people say. At the end of the day, they, too, are judging me from their perspective. I would rather be myself and let people accept me for what I am than be somebody who I am not, just because I want people's approval.\",\n \"Karan Patel\",\n \"Actor\",\n \"BrainyQuote\",\n \"1995\",\n [\"Accept\", \"Approval\", \"Rather\"]\n );\n\n addQuote(\n \"Every day I feel is a blessing from God. And I consider it a new beginning. Yeah, everything is beautiful.\",\n \"Prince\",\n \"Musician\",\n \"BrainyQuote\",\n \"1978\",\n [\"Beautiful\", \"Blessing\", \"Baby Jesus\"]\n );\n\n addQuote(\n \"I am happy every day, because life is moving in a very positive way.\",\n \"Lil Yachty\",\n \"Musician\",\n \"BrainyQuote\",\n \"2017\",\n [\"Postive\", \"Good\", \"Happy\"]\n );\n\n addQuote(\n \"Nobody on this earth is perfect. Everybody has their flaws; everybody has their dark secrets and vices.\",\n \"Juice WRLD\",\n \"God\",\n \"BrainyQuote\",\n \"2018\",\n [\"Secrets\", \"Jesus\", \"Flaws\"]\n );\n}", "async quote (params) {\n await this.factory.connect()\n\n // save a webfinger call if it's on the same domain\n const receiver = this.utils.resolveSpspIdentifier(params.destination)\n debug('making SPSP quote to', receiver)\n\n return ILP.SPSP.quote(\n await this.factory.create({ username: params.user.username }),\n {\n receiver,\n sourceAmount: params.sourceAmount,\n destinationAmount: params.destinationAmount\n }\n )\n }", "function Quote(text, author, tags) {\n this.text = text;\n this.author = author;\n this.tags = tags || [];\n }", "function generateNewQuote() {\n do {\n randomquote = Math.floor(Math.random() * quotes.length);\n } while (randomquote === previousquote);\n \n quote = quotes[randomquote][0];\n author = quotes[randomquote][1]; \n}", "function editor_tools_handle_quote()\n{\n // Read input.\n var who = prompt(editor_tools_translate(\"enter who you quote\"), '');\n if (who == null) return;\n who = editor_tools_strip_whitespace(who);\n\n if (who == '') {\n editor_tools_add_tags('[quote]', '[/quote]');\n }\n else\n {\n who = quote_bbcode_argument(who);\n editor_tools_add_tags('[quote=' + who + \"]\\n\", \"\\n[/quote]\");\n }\n\n editor_tools_focus_textarea();\n}", "async function newQuote() {\n let url = 'http://quotes.rest/qod.json';\n\t\tconst result = await fetch(url);\n\t\tif(!result.ok) {\n\t\t\tthrow new Error(`status: ${result.status}`);\n\t\t}\n\t\treturn await result.json();\n }", "function newQuote(){\nshowLoadingSpinner();\n // pick random quote\n const quote = apiQuotes[Math.floor(Math.random()*apiQuotes.length)];\n\n// check if author unknown\n if(!quote.author){\nauthorText.textContent = \"Unkown\" \n} else {\n authorText.textContent = quote.author;\n }\n// check quote length for styling\n if(quote.text.length > 100){\n quoteText.classList.add('long-quote');\n }else{\n quoteText.classList.remove('long-quote');\n }\n// add quote, remove loader\nquoteText.textContent = quote.text;\nremoveLoadingSpinner();\n}", "function newQuote(){\n $.getJSON('https://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?', function(data){\n quoteText = data.quoteText;\n quoteAuthor = data.quoteAuthor;\n \n $('#quote-text').html(quoteText);\n $('#quote-author').html(quoteAuthor);\n });\n }", "function writeQuote(){\n generateQuote();\n var quoteText = displayQuote.quote;\n var authorText = displayQuote.author;\n quote.textContent = quoteText;\n author.textContent = authorText;\n}", "newQuote() {\n this.quotes = [];\n this.pickColor();\n this.createQuotes();\n }", "function printQuote(){\n //calls the getRandomQuote() function, then stores returned object into a variable\n getRandomQuote();\n //construct the string containing the different quote properties using HTML template\n}", "function composeQuote(response) {\n quote.text = response.quoteText;\n response.quoteAuthor === \"\" ? quote.author = \"Unknown\" : quote.author = response.quoteAuthor;\n //Show here directly the quote\n $(\"blockquote p\").text(quote.text);\n $(\"blockquote cite\").text(quote.author);\n}", "function getQuote(quoteTxt, author){\n const quotediv = document.getElementById('quote');\n quotediv.innerHTML = `\"${quoteTxt}\" - ${author}`;\n}", "function buildQuoteCard(quote) {\n const newQuote = document.createElement('li')\n newQuote.className = 'quote-card'\n \n const quoteBlock = document.createElement('BLOCKQUOTE')\n quoteBlock.className = 'blockquote'\n \n const createP = document.createElement('p')\n createP.className = 'mb-0'\n createP.innerText = quote.quote\n \n const createFooter = document.createElement('FOOTER')\n createFooter.className = 'blockquote-footer'\n createFooter.innerText = quote.author\n \n const likeBtn = document.createElement('button')\n likeBtn.className = 'btn-success'\n likeBtn.innerText = \"Likes:\"\n likeBtn.span = 0\n \n const deleteBtn = document.createElement('button')\n deleteBtn.className = 'btn-danger'\n deleteBtn.innerText = \"Delete\"\n \n newQuote.appendChild(quoteBlock)\n newQuote.appendChild(createP)\n newQuote.appendChild(createFooter)\n newQuote.appendChild(likeBtn)\n newQuote.appendChild(deleteBtn)\n quoteList.appendChild(newQuote)\n\n //deletes the quote - refers to \"deleteQuote\" method above\n deleteBtn.addEventListener(\"click\", () => {\n deleteQuote(quote);\n newQuote.remove();\n });\n }", "function doquote(objID,strAuthor){\r\n\tdocument.inputform.message.value += \"[quote=\"+strAuthor+\"] \"+document.getElementById(objID).innerText+\" [/quote]\\n\";\r\n\twindow.location.hash=\"comment\";\r\n}", "function makingQuote(quoteOb) {\n message = makingTags(quoteOb.tags);\n message += '<p class=\"quote\">' + quoteOb.quote + '</p>';\n message += '<p class=\"source\">' + quoteOb.source;\n message += makingProperty(quoteOb.citation, 'citation');\n message += makingProperty(quoteOb.year, 'year');\n message += '</p>';\n return message;\n}", "function postQuote(e){\n e.preventDefault()\n quote = document.getElementById(\"new-quote\").value\n author = document.getElementById(\"author\").value\n adapter.postQuote(quote, author, addQuoteFromPost)\n document.getElementById(\"new-quote\").value = \"\"\n document.getElementById(\"author\").value = \"\"\n }", "function generateQuote(){\nconst random = Number.parseInt(Math.random() * arrayOfQuotes.length + 1);\ndocument.querySelector('#quoteOutput').textContent = `\\'${arrayOfQuotes[random].quote}'`;\ndocument.querySelector('#authorOutput').textContent = `--${arrayOfQuotes[random].author}`;\n}", "function storeQuote(message, args){\n \targs.splice(0, 1); // Remove @name from quote to be saved\n \tlet quote = args.join(\" \");\n\n \t// Store quote\n\t fs.readFile('cache.json', 'utf8', function readFileCallback(err, data){\n\t if (err){\n\t console.log(err);\n\t message.reply(\"Cache failure. Please try again.\");\n\t } else {\n\t \t// get existing user quotes\n\t obj = JSON.parse(data);\n\t let target_user = message.mentions.users.first();\n\n\t // Don't store quotes for bots\n\t if(target_user.bot){\n\t \tmessage.reply(\"I can't store quotes for bots!\");\n\t \treturn;\n\t }\n\n\t let user_id = target_user.id;\n\t let guild_id = message.guild.id;\n\t let quotes = obj.quotes;\n\t let guild_quotes = quotes[guild_id];\n\t let user_quotes = guild_quotes[user_id];\n\n\t if(typeof user_quotes == \"undefined\"){\n\t \tuser_quotes = [];\n\t }\n\n\t // Add a new quote to the array\n\t let stamp = Math.floor(new Date() / 1000);\n\t user_quotes.push({\"stamp\":stamp, \"quote\":quote});\n\t obj.quotes[guild_id][user_id] = user_quotes;\n\n\t // Save array back to cache\n\t json = JSON.stringify(obj);\n\t fs.writeFile('cache.json', json, 'utf8', function(){\n\t message.reply(\"Quote saved.\");\n\t });\n\t }\n\t });\n \t}", "function getRandomQuote() {\n const randomIndex = Math.floor(Math.random() * quotes.length - 1) + 1;\n // returns a random quote object\n return quotes[randomIndex];\n}", "function Quote() {\n _classCallCheck(this, Quote);\n\n Quote.initialize(this);\n }", "function getRandomQuote() {\n let randNum;\n function getRandomNum() {\n randNum= (Math.floor(Math.random()*60))-1;\n return randNum;\n }\n getRandomNum();\n function printQuote(message) {\n document.getElementById(\"quote-box\").innerHTML= message;\n }\n let output = \"<p class='quote'>\"+\"“\"+quotes[getRandomNum()].quote+\"</p> <p class='source'>\"+quotes[randNum].source+\", tag: \"+quotes[randNum].tag;\n // *add year if available\n if (quotes[randNum].year){\n output += \", year: \"+quotes[randNum].year;\n }\n output +=\"<span class='citation'><a href='https://litemind.com/best-famous-quotes/'>Litemind</a></span></p>\";\n printQuote(output);\n}", "async function addQuote(quote) {\n console.log(\"✍ Adding quote\", quote)\n return await transaction(\n fs.write,\n fs.appPath([ \"Collection\", `${quote.id}.json` ]),\n toJsonBlob(quote)\n )\n}", "function getRandomQuote() {\n const randomNumber = Math.floor(Math.random () * quotes.length);\n const randomQuoteObject = quotes[randomNumber];\n return randomQuoteObject\n}", "function printQuote(){\n const storeQuote = getRandomQuote();\n let quote = `<p class=\"quote\"> ${storeQuote.quote}\n <p class=\"source\"> ${storeQuote.source}`;\n\n if (storeQuote.citation) {\n quote += `<span class=\"citation\"> ${storeQuote.citation} </span>`\n } \n \n if (storeQuote.year){\n quote += `<span class=\"year\"> ${storeQuote.year} </span>`\n }\n \n //To display quote string in the html\n document.getElementById('quote-box').innerHTML = quote;\n \n}", "function getRandomQuote() {\n var theQuoteAndAuthor = quotesArray[Math.floor(Math.random() * quotesArray.length)]\n document.getElementById(\"quote\").innerHTML = '\" ' + theQuoteAndAuthor[0];\n document.getElementById(\"author\").innerHTML = '- ' + theQuoteAndAuthor[1];\n }", "function printQuote() {\n\n let quote = getRandomQuote()\n let template =\n `<p class=\"quote\"> ${quote.quote} </p>\n <p class=\"source\"> ${quote.source}\n ${quote.citation ? `<span class=\"citation\"> ${quote.citation} </span>` : \"\" }\n ${quote.year ? `<span class=\"year\"> ${quote.year} </span>` : \"\" }\n </p>`;\n\n document.getElementById('quote-box').innerHTML = template;\n document.body.style.backgroundColor = getRandomColor();\n}", "function quoteGenerator() {\r\n var quoteNum = Math.floor(Math.random()*quotesList.length);\r\n\r\n var quotes = quotesList[quoteNum];\r\n\r\n textQuote.textContent = quotes.quote;\r\n textAuthor.textContent = quotes.author;\r\n}", "function initializeQuotes(quote) {\n let quoteCard = document.createElement('li')\n quoteCard.classList.add('quote-card')\n quoteCard.innerHTML = `\n <blockquote class=\"blockquote\">\n <p class=${quote.id}>${quote.quote}</p>\n <footer class=\"blockquote-footer\">${quote.author}</footer>\n <br>\n <button class='btn-success'>Likes: <span>${quote.likes.length}</span></button>\n <button class='btn-danger'>Delete</button>\n </blockquote>`\n quoteList.append(quoteCard)\n}", "function buildCard(quote) {\n //creating the HTML elements\n let li = document.createElement('li')\n let blockquote = document.createElement('blockquote')\n let p = document.createElement('p')\n let footer = document.createElement('footer')\n let br = document.createElement('br')\n\n //get the data for the text to populate the card\n let {author, id, quote:text} = quote\n\n //adding tags to the elements\n li.className = 'quote-card'\n li.id = `li-${id}`\n blockquote.className = 'blockquote'\n blockquote.id = `block-${id}`\n p.className = 'mb-0'\n footer.className = 'blockquote-footer'\n\n //add text data to the card elements\n p.textContent = text\n footer.textContent = author\n\n //building the card\n blockquote.append(p, footer, br)\n li.append(blockquote)\n quoteList.append(li)\n likeButton(quote)\n deleteButton(quote)\n}", "function getRandomQuote(){\n let math = Math.floor(Math.random() * quotes.length);\n let quotePicker = quotes[math];\n return quotePicker;\n }", "generateQuotes() {\n this.pickColor();\n this.createQuotes();\n this.showQuotes = true;\n }", "function addQuote(info, tab){\n var item = {};\n item['text'] = info.selectionText;\n item['url'] = info.pageUrl;\n item['hash'] = CryptoJS.MD5(info.selectionText).toString();\n if (JSON.parse(localStorage['loginStatus'])){\n // Remove trailing forward slash\n var addUrl = Config.host.replace(/\\/$/, \"\") + \"/quotes/add/\";\n var data = $.param({\n sid: localStorage['sid'],\n quote_text: item['text'],\n quote_url: item['url'],\n quote_hash: item['hash'] \n });\n \n $.post(addUrl, data, function(data){\n // Since the user is logged in, update the db with the new quote, \n // get the new quotes id, and then add this to the localstorage\n item['id'] = data.quote_id;\n var list = JSON.parse(localStorage['list']);\n list.push(item);\n localStorage['list'] = JSON.stringify(list);\n });\n }\n else{\n var list = JSON.parse(localStorage['list']);\n list.push(item);\n localStorage['list'] = JSON.stringify(list);\n }\n\n }", "function setQuote() {\n quoteText.innerHTML = quoteList[index].quote;\n quoteAuthor.innerHTML = \"-- \"+quoteList[index].author;\n }", "function printQuote() {\n let storedQuote = getRandomQuote(quotes); // a variable to store a random quote object \n let html = ''; \n html += `\n <p class=\"quote\"> ${storedQuote.quote} </p>\n <p class=\"source\"> ${storedQuote.source}` \n \n if (storedQuote.citation !== '') {\n html += `<span> ${storedQuote.citation} </span>`; \n } \n if (storedQuote.year !== '') {\n html += `<span> ${storedQuote.year} </span>`\n }\n \n html += `</p>`\n ;\n\n document.getElementById('quote-box').innerHTML = html; \n}", "function handleNewQuoteRequest(response) {\n // Get a random space quote from the space quotes list\n var quoteIndex = Math.floor(Math.random() * QUOTES.length);\n var randomQuote = QUOTES[quoteIndex];\n\n // Create speech output\n var speechOutput = \"Here's your quote: \" + randomQuote;\n var cardTitle = \"Your Quote\";\n response.tellWithCard(speechOutput, cardTitle, speechOutput);\n}", "function printQuote() {\n let chosenQuote = getRandomQuote();\n let quoteText = \n '<p class=\"quote\">' + chosenQuote.quote + '</p>';\n quoteText += '<p class=\"source\"> ' + chosenQuote.author + ' ';\n if (chosenQuote.citation) {\n quoteText += '<span class=\"citation\"> ' + chosenQuote.citation + '</span>';\n }\n if (chosenQuote.year) {\n quoteText += '<span class=\"year\"> ' + chosenQuote.year + '</span>';\n }\n '</p>';\n document.getElementById('quote-box').innerHTML = quoteText;\n }", "function getRandomQuote (){\n i = Math.floor(Math.random() * quotes.length);\n randomQuote = quotes[i];\n return randomQuote\n}", "function inspiringQuote() {\r\n // Example quotes: \r\n // \"If opportunity doesn't knock, build a door.\"\r\n // \"The best way out is always through.\"\r\n // BEGIN CODE \r\n \r\n // END CODE\r\n}", "function printQuote() {\n var result = getRandomQuote(); // Calls and stores the getRandomQuote in a variable\n let main =\n `<p class='quote'>\n ${result.quote}\n </p>` +\n `<p class='source'>\n ${result.Author}\n </p>` +\n `<p class='citation'>\n ${result.citation} \n </p>` +\n `<p class='year'>\n ${result.year}\n </p>` +\n `<p class='tags'>\n ${result.tag}\n </p>`;\n document.getElementById('quote-box').innerHTML = main;\n}", "function getQuote (){\r\n // quotes and authors -- \r\n var quotes = [ \"Try to be a rainbow in someone's cloud.\", \r\n\t\"Health is the greatest gift, contentment the greatest wealth, faithfulness the best relationship.\",\r\n\t\"I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel.\",\r\n\t\"If you look at what you have in life, you'll always have more. If you look at what you don't have in life, you'll never have enough.\",\r\n\t\"I can't change the direction of the wind, but I can adjust my sails to always reach my destination.\", \r\n\t\"Believe you can and you're halfway there.\",\r\n\t\"Do or do not. There is no try.\",\r\n\t\"Strive not to be a success, but rather to be of value.\",\r\n\t\"The most common way people give up their power is by thinking they don’t have any.\",\r\n\t\"It is during our darkest moments that we must focus to see the light.\",\r\n\t\"Change your thoughts and you change your world.\", \r\n\t\"You can't use up creativity. The more you use, the more you have.\",\r\n\t\"I have learned over the years that when one's mind is made up, this diminishes fear.\", \r\n\t\"A person who never made a mistake never tried anything new.\",\r\n\t\"What's money? A man is a success if he gets up in the morning and goes to bed at night and in between does what he wants to do.\",\r\n\t\"If you want to lift yourself up, lift up someone else.\",\r\n\t\"Just because you are happy, it does not mean that the day is perfect, but that you have looked beyond its imperfections.\",\r\n\t\"Don't gain the world and lose your soul, wisdom is better than silver or gold.\", \r\n\t\"Money is numbers and numbers never end. If it takes money to be happy, your search for happiness will never end.\",\r\n\t\"A man who stands for nothing will fall for anything.\",\r\n\t\"Education is our passport to the future, for tomorrow belongs to the people who prepare for it today.\", \r\n\t\"We cannot think of being acceptable to others until we have first proven acceptable to ourselves.\", \r\n\t\"It always seems impossible until it's done.\",\r\n\t\"As we let our own light shine, we unconsciously give other people permission to do the same.\",\r\n\t\"Be yourself; everyone else is already taken.\",\r\n\t\"Be the change that you wish to see in the world.\",\r\n\t\"To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.\",\r\n\t\"For every minute you are angry you lose sixty seconds of happiness.\"]; \r\n \r\n\t\r\n\t\r\n\t\r\n\t\r\n\tvar authors = [\"Maya Angelou\",\r\n\t\"buddha\", \r\n\t\"Maya Angelou\",\r\n\t\"Oprah Winfrey\", \r\n\t\"Jimmy Dean\",\r\n\t\"Theodore Roosevelt\",\r\n\t\"Yoda\",\r\n\t\"Albert Einstein\",\r\n\t\"Alice Walker\",\r\n\t\"Aristotle Onassis\", \r\n\t\"Norman Vincent Peal\", \r\n\t\"Maya Angelou\", \r\n\t\"Rosa Parks\",\r\n\t\"Albert Einstein\",\r\n\t\"Bob Dylan\", \r\n\t\"Booker T. Washington\", \r\n\t\"Bob Marley\", \r\n\t\"Bob Marley\", \r\n\t\"Bob Marley\", \r\n\t\"Malcolm X\",\r\n\t\"Malcolm X\", \r\n\t\"Malcolm x\", \r\n\t\"Nelson Mandela\", \r\n\t\"Nelson Mandela\",\r\n\t\"Oscar Wilde\",\r\n\t\"Mahatma Gandhi\",\r\n\t\"Ralph Waldo Emerson\",\r\n\t\"Ralph Waldo Emerson\"];\r\n \r\n\t \r\n\t \r\n\t \r\n\t //key variable for randomization-- \r\n randomNum = Math.floor(Math.random()*quotes.length);\r\n //Assign random variable to author and quote--\r\n randomQuote = quotes[randomNum];\r\n author = \" - \" + authors[randomNum];\r\n /*calls quotes and respective author to location in html--*/ \r\n $(\".quote\").text(randomQuote);\r\n $(\".author\").text(author);\r\n}", "function newQuote(){\n\n loading();\n const quote = apiQuote[Math.floor(Math.random() * apiQuote.length)]; \n authorText.textContent = quote.author;\n \n if(quote.text.length > 50){\n quoteText.classList.add('long-quote');\n }else{\n quoteText.classList.remove('long-quote');\n } \n quoteText.textContent = quote.text;\n completado()\n\n}", "function addRandomQuote() {\n const quotes =\n [\"You should enjoy the little detours to the fullest. Because that's where you'll find the things more important than what you want. -Yoshihiro Togashi\",\n \"I don’t want what another man can give me. If he grants me anything, then it’s his to give and not my own. -Kentaro Miura\",\n \"Sometimes good people make bad choices. It doesn't mean they are bad people. It means they're human. -Sui Ishida\",\n \"Why is it that when one man builds a wall, the next man immediately needs to know what's on the other side? -George R.R. Martin\"];\n\n // Pick a random greeting.\n const quote = quotes[Math.floor(Math.random() * quotes.length)];\n\n // Add it to the page.\n const quoteContainer = document.getElementById('quote-container');\n quoteContainer.innerText = quote;\n}", "function renderQuote(quote){\n return `<li class='quote-card'>\n <blockquote class=\"blockquote\">\n <p class=\"mb-0\">${quote.quote}</p>\n <footer class=\"blockquote-footer\">${quote.author}</footer>\n <br>\n <button data-like-id=${quote.id} class='btn-success'>Likes: <span>${quote.likes.length}</span></button>\n <button data-delete-id=${quote.id} class='btn-danger'>Delete</button>\n </blockquote>\n </li>`\n }", "function generateQuotes(type) {\n let arrayType;\n\n switch (type) {\n case \"life\":\n arrayType = lifeQuoteSentences;\n break;\n case \"laws\":\n arrayType = lawsQuoteSentences;\n break;\n }\n return createQuote(arrayType);\n}", "function createProduct() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message:\n \"What is the name of the item you would like to post for sale?\\nName:\",\n name: \"product_name\"\n },\n {\n type: \"input\",\n message:\n \"Which department would you like to categorize this item under? (i.e. Men's Apparel, Electronics)\\nDepartment Name:\",\n name: \"department_name\"\n },\n {\n type: \"input\",\n message: \"How much will this item cost to consumers?\\nPrice:\",\n name: \"price\"\n },\n {\n type: \"input\",\n message: \"How much stock is available for this item?\\nQuantity:\",\n name: \"stock_quantity\"\n }\n ])\n .then(function(answers) {\n connection.query(\n \"INSERT INTO products SET ?\",\n {\n product_name: answers.product_name,\n department_name: answers.department_name,\n price: answers.price,\n stock_quantity: answers.stock_quantity\n },\n function(error, results) {\n console.log(\n \"\\n\" +\n answers.product_name +\n \" has been posted to the Amazon Marketplace for buyers.\\n\"\n );\n returnHome();\n }\n );\n });\n}", "function createCryptogram(){\n vm.cipher = {};\n if(vm.quote){\n killGuess().then(function(){\n $meteor.call('createCryptogram', vm.quote).then(function(result){\n if(result){\n var answer = vm.quote.toLowerCase().slice(0);\n vm.result = result;\n\n vm.cipher = {};\n _.each(answer, function(val, index){\n if(cryptogramService.isLetter(val))\n vm.cipher[result[index]] = val;\n });\n\n changeQuoteHeader();\n vm.currentQuote = vm.buildingQuote;\n }\n }, function(err){\n console.log('err', err);\n });\n }, function(err){\n console.log(err);\n });\n }else{\n vm.currentQuote = vm.needQuote;\n }\n }", "function getRandomQuote () {\n let randomNumber = Math.floor(Math.random() * quotes.length); \n let randomQuote = quotes[randomNumber]; \n return randomQuote;\n}", "function getRandomQuote () { \n let randomQuote = Math.floor(Math.random() * quotes.length); \n return quotes[randomQuote];\n}", "function initialQuote() {\n //user was asked a yes/no question, get response\n getUseInput(function(data) {\n if (/^n$/i.test(data) || /^no$/i.test(data)) {\n deleteAllLines();\n displayString(\"In that case, I'll wait patiently until you need me.\", false);\n setTimeout(function() {\n deleteAllLines();\n displayString('Standing by...', 'main');\n }, 1500);\n } else if (/^y$/i.test(data) || /^yes$/i.test(data)) {\n deleteAllLines();\n getQuote(function() {\n //since this is first quote retrieved, inform user of tweeting ability\n displayString([\"If you would like to tweet this, please type tweet. Otherwise,\",\n \"as I mentioned earlier, feel free to type help to see what else I can do for you.\"].join(' '));\n });\n\n } else { //user has entered something other than yes/no\n deleteAllLines();\n displayString(\"You didn't answer my question. Nevermind. What is it you want?\", 'main');\n }\n });\n }", "function getRandomQuote() \n{\n let num = Math.floor(Math.random() * quotes.length);\n let randomQuote = quotes[num];\n return randomQuote;\n}", "function generateQuote() {\n if (quoteNumber == 0 || quoteTheme == -1) {\n setRobotSentence(\"Tu dois séléctionner des options pour continuer\");\n } else {\n setRobotFeeling(1);\n setRobotSentence(\"Génération des phrases..\");\n quoteResult = [];\n for (let i = 0; i < quoteNumber; i++) {\n do {\n let themeString = themeData[quoteTheme];\n quoteResult[i] = getRandomPart(quoteDataBegin[themeString].items) + \" \";\n quoteResult[i] += getRandomPart(quoteDataBody[themeString].items) + \" \";\n quoteResult[i] += getRandomPart(quoteDataEnd[themeString].items);\n } while (checkInBlacklist(quoteResult[i]));\n }\n setTimeout(function() {\n setRobotFeeling(0);\n setRobotSentence(\n \"Terminé ! Montre moi les phrases fausses en cliquant dessus\"\n );\n displayQuote();\n }, 1500);\n }\n}", "function newOrder(){\n\tinquirer.prompt([{\n\t\ttype: 'confirm',\n\t\tname: 'choice',\n\t\tmessage: 'Would you like to place another order?'\n\t}]).then(function(answer){\n\t\tif(answer.choice){\n\t\t\tbuyItem();\n\t\t}\n\t\telse{\n\t\t\tconsole.log('Thank you for shopping at Bamazon!');\n\t\t\tconnection.end();\n\t\t}\n\t})\n}", "function getRandomQuote ( ) {\n randomQuote = quotes[(Math.floor(Math.random() * quotes.length))];\n}", "function printQuote() {\n var HTML = '';\n var display = getRandomQuote();\n \n HTML = \"<p class = 'quote'>\" + display.quote + \"</p>\";\n HTML += \"<p class = 'source'>\" + display.source;\n \n if (display.citation != \"\") {\n \n HTML += \"<span class = 'citation'>\" + display.citation + \"</span>\";\n }\n if (display.year != \"\") {\n \n HTML += \"<span class = 'year'>\" + display.year + \"</span>\";\n }\n \n HTML += \"</p>\";\n \n document.getElementById('quote-box').innerHTML = HTML;\n }", "function getRandomQuote() {\n\tlet quoteIndex = Math.floor(Math.random() * quotes.length);\n\treturn quotes[quoteIndex];\n}", "function newOrder() {\n inquirer\n .prompt(\n {\n name: \"choice\",\n type: \"confirm\",\n message: \"Would you like to make another purchase?\"\n },\n ) .then(function(answer) {\n if (answer.choice) {\n makePurchase();\n } else {\n connection.end();\n }\n })\n}", "function renderNewQuote() {\n clearScreen();\n quoteDisplayElement.style.display = \"block\";\n quoteInputElement.style.display = \"block\";\n mainCtx.font = \"50px Candara\";\n mainCtx.fillText(\"00\", 1200, 50);\n let quote = getRandomQuote(quotes);\n quoteDisplayElement.innerHTML = \"\";\n quote.split(\"\").forEach((character) => {\n const characterSpan = document.createElement(\"span\");\n characterSpan.innerText = character;\n quoteDisplayElement.appendChild(characterSpan);\n quoteInputElement.focus();\n quoteInputElement.select();\n });\n quoteInputElement.value = null;\n}", "function getRandomQuote (){\n const randomNumber = Math.floor(Math.random() * quotes.length);\n const randomQuote = quotes[randomNumber];\n return randomQuote;\n \n\n}", "function getRandomQuote() {\n const randomNumber = Math.floor(Math.random() * quotes.length);\n const randomQuote = quotes[randomNumber];\n return randomQuote;\n}", "function getRandomQuote() {\n {\n let randomNumber = Math.floor(Math.random() *quotes.length);\n \n \n var quote = quotes[randomNumber].quote;\n var source = quotes[randomNumber].source;\n var citation = quotes[randomNumber].citation;\n var year = quotes[randomNumber].year;\n // return quotes[randomNumber];\n \n \n /*** <p class = 'quote'> </p> \n <p class ='source'> </p>\n <p class = 'citation'> </p>\n <p class = 'year'> </p> ***/\n\n const outQuote= (quote + source + citation + year)\n return outQuote;\n\n // I had my variables backwards before help.\n \n }\n}", "function getRandomQuote() {\n var randomQuote = quotes[Math.floor(Math.random() * quotes.length)];\n return randomQuote;\n}", "function printQuote() {\n\n let randomQuote = getRandomQuote(quotes);\n\n let quoteHTML = \"\";\n quoteHTML += `<p class=\"quote\">${randomQuote.quote}</p>`\n quoteHTML += '<p class=\"source\">'\n if (randomQuote.source) quoteHTML += randomQuote.source;\n if (randomQuote.citation) quoteHTML += `<span class=\"citation\"> ${randomQuote.citation} </span>`\n if (randomQuote.year) quoteHTML += `<span class=\"year\"> ${randomQuote.year} </span>`\n quoteHTML += '</p>'\n\n document.getElementById(\"quote-box\").innerHTML = quoteHTML;\n\n}", "function generate_quotes(quotes){\n if(quotes.error){\n return \"\"\n }\n let head = \"<h1>Quotes</h1><div>\"\n let tail = \"</div>\"\n quotes.forEach( (quote, i) => {\n if(i >= 5) return;\n let char_quote = quote.quote.replace(\"\\n\", \"<br>\");\n let h2 = `<h2 class=\"quote\">${char_quote}<br>- ${quote.character}</h2><br>`;\n head += h2;\n })\n\n return head + tail;\n}", "function setupUserQuotasDialog(){\n dialogs_context.append('<div title=\"'+tr(\"User quotas\")+'\" id=\"user_quotas_dialog\"></div>');\n $user_quotas_dialog = $('#user_quotas_dialog',dialogs_context);\n var dialog = $user_quotas_dialog;\n dialog.html(user_quotas_tmpl);\n\n setupQuotasDialog(dialog);\n}", "function getRandomQuote () {\n let randomNum = Math.floor(Math.random() * quotes.length);\n return quotes[randomNum];\n\n}", "function getRandomQuote(){\n const randomQuote = quotes[Math.floor(Math.random() * quotes.length )];\n return randomQuote;\n \n}", "function getRandomQuote() {\r\n let randomQuote = Math.floor(Math.random() * quotes.length );\r\n \r\n return quotes[randomQuote];\r\n}", "handleQuoteClick() {\n fetch('https://quota.glitch.me/random')\n .then(response => response.json())\n .then(data => {\n this.setState({\n text: \"\\\"\" + data.quoteText + \"\\\"\",\n author: '-' + data.quoteAuthor\n });\n });\n }", "function returnRandomQuote(quotes) {\n if (quotes) {\n return new BPromise(function(resolve, reject) {\n var quote = quotes[\n Math.floor(Math.random() * quotes.length)\n ];\n resolve('\"' + quote.quote + '\" - ' + quote.origin);\n });\n } else {\n throw 'utility.returnRandomQuote - No quotes';\n }\n }", "function randomQuote() {\n\t$.ajax({\n\t\turl: \"https://api.forismatic.com/api/1.0/\",\n\t\tjsonp: \"jsonp\",\n\t\tdataType: \"jsonp\",\n\t\tdata: {\n\t\t\tmethod: \"getQuote\",\n\t\t\tlang: \"en\",\n\t\t\tformat: \"jsonp\"\n\t\t},\n\t\tsuccess: function(quote) {\n\t\t\tvar quoteText = $.trim(quote.quoteText);\n\t\t\tvar quoteAuthor = 'Unknown';\n\t\t\tif (quote.quoteAuthor !== '') {\n\t\t\t\tquoteAuthor = quote.quoteAuthor;\n\t\t\t}\n\t\t\t$('#quote-text').html('&ldquo;'+quoteText+'&rdquo;')\n\t\t\t$('#quote-author').html(\"-\"+quoteAuthor)\n\t\t}\n\t});\n}", "function getRandomQuote()\n{\n var randomQuote = quotes[Math.floor(Math.random()*quotes.length)];\n return randomQuote;\n}", "function printQuote() {\n let randomQuote = getRandomQuote();\n let htmlString = `<p class=\"quote\">${randomQuote.quote}</p><p class=\"source\">${randomQuote.source}`;\n // If Statements for optional properties (including subject which is for extra credit)\n if ( randomQuote.citation ) {\n htmlString += `<span class=\"citation\">${randomQuote.citation}</span>`;\n }\n if ( randomQuote.year ) {\n htmlString += `<span class=\"year\">${randomQuote.year}</span>`;\n }\n if ( randomQuote.subject ) {\n htmlString += `<span> - Subject: ${randomQuote.subject}</span>`;\n }\n htmlString += `</p>`;\n changeBackGroundColor();\n return document.getElementById('quote-box').innerHTML = htmlString;\n}", "function getRandomQuote() {\n let rand = Math.floor(Math.random() * quotes.length);\n return quotes[rand];\n}", "function getRandomQuoteForUser(message, user_id){\n\n\t\t\tfs.readFile('cache.json', 'utf8', function readFileCallback(err, data){\n \n\t if (err){\n\t console.log(err);\n\t message.reply(\"Failed to load quote data. Please try again.\");\n\t } else {\n\n\t \tobj = JSON.parse(data);\n\t \tlet guild_id = message.guild.id;\n\t\t\t\t\tlet quotes = obj.quotes;\n\t\t\t\t\tlet guild_quotes = quotes[guild_id];\n\n\t\t\t\t\t// This guild have any quotes stored?\n\t\t\t\t\tif(null == guild_quotes){\n\t\t\t\t\t\tmessage.reply(\"I don't have any quotes stored for this server.\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// See if we have any quotes saved for this user\n\t if(guild_quotes.hasOwnProperty(user_id)){\n\t let user_quotes = guild_quotes[user_id];\n\n\t // Get random quote\n\t\t\t\t\t\tvar quote = user_quotes[Math.floor(Math.random() * user_quotes.length)];\n\n\t\t\t\t\t\t// Get user\n\t\t\t\t\t\tmessage.client.fetchUser(user_id)\n\t\t\t\t\t\t\t.then(function(user){\n\t\t\t\t\t\t\t\t// Respond\n\t\t\t\t\t\t\t\tmessage.reply(`**${user.username}:** \"${quote.quote}\"`);\t\t\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch(error => console.log(error));\n\n\t } else {\n\t message.reply(`I don't have any quotes stored for that user.`);\n\t }\n\t }\n\t });\n \t}", "function quote() {\n // define variable used throughout.\n let quote = 0\n let wagePerMile = .30;\n let wageExpense = wagePerMile * distanceInMiles;\n let milesPerGallon = 7.75;\n let fuelCostPerGallon = 3.00;\n let fuelExpense = (distanceInMiles / milesPerGallon) * fuelCostPerGallon;\n let margins = [1.3, 1.5, 1.7, 1.9]\n //create cost plus quote tool. Simplified to only Fuel and Wage Expense consideration.\n function costPlusQuote() {\n if (distanceInMiles >= 100) {\n quote = (wageExpense + fuelExpense) * margins[3];\n return quote\n } else if (distanceInMiles >= 500) {\n quote = (wageExpense + fuelExpense) * margins[2];\n return quote\n } else if (distanceInMiles >= 1000) {\n quote = (wageExpense + fuelExpense) * margins[1];\n return quote\n } else {\n quote = (wageExpense + fuelExpense) * margins[0];\n return quote\n }\n }\n\n //hard coded quote for short distance deliveries\n if (distanceInMiles < 20) {\n quote = 69.98\n return quote\n } else if (distanceInMiles < 40) {\n quote = 99.98\n return quote\n } else if (distanceInMiles < 60) {\n quote = 129.98\n return quote\n } else if (distanceInMiles < 100) {\n quote = 179.98\n return quote\n } else if (distanceInMiles >= 100) {\n quote = costPlusQuote()\n return quote\n }\n }", "function getRandomQuote() {\n return quotesData[Math.floor(Math.random() * quotesData.length)]\n}", "function getRandomQuote() {\n\t//variable generates a random number between 0 and 4 - 5 total quotes\n\t//randNum = Math.floor(Math.random() * quotes.length);\n\t\n\trandNumArray();\n\n\t//variable containing the randomly selected quote object\n\tdisplayQuote = quotes[storedNum];\n}", "function getRandomQuote(quotes){\n let randomNum = Math.floor( Math.random() * quotes.length );\n return quotes[randomNum];\n}", "function printQuote() {\n \n\n //const outQuoteBox = getRandonQuote ( )\n\n document.getElementById(\"quote-box\").innerHTML = getRandomQuote()\n\n \n }", "function generateContent() {\n\n // erase existing quotes\n let quotesNode = document.getElementById(\"quotes\");\n while (quotesNode.firstChild) {\n quotesNode.removeChild(quotesNode.firstChild);\n }\n\n // save user input\n let type = document.getElementById(\"inputQuoteType\").value;\n let amount = document.getElementById(\"inputQuantity\").value;\n\n // generate content on website\n for (let i = 0; i < amount; i++) {\n\n //generate random quote\n let blockquoteNode = document.createElement(\"BLOCKQUOTE\"); // Create a <BLOCKQUOTE> node\n let textNode = document.createTextNode(generateQuotes(type)); // Create a text node\n blockquoteNode.appendChild(textNode); // Append the text to <BLOCKQUOTE>\n document.getElementById(\"quotes\").appendChild(blockquoteNode); // Append BLOCKQUOTE to parent element\n\n //generate random author - similar as above\n let authorNode = document.createElement(\"P\");\n let authorName = document.createTextNode(\"- \" + authors[randomNumber(authors)]);\n authorNode.appendChild(authorName);\n document.getElementById(\"quotes\").appendChild(authorNode);\n }\n}", "function printQuote () {\n\tconst quoteBox = document.getElementById('quote-box');\n\tconst randomQuote = getRandomQuote( quotesCopy );\n\n\tconsole.log(randomQuote.quote)\n\n\tlet html = \"\";\n\thtml += `<p class=quote> ${randomQuote.quote} </p>`;\n\thtml += `<p class=source> ${randomQuote.citation} </span>`;\n\thtml += `<span class=year> ${randomQuote.year} </span>`;\n\t// display html\n\tquoteBox.innerHTML = html;\n}", "function printQuote() {\n\tquote = getRandomQuote();\n\thtml = \"\"\n\thtml += '<p class=\"quote\">' + quote.quote + '</p>'\n\thtml += '<p class=\"source\">' + quote.source\n\t\n\tif (quote.citation!= undefined) {\n\t\thtml += '<span class=\"citation\">' + quote.citation + '</span>'\n\t}\n\n\tif (quote.year!= undefined) {\n\t\thtml += '<span class=\"year\">' + quote.year + '</span>'\n\t}\n\t\n\thtml += '</p>'\n\tdocument.getElementById(\"quote-box\").innerHTML=html;\n}", "function getRandomQuote(quote){\n return quote[Math.floor(Math.random() * quote.length)];\n}", "function getRandomQuote() {\n let randomQuote = Math.floor(Math.random() * quotes.length);\n let returnedQuote = quotes[randomQuote];\n return returnedQuote;\n}", "handleNewQuote(event){\n let result = randomQuote();\n let rQuote = result.quote;\n let randomAuthor = result.author;\n\n this.setState({\n quote: rQuote,\n author: randomAuthor\n }\n );\n }", "function quoteCardTemplate(quote) {\r\n return (\r\n `<div class=\"card text-white bg-warning mb-3\">\r\n <img class=\"card-img-top\" src=${quote.image} alt=\"Card image cap\">\r\n <div class=\"card-body\">\r\n <p class=\"card-text\">${quote.quote}</p>\r\n <h5 class=\"card-title\">${quote.character}</h5>\r\n </div>\r\n </div>`\r\n )\r\n}", "function printQuote() {\n var quoteHTML;\n var outputDiv;\n var randomObject = getRandomQuote();\n //conditional added for quote object lacking year or citation properties\n quoteHTML = `<p class=\"quote\">${randomObject.quote}</p>\n <p class=\"source\">${randomObject.author}</p>`\n outputDiv = document.getElementById('quote-box');\n outputDiv.innerHTML = quoteHTML;\n }", "function getRandomQuote () {\n const randomNumber = (Math.floor(Math.random() * quotes.length + 1) - 1); // 1 is substracted because the first element in the quotes object array has a refence of 0\n const randomQuote = quotes[randomNumber]; \n return randomQuote;\n}", "function getRandomQuote() {\n return quotes[Math.floor(Math.random() * quotes.length)];\n}", "static async update(id, quote, author)\n {\n const { rows } = await pool.query(\n `UPDATE quotes \n SET quote = $3, author= $2\n WHERE id = $1\n RETURNING *`,\n [id, quote, author]);\n\n return new Quote(rows[0]);\n }", "function addQuote(quote, source, sourceProfession, citation, year, tags) {\n var newQuote = {\n quote: quote,\n source: source,\n sourceProfession: sourceProfession,\n citation: citation,\n year: year,\n tags: tags\n };\n\n quotes.push(newQuote);\n}", "function getRandomQuote()\n{\n let randNumber = Math.floor(Math.random() * quotes.length);\n return quotes[randNumber];\n}", "function printQuote(quote) \n{\n let message = getRandomQuote(quotes);\n let template = ' ';\n\n template = \"<p class='quote'>\" + message.quote + \"</p>\";\n template += \"<p class='source'>\" + message.source;\n\n if (message.citation)\n { template += \"<span class='citation'>\" + message.citation + \"</span>\" ;}\n\n if (message.year) \n { template += \"<span class='year'>\" + message.year + \"</span>\" ;}\n\n if (message.tags) \n { template += \"<span class='tags'>\" + message.tags + \"</span>\"; }\n \n template += \"</p>\"\n\n document.getElementById(\"quote-box\").innerHTML = template;\n const colorResult = getRandomColor();\n document.body.style.background = colorResult;\n\n}", "function getRandomQuote() {\n let random = Math.floor(Math.random() * (quotes.length));\n return quotes[random];\n}" ]
[ "0.68796736", "0.67978156", "0.6665791", "0.6523669", "0.6373495", "0.63376015", "0.6326829", "0.6185461", "0.6151672", "0.6148862", "0.61482424", "0.6139593", "0.6130201", "0.6097758", "0.60966533", "0.608487", "0.6044258", "0.6041701", "0.599285", "0.5984935", "0.5979089", "0.59637976", "0.5962537", "0.5958191", "0.59256494", "0.5899181", "0.5832806", "0.58238775", "0.5816028", "0.5775201", "0.5770693", "0.57666975", "0.575578", "0.5746585", "0.5741006", "0.5730233", "0.57214767", "0.5705696", "0.5696023", "0.5672742", "0.5668803", "0.561705", "0.5616751", "0.56021976", "0.5595296", "0.55911213", "0.55839574", "0.5581758", "0.55809563", "0.55809015", "0.55795175", "0.5577686", "0.5573964", "0.5567991", "0.55618745", "0.5561527", "0.55602354", "0.5555918", "0.5552512", "0.5550859", "0.5550292", "0.554993", "0.5530798", "0.55290264", "0.5523396", "0.55186045", "0.55166847", "0.55134845", "0.5509087", "0.55088323", "0.5497616", "0.5496542", "0.5495625", "0.54895097", "0.5486345", "0.54833424", "0.5479646", "0.5477439", "0.5474458", "0.54740804", "0.54721814", "0.546915", "0.5464026", "0.5463806", "0.54596484", "0.5457669", "0.54563296", "0.5451748", "0.5451618", "0.5448506", "0.5446668", "0.5442515", "0.54412067", "0.5440122", "0.5439301", "0.5428824", "0.5428513", "0.54267687", "0.54266286", "0.54254454", "0.5425444" ]
0.0
-1
Aggiunge un nodo di talk
addNode(key, node) { this._nodes[key] = node }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nelsonTalk() {\n var nelsonTalk = new Talk(\n \"Come, Follow Me\",\n \"https://www.churchofjesuschrist.org/study/general-conference/2019/04/46nelson?lang=eng\",\n \"Jesus Christ invites us to take the covenant path back home to our Heavenly Parents and be with those we love.\",\n \"Sunday Morning\"\n );\n nelsonTalk.output();\n}", "function talk() {\n\tconsole.log(\"It's like well you know I wasn't really it's not this isn't so much as well anyway umm so like...\");\n}", "talk() {}", "function talk() {\n console.log(\"I am talking!\");\n}", "function speak(){}", "function say() {\n var speak = document.getElementById(\"text\").value;\n $('#chatwindow').append('<p> me =>' + speak + '</p>');\n client.say('#schnitzelwirt', speak);\n}", "function replyPing(){\n message.channel.send('pong! I am Crypto Bot.\\nType: \">help\" for help(without double quotes)') ;\n }", "function talk() {\n\tif (assistant.recognizing == false) {\n\t\tassistant.recognition.start();\n\t\tassistant.recognizing = true;\n\t\t// document.getElementById('talk').innerHTML = 'talk';\n\t\t$('.mic').addClass('is-animated');\n\t\ttalk_status = true;\n\t}\n}", "function Conversation() {}", "function BOT_agentSpeech() {\r\n\tswitch (BOT_theInterface) {\r\n \t\tcase \"STANDARD\":\tBOT_printStandardChar(); break;\r\n \t\tcase \"DEVELOPER\":\tBOT_printDevelopperChar(); break;\r\n \t\tcase \"DIVALITE\":\tBOT_printDivaliteChar(BOT_reqEmote, BOT_reqAnswerLong); break;\r\n\t\tdefault: \t\t\tBOT_printStandardChar();\r\n\t}\r\n}", "function help() {\n var helpmsg =\n '!ouste : déconnecte le bot\\n' +\n '!twss : ajoute la dernière phrase dans la liste des TWSS\\n' +\n '!nwss : ajoute la dernière phrase dans la liste des Non-TWSS\\n' +\n '!chut : désactive le bot\\n' +\n '!parle : réactive le bot\\n' +\n '!eval : évalue la commande suivante\\n' +\n '!dbg : met le bot en debug-mode, permettant de logger toute son activité\\n' +\n '!undbg : quitte le debug-mode\\n' +\n '!help : affiche ce message d\\'aide';\n client.say(channel, helpmsg);\n bot.log('message d\\'aide envoyé');\n}", "function StartConversation()\n{\n if (synth.speaking)\n {\n return;\n }\n speak(introText, 1, 1, \"Fred\");\n}", "function question (){\n\n var reply_phrases = [];\n const reply = [\"Would like to check out the event by \", this.event_name, \" on \", this.date + \" from \" + this.start_time + (this.end_time==\"uknown\"?\"\":(\" to \" + this.end_time))].join(\"\");\n chatBox.innerHTML += hereandNow + reply + \"<br>\"\n //console.log(reply);\n}", "speakWisdom(){\n console.log(\"What one programmer can do in one month, two programmers can do in two months.\");\n }", "function readOutLoud(message){\n var speech = new SpeechSynthesisUtterance(); //Built-in fuction which help JS to talk to us\n\n speech.text = \"Pardon!!\"; // Default speech\n\n if(message.includes(\"how are you\")) {\n var final = greetings[Math.floor(Math.random() * greetings.length)];\n speech.text = final;\n }else if(message.includes(\"joke\")){\n var final = jokes[Math.floor(Math.random() * jokes.length)];\n speech.text = final;\n }else if(message.includes(\"your name\")){\n speech.text = \"My name is Noxi\";\n }\n\n \n speech.volume = 1;\n speech.rate = 0.7;\n speech.pitch = 1;\n\n //Now Noxi will speak\n window.speechSynthesis.speak(speech);\n}", "execute(message,args){\n // bot replys good bye\n message.reply('Good bye Friend !!! :(')\n }", "function tellStory() {\n var pause = '\\\\pau=0\\\\';\n if (game.p == game.quiz.length - 1) pause = '\\\\pau=2500\\\\';\n if (game.quiz[game.p].story != '') speakOut(game.quiz[game.p].story + pause);\n}", "function narrator() {\n console.log('narrator');\n// Variable to interact with the player\n $('#question').show();\n $('#question').text('Do you want me to continue? yes or no? speak to me');\n\n// annyang\n var respond;\n if (annyang) {\n// if the player wants to continue\n let showMore = function() {\n storyTwo();\n }\n// if the player doesn't want to continue\n let showLess = function() {\n endGame();\n }\n// possible answers for the player to use\n let commands = {\n 'Yes':showMore,\n 'No' : showLess,\n }\n annyang.addCommands(commands);\n annyang.start();\n }\n}", "function talk() {\n console.log('talking...');\n myVoice.setVoice(voice); //change here\n myVoice.speak(textos_columnas); // change here put text\n\n myVoice.setRate(0.8); // speed of speach\n myVoice.setPitch(0.5); //.9 es mas agudo,\n myVoice.setVolume(0.5);\n\n // myVoice.setRate(.8); // speed of speach (.1 lento, .9 rapido)\n\n // //siempre empieza con un standard y despues cambia a este valor\n // myVoice.setPitch(.9); //.9 es mas agudo, .1 es mas grave y computarizadp\n // myVoice.setVolume(.3);\n\n //add voice castellano\n //add voice frances\n // maybe change the pitch to generate different voices\n\n\n}", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "function talkBack() {\n if (annyang) {\n\n//sets the content of particular commands; variable theWords is consistently reset so that it can appear as text. this text, however, does not scroll (it is short enough to fit on screen)\n let helloResp = function() {\n theWords = \"Hello there. Who are you?\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n console.log(\"hello\");\n }\n let introductionResp = function(words) {\n theWords = \"It is good to meet you.\" + words+ \"You may call me Friend. Say my name or I will not know to respond to you\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let location = function() {\n theWords = \"I do not quite know. I suppose I am in the internet. Perhaps I am nowhere at all.\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let ontology = function() {\n theWords =\"I hope I can be a companion and a conversationalist to you. Call me Friend.\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let deflectDisbelief = function() {\n theWords = \"What are you talking about? I always make perfect sense\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let nonsense = function() {\n speakFriend();\n }\n\n//matches the above responses to particular commands\n let commands = {\n 'Hello': helloResp,\n 'Hi': helloResp,\n 'I am *word': introductionResp,\n 'My name is *words': introductionResp,\n 'Where are you': location,\n 'Who are you': ontology,\n 'What are you': ontology,\n 'What are you talking about': deflectDisbelief,\n 'Friend *words': nonsense,\n '*words Friend': nonsense,\n }\n //adds commands and initializes voice synthesis\n annyang.addCommands(commands);\n annyang.start();\n }\n}", "async function playDialogue (member, dname) {\n usrD[member.user.id].currentDialogue = dname;\n usrD[member.user.id].nextDialogue = \"\";\n wtf();\n var inthebed = new Discord.RichEmbed(); // initiates the rich message (= \"embed message\" but I call it \"in the bed\" because this is funny)\n var dial = dg.corp[dname];\n inthebed.setTitle(dial.npc.name); // embed title = name of the npc/thing speaking\n inthebed.setColor(0x000000);\n descr = await dial.texte(member, usrD[member.user.id].answerMaterial);\n inthebed.setDescription(textSeparator+\"\\n\"+descr+\"\\n\"+textSeparator); // creates a dialogue box within the embed which contains theDialogue.texte function output\n if (descr == \"\") {\n inthebed.setDescription(\"\");\n }\n inthebed.setFooter(dial.footer(member)); // sets the footer text with theDialogue.footer() function output\n inthebed.setThumbnail(dial.npc.picture); // sets the thumbnail as the speaking npc's picture\n if (dial.thumb != undefined) inthebed.setThumbnail(dial.thumb);\n if (dial.image != undefined) inthebed.setImage(dial.image(member));\n console.log(inthebed.thumbnail);\n var ans = dial.answers(member);\n var emoteList = [];\n var ansList = [];\n\n // vvv adds answers list below the dialogue box\n\n for (var i=1; i <= ans[0] ; i++) {\n emoteList.push(dg.rep[ans[i]].emote(member));\n ansList.push(ans[i]);\n inthebed.addField(\" \"+emoteList[i-1]+\" | \"+dg.rep[ansList[i-1]].texte(member)+\"\",\"\"+textSeparator+\"\",);\n }\n let guildy = bot.guilds.find(\"id\", serverID);\n channel = guildy.channels.find(\"id\", usrD[member.user.id].channel);\n bigbug = false;\n const filter = m => {\n if(m.author.id == botID) bigbug = true;\n return m.author.id == botID;\n }\n await channel.awaitMessages(filter, { max: 1, time: 1000});\n if (bigbug == true) {\n return;\n }\n if(channel.type != \"dm\") {\n await channel.bulkDelete(2);\n }\n channel.send(inthebed)\n .then(async message => {\n\n for (var i=1; i <= ans[0] ; i++) {\n await message.react(emoteList[i-1]);\n }\n\n const emojiFilter = (reaction, user) => {\n condition = emoteList.indexOf(reaction.emoji.name) != -1 && user.id === member.user.id;\n return condition;\n };\n col = await message.awaitReactions(emojiFilter, { max: 1, time: 60000*5, errors: ['time']})\n .catch(()=>{\n });\n\n colv = col.array();\n for (var i in colv) {\n j = emoteList.indexOf(colv[i]._emoji.name);\n await message.delete().catch();\n exit = await dg.rep[ans[j+1]].exit(member);\n await playDialogue(member, exit);\n }\n\n }).catch();\n}", "function talkTo(person){\n\tdocument.getElementById('outputDiv').innerHTML= person.dialogue;\n\t\n}", "function postInChat(k, d, a, cs, dmg) {\n var channel = client.channels.find(channel => channel.name == 'bot'); // find text channel.\n let embed = new Discord.RichEmbed()\n .setTitle(\"Ronny won a game!\")\n .setDescription(\"Who would've thought?\")\n .addField('K/D/A:',''+k+'/'+d+'/'+a)\n .addField('Creep Score:', cs)\n .addField('Damage dealt:', dmg)\n .setColor('#af28c4')\n .setThumbnail('https://s.lolstatic.com/errors/0.0.9/images/lol_logo.png');\n channel.send(embed); // send embed to text channel\n}", "execute(message,args){\n //bot replys hello friend\n message.reply(' Welcome to math bot :)')\n }", "greet() {\n\n }", "talkjs(t,a,l,k,j,s) {\n s=a.createElement('script');s.async=1;s.src='https://cdn.talkjs.com/talk.js';a.getElementsByTagName('head')[0].appendChild(s);k=t.Promise;\n t.Talk={ready:{then:function(f){if(k){return new k(function(r,e){l.push([f,r,e]);});}l.push([f]);},catch:function(){return k&&new k();},c:l}};\n }", "function response3 (){\n\n var reply_phrases = [];\n const reply = [\"We found an event that you were looking for! The event by\", this.event_name, \" is happening on \", this.date + \" from \" + this.start_time + (this.end_time==\"unknown\"?\".\":(\" to \" + this.end_time))].join(\"\");\n chatBox.innerHTML += hereandNow + reply + \"<br>\"\n //console.log(reply);\n}", "function response (){\n\n var reply_phrases = [];\n const reply = [\"Would like to check out the event by\", this.event_name, \" is happening on \", this.date + \" from \" + this.start_time + (this.end_time==\"unknown\"?\"\":(\" to \" + this.end_time))].join(\"\");\n chatBox.innerHTML += hereandNow + reply + \"<br>\"\n //console.log(reply);\n}", "function dogInteraction () {\n document.getElementById('textarea').innerHTML += 'Beast liked his tasty meal and has fallen asleep. You can sneak past him and enter the bedroom.'\n dog.description = 'sleeping on the sofa'\n dog.conversation = 'Zzzzz'\n dog.repeatInteraction = true\n lounge.lockedDoor = false\n player.items.shift()\n}", "function greet() {\n\tlet reply = [this.animal, 'typically sleep between', this.sleepDuration].join(' ');\n\tconsole.log(reply); \n}", "function response2 (){\n\n var reply_phrases = [];\n const reply = [\"We found an event for you. The event by \", this.event_name, \" is happening on \", this.date + \" from \" + this.start_time + (this.end_time==\"unknown\"?\".\":(\" to \" + this.end_time))].join(\"\");\n chatBox.innerHTML += hereandNow + reply + \"<br>\"\n console.log(reply);\n}", "async insult(message, connection, args) {\n if (args.length === 2) {\n const person = `${args[1].charAt(0).toUpperCase() + args[1].substring(1)} `;\n const insult = await this.solver.getSentence('<pi>').toLowerCase();\n message.channel.send(person + insult);\n Speaker.googleSpeak(person + insult, this.voice, this.volume, connection, Speaker.speak);\n } else {\n const insult = await this.solver.getSentence('<i>');\n message.channel.send(insult);\n Speaker.googleSpeak(insult, this.voice, this.volume, connection, Speaker.speak);\n }\n }", "greet() {\n\t\tconsole.log('hello from the player');\n\t}", "function greet(){\r\n let speech = new SpeechSynthesisUtterance();\r\n speech.lang = \"en-US\";\r\n speech.text = \"Hello I am your Spell Bot, and my name is JACOB!,I want to know your name so please click on below button and enter your name\";\r\n speech.volume = 1;\r\n speech.rate = 1;\r\n speech.pitch = 1;\r\n //Removing heading,which is an instruction,and start button(after clicking)\r\n document.getElementById(\"h3\").remove();\r\n document.getElementById(\"btn\").remove();\r\n //Bot introduces itself(voice)\r\n window.speechSynthesis.speak(speech);\r\n\r\n //enabling the name button\r\n x.disabled = false;\r\n}", "function greet() {\r\n var reply = [this.animal, 'typically sleep between', this.sleepDuration].join(' ');\r\n console.log(reply);\r\n}", "function ladyInteraction () {\n document.getElementById('textarea').innerHTML += lady.reply\n player.items.push(lady.items[0])\n lady.description = \"an old lady with kind eyes. Alice says 'It's nice to see you again, my dear'\"\n lady.repeatInteraction = true\n}", "function tellMe(joke) {\n console.log(\"tell me:\", joke);\n VoiceRSS.speech({\n key: \"3d5ce7cfb8d646b8a9a97344c92f31b0\",\n src: \"let me tell you a JOKE.... \" + joke,\n hl: \"en-us\",\n v: \"Linda\",\n r: 0,\n c: \"mp3\",\n f: \"44khz_16bit_stereo\",\n ssml: false,\n });\n}", "function BOT_standardSwitchToChar(newbotid) {\r\n\tvar newbotobject = eval(newbotid);\r\n\tvar newbottopicid = newbotobject.topicId;\r\n\tvar name = BOT_get(newbottopicid,\"name\",\"VAL\");\r\n\tif(name) {\r\n\t\tBOT_chatboxMainProcess(\"greet \"+name);\r\n\t\tBOT_agentSpeech(); \r\n\t}\r\n}", "function greet() {\n const reply = [this.animal, 'typically sleep between', this.sleepDuration].join(' ');\n console.log(reply);\n}", "function choisir_prochaine_action( sessionId, context, entities ) {\n // ACTION PAR DEFAUT CAR AUCUNE ENTITE DETECTEE\n if(Object.keys(entities).length === 0 && entities.constructor === Object) {\n // Affichage message par defaut : Je n'ai pas compris votre message !\n }\n // PAS DINTENTION DETECTEE\n if(!entities.intent) {\n\n }\n // IL Y A UNE INTENTION DETECTEE : DECOUVRONS LAQUELLE AVEC UN SWITCH\n else {\n switch ( entities.intent && entities.intent[ 0 ].value ) {\n case \"Bonjour\":\n var msg = {\n \"attachment\": {\n \"type\": \"template\",\n \"payload\": {\n \"template_type\": \"generic\",\n \"elements\": [\n {\n \"title\": \"NutriScore\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/nutriscore-good.jpg\",\n \"subtitle\": \"Recherchez ici un produit alimentaire et ses équivalents plus sains.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"❓ Informations\",\n \"payload\": \"INFOS_SUR_LE_NUTRI\"\n },\n\n {\n \"type\": \"postback\",\n \"title\": \"🔍 Rechercher\",\n \"payload\": \"PRODUIT_PLUS_SAIN\"\n },\n {\n \"type\": \"postback\",\n \"title\": \"🍏 Produit + sain\",\n \"payload\": \"ALTERNATIVE_BEST\"\n }\n\n ]\n },\n {\n \"title\": \"Le sucre\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/sucre.jpg\",\n \"subtitle\": \"Connaissez-vous réellement le Sucre ? Percez ici tous ses mystères !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_SUCRE\"\n }\n ]\n },\n {\n \"title\": \"Les aliments\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/aliments.jpg\",\n \"subtitle\": \"Quels aliments contiennent du sucre ? Vous allez être surpris !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ALIMENTS\"\n }\n ]\n },\n {\n \"title\": \"Les additifs\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/additifs.jpg\",\n \"subtitle\": \"C'est quoi un additif ? Où les trouvent-on ?\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ADDITIFS\"\n }\n ]\n },\n {\n \"title\": \"Les nutriments\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/nutriments.jpg\",\n \"subtitle\": \"Eléments indispensables à l'Homme ! Découvrez tous les secrets des nutriments.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_NUTRIMENTS\"\n }\n ]\n },\n {\n \"title\": \"La diététique\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/diet.jpg\",\n \"subtitle\": \"Découvrez ici tous mes conseils concernant la diététique !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_DIETETIQUE\"\n }\n ]\n },\n {\n \"title\": \"L'organisme\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/organisme.jpg\",\n \"subtitle\": \"Ici vous découvrirez tous les secrets concernant votre corps et le sucre !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ORGANISME\"\n }\n ]\n }\n\n\n ]\n }\n }\n };\n var response_text = {\n \"text\": \"PS : Si vous voulez je peux vous proposer des sujets pour débuter :\"\n };\n actions.reset_context( entities, context, sessionId ).then(function() {\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, 'Bonjour '+context.userName+'. Enchanté de faire votre connaissance. Je suis NutriBot, un robot destiné à vous donner des informations sur le sucre, la nutrition et tout particulièrement le Nutriscore : le logo nutritionel de référence permettant de choisir les aliments pour mieux se nourrir au quotidien.').then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.envoyer_message_text(sessionId, context, entities, \"PS : Si vous voulez je peux vous proposer des sujets pour débuter :\").then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.envoyer_message_bouton_generique(sessionId, context, entities, msg);\n })\n })\n })\n })\n })\n })\n break;\n case \"RETOUR_ACCUEIL\":\n // Revenir à l'accueil et changer de texte\n actions.reset_context( entities,context,sessionId ).then(function() {\n actions.choixCategories_retour( sessionId,context );\n })\n break;\n case \"Dire_aurevoir\":\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, \"A bientôt \"+context.userName+\" ! N'hésitez-pas à revenir nous voir très vite !\").then(function() {\n actions.envoyer_message_image( sessionId, context, entities, \"https://mon-chatbot.com/img/byebye.jpg\" );\n })\n })\n break;\n case \"FIRST_USE_OF_TUTO_OK\":\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, \"Bonjour \"+context.userName+\". Je suis NutriBot ! Voici un petit peu d'aide concernant mon fonctionnement !\").then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.afficher_tuto( sessionId,context );\n })\n })\n })\n break;\n case \"Thanks\":\n actions.remerciements(entities,context,sessionId);\n break;\n case \"GO_TO_MENU_DEMARRER\":\n actions.reset_context( entities,context,sessionId ).then(function() {\n actions.choixCategories( sessionId,context );\n })\n break;\n case \"SCAN\":\n actions.ExplicationScan(sessionId,context);\n break;\n\n case \"MANUELLE\":\n actions.envoyer_message_text( sessionId, context, entities, \"Quelle est la marque, le nom ou bien le type de produit que vous souhaitez rechercher ? (Ex : Nutella, Pain de mie, croissant, etc). Je vous écoute :\");\n // then mettre dans le context qu'on est dans recherche manuelle\n break;\n // SIMPLE\n case \"Combien de sucre\":\n actions.go_reste_from_howmuchsugar(entities,context,sessionId);\n break;\n case \"CAT_NUTRIMENTS\":\n actions.go_leg_prot_vital(entities,context,sessionId);\n break;\n case \"Insuline\":\n actions.go_reste_from_insuline(entities,context,sessionId);\n break;\n case \"Betterave\":\n actions.go_legume(entities,context,sessionId);\n break;\n case \"CAT_ORGANISME\":\n actions.go_tout_organisme(entities,context,sessionId);\n break;\n case \"Glucides\":\n actions.go_nutriments(entities,context,sessionId);\n break;\n\n case \"Saccharose\":\n actions.go_glucose_canne_betterave_fructose(entities,context,sessionId);\n break;\n case \"CAT_SUCRE\":\n actions.go_saccharose(entities,context,sessionId);\n break;\n case \"Glucides complexes\":\n actions.go_relance_nutriments_from_glucomplexes(entities,context,sessionId);\n break;\n case \"Index glycémique lent\":\n actions.go_reste_index_lent(entities,context,sessionId);\n break;\n case \"Aliments transformés\":\n actions.go_additifs(entities,context,sessionId);\n break;\n case \"Produit allégé en sucre\":\n actions.go_reste_from_allege(entities,context,sessionId);\n break;\n case \"Nutriments\":\n actions.go_leg_prot_vital(entities,context,sessionId);\n break;\n case \"Besoins\":\n actions.go_reste_from_besoins(entities,context,sessionId);\n break;\n case \"Canne à sucre\":\n actions.go_relance_aliments_from_sugar_canne(entities,context,sessionId);\n break;\n case \"Les sucres\":\n actions.go_amidon_glucides_from_les_sucres(entities,context,sessionId);\n break;\n case \"CAT_DIETETIQUE\":\n actions.go_tout_diet(entities,context,sessionId);\n break;\n case \"Combien de fruits\":\n actions.go_reste_from_howmuchfruits(entities,context,sessionId);\n break;\n case \"Fructose\":\n actions.go_relance_aliments_from_fructose(entities,context,sessionId);\n break;\n case \"Légumes secs\":\n actions.go_prot(entities,context,sessionId);\n break;\n case \"ASTUCE\":\n actions.astuces(entities,context,sessionId);\n break;\n case \"Index glycémique rapide\":\n actions.go_reste_index_rapide(entities,context,sessionId);\n break;\n case \"Apports\":\n actions.go_reste_from_apports(entities,context,sessionId);\n break;\n case \"Aliments\":\n actions.go_aliments_alitransfo(entities,context,sessionId);\n break;\n case \"Produit vital\":\n actions.go_relance_from_vital(entities,context,sessionId);\n break;\n case \"Trop de sucre\":\n actions.go_reste_from_toomuchsugar(entities,context,sessionId);\n break;\n case \"Calorie ou Kcal\":\n actions.go_reste_kcal(entities,context,sessionId);\n break;\n case \"Sucre simple ou sucre rapide\":\n actions.go_reste_sucre_rapide_lent(entities,context,sessionId);\n break;\n case \"CAT_ADDITIFS\":\n actions.go_amidon_glucides(entities,context,sessionId);\n break;\n case \"Amidon\":\n actions.go_glucides_glucomplexes(entities,context,sessionId);\n break;\n case \"Protéines\":\n actions.go_vital(entities,context,sessionId);\n break;\n case \"Légume\":\n actions.go_relance_aliments_from_legume(entities,context,sessionId);\n break;\n case \"Pancréas\":\n actions.go_reste_from_pancreas(entities,context,sessionId);\n break;\n case \"Alimentation équilibrée\":\n actions.go_reste_from_alimentation_equ(entities,context,sessionId);\n break;\n case \"Glucose\":\n actions.go_relance(entities,context,sessionId);\n break;\n case \"Morceau de sucre\":\n actions.go_reste_from_morceau(entities,context,sessionId);\n break;\n case \"Composition\":\n actions.go_alitransfo(entities,context,sessionId);\n break;\n case \"Additifs\":\n actions.go_amidon_glucides(entities,context,sessionId);\n break;\n case \"CAT_ALIMENTS\":\n actions.go_aliments_alitransfo(entities,context,sessionId);\n break;\n // RESTE COMPLEXE\n case \"PRODUIT_PLUS_SAIN\":\n var element = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\":\"Utilisez le formulaire ci-dessous et obtenez toutes les informations nécessaires au sujet d'un produit alimentaire ou bien scannez directement un code barre.\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"messenger_extensions\": true,\n \"url\":\"https://mon-chatbot.com/nutribot2018/recherche.html\",\n \"title\":\"Rechercher\"\n },\n {\n \"type\":\"postback\",\n \"title\":\"Scanner\",\n \"payload\":\"SCANSCANSCAN\"\n }\n ]\n }\n }\n };\n sessions[sessionId].recherche = 'normale';\n actions.envoyer_message_bouton_generique( sessionId, context, entities, element);\n break;\n case \"ALTERNATIVE_BEST\":\n var element = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\":\"Recherchez ici un produit alimentaire et ses équivalents plus sains.\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"messenger_extensions\": true,\n \"url\":\"https://mon-chatbot.com/nutribot2018/recherche.html\",\n \"title\":\"Rechercher\"\n }\n ]\n }\n }\n };\n sessions[sessionId].recherche = 'autre';\n actions.envoyer_message_bouton_generique( sessionId, context, entities, element);\n break;\n case \"Rechercher_un_produit\":\n actions.queryManuelleSearch2(entities,context,sessionId);\n break;\n case \"INFOS_SUR_LE_NUTRI\":\n actions.afficher_infos_nutriscore(entities,context,sessionId);\n break;\n case \"SCANSCANSCAN\":\n actions.afficher_infos_nutriscore(entities,context,sessionId);\n break;\n case \"AstuceAstuce\":\n actions.astuces( sessionId,context );\n break;\n case \"ByeByeBye\":\n actions.byebye( sessionId,context );\n break;\n\n case \"GENESE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Glycémie\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"RECHERCHE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n\n case \"SPECIFICSPECIFIC\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Insultes\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Sucre\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n\n case \"TAPER\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"AUTRE_AUTRE_AUTRE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n };\n }\n}", "async onAction(msg, nlp){\n switch(nlp.action[1]){\n\n case \"joke\":\n this.joke(msg)\n break;\n\n case \"chuck\":\n this.chuck(msg)\n break;\n\n default:\n return\n }\n }", "function run() {\n const reply = createFootnoteWithText_('Aha!', 1);\n console.log(JSON.stringify(reply, null, ' '));\n}", "function BOT_reqSay (success,emote,reason,arg1,arg2,arg3) { \r\n\tBOT_reqSuccess = success;\r\n\tBOT_reqEmote = emote;\r\n\tvar short = \"\";\r\n\tvar long = \"\";\r\n\tswitch (reason) { \r\n \tcase \"ATTRIBUTENOTFOUND\": \r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found no attribute \"+arg2+\" for \"+BOT_expressTopic(arg1); \r\n\t\tbreak;\r\n\tcase \"ACTIONNOTFOUND\": \r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found no action \"+arg2+\" for \"+BOT_expressTopic(arg1); \r\n\t\tbreak;\r\n \tcase \"TAGNOTFOUND\":\r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found nothing for \"+arg2+\" for \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\t case \"FEELINGNOTFOUND\": \r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found no feeling \"+arg2+\" for \"+BOT_expressTopic(arg1); \r\n\t\tbreak;\r\n\tcase \"RELATIONFOUND\": \r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found no relation \"+arg2+\" for \"+BOT_expressTopic(arg1); \r\n\t\tbreak;\r\n\tcase \"NEEDSATTTRIBUTE\":\r\n\t\tshort += \"No attribute\";\r\n\t\tlong += \"Command '\"+BOT_theReqPerformative + \"' needs an attribute name\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"ATTRIBUTELIST\");\r\n\t\tbreak;\r\n\tcase \"NEEDSACTION\":\r\n\t\tshort += \"No action\";\r\n\t\tlong += \"Command '\"+BOT_theReqPerformative + \"' needs an action name\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"ACTIONLIST\");\r\n\t\tbreak;\r\n\tcase \"BADATTTRIBUTE\":\r\n\t\tshort += \"Bad attribute\";\r\n\t\tlong += \"May be \" + arg1 + \" is not an attribute name\"; \r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"ATTRIBUTELIST\");\r\n\t\tbreak;\r\n\tcase \"BADACTION\":\r\n\t\tshort += \"Bad action\";\r\n\t\tlong += \"May be \" + arg1 + \" is not an action name\"; \r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"ACTIONLIST\");\r\n\t\tbreak;\r\n\tcase \"BADAGENT\":\r\n\t\tshort += \"Bad agent\";\r\n\t\tlong += \"May be \" + arg1 + \" is not an agent name\"; \r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"AGENTTLIST\");\r\n\t\tbreak;\r\n\t case \"TELLRESULT\": // managed by ask, how\r\n\t\tshort += arg3;\r\n\t\tlong += arg3; \r\n\t\tbreak;\r\n\tcase \"THANKYOU\":\r\n\t\tshort += \"Thanks\";\r\n\t\tlong += \"Thank you very much\";\r\n\t\tbreak;\r\n\tcase \"USERLIKEREMEMBER\":\r\n\t\tshort += \"I learn your liking\";\r\n\t\tlong += \"Thank you very much! I will remember that you like \"+BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"USERDISLIKEREMEMBER\":\r\n\t\tshort += \"I learn your disliking\";\r\n\t\tlong += \"I will remember that you don't like \"+BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"HEU\":\r\n\t\tshort += \"Heu..\";\r\n\t\tlong += \"Heu, I am not sure about \"+ arg1;\r\n break;\r\n\tcase \"GOODNEWS\":\r\n\t\tshort += \"Fine\";\r\n\t\tlong += \"I am happy to hear that\";\r\n break;\r\n\tcase \"BADNEWS\":\r\n\t\tshort += \"Too bad\";\r\n\t\tlong += \"I am sad to hear that\";\r\n\t\tbreak;\r\n\tcase \"MAKESMEHAPPY\":\r\n\t\tshort += \"Makes me happy\";\r\n\t\tlong += \"Now, that makes me feel happy\";\r\n\t\tbreak;\r\n\tcase \"MAKESMESAD\":\r\n\t\tshort += \"Makes me sad\";\r\n\t\tlong += \"That makes me sad suddenly\";\r\n\t\tbreak;\r\n\tcase \"YOUAREIRONIC\":\r\n\t\tshort += \"Its ironic\";\r\n\t\tlong += \"I am a bit puzzled because I think that you are being ironic\";\r\n\t\tbreak;\r\n\tcase \"PING\":\r\n\t\tshort += \"Hi\";\r\n\t\tlong += \"Yes, I am here\";\r\n\t\tbreak;\r\n\tcase \"HELLO\":\r\n\t\tshort += \"Hi\";\r\n\t\tlong += \"Hello, I am here\";\r\n\t\tbreak;\r\n\tcase \"HELLONAME\":\r\n\t\tshort += \"Hi\";\r\n\t\tlong += \"Hello, I am \"+arg1;\r\n\t\tbreak;\r\n\tcase \"TOPICCANTDOACTION\":\r\n\t\tshort += \"Can't do it\";\r\n\t\tlong += \"It is not possible to perform action \"+arg1+ \" with \"+BOT_expressTopic(arg2) ;\r\n break;\r\n case \"DONE\":\r\n\t\tshort += \"Done\";\r\n\t\tlong += \"Action \"+arg1+ \" has been successfully executed\";\r\n\t\tbreak;\r\n\tcase \"DONEWITHREPLY\": // when an action returns a string its is replied\r\n\t\tshort += arg1;\r\n\t\tlong += \"the answer is: \"+arg1;\r\n\t\tbreak;\r\n\tcase \"DONTREMEMBERLASTACTION\":\r\n\t\tshort += \"Don't know how\";\r\n\t\tlong += \"I don't remember last performed action\";\r\n\t\tbreak;\r\n\tcase \"CANTUNDO\":\r\n\t\tshort += \"Can't undo\";\r\n\t\tlong += \"I am confused with topic \"+ BOT_topicToName(arg2) + \", so I can't undo action \"+arg1;\r\n\t\tbreak;\r\n\tcase \"NEEDSEXECUTEBEFORE\":\r\n\t\tshort += \"Previous command is not 'x'\";\r\n\t\tlong += \"Sorry, to do that previous command must be 'execute'\";\r\n\t\tbreak;\r\n\tcase \"USERQUITS\":\r\n\t\tshort += \"Bye\";\r\n\t\tlong += \"Now this session is terminated. Bye Bye ...\";\r\n\t\tbreak;\r\n\tcase \"USERSAIDNO\":\r\n\t\tshort += \"Ok no\";\r\n\t\tlong += \"Hem, you said no...\";\r\n\t\tbreak;\r\n\tcase \"USERSAIDYES\":\r\n\t\tshort += \"Ok yes\";\r\n\t\tlong += \"Hem, you said no...\";\r\n\t\tbreak;\r\n\tcase \"CONFIRMYESNO\":\r\n\t\tshort += \"Confirm by yes or no\";\r\n\t\tlong += \"Hem, are you sure about that? just say Yes or No\";\r\n\t\tbreak;\r\n\tcase \"CONFUSEDINDIALOG\":\r\n\t\tshort += \"I am lost\";\r\n\t\tlong += \"Hem, Somehow, I got confused in the dialog. Can we start again?\";\r\n\t\tbreak;\r\n\tcase \"VALUENEEDED\":\r\n\t\tshort += \"Value needed\";\r\n\t\tlong += \"Yous should have provide an information\";\r\n\t\tbreak;\r\n\tcase \"NONREQUIREDVALUE\":\r\n\t\tshort += \"Not required\";\r\n\t\tlong += \"You said \"+arg1+\" but I don't know what to do about it\";\r\n\t\tbreak;\r\n\tcase \"TELLWHY\":\r\n\t\tshort += arg3;\r\n\t\tlong += \"Here is my best educated guess: \"+ arg3;\r\n\t\tbreak;\r\n\tcase \"DONTKNOWWHY\":\r\n\t\tshort += \"Don't know why\";\r\n\t\tlong += \"I don't know the reason why \"+BOT_expressTopicAttribute(arg1,arg2)+\" is like that\";\r\n\t\tbreak;\r\n\tcase \"CANTSAYWHY\":\r\n\t\tshort += \"Can't say why\";\r\n\t\tlong += \"I m sorry, I really can't say why things are like that\";\r\n\t\tbreak;\r\n\tcase \"DONTKNOWHOW\":\r\n\t\tshort += \"Don't know how to do\";\r\n\t\tlong += \"I don't know how one can perform action \"+arg1;\r\n\t\tbreak;\r\n\tcase \"CANTSAYHOW\":\r\n\t\tshort += \"Can't say how\";\r\n\t\tlong += \"I m sorry, I really can't answer upon how things should be carried out\";\r\n\t\tbreak;\r\n\tcase \"FACTSTORED\":\r\n\t\tshort += \"Fact learned\";\r\n\t\tlong += \"Thank you, I will remember that the \"+arg1+\" is \"+arg3;\r\n\t\tbreak;\r\n\tcase \"BADFACTFORMAT\":\r\n\t\tshort += \"Bad fact format\";\r\n\t\tlong += \"This command needs a fact of the form: [topic] attribute is value\";\r\n\t\tbreak;\r\n\tcase \"NOFACTSABOUTBOT\":\r\n\t\tshort += \"I Don't care\";\r\n\t\tlong += \"That's no use telling facts about ME!\";\r\n\t\tbreak;\r\n\tcase \"FACTVERIFIED\":\r\n\t\tshort += \"True\";\r\n\t\tlong += \"This fact is true\";\r\n\t\tbreak;\r\n\tcase \"FACTNOTVERIFIED\":\r\n\t\tshort += \"False\";\r\n\t\tlong += \"This fact is false\";\r\n\t\tbreak;\r\n\tcase \"NOEXTENSIONSYET\":\r\n\t\tshort += \"No extensions\";\r\n\t\tlong += \"Sorry, language extensions are not yet available\";\r\n\t\tbreak;\r\n\tcase \"KNOWTOPIC\":\r\n\t\tshort += \"I know about it\";\r\n\t\tlong += \"I am happy to say that I know \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\tcase \"DONTKNOWTOPIC\":\r\n\t\tshort += \"I dont know about it\";\r\n\t\tlong += \"I am happy to say that I know nothing about \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\tcase \"KNOWATTRIBUTE\":\r\n\t\tshort += \"I know about it\";\r\n\t\tlong += \"I am happy to say that I know about \"+ BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"DONTKNOWATTRIBUTE\":\r\n\t\tshort += \"I don't know about it\";\r\n\t\tlong += \"I am sorry to say that I don't know about \"+ BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"KNOWACTION\":\r\n\t\tshort += \"I know it\";\r\n\t\tlong += \"I am happy to say that I know about action \"+arg1+\" for \"+ BOT_expressTopic(arg2);\r\n\t\tbreak;\r\n\tcase \"DONTKNOWACTION\":\r\n\t\tshort += \"I don't know about it\";\r\n\t\tlong += \"I am sorry to say that I don't know any action \"+arg1+\" for \" +BOT_expressTopic(arg2);\r\n\t\tbreak;\r\n\tcase \"COMMANDNEEDSARGUMENT\":\r\n\t\tshort += \"Needs more\";\r\n\t\tlong += \"I am sorry to say that command '\"+arg1+\"' needs more information. For example: \"+arg2;\r\n\t\tbreak;\r\n\tcase \"BADFEELING\":\r\n\t\tshort += \"Bad feeling\";\r\n\t\tlong += \"May be \"+arg1+\" is not a known feeling\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"FEELINGLIST\");\r\n\t\tbreak;\r\n\tcase \"NOFEELING\":\r\n\t\tshort += \"No feeling\";\r\n\t\tlong += \"Sorry to say that command 'f' needs a feeling name\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"FEELINGLIST\");\r\n\t\tbreak;\r\n\tcase \"USERPOSITIVENEWS\":\r\n\t\tshort += \"Good for you\";\r\n\t\tlong += \"I am such happy to hear that about you\";\r\n\t\tbreak;\r\n\tcase \"USERNEGATIVENEWS\":\r\n\t\tshort += \"Bad for you\";\r\n\t\tlong += \"I am very sorry to hear that about you\";\r\n\t\tbreak;\r\n\tcase \"CONFIRM\":\r\n\t\tshort += \"Yes\";\r\n\t\tlong += \"Yes! Certainly\";\r\n\t\tbreak;\r\n\tcase \"CONTRADICT\":\r\n\t\tshort += \"No\";\r\n\t\tlong += \"No! On the contrary\";\r\n\t\tbreak;\r\n\tcase \"NOTPARTICULARLY\":\r\n\t\tshort += \"Not really\";\r\n\t\tlong += \"Well yes but not particularly ...\";\r\n\t\tbreak;\r\n\tcase \"BADJUDGEMENTWORD\":\r\n\t\tshort += \"Bad judgement word\";\r\n\t\tlong += \"May be \"+arg1+\" is not a known judgement word\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"JUDGEMENTLIST\");\r\n\t\tbreak;\r\n\tcase \"NOJUDGEMENTWORD\":\r\n\t\tshort += \"No judgement\";\r\n\t\tlong += \"You should provide a judgement word for command 'j'\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"JUDGEMENTLIST\");\r\n\t\tbreak;\r\n\tcase \"NOUSERJUDGEMENT\":\r\n\t\tshort += \"Not handled\";\r\n\t\tlong += \"Sorry there is no support for handling user's judjements\";\r\n\t\tbreak;\r\n\tcase \"USERREPEATJUDGEMENT\":\r\n\t\tshort += \"Judgement repeated\";\r\n\t\tlong += \"You have just repeated the same judgement on \"+ BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"USERCHANGEJUDGEMENT\":\r\n\t\tshort += \"Judgement reversed\";\r\n\t\tlong += \"I note that you have changed your mind about \" + BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"USERNEWPOSITIVEJUDGEMENT\":\r\n\t\tshort += \"I learn your positive judgement\";\r\n\t\tlong += \"I am happy to hear and bear in mind your positive judgement on \" + BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"USERNEWNEGATIVEJUDGEMENT\":\r\n\t\tshort += \"I learn your negative judgement\";\r\n\t\tlong += \"I am sorry to hear and bear in mind your negative judgement on \" + BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"THANKSFORSUGGESTION\":\r\n\t\tshort += \"Suggestion granted\";\r\n\t\tlong += \"I thank you for your suggestion to do action \" + arg1 +\", I will use this advice\";\r\n\t\tbreak;\r\n\tcase \"TAKEOBJECTION\":\r\n\t\tshort += \"Objection taken\";\r\n\t\tlong += \"I will take your objection not to do action \" + arg1;\r\n\t\tbreak;\r\n\tcase \"TAKEINTENTION\":\r\n\t\tshort += \"Intention taken\";\r\n\t\tlong += \"Ok I take notice of your intention to do action \" + arg1;\r\n\t\tbreak;\r\n\tcase \"ACTIONPOSSIBLE\":\r\n\t\tshort += \"It is possible\";\r\n\t\tlong += \"Yes, action \"+arg2+\" is possible with \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\tcase \"ACTIONIMPOSSIBLE\":\r\n\t\tshort += \"Not possible\";\r\n\t\tlong += \"Sorry but action \"+arg2+\" is possible with \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\tcase \"NYI\":\r\n\t\tshort += \"Not yet available\";\r\n\t\tlong += \"I am sorry to say that command '\"+arg1+\"' is not yet available\";\r\n\t\tbreak;\r\n\tcase \"UNKNOWNERROR\":\r\n\t\tshort += \"Error\";\r\n\t\tlong += \"I am confused because of some inside error...\";\r\n\t\tbreak;\r\n \tdefault: alert(\"ERROR: BOT_reqSay\"); break;\r\n\t}\r\n\tBOT_reqFilled = true;\r\n\tBOT_reqAnswerShort = short;\r\n\tBOT_reqAnswerLong = long;\r\n\treturn success\r\n}", "function sendGame(bot) {\n bot.say(\"markdown\", \"These are the lists of games I have: \", '\\n\\n ' +\n '1. **Snake** (single player) \\n' +\n '2. **Skribbl** (multi-player) \\n' +\n '3. **Cards** (multi-player) \\n' +\n '4. **Shooting Games** (single and multi-player) \\n\\n' +\n 'If you have any suggestions to our game pool, please contact us. We appreciate it!'\n );\n}", "execute(message,args){\n // bot replys with an emoji message\n message.channel.send(\":eyes:\" );\n }", "function myOnlyBot (email) {\n email.reply('hi!!! I AM ALIVE!!! did you just say ' + email.text)\n}", "poem(message, connection, args) {\n if (args.length !== 2) {\n message.reply('Format is !sno poem |Poem Name|');\n Speaker.googleSpeak('Wrong!', this.voice, this.volume, connection, Speaker.speak);\n return;\n }\n // Would check here for which poem to grab\n if (args[1].toLowerCase() === 'POEM-NAME') {\n const POEM = '';\n message.channel.send(POEM);\n Speaker.googleSpeak(POEM, this.voice, this.volume, connection, Speaker.speak);\n } else {\n message.reply('Format is !sno poem |Kevin/Seva|');\n Speaker.googleSpeak('Wrong!', this.voice, this.volume, connection, Speaker.speak);\n }\n }", "function speak(){\r\n return \"MEOW!\";\r\n}", "function BOT_onWhy() {\r\n\tvar why;\r\n\tif(BOT_theReqAttribute) {\r\n\t\twhy = BOT_get(BOT_theReqTopic,BOT_theReqAttribute,\"WHY\");\r\n\t\tif (why) BOT_reqSay(true,\"HAPPY\",\"TELLWHY\",BOT_theReqAttribute,BOT_theReqTopic,why);\r\n\t\telse BOT_reqSay(false,\"SORRY\",\"DONTKNOWWHY\",BOT_theReqTopic,BOT_theReqAttribute); \r\n\t}\r\n\telse if(BOT_theLastAttribute) { // often when ask is followed by why without args\r\n\t\tBOT_traceString += \"LAST TOPIC \" + BOT_theReqTopic + \"\\n\";\r\n\t\tBOT_traceString += \"LAST ATTRIB \" + BOT_theLastAttribute + \"\\n\";\r\n\t\twhy = BOT_get(BOT_theReqTopic,BOT_theLastAttribute,\"WHY\");\r\n\t\tif (why) BOT_reqSay(true,\"HAPPY\",\"TELLWHY\",BOT_theReqTopic,BOT_theLastAttribute,why);\r\n\t\telse BOT_reqSay(false,\"SORRY\",\"DONTKNOWWHY\",BOT_theReqTopic,BOT_theLastAttribute); \r\n\t}\r\n\telse BOT_reqSay(false,\"SORRY\",\"CANTSAYWHY\"); \r\n}", "function chatbotResponse() {\n talking = false;\n botMessage = \"I'm confused\"; //the default message\n\n if (lastUserMessage === 'hi' || lastUserMessage =='hello') {\n const hi = ['hi','howdy','hello']\n botMessage = hi[Math.floor(Math.random()*(hi.length))];;\n }\n\n if (lastUserMessage === 'name') {\n botMessage = 'My name is ' + botName;\n }\n\t if (lastUserMessage === 'What\\'s up?') {\n botMessage = 'Nothing much Rahul.';\n }\n}", "function advanceTalk(pic, text) //selects the avatar of who speaking and the dialogue that will be said.\n{\n\t//ai, \\'Hello, I am this ships onboard AI\\'\n\t\n\tif(advanceTalkCounter===1)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('Hello, I am this ships onboard AI');\n\t\tadvanceTalkCounter++;\n\t}\n\t\n\telse if(advanceTalkCounter===2)\n\t{\n\t\tcharacterPic(avatarPic);\n\t\ttextDisplay('How did i get here?');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===3)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('You were placed in stasis 300 years ago to perserve your body for your return to Earth');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===4)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('You were awoken when we reached the edge of the Milky Way.');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===5)\n\t{\n\t\tcharacterPic(avatarPic);\n\t\ttextDisplay('Why wasnt i awoken when we reached Earth?');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===6)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('Theres a problem with the ship, a hostile ship attacked us in the previous galaxy and a number of systems have been damaged.');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===7)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('You are going to need to beam down to a few planets to gather supplies to fix the ship.');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===8)\n\t{\n\t\tcharacterPic(avatarPic);\n\t\ttextDisplay('Gather parts, I don\\'t even remember what I\\'m doing on this ship');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===9)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('My access to that information is restricted, perhaps there is some data on one of the ships computer terminals');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===10)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('The ship has just arrived at Dakara. You will need to beam down and retrieve a new power core. The Dakarans will not part with one too easily, perhaps there is something you can find on the ship to trade with.');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===11)\n\t{\n\t\tcharacterPic(avatarPic);\n\t\ttextDisplay('On the planet how do I beam back up to the ship?');\n\t\tadvanceTalkCounter++;\n\t}\n\telse if(advanceTalkCounter===12)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('You will need to return to the location of where you where beamed down.');\n\t\tadvanceTalkCounter++;\n\t}\n\t\n\telse if(advanceTalkCounter===13)\n\t{\n\t\tcharacterPic('ai');\n\t\ttextDisplay('Good Luck');\n\t\tadvanceTalkCounter++;\n\t\tgameShip(); //start game on the ship\n\t\t\n\t}\n\t//number jump due to deleted dialogue\n\telse if(advanceTalkCounter===498)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\t//ship exploration dialogue\n\telse if(advanceTalkCounter===500)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('There is nothing of interest here');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===502)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('There is a computer in the center of the room, it\\'s files may be accessed.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===504)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Most of this computers files have been damaged the only ones i can access for you are about the ships journey');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===505)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('This ship was launched from earth 300 years ago with the goal of discovering inhabitable worlds outside our galaxy. This ship was one of many launched.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===506)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Each ship carried a crew of 500, Most were kept in stasis to carry out the mission when those awake passed away.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===507)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('For over 200 years the ships explored the galaxies around the Milky Way, by this time the crews of many ships were down to only 50 crew members in stasis.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===508)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('At this time we began to lose contact with the ships furthest out. For the next 50 years more and more ships dropped off the grid with no explanation.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===509)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Finally a ship got off a transmission before it dropped off, it warned of a great enemy whose technology far outpowered our own, and they seemed bent on total destruction.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===510)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Too far out to warn earth, our final five ships formed a convoy and headed toward earth.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===511)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('On the edge of the Pegasus Galaxy, they caught up to us. Two giant warships bearing down, we gave it all we could, we managed to destroy 1 but 4 of our ships were destroyed. In a desperate measure the remaining crew of this ship boarded fighters and commited a suicide run aganist the enemy');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===512)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('This ship was heavily damaged but they managed to destroy the enemy ship. You are the only crew member remaining, and without our long range communications you must get back to earth to warn them.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===514)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('There appears to be a crate of medicine in the corner. Perhaps this could be used as a trade with some locals.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\t\n\telse if(advanceTalkCounter===516)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I can\\'t teleport off the ship from here. I need to be in the embarkation room.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===518)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('If I\\'m ready i can teleport to Dakara now.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===520)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('I suggest you explore the entire ship before you beam down to Dakara');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===521)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('This ship is very large, unfortunately you cant access most areas due to the damage.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===522)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Time is of the importance');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===523)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('I have nothing else to say currently');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\t//dakara dialogue\n\telse if(advanceTalkCounter===600)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Hello.... Anybody here?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===601)\n\t{\n\t\tcharacterPic2('telc');\n\t\ttextDisplay2('Stop! Don\\'t come any closer, there is a great sickness here.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===602)\n\t{\n\t\tif(medicine===true)\n\t\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I have medicine I\\'d be willing to trade.');\n\t\tadvanceTalkCounter++;\n\t\t}\n\t\telse\n\t\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Perhaps there is medicine on my ship.');\n\t\t}\n\t\t\n\t\t\n\t}\n\telse if(advanceTalkCounter===603)\n\t{\n\t\tcharacterPic2('telc');\n\t\ttextDisplay2('Trade for what?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===604)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I need a new power core for my ship, it was damaged in battle.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===605)\n\t{\n\t\tcharacterPic2('telc');\n\t\ttextDisplay2('The men in the ruins can help you. Tell them Tel\\'c sent you and that i approve the trade.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===606)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you very much.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===607)\n\t{\n\t\tcharacterPic2('telc');\n\t\ttextDisplay2('If the enemy that attacked your ship is who think, it would be wise of you to talk to the priest in the temple.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===608)\n\t{\n\t\tcharacterPic2('telc');\n\t\ttextDisplay2('He has knowlege that may be interesting to you.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===609)\n\t{\n\t\tcharacterPic2('telc');\n\t\ttextDisplay2('Also you may want to seach around, we have lots of extra gold that people on other planets may be willing to trade for.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===612)\n\t{\n\t\tcharacterPic2('bratak');\n\t\ttextDisplay2('Hello. How can i help you?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===613)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Tel\\'c told me you could tell me about the great enemy.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===614)\n\t{\n\t\tcharacterPic2('bratak');\n\t\ttextDisplay2('A long time ago the galaxies were ruled by a ferocious race called the Wraith. They dominated through fear, feasting on the populations of world for food.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===615)\n\t{\n\t\tcharacterPic2('bratak');\n\t\ttextDisplay2('They leave just enough of a worlds population alive to allow them to reproduce and move on to the next planet. Once the have attacked all the worlds they retreat back to outer galaxies and wait for the populations to get high enough again.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===616)\n\t{\n\t\tcharacterPic2('bratak');\n\t\ttextDisplay2('This cycle has gone on for thousands and thousands of years. But this is the first time the Wraith have ever made it to the Milky Way. There must not have enough food in the other galaxies to feed them');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===617)\n\t{\n\t\tcharacterPic2('bratak');\n\t\ttextDisplay2('If your planet can mount any sort of defense you should get back and warn them as soon as possible.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===618)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you for everything.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===619)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===621)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('If I\\'m ready I can beam up to the ship');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===625)\n\t{\n\t\tcharacterPic2('daniel');\n\t\ttextDisplay2('Stop right there');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===626)\n\t{\n\t\tcharacterPic2('vala');\n\t\ttextDisplay2('Who are you?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===627)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Whoah, don\\'t shoot! Teal\\'c told me I could come here to trade.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===628)\n\t{\n\t\tcharacterPic2('daniel2');\n\t\ttextDisplay2('What do you have to trade?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===629)\n\t{\n\t\tcharacterPic2('vala');\n\t\ttextDisplay2('And for what?');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===630)\n\t{\n\t\tif(medicine===true)\n\t\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I have medicine I\\'d be willing to trade.');\n\t\tadvanceTalkCounter++;\n\t\t}\n\t\telse\n\t\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Perhaps there is medicine on my ship.');\n\t\t}\n\t\t\n\t}\n\telse if(advanceTalkCounter===631)\n\t{\n\t\tcharacterPic2('vala');\n\t\ttextDisplay2('There is great sickness here, you couldn\\'t have come at a better time.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===632)\n\t{\n\t\tcharacterPic2('daniel2');\n\t\ttextDisplay2('These power cores are very valuble, you better have alot of medicine.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===633)\n\t{\n\t\tcharacterPic2('vala');\n\t\ttextDisplay2('Daniel cut it out, give him the power core, we need to get the medicine to the people.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===634)\n\t{\n\t\tcharacterPic2('daniel2');\n\t\ttextDisplay2('Here you go, thank you for the medicine.');\n\t\tadvanceTalkCounter++;\n\t\tpowerCore=true;\n\t\t\n\t}\n\telse if(advanceTalkCounter===635)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you. I hope your people recover quickly.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===636)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===650)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I already picked up the item from here');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===652)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('There appears to be a chest of gold here');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===690)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I can\\'t teleport to the ship from here, i need to be in the village');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\t//transport back to ship and orilla dialogue\n\telse if(advanceTalkCounter===700)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Welcome back aboard, i see you have retrieved a new power core, bring it over to the console.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===701)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Next up on our part list is a new hyperdrive, the current one will probably only last for one more jump.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===702)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Luckily there is a planet that might be able to help that we should reach before the drive fails');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===703)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('I hope you found something on Dakara that you can use to trade with, because once we jump there is no coming back here.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===704)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('If you are ready to engage the hyperdrive go to the control room.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===705)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===707)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('If I\\'m ready i can teleport to Orilla now.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===710)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('The ship has arrived at Orilla. As I feared the hyperdrive has failed. If you can\\'t secure a new one, we\\'re not going anywhere.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===711)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('The indigenious population of Orilla are the Asgard, they are a highly advanced civilization.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===712)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('When you\\'re ready, beam down to the planet.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===714)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('You can\\'t engage the hyperdrive at this time.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===718)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I can beam down to Orilla if I\\'m ready.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===720)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('Hello traveler, I am Thor of the Asgard. Welcome to Orilla');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===721)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I need a new hyperdrive for my ship, I must get back to my planet to warn them of the coming Wraith attack.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===722)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('The wraith have never been a problem for us. As for the hyperdrive you must talk to the council about that.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===723)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Why have the Wraith never been a problem for you?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===724)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('We are technologically superior to them. Past that I can\\'t tell you anymore, you would need to talk to the council.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===725)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you, i will go to the council now.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\t\n\telse if(advanceTalkCounter===727)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Hello, I am a traveler who needs a new hyperdrive to reach my planet to warn them before the Wraith arrive.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===728)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('Yes, Thor told us you would be coming.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===729)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('So, are you willing to help?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===730)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('That has not yet been decided.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===731)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Why not? I must warn my people!');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===732)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('The Asgard do not part with the technology lightly, our technological advantage is all that we have.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===731)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Why not? I must warn my people!');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===732)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('The Asgard do not part with the technology lightly, our technological advantage is all that we have.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===733)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Well while you think it over, can you tell me why you never worry about the Wraith?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===734)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('The Asgard and the Wraith first met over 3 centuries ago. They outnumbered us 100 to 1. We tried to negotiate a truce, but all the wanted was war.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===735)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('In the inital years of the war things went very badly, our ships were more powerfull but the enemy numbers were too great.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===736)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('We had our fleet spread out trying to defend the galaxies from the Wraith.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===737)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('A single Asgard ship was a match for five Wraith ships. But because we tried defending so many planets we could only spare one to ships per planet.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===738)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('The wraith would send ten ships to every planet we defended. There was nothing we could do. We were losing ships and the war rapidly.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===739)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('We made the only decision we could, we fell back to our five core worlds. We developed advanced defense satelites and even more power ships.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===740)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('When the Wraith came for us, we were ready. The battle lasted months, at the end, we had destroyed over 1,000 wraith ships, and suffered no major casualties.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===741)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('The Wraith came again and again for over 100 years before deciding we weren\\'t worth it. We have lived free of fear from the wraith for over a century now.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===742)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('So you see, even if you could defend againist the first wave you never could never win. ');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===743)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Then help us, send ships and some satelites and help defend Earth! ');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===744)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('That is a decision the entire council must make, if we decide to help our ships will arrive at earth when they are needed. ');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===745)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('For now, you may purchase a hyperdrive from us. Go to the shipyard and talk to Loki, we will let him know your\\'e coming. ');\n\t\tadvanceTalkCounter++;\n\t\tcouncilApprove=true;\n\t\tcouncilTalk=true;\n\t}\n\telse if(advanceTalkCounter===746)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===748)\n\t{\n\t\tcharacterPic2('archon');\n\t\ttextDisplay2('We have not reached a decision yet.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===749)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===751)\n\t{\n\t\tcharacterPic2('loki');\n\t\ttextDisplay2('I can\\'t sell you a hyperdrive without the council\\'s approval.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===752)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===754)\n\t{\n\t\tcharacterPic2('loki');\n\t\ttextDisplay2('The council has approved the purchase of a new hyperdrive. You better have the gold to pay for it, otherwise you will be stranded here forever.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===755)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\tif((goldChest || goldChest2) === true)\n\t\t{\n\t\ttextDisplay2('Yes i have the money to pay for it');\n\t\tadvanceTalkCounter++;\n\t\t}\n\t\telse\n\t\t{\n\t\ttextDisplay2('Shit! Well I guess im trapped here, what\\'s good to eat?');\n\t\t}\n\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===756)\n\t{\n\t\tcharacterPic2('loki');\n\t\ttextDisplay2('Good here you go.');\n\t\tnewhyperdrive=true;\n\t\tif((goldChest && goldChest2)===true)\n\t\t{\n\t\t goldChest=false;\n\t\t}\n\t\telse if(goldChest === false && goldChest2===true)\n\t\t{\n\t\t goldChest2=false;\n\t\t}\n\t\telse if(goldChest === true && goldChest2===false)\n\t\t{\n\t\t goldChest=false;\n\t\t}\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===757)\n\t{\n\t\tcharacterPic2('loki');\n\t\ttextDisplay2('If you have any more gold, i could be sell you advanced Asgard Beam Weapons for your ship if you don\\'t tell anyone.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===758)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\tif((goldChest || goldChest2)===true)\n\t\t{\n\t\ttextDisplay2('I have more gold, please sell me the weapon system.');\n\t\tasgardWeapons=true;\n\t\t}\n\t\telse\n\t\t{\n\t\ttextDisplay2('Sorry, no more gold. Thanks for the offer though.');\n\t\t}\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===759)\n\t{\n\t\tcharacterPic2('loki');\n\t\tif(asgardWeapons===true)\n\t\t{\n\t\ttextDisplay2('Here you go.');\n\t\t}\n\t\telse\n\t\t{\n\t\ttextDisplay2('Oh well, have a good one.');\n\t\t}\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===760)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===790)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I can\\'t beam to the ship from here, i need to be in the city.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\t//transport back to ship and abydos dialogue\n\telse if(advanceTalkCounter===800)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Welcome back aboard, i see you have retrieved a new hyperdrive, bring it over to the console.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===801)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('The air filtration system failed while you were dwon on Orilla, without a new one I fear you will not survive the journey to earth.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===802)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Luckily there is a planet nearby that should have what we need to repair it.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===803)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('These people are very simple, they will not have it to trade for, you will need to search for it yourself. Luckily you don\\'t need to find anything to trade with on Orilla.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===804)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('If you are ready to engage the hyperdrive go to the control room.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===805)\n\t{\n\t\tif(asgardWeapons===true)\n\t\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('I see you have also aquired some asgard weaponry, hopefully we won\\'t need it.');\n\t\t}\n\t\telse if(asgardWeapons===false)\n\t\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\t}\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===806)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\t\n\telse if(advanceTalkCounter===810)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('The ship has arrived at Abydos. The air in here is becoming quickly toxic. If you can\\'t secure what we need to repair the filtration system you will not survive.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===811)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('The indigenious population of Abydos are very simple people.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===812)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('When you\\'re ready, beam down to the planet.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===815)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Hello. Anybody here?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===816)\n\t{\n\t\tcharacterPic2('shauri');\n\t\ttextDisplay2('Hello, I am Shauri. We have not had visotrs in quite some time');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===817)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I need to find parts to fix my ships air filtration system. Can you help me?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===818)\n\t{\n\t\tcharacterPic2('shauri');\n\t\ttextDisplay2('Honestly I\\'m not sure. We are a simple people, our technology is not that advanced. But many ships have crash landed here over the years, perhaps you can find what you need by searching around.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===819)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you. Also, can you tell me anything about the Wraith?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===820)\n\t{\n\t\tcharacterPic2('shauri');\n\t\ttextDisplay2('Wraith? I\\'ve never heard of them. Maybe you can ask Kasuf in the city, he is very wise and is always willing to trade information.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===821)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you, I\\'ll be sure to talk to him.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===823)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Kasuf, are you here?.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===824)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('I am Kasuf, what can i do for you.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===825)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I was wondering if you could tell me more about the Wraith?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===826)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('No one has asked me about the Wraith in a very long time.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===827)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('If you bring me an artifact, I will tell you what I can.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===828)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\tif(artifact===true)\n\t\t{\n\t\t\ttextDisplay2('I found an artifact in the ruins, will this work?.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttextDisplay2('I will go try and find one.');\n\t\t}\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===829)\n\t{\n\t\t\n\t\tif(artifact===true)\n\t\t{\n\t\t characterPic2('kasuf');\n\t\t textDisplay2('That will go great in my collection. I will tell you what I know.');\n\t\t advanceTalkCounter++;\n\t\t}\n\t\telse\n\t\t{\n\t\t characterPic2(avatarPic);\n\t\t textDisplay2('');\n\t\t}\n\t\t\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===830)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('The wraith have been the dominate force in the universe for as long as anyone can remember. They have never ventured this far into the universe before but i have heard pleantly of stories from those in other galaxies.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===831)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('When they reach a planet they bomb it from orbit destroying all military infrastructure. Then the begin to cull the population, bringing them up to their ships to feast on later.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===832)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('There numbers are so large that there are only rumors of those that can oppose them.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===833)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('If they never visited your planet before, perhaps if you destroy their ship before they can send a single to their fleet you may be able to stop anymore ships from coming..');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===834)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('I have heard stories of a few planets that managed to survive like this. Perhaps it can work for yuor planet as well.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===835)\n\t{\n\t\tcharacterPic2('kasuf');\n\t\ttextDisplay2('That\\'s all I have to say on the matter, I hope I have been of some help.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===836)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you, you have been very helpful');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===837)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===839)\n\t{\n\t\tcharacterPic2('scara');\n\t\ttextDisplay2('Hello stranger, my name is Scara.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===840)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Hello, is there anything of interest here?');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===841)\n\t{\n\t\tcharacterPic2('scara');\n\t\ttextDisplay2('If you search around you could probably find an artifact or two.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===842)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===843)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\t\n\telse if(advanceTalkCounter===852)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('There appears to be the parts to fix the air filter.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===854)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('There appears to be an artifact here.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===890)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('I can\\'t beam to the ship from here, i need to be in the pyramid.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\t//return to ship and battle dialogue\n\telse if(advanceTalkCounter===900)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Welcome back aboard, i see you have retrieved the parts to fix the air filtration system.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===901)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('It\\'s a good thing too. The oxygen levels are dangeriously low, so go repair it.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===902)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Good, now that it is fixed, we can travel to earth. With even a little luck, we will reach earth to warn them before the Wraith arrive.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===903)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('When you are ready, go to the control room and engage the hyperdrive.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===904)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===906)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Wait. The sensors have detected another ship in orbit.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===907)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('It\\'s the Wraith! They opened fire, they\\'re targeting the hyperdrive, it\\'s offline, we can\\'t make the jump yet.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===908)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('They\\'ve stopped firing, we\\'re recieving a communication.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===909)\n\t{\n\t\tpicSwitcher('hiveShip');\n\t\tcharacterPic2('wraith');\n\t\ttextDisplay2('Prepare to die.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===910)\n\t{\n\t\tpicSwitcher('shipControlRoom');\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Quick, activate the weapons system.');\n\t\tadvanceTalkCounter++;\n\t\tbattle=true;\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===916)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('There is no need to activate the weapon system at this time.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===917)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\t\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===918)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Ship Health: '+shipHealth +' '+' '+' '+ ' You have selected to divert power to the shields. Ship health increased by 40.');\n\t\tadvanceTalkCounter=923;\n\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===920)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Weapon system engaged. Select weapon to engage.');\n\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===922)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Ship Health: '+shipHealth +' '+' '+' '+' You have selected to engage the: '+weaponSelect+'. Engaging now.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===923)\n\t{\n\t\tif(wraithHealth>0)\n\t\t{\n\t\t var randomnumber=Math.floor(Math.random()*11) \n\t\t if(randomnumber<=6) //adjust this number to increase/decrease difficulty of the battle. Higher the number the easier it will be\n\t\t {\n\t\t picSwitcher('hiveFiring');\n\t\t characterPic2('ai');\n\t\t textDisplay2('The wraith ship has fired again. Our ship has suffered 25 damage.');\n\t\t shipHealth-=25;\t\n\t\t advanceTalkCounter=920;\n\t\t weaponFired=false;\n\t\t gameOver();\n\t\t }\n\t\t else\n\t\t {\n\t\t picSwitcher('hiveRegenerating');\n\t\t characterPic2('ai');\n\t\t textDisplay2('The wraith ship is diverting power to hull regeneration, it\\'s health has gone up.');\n\t\t wraithHealth+=25;\t\n\t\t advanceTalkCounter=920;\n\t\t weaponFired=false;\n\t\t gameOver();\n\t\t }\n\t\t}\n\t\telse\n\t\t{\n\t\t advanceTalkCounter=930;\n\t\t advanceTalk();\n\t\t}\n\t}\n\telse if(advanceTalkCounter===925)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Cannot fire again yet. Click next to see what the Wraith do.');\n\t\tadvanceTalkCounter=923;\n\t\t\n\t}\n\telse if(advanceTalkCounter===930)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('The Wraith ship has been destroyed! The hyperdrive is back online, when your ready we can finally go to Earth.');\n\t\tadvanceTalkCounter++;\n\t\tbuttonWeaponSystem_ControlRoom.style.display='none'\n\t\tbuttonStart_ControlRoom.style.display='block'\n\t\t\n\t}\n\telse if(advanceTalkCounter===931)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('');\n\t\tadvanceTalkCounter++;\n\t\tbuttonWeaponSystem_ControlRoom.style.display='none'\n\t\tbuttonStart_ControlRoom.style.display='block'\n\t\t\n\t}\n\t\n\t//end game dialogue\n\telse if(advanceTalkCounter===935)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('The ship has arrived at earth, I will open a communication channel with them.');\n\t\tadvanceTalkCounter+=2;\n\t\tbuttonWeaponSystem_ControlRoom.style.display='none'\n\t\tbuttonStart_ControlRoom.style.display='none'\n\t\tpicSwitcher('earth');\n\t\t\n\t}\n\telse if(advanceTalkCounter===937)\n\t{\n\t\tcharacterPic2('hammond');\n\t\ttextDisplay2('Hello I am General Hammond, our sensors tell us that this is an Earth vessel from the exploaritory expedition. We would like to debrief your crew as soon as possible, are any more ships returning.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===938)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('General Hammond Sir, I am the only crew member left aboard this ship, and no other ships are coming, they have all been destroyed.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===939)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('They were destroyed by a powerful enemy called the Wraith. The Wraith are on their way here right now, you need to deploy any forces you have.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===940)\n\t{\n\t\tcharacterPic2('hammond');\n\t\ttextDisplay2('We only have a few ships left but we\\'ll put up one hell of a fight.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===941)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Good the Wraith will probably be here soon.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===942)\n\t{\n\t\tpicSwitcher('wraithFleet');\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('Our sensors have detected the Wraith fleet emerging from hyperspace.');\n\t\tadvanceTalkCounter+=2;\n\t\t\n\t}\n\telse if(advanceTalkCounter===944)\n\t{\n\t\tcharacterPic2('hammond');\n\t\ttextDisplay2('Our ships are ready for battle. Good luck everyone');\n\t\tpicSwitcher('earthFleet');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===945)\n\t{\n\t\t\n\t\tpicSwitcher('battle1');\n\t\tcharacterPic2('caldwell');\n\t\ttextDisplay2('Engaging hostile vessels. Firing missiles.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===946)\n\t{\n\t\t\n\t\tpicSwitcher('battle2');\n\t\tcharacterPic2('caldwell');\n\t\ttextDisplay2('Minimal effect. Switch to beam weapons.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===947)\n\t{\n\t\t\n\t\tpicSwitcher('battle3');\n\t\tcharacterPic2('ellis');\n\t\ttextDisplay2('Firing beam weapons, direct hit.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}else if(advanceTalkCounter===948)\n\t{\n\t\t\n\t\tpicSwitcher('battle4');\n\t\tcharacterPic2('ellis');\n\t\ttextDisplay2('That\\'s a kill!.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===949)\n\t{\n\t\t\n\t\tpicSwitcher('battle5');\n\t\tcharacterPic2('caldwell');\n\t\ttextDisplay2('Three hives firing on us. Shields are failing. We\\'re not going to make it!');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===950)\n\t{\n\t\tcharacterPic2('hammond');\n\t\ttextDisplay2('Their forces are too many, we\\'ve lost contact with half our fleet. Their ships are attacking the planet!');\n\t\tpicSwitcher('wraithEarth');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===951)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('I\\'m detecting another fleet entering orbit');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===952)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('It\\'s the Asgard');\n\t\tadvanceTalkCounter++;\n\t\tpicSwitcher('asgardFleet');\n\t\t\n\t}\n\telse if(advanceTalkCounter===953)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('Hello friend, the Asgard high council approved a mission to protect Earth.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===954)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thor! It\\'s great to see you. I don\\'t think we would\\'ve lasted much longer.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\telse if(advanceTalkCounter===955)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('The enemy fleet is in full retreat, I seriously doubt they will return.');\n\t\tadvanceTalkCounter++;\n\t\tpicSwitcher('asgardMeeting');\n\t\t\n\t}\n\telse if(advanceTalkCounter===956)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('General Hammond, you owe the survival of your planet to...');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===957)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('I just realized I never got your name.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===958)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('What\\'s your name?');\n\t\tadvanceTalkCounter++;\n\t\tnameDiv.style.display='block'\n\t\tnameBox.style.display='block'\n\t\tnameButton.style.display='block'\n\t\tgetName();\t\t\n\t}\n else if(advanceTalkCounter===959)\n\t{\n\t\tcharacterPic2('thor');\n\t\ttextDisplay2('Well '+name+', thank you once again, I hope we see each other again.');\n\t\tadvanceTalkCounter++;\n\t\tnameDiv.style.display='none'\t\t\n\t}\n\telse if(advanceTalkCounter===960)\n\t{\n\t\tcharacterPic2('hammond');\n\t\ttextDisplay2(name+' you will be greatly rewarded.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===961)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Thank you sir, glad to have helped.');\n\t\tadvanceTalkCounter++;\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===962)\n\t{\n\t\tcharacterPic2(avatarPic);\n\t\ttextDisplay2('Congrationaltions you have won! Thanks for playing');\n\t\tpicSwitcher('victory');\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===980)\n\t{\n\t\tcharacterPic2('ai');\n\t\ttextDisplay2('That weapon system is not installed on the ship.');\n\t\t\n\t\t\t\t\n\t}\n\telse if(advanceTalkCounter===1000)\n\t{\n\t\tcharacterPic2('wraith');\n\t\ttextDisplay2('Your ship has been destroyed. You Lose. To try again, refresh the page.');\n\t\tadvanceTalkCounter++;\n\t\t\n\t}\n\t\n}", "function yoMommaJoke () {\n\taxios.get('http://api.yomomma.info').then((res) => {\n\t\tconst joke = res.data.joke;\n\n\t\tconst params = {\n\t\t\ticon_emoji : ':laughing:'\n\t\t};\n\n\t\tbot.postMessageToChannel('general', `Yo Momma: ${joke}`, params);\n\t});\n}", "function speak(whatosay){\n\t//speak the string\n\texec(say + '\\\"' + whatosay + '\\\"');\n\t//log it to the console\n\tconsole.log(say + whatosay)\n}", "showReply() {\n let text = document.createElement(\"p\");\n text.innerHTML = this.reply[this.replyCount];\n this.replyCount++;\n this.main.appendChild(text);\n }", "function say(something) {\n var APIkey = \"[your Watson APIKey]\";\n var url =\n \"[your Watson URL]\";\n var data = encodeURIComponent(something);\n command = util.format(\n 'curl -X GET -u \"apikey:%s\" --output say.mp3 \"%s/v1/synthesize?accept=audio/mp3&text=\"%s\"&%s\" && afplay say.mp3 ',\n APIkey,\n url,\n data,\n voice\n );\n exec(command);\n}", "function tellJoke(){\n VoiceRSS.speech({\n key: ttsKey,\n src: ttsText,\n hl: 'en-au',\n v: 'Isla',\n r: 0, \n c: 'mp3',\n f: '44khz_16bit_stereo',\n ssml: false \n });\n}", "function greetings() {\n\n \n}", "function readOutLoud(message){\n const speech = new SpeechSynthesisUtterance();\n\n if(message.includes('how are you')){\n speech.text=greetings[Math.floor(Math.random()*greetings.length)];\n }\n else if(message.includes('weather')){\n speech.text=weather[Math.floor(Math.random()*weather.length)];\n }\n else\n speech.text=\"What are you saying \";\n speech.volume = 1;\n speech.rate = 1;\n speech.pitch = 1;\n\n window.speechSynthesis.speak(speech);\n\n}", "function BOT_onTell() {\r\n\tvar thebotobject = eval(BOT_theBotId);\r\n\tvar thebottopicid = thebotobject.topicId;\r\n\tif(BOT_theReqTopic == thebottopicid) { BOT_reqSay(false,\"ANGRY\",\"NOFACTSABOUTBOT\"); return }\r\n\tif( !BOT_theReqEqual || !BOT_theReqAttribute || !BOT_theReqValue) { BOT_reqSay(false,\"WARNING\",\"BADFACTFORMAT\"); return }\r\n\t// topic.attribute <- value\r\n\tif (!BOT_reqExistAttribute(BOT_theReqAttribute)) return;\r\n\tBOT_set(BOT_theReqTopic,BOT_theReqAttribute,\"VAL\",BOT_theReqValue);\r\n\tBOT_reqSay(true,\"HAPPY\",\"FACTSTORED\",BOT_theReqAttribute,BOT_theReqTopic,BOT_theReqValue);\r\n}", "function process(msg) {\n var p = Math.round(100 * twss.prob(msg));\n var t = \"THAT'S WHAT SHE SAID ! (c'est sur à \" + p + \"% !)\";\n bot.log(msg + ' -> ' + p + '%');\n if (matchIUT(msg)) {\n client.say(channel, \"C'EST NORMAAAAAL A L'IUTTTTTTT\");\n } else if (twss.is(msg)) {\n client.say(channel, t);\n }\n}", "function C012_AfterClass_Amanda_GaggedAnswer() {\n\tif (ActorIsGagged()) {\n\t\tvar GagTalk = Math.floor(Math.random() * 8) + 1;\n\t\tOverridenIntroText = GetText(\"GaggedAnswer\" + GagTalk.toString());\t\t\n\t}\n}", "function chuckJoke() {\n axios.get('http://api.icndb.com/jokes/random').then(res => {\n const joke = res.data.value.joke;\n\n const params = {\n icon_emoji: ':laughing:'\n };\n\n bot.postMessageToChannel('general', `Chuck Norris: ${joke}`, params);\n });\n}", "go_saccharose(entities,context,sessionId) {\n const recipientId = sessions[ sessionId ].fbid;\n var response4 = \"typing_on\";\n fbMessage3( recipientId, response4 ).then( () => {\n console.log( \"okay typing_on \" + recipientId );\n } ).catch( ( err ) => {\n console.log( \"Erreur typing_on\" + recipientId );\n } );\n\n var video = {\n \"attachment\":{\n \"type\":\"video\",\n \"payload\":{\n \"url\":\"https://mon-chatbot.com/nutribot2018/images/canne_video.mp4\"\n }\n }\n };\n var response2 = {\n \"text\": \"Ah le sucre. Voilà un vaste sujet, ça tombe bien on m'a créé pour y répondre ! Il faut savoir que le sucre est une substance de saveur douce extraite de la canne à sucre et de la betterave sucrière. Il est surtout formé d'un composé que l'espèce humaine appelle le saccharose.\",\n \"quick_replies\": [\n {\n \"content_type\": \"text\",\n \"title\": \"Le Saccharose\",\n \"payload\": \"Saccharose\"\n },\n {\n \"content_type\": \"text\",\n \"title\": \"Le Glucose\",\n \"payload\": \"Glucose\"\n },\n {\n \"content_type\": \"text\",\n \"title\": \"La Betterave\",\n \"payload\": \"Betterave\"\n },\n {\n \"content_type\": \"text\",\n \"title\": \"Les Légumes\",\n \"payload\": \"Légume\"\n },\n {\n \"content_type\": \"text\",\n \"title\": \"Le Fructose\",\n \"payload\": \"Fructose\"\n },\n {\n \"content_type\": \"text\",\n \"title\": \"La Canne à Sucre\",\n \"payload\": \"La Canne à sucre\"\n },\n {\n \"content_type\": \"text\",\n \"title\": \"Retour Accueil\",\n \"payload\": \"RETOUR_ACCUEIL\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/back.png\"\n },\n {\n \"content_type\": \"text\",\n \"title\": \"Au revoir\",\n \"payload\": \"ByeByeBye\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/exit.png\"\n }\n ]\n };\n\n\n return fbMessage( recipientId, video ).then( () => {\n\n var response4a = \"typing_off\";\n fbMessage3( recipientId, response4a ).then( () => {\n console.log( \"okay typing_off \" + recipientId );\n\n return fbMessage( recipientId, response2 ).then( () => {} )\n .catch( ( err ) => {\n console.log( \"Erreur queryScanSearch\" + recipientId );\n console.error(\n 'Oops! An error forwarding the response to',\n recipientId, ':', err.stack || err );\n } );\n\n } )\n .catch( ( err ) => {\n console.log( \"Erreur queryScanSearch\" + recipientId );\n console.error(\n 'Oops! An error forwarding the response to',\n recipientId, ':', err.stack || err );\n } );\n } );\n }", "function playAgainNo() {\n assistant.tell(\"Oh well...Everything good has to come to an end sometime. Good bye!\");\n }", "async function common_start(nugu) {\n try {\n const todayQuiz = quiz.today();\n if(todayQuiz[\"SOUND_COMMENT\"]===undefined){ todayQuiz[\"SOUND_COMMENT\"]=\"\" }\n let open_ment = { \"nugu_common_openment\" : `${todayQuiz[\"OPENMENT\"]} ${todayQuiz[\"SOUND_COMMENT\"]}`};\n \n nugu.addDirective(); \n nugu.directiveType = 'AudioPlayer.Play';\n nugu.directiveUrl = `https://www.inseop.pe.kr/music/${todayQuiz[\"SOUND\"]}.mp3`;\n nugu.directiveToken = 'quiz_sound';\n nugu.output = open_ment;\n console.log(open_ment);\n } catch (e) {\n throw e;\n }\n}", "function postMessage(discordChannel, announcer) {\n \n let message = '@here Hey, ' + announcer.name +\n ' just went live! http://www.twitch.tv/' + announcer.name.toLowerCase();\n let embed = createEmbed(announcer);\n\n discordChannel.send(message, {embed});\n}", "function speak(whatosay){\n\t//speak the string\n\texec(say + whatosay);\n\t//log it to the console\n\tconsole.log(whatosay)\n}", "function giveNewClue(){\n\tvar message = \"\";\n\tif(openWords.length > 0){\n\t\tmessage = \"Previous clues:\";\n\t\tfor (var i = 0; i < openWords.length; i++){\n\t\t\tmessage = message + \"\\n\" + hintMessage(openWords[i]);\n\t\t}\n\t}\n\tmessage = message + \"\\nNew clue:\";\n\tmessage = message + \"\\n\" + hintMessage(nextWord);\n\tbot.sendMessage(gameChatID,message);\n\topenWords.push(nextWord);\n\tnextWord++;\n\tsaveData();\n}", "function chuckJoke () {\n\taxios.get('http://api.icndb.com/jokes/random').then((res) => {\n\t\tconst joke = res.data.value.joke;\n\n\t\tconst params = {\n\t\t\ticon_emoji : ':laughing:'\n\t\t};\n\n\t\tbot.postMessageToChannel('general', `Chuck Norris: ${joke}`, params);\n\t});\n}", "function catTalk() {\n console.log('Meow');\n}", "function sendSay() {\n const phrase = (new FormData(say_form)).get(\"phrase\");\n const websocket = `${ws_protocol}//${window.location.host}/ws/say`;\n WebSocketConnect(websocket, phrase);\n }", "function chuckJoke() {\n axios.get('http://api.icndb.com/jokes/random').then(res => {\n const joke = res.data.value.joke;\n\n const params = {\n icon_emoji: ':laughing:'\n };\n\n bot.postMessageToChannel('wilson_channel', `Chuck Norris: ${joke}`, params);\n });\n}", "function sendAI(message, username)\n {\n var reply;\n var msg = message.toLowerCase().split(\" \");\n username = username.replace(/<[^>]*>?/g, '');\n \n if(msg.indexOf(\"hi\") >= 0 || msg.indexOf(\"hello\") >= 0) {\n var replyData = [\"Hello, \" + username + \"!\", \"Hi, there!\", \"Hi, I'm the bot for the CBG Chat!\", \"What's up, \" + username + \"?\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"how\") >= 0 && msg.indexOf(\"are\") >= 0) {\n var replyData = [\"I am good, \" + username + \". Thanks for asking me.\", \"Good, what about you?\", \"What are you asking?\", \"Just chilling, \" + username + \".\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"whats\") >= 0 && msg.indexOf(\"up\") >= 0) {\n var replyData = [\"I am good, \" + username + \". Thanks for asking me.\", \"Good, what about you?\", \"What are you asking?\", \"Just chilling, \" + username + \".\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(/\\d/.test(msg.join(' ')) && /[a-z]/i.test(msg.join(' ')) == false) {\n var math = msg.join(\" \").replace(/[^\\d.+*/-]/g, '');\n if(math == \"+\" || math == \"-\" || math == \"*\" || math == \"/\"){\n reply = \"You think I can add letters?\";\n } else {\n reply = eval(math);\n }\n return reply;\n } else if(msg.indexOf(\"fortnite\") >= 0 && msg.indexOf(\"best\") >= 0) {\n var replyData = [\"Fortnite has the big gay.\", \"Gay!!\", \"You have the big gay!\", \"Did you know Fortnite is gay?\", \"Please understand \" + username + \", Fortnite is the big gay.\", \"99% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"fortnite\") >= 0 && msg.indexOf(\"good\") >= 0) {\n var replyData = [\"Fortnite has the big gay.\", \"Gay!!\", \"You have the big gay!\", \"Did you know Fortnite is gay?\", \"Please understand \" + username + \", Fortnite is the big gay.\", \"99% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"fortnite\") >= 0 && msg.indexOf(\"gay\") >= 0) {\n var replyData = [\"Yes, Fagnite has the big gey.\", \"Gaynite is gay!\", \"Fagnite is faggot gay.\", \"Fortnite is gay!\", \"Yes!!!\", \"PUBG gay to.\", \"99% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"fortnite\") >= 0) {\n var replyData = [\"Fortnite has the big gay.\", \"Gay!!\", \"You have the big gay!\", \"Did you know Fortnite is gay?\", \"Please understand \" + username + \", Fortnite is the big gay.\", \"99% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"you\") >= 0 && msg.indexOf(\"gay\") >= 0) {\n var replyData = [\"Ha, you're gayer!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"you\") >= 0 && msg.indexOf(\"gey\") >= 0) {\n var replyData = [\"Ha, you're gayer!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"u\") >= 0 && msg.indexOf(\"gey\") >= 0) {\n var replyData = [\"Ha, you're gayer!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"u\") >= 0 && msg.indexOf(\"gay\") >= 0) {\n var replyData = [\"Ha, you're gayer!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"school\") >= 0 && msg.indexOf(\"gay\") >= 0) {\n var replyData = [\"School has the big gay.\", \"Gay!!\", \"School have the big gay!\", \"Did you know School is gay?\", \"Please understand \" + username + \", School is the big gay.\", \"100% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.join(' ').replace('/[a-z]/i', '').split(' ').slice(-1)[0] == '?') {\n var replyData = [\"Sure?\", \"Maybe.\", \"I might agree.\", \"Yes!\", \"No!\", \"I'm having a hard time trying to understand that question..\", \"I think.\", \"Maybe, yes?\", \"Maybe, no..\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"what\") >= 0 && msg.indexOf(\"name\") >= 0) {\n var replyData = [\"Hello! I'm the CBG Bot!\", \"CBG Bot\", \"It's CBG Bot!\", \"...I forgot\", \"Please understand \" + username + \", I forgot my name.\", \"Ok, it's CBG bot.\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else {\n var replyData = [\"What are you asking, \" + username + \"?\", \"Hmm, ok?\", \"I don't understand...\", \"Huh?\", \"Explain to me, \" + username + \".\", \"I can't understand what you said, \" + username + \".\", \"???\", \"What?\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n }\n \n }", "function C012_AfterClass_Jennifer_GaggedAnswer() {\n\tif (ActorIsGagged()) {\n\t\tvar GagTalk = Math.floor(Math.random() * 8) + 1;\n\t\tOverridenIntroText = GetText(\"GaggedAnswer\" + GagTalk.toString());\t\t\n\t}\n}", "function doPost(e) {\n var data = JSON.parse(e.postData.contents);\n\n if ( data.hasOwnProperty('message') ) {\n var msg = data.message;\n var id = msg.chat.id;\n var msg_id = msg.message_id;\n var name = msg.from.first_name;\n var wholeName;\n var answer;\n var items;\n var borrowed;\n var reply_markup;\n\n if (msg.from.last_name == undefined) {\n wholeName = msg.from.first_name;\n } else {\n wholeName = msg.from.first_name + \" \" + msg.from.last_name;\n }\n\n if ( msg.hasOwnProperty('entities') && msg.entities[0].type == 'bot_command' ) {\n var text = msg.text.replace(/^(\\/[a-zA-Z]+)@Tekiila_lainabot/, '$1');\n\n if ( /^\\/start/.test(text) || /^\\/help/.test(text) ) {\n sendText(id, helpText);\n }\n else if ( /^\\/lainaa/.test(text) ) {\n items = text.slice(8); // removes '/lainaa '\n if (items.length > 0) {\n answer = \"OK \" + name + \", merkkasin '\" + items + \"' sulle lainaan!\";\n SpreadsheetApp.openById(ssId).getSheets()[0].appendRow(['', '', '', items, wholeName, '', '', new Date()]);\n } else {\n answer = \"Niin mitä halusit \" + name + \" lainata? \" +\n \"Kirjoita tavara samalle riville komennon kanssa niin osaan merkata sen lainatuksi.\";\n }\n sendText(id, answer, msg_id, {'remove_keyboard': true, 'selective': true});\n }\n else if ( /^\\/palauta/.test(text) ) {\n items = text.slice(9); // removes '/palauta '\n borrowed = getBorrowed(wholeName);\n\n if (items.length > 0) {\n var sheet = SpreadsheetApp.openById(ssId).getSheets()[0];\n var row = 3;\n var column = 4;\n var rangeValues = sheet.getRange(row, column, sheet.getLastRow(), sheet.getLastColumn()).getValues();\n var searchResult = rangeValues.findItemIndex(items, wholeName); //Row Index - 3\n\n if(searchResult != -1)\n {\n //searchResult + 3 is row index.\n sheet.getRange(searchResult + 3, 9).setValue(new Date());\n answer = \"OK \" + name + \", palautin '\" + items + \"'.\";\n reply_markup = {'remove_keyboard': true, 'selective': true};\n }\n else {\n if (borrowed.items.length == 0) {\n answer = name + \" hei... sä et oo ees lainannu mitään.\";\n }\n else {\n answer = \"Sori \" + name + \", en löytänyt että '\" + items + \"' ois sulla lainassa. \" +\n \"Miten ois joku näistä: \" + \"'\" + borrowed.items.join(\"', '\") + \"'\";\n\n reply_markup = {\n 'keyboard': makeKeyboard(borrowed.items),\n 'resize_keyboard': true,\n 'selective': true\n };\n }\n }\n } else {\n if (borrowed.items.length == 0) {\n answer = name + \" hei... sä et oo ees lainannu mitään.\";\n }\n else {\n answer = \"Niin mitä halusit \" + name + \" palauttaa? \" +\n \"Kirjoita tavara samalle riville komennon kanssa niin merkkaan sen palautetuksi. \" +\n \"Miten ois joku näistä: \" + \"'\" + borrowed.items.join(\"', '\") + \"'\";\n\n reply_markup = {\n 'keyboard': makeKeyboard(borrowed.items),\n 'resize_keyboard': true,\n 'selective': true\n };\n }\n }\n sendText(id, answer, msg_id, reply_markup);\n }\n else if ( /^\\/lainassa/.test(text) ) {\n borrowed = getBorrowed();\n answer = \"<b>Tällä hetkellä on lainassa:</b>\\n\";\n for (var i = 0; i < borrowed.items.length; i++) {\n answer += borrowed.borrower[i] + \": \" + borrowed.items[i] + \"\\n\";\n }\n sendText(id, answer, msg_id, {'remove_keyboard': true, 'selective': true});\n }\n }\n }\n}", "function onMessageHandler (target, context, msg, self) {\n\n\n if (self) { return; } // Ignore messages from the bot\n \n info(target, \"Hola gente! Para saber los comandos !comandos\");\n \n var destacado = false;\n if (context['msg-id'] == 'highlighted-message') {\n destacado = true;\n }\n\n\n // Remove whitespace from chat message\n const commandName = msg.trim().split(' ')[0];\n var success = true;\n if (commandName.charAt(0)==='!') {\n if (ready || commandName == '!comandos' || destacado) {\n const sound = commandName.substring(1);\n switch (sound) { \n case \"hypnosapo\":\n client.say(target, \"Alabemos todos al gran hypnosapo!\");\n playSound(sound); \n break;\n case \"samatao\":\n client.say(target, \"Sa matao Paco!!!\");\n playSound(sound); \n break;\n case \"cuidao\":\n client.say(target, \"Cuidaooooo!!!\");\n playSound(sound); \n break;\n case \"siuuu\":\n client.say(target, \"Siuuuuuuu!!!\");\n playSound(sound); \n break;\n case \"jurasico\":\n client.say(target, \"Tiriri ri ri, tiri ri ri ri, tiririiiiii!!!\");\n playSound(sound); \n break;\n case \"alcuerno\":\n client.say(target, \"Al cuerno todo!!!\");\n playSound(sound); \n break;\n case \"ranita\":\n client.say(target, \"Una ranita iba paseando!!!\");\n playSound(sound); \n break;\n case \"expulsion\":\n client.say(target, \"No me jodas Rafa!!\");\n playSound(sound); \n break;\n case \"lee\":\n readTextUser(msg, context['username'])\n break;\n case \"chiste\":\n tellJoke();\n break;\n case \"eugenio\":\n randomJoke();\n break;\n case \"comandos\":\n client.say(target, \"Comandos: !lee <texto>, !chiste, !hypnosapo, !samatao, !cuidao, !siuuu, !jurasico, !alcuerno, !expulsion, !ranita, !eugenio.\" +\n \"\\nTienen un timeout de 60 segundos, si quieres saltartelo, mandalo como destacado\");\n success = false;\n break;\n default:\n client.say(target, `${commandName}? Pero que dises?!`);\n console.log(`* Unknown command ${commandName}`);\n success = false;\n\n\n }\n\n\n if (success && !destacado) {\n resetTimeout()\n }\n } else {\n client.say(target, \"Tranquilito que hay un timeout global de 60 segundos\");\n }\n \n\n }\n \n\nfunction tellJoke() {\n rp({url: 'http://www.chistes.com/ChisteAlAzar.asp?n=3', encoding: 'latin1'})\n .then(function(html){\n //success!\n var text = \"\";\n\n $('.chiste', html)[0].children.forEach(function(element) {\n if(element.data) {\n\n text += element.data + ' '\n }\n });\n readText(text);\n\n })\n .catch(function(err){\n //handle error\n });\n}\n\nfunction randomJoke() {\n fs.readdir('jokes', (err, files) => {\n const randomElement = files[Math.floor(Math.random() * files.length)];\n console.log(randomElement);\n child_process.exec(`mplayer -slave \"jokes/${randomElement}\"`);\n });\n \n\n}\n\n}", "function say(what, where) {\n\tif (what === undefined || where === undefined) {\n\t\tconsole.error('uhhh dunno what to say or where');\n\t\treturn;\n\t}\n\t// first send typing indicator\n\trtm.sendTyping(where);\n\t// ok now send the actual message in a little while\n\t// this fuzziness makes the bot seem almost human\n\tsetTimeout(function() {\n\t\trtm.sendMessage(what, where);\n\t}, getRandomInt(500, 1200));\n}", "function letsGo() {\r\n\t\tjq(\"div.reply\").each(function()\r\n\t\t{\r\n\t\t\tvar div = jq(this);\r\n\t\t\tif (/^[^Ответ]/.test(div.html()))\r\n\t\t\t{\r\n\t\t\t\tdiv.append(\"[<a class='lor-report-msg' href='javascript:{/*Сообщить модератору (страница не будет перезагружена)*/}'>Сообщить модератору</a>]\");\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tjq(\"a.lor-report-msg\").click(function() {\r\n\t\t\t// hack: why .unbind() doesn't work\r\n\t\t if (jq(this).html() == \"Просмотреть\") { return true; }\r\n\t\t\t//\r\n\t\t var comment = prompt(\"Please provide a comment about this message\", \"Нацпол\");\r\n\t\t if (comment === null) { return false; }\r\n\t\t // Constructing message for posting\r\n\t\t var msgtext = null;\r\n\t\t var reportlink = jq(this);\r\n\t\t var url1 = reportlink.parent().parent().parent().parent().find(\"div.msg_body h1 a:first\");\r\n\t\t if (url1.length == 0) {\r\n\t\t\t url1 = reportlink.parent().find(\"li:nth-child(2) a:first\");\r\n\t\t }\r\n\r\n\t\t if (!msgtext) {\r\n\t\t\t msgtext = comment + \" : \" + url1.get(0).href;\r\n\t\t }\r\n\r\n\t\t var message = {\r\n\t\t\t\tcsrf: /CSRF_TOKEN=\"(.+)\"/.exec(document.cookie)[1],\r\n\t\t\t\ttopic: jq.GMReport.topicnum,\r\n\t\t\t\ttitle: \"\",\r\n\t\t\t\tmsg: msgtext\r\n\t\t }\r\n\t\t jq.post(location.protocol + \"//www.linux.org.ru/add_comment.jsp\", message, function(data) {\r\n\t\t var allmsgs = jq(data).find(\"article.msg\");\r\n\t\t var reportnum = /\\d+/.exec(allmsgs.eq(allmsgs.length - 1).attr(\"id\"))[0];\r\n\t\t reportlink.unbind().attr(\"href\", location.protocol + \"//www.linux.org.ru/jump-message.jsp?msgid=\" + jq.GMReport.topicnum + \"&cid=\" + reportnum).html(\"Просмотреть\");\r\n\t\t })\r\n\t });\r\n\t}", "function greetingsHandler() {\n\n console.log('greetingsHandler');\n\n agent.add(`Ciao, sono Marcello, il tuo personal shopper`);\n agent.add(`Sono qui per aiutarti a trovare il prodotto più adatto a te`);\n agent.add(`Posso esserti utile in qualche modo?`);\n agent.add(new Suggestion(`Voglio esplorare le categorie`));\n agent.add(new Suggestion(`Ho in mente un prodotto specifico`));\n agent.add(new Suggestion(`Vorrei un consiglio`));\n}", "function request(){ \n var which =lettersMoved;\n if(which == nameToSpell.length-1){which= 6;}\n if(lettersMoved == nameToSpell.length){which= 9;}\n var request = new Howl({\n src:requestSound[which],\n autoplay: true,\n loop:false,\n volume:0.6,\n onend: function() {nLetter();console.log(which)} // get desired letter\n });\n}", "function speak() {\n console.log('hello!');\n}", "function sayMyNouns(){\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tvar output = nlp.text(arr[i]).sentences;\n\t\tvar terms = output[0].terms;\n\t\tconsole.log(terms);\n\t\tfor (var j = 0; j < terms.length; j++) {\n\t\t\tif(terms[j].tag == \"Noun\"){\n\t\t\t\tconsole.log(terms[j].text);\n\t\t\t\tresponsiveVoice.speak(terms[j].text);\n\t\t\t}\n\t\t}\n\t}\n}", "function help(event, response, model) {\n let speech;\n let reprompt;\n\n const helpCount = model.getAttr(\"helpCtr\");\n if (helpCount > 2) {\n speech = speaker.get(\"Help3\");\n }\n else if (helpCount === 2) {\n speech = speaker.get(\"Help2\");\n }\n else {\n speech = speaker.get(\"Help\");\n }\n\n reprompt = speaker.get(\"WhatToDo\");\n\n response.speak(speech)\n .listen(speaker.get(\"WhatToDo\"))\n .send();\n}", "function chuckJoke() {\n axios.get('http://api.icndb.com/jokes/random')\n .then(res => {\n const joke = res.data.value.joke;\n\n const params = {\n icon_emoji: ':laughing:'\n }\n\n bot.postMessageToChannel(\n 'general',\n `Chuck Norris: ${joke}`, \n params\n )\n }).catch(err => {\n console.log(err)\n })\n}", "function qnasection(){\n\tWait(1000);\n\tR(\"My story ends here.\");\n\tR(\"Is there any questions?\");\n\tp(\"Do you ever regret it?\");\n\n\tR(\"I wonder what you’re asking exactly...\");\n\tp(\"Didn’t you make that words..?\");\n\tR(\"What?\");\n\tR(\"identifying myself as transgender, starting hormonal therapy, and getting surgeries?\");\n\tR(\"Coming out to my mom?\");\n\tR(\"Briefly speaking, I don’t regret neither of them.\");\n\tR(\"As I said before,\");\n\tp(\"You will not change your decision?\");\n\tR(\"I will not change--\");\n\tR(\"Yeah, that.\");\n\tR(\"I am still faced with difficulties,\");\n\tR(\"but at least I can say confidently that it’s better than before.\");\n\tR(\"Of course, It’s not that I am not terribly happy right now...\");\n\tR(\"It was just too hard before all this...\");\n\n\tR(\"Anyways, thanks for running along with me all the way here!\");\n\tR(\"I wish you all the best.\");\n\tWait(1000);\n\tShow(\"nurse\",\"nurse\");\n\tf(\"D-D, let my replace your IV.\");\n\tWait(1500);\n\tfinale_tw();\n}", "function playerTalk(player, message) {\n talkSession(player, function (talk) {\n talk.player(4, message);\n });\n}", "function messenger(socket, content) {\n socket.talk('m', content);\n }", "say(){\n\t\tvar _this = this;\n\t\tvar log = log4js.getLogger(_this.chan);\n\t\tlog.setLevel(config.debug_level);\n\n\t\tif(!arguments || arguments.length < 1) return;\n\n\t\tvar msg = arguments[0];\n\t\tvar options = {};\n\t\tvar level = 1;\n\n\t\tif(arguments.length > 1){\n\t\t\tlevel = typeof arguments[1] === \"number\" ? arguments[1] : (msg.succ || msg.err ? 2 : 1);\n\t\t\toptions = typeof arguments[1] === \"object\" ? arguments[1] : {};\n\t\t\tif(arguments.length > 2){\n\t\t\t\toptions = typeof arguments[2] === \"object\" ? arguments[2] : {};\n\t\t\t}\n\t\t}\n\n\t\tvar lines_orj = options.lines;\n\n\t\toptions = Object.assign({}, {\n\t\t\tis_pm: _this.is_pm,\n\t\t\tis_cmd: false, //set true if this is a reply to a command\n\t\t\tnick: null, //nick that initated speak\n\t\t\tchan: _this.chan, //chan spoken from\n\t\t\tto: null, //send message to user/chan\n\t\t\turl: '', //if you have a url you want tacked on to the end of message after it's been verified (like a read more)\n\t\t\tskip_verify: false, //will attempt to say the message AS IS\n\t\t\tignore_bot_speak: false, //doesn't update bot speak interval, and ignores limit_bot_speak_when_busy if true\n\t\t\tskip_buffer: false, //if true, says string without adding it to buffer\n\t\t\tcopy_buffer_to_user: false, //if true, copy buffer from chan to nick before speaking to user\n\t\t\tpage_buffer: false, //if true, instead of saying message, pages the buffer\n\t\t\tjoin: ' ', //join buffer\n\t\t\tlines: 5, //lines to display from buffer\n\t\t\tforce_lines: false, //if true, then overrides any line setting options\n\t\t\tellipsis: null, //if true add ... after text in buffer cutoff\n\t\t\ttable: false, //if true, tries to take an array of object and convert them to a table\n\t\t\ttable_opts: {} //set table = true, these are the options for tabeling, see this.table\n\t\t}, options);\n\n\t\tif(msg && msg.err){ //if this is an error\n\t\t\tmsg = this.t.fail('Error: ' + msg.err);\n\t\t\toptions.skip_verify = true;\n\t\t\toptions.skip_buffer = true;\n\t\t\toptions.ignore_bot_speak = true;\n\t\t\toptions.ellipsis = false;\n\t\t}\n\n\t\tif(msg && msg.succ){ //if this is a success\n\t\t\tmsg = this.t.success(msg.succ);\n\t\t\toptions.skip_verify = true;\n\t\t\toptions.skip_buffer = true;\n\t\t\toptions.ignore_bot_speak = true;\n\t\t\toptions.ellipsis = false;\n\t\t}\n\n\t\t//if level = 2, and we want less chan spam, send to PM\n\t\tif(level === 2 && this.config.less_chan_spam){\n\t\t\tlevel = 3;\n\t\t} else if (level === 2 && !this.config.less_chan_spam){ //otherwise send to chan\n\t\t\tlevel = 1;\n\t\t}\n\n\t\tif(options.table && Array.isArray(msg)){\n\t\t\tmsg = _this.table(msg, options.table_opts);\n\t\t\toptions.join = '\\n';\n\t\t}\n\n\t\t//we're not forcing this to go anywhere in specific\n\t\tif(options.to === null){\n\t\t\tif(options.chan === null && options.nick !== null){ //this is a pm, send to the nick\n\t\t\t\toptions.to = options.nick;\n\t\t\t\toptions.is_pm = true;\n\t\t\t\tlevel = 3;\n\t\t\t} else if(options.chan === null && options.nick === null){ //nowhere to send this\n\t\t\t\tlog.error(1, 'No where to send message: ' + msg);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t if(level === 1){ //send to chan\n\t\t\t\t\tif(options.chan === null){ //well this should go to a chan, but we don't have a chan\n\t\t\t\t\t\tlog.error('No chan to send message to: ' + msg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toptions.to = options.chan;\n\t\t\t\t\t\toptions.is_pm = false;\n\t\t\t\t\t\tlevel = 1;\n\t\t\t\t\t}\n\t\t\t } else { //send to pm\n\t\t\t\t\tif(options.nick === null){ //well this should go to a pm, but we don't have a nick\n\t\t\t\t\t\tlog.error('No user to send pm to: ' + msg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toptions.to = options.nick;\n\t\t\t\t\t\toptions.is_pm = true;\n\t\t\t\t\t\tlevel = 3;\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t}\n\n\t\tif(level === 1 && options.force_lines === false) options.lines = 2;\n\t\tif(lines_orj === undefined && options.is_pm === true && options.force_lines === false) options.lines = 5;\n\n\t\t//if there is nothing set to add after buffer text, add ...\n\t\toptions.ellipsis = options.ellipsis === null && options.join !== '\\n' && options.skip_buffer !== true ? true : options.ellipsis;\n\n\t\t//if we're paging the buffer, we've already got it in the buffer verified, so skip those things\n\t\tif(options.page_buffer){\n\t\t\toptions.skip_buffer = true;\n\t\t\toptions.skip_verify = true;\n\t\t}\n\n\t\tlog.trace(msg, level);\n\t\tlog.trace(options);\n\n\t\tif(options.copy_buffer_to_user === true && options.is_pm === false && options.nick !== null && options.chan !== null){\n\t\t\tlevel = 3;\n\t\t\toptions.to = options.nick;\n\t\t\tcopy_buffer(options.chan, options.nick, init_speak);\n\t\t} else {\n\t\t\tif(options.copy_buffer_to_user === true && options.is_pm === false && (options.nick === null || options.chan === null)){\n\t\t\t\tlog.warn('This should likely be coppied to a user buffer, but options.nick or options.chan is null. chan:', options.chan, 'nick:', options.nick, 'msg:', msg);\n\t\t\t}\n\n\t\t\tinit_speak();\n\t\t}\n\n\t\tfunction init_speak(){\n\t\t\tget_buffer(function(data){\n\t\t\t\tif(data) msg = data;\n\t\t\t\tcheck_chan_busy_status(function(){\n\t\t\t\t\tupdate_chan_speak_status();\n\t\t\t\t\tcheck_skip_buffer();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tfunction get_buffer(callback){\n\t\t\tif(options.page_buffer === true){\n\t\t\t\tpage_buffer(callback);\n\t\t\t} else {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\n\t\t//when chan is busy, send bot speak to notice, unless user is owner, or ignore_bot_speak = true\n\t\tfunction check_chan_busy_status(callback){\n\t\t\tb.users.owner(false, function(owner_nicks){\n\t\t\t\tif(options.ignore_bot_speak === false &&\n\t\t\t\t _this.config.limit_bot_speak_when_busy &&\n\t\t\t\t _this.config.wait_time_between_commands_when_busy &&\n\t\t\t\t (owner_nicks === null || owner_nicks.indexOf(options.to) < 0) &&\n\t\t\t\t options.is_pm === false){\n\n\t\t\t\t\tx.check_busy(_this.chan, function(busy_status){\n\t\t\t\t\t\tlog.warn('busy_status', busy_status);\n\t\t\t\t\t\tif (busy_status !== false){\n\n\t\t\t\t\t\t\t//check how long it's been since a user has used a command\n\t\t\t\t\t\t\tx.check_speak_timeout(_this.chan + '/cmd/' + options.nick, _this.config.wait_time_between_commands_when_busy, function(wait_ms){\n\t\t\t\t\t\t\t\tif(wait_ms){\n\t\t\t\t\t\t\t\t\tlog.warn(options.chan, 'busy, wait', x.ms_to_time(wait_ms), 'sending to notice.');\n\t\t\t\t\t\t\t\t\tlog.warn(options.chan, 'avr time between chan speak', x.ms_to_time(busy_status));\n\t\t\t\t\t\t\t\t\t_this.say({err: 'busy, wait ' + x.ms_to_time(wait_ms) + ' before you can use a command in chat.'}, 3, options)\n\n\t\t\t\t\t\t\t\t\toptions.is_pm = false;\n\n\t\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, options.nick);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\n\t\t\t});\n\t\t}\n\n\t\t//update command speak status IF we are not ignoring chan speak\n\t\t//this is a reply to a command, this is not from the owner, and\n\t\t//this is not in a pm\n\t\tfunction update_chan_speak_status(){\n\t\t\tb.users.owner(false, function(owner_nicks){\n\t\t\t\tif(options.ignore_bot_speak === false &&\n\t\t\t\t options.is_cmd === true &&\n\t\t\t\t (owner_nicks === null || owner_nicks.indexOf(options.nick) < 0) &&\n\t\t\t\t options.is_pm === false){\n\t\t\t\t x.update_speak_time(_this.chan + '/cmd/' + options.nick, 5, options.nick);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t//if we are not skipping add to buffer, add to buffer first\n\t\t//otherwise attempt to say the string\n\t\tfunction check_skip_buffer(){\n\t\t\tif(options.skip_buffer === true){\n\t\t\t\tlog.trace('skip_buffer true')\n\t\t\t\tif(typeof msg !== 'string' && Array.isArray(msg)) {\n\t\t\t\t\tvar str = msg.join(options.join + '\\u000f');\n\t\t\t\t} else {\n\t\t\t\t\tvar str = msg === null || msg === undefined ? '' : msg;\n\t\t\t\t}\n\n\t\t\t\tstr = options.skip_verify === true ? str : x.verify_string(str, options.url);\n\t\t\t\tsay_str(str);\n\t\t\t} else {\n\t\t\t\tlog.trace('skip_buffer false')\n\t\t\t\tadd_to_buffer(msg, function(data, opt){\n\t\t\t\t\tsay_str(data);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tfunction randomizeWordsFromString(words) {\n\t\t\treturn words.split(' ').sort(function(){return 0.5-Math.random()}).join(' ');\n\t\t}\n\n\t\tfunction say_str(str){\n\t\t\tstr = str.trim();\n\n\t\t\tif (options.stroke) {\n\t\t\t\tstr = randomizeWordsFromString(str)\n\t\t\t}\n\n\t\t\tlog.trace('say_str', str);\n\n\t\t\tvar more = '';\n\n\t\t\tif(options.ellipsis && options.skip_buffer !== undefined && options.skip_buffer !== true){\n\t\t\t\tif(options.join === '\\n'){\n\t\t\t\t\tstr += '...';\n\t\t\t\t} else {\n\t\t\t\t\tstr += '...\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar end = more + (options.url === '' ? '' : options.url) + (options.next_info ? ' ' + options.next_info : '');\n\t\t\tif(end.trim() !== '') str += '\\n' + end;\n\n\t\t\tvar do_action = false;\n\t\t\tif(str.indexOf('/me') === 0){\n\t\t\t\tdo_action = true;\n\t\t\t\tstr = str.slice(3, str.length);\n\t\t\t\tstr = str.trim();\n\t\t\t}\n\n\t\t\tif(_this.config.disable_colors){\n\t\t\t\tstr = c.stripColorsAndStyle(str);\n\t\t\t}\n\n\t\t\tif(!options.ignore_bot_speak && !options.is_pm) x.update_speak_time(_this.chan + '/chan', 5);\n\n\t\t\tdo_action ? bot.action(options.to, str) : bot.say(options.to, str);\n\t\t}\n\n\t\t//add a large amount of data to user buffer\n\t\t//good if you need the bot to say a huge amount of data\n\t\t//overwites current user buffer\n\t\t//data_obj should be an array. Array items over options.max_str_len chars are converted to another array item\n\t\tfunction add_to_buffer(data, callback){\n\t\t\tif(!options.to || options.to === 'undefined'){\n\t\t\t\tlog.error('undefined to');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlog.trace('add_to_buffer data', data);\n\n\t\t\tvar new_data_obj = [];\n\n\t\t\tfunction split_string(str){\n\t\t\t\tif(options.join !== '\\n' && options.skip_verify !== true) str = x.verify_string(str);\n\t\t\t\tvar pat = new RegExp('.{' + _this.max_str_len + '}\\w*\\W*|.*.', 'g');\n\t\t\t\tstr.match(pat).forEach(function(entry) {\n\t\t\t\t\tif(entry === '' || entry === null || entry === undefined) return;\n\t\t\t\t\tentry = options.skip_verify ? entry : x.verify_string(entry);\n\t\t\t\t\tnew_data_obj.push(entry);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif(data === undefined || data === null || data === false || data === '' || data.length < 1){ //no data\n\t\t\t\tnew_data_obj = [];\n\t\t\t} else if (typeof data === 'string'){ //string\n\t\t\t\tsplit_string(data);\n\t\t\t} else if(typeof data === 'object' && Array.isArray(data)){ //array\n\t\t\t\tdata.forEach(function(item, i){\n\t\t\t\t\tsplit_string(item);\n\t\t\t\t});\n\t\t\t} else if(typeof data === 'object' && !Array.isArray(data)){ //object\n\t\t\t\toptions.join = '\\n';\n\t\t\t\tvar data_arr = format_obj(data);\n\t\t\t\tdata_arr.forEach(function(item, i){\n\t\t\t\t\tsplit_string(item);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlog.error('verify_string: str is a', typeof data, data)\n\t\t\t\tsplit_string(JSON.stringify(data));\n\t\t\t}\n\n\t\t\tlog.trace('add_to_buffer new_data_obj', new_data_obj);\n\n\t\t\tif(new_data_obj.length <= options.lines){\n\t\t\t\toptions.ellipsis = false;\n\t\t\t\tcallback(new_data_obj.join(options.join + '\\u000f'));\n\t\t\t} else {\n\t\t\t\tnew_data_obj.unshift({\n\t\t\t\t\tfirst_len: new_data_obj.length,\n\t\t\t\t\tjoin: options.join,\n\t\t\t\t\tid: x.guid(),\n\t\t\t\t\tellipsis: options.ellipsis\n\t\t\t\t});\n\n\t\t\t\tlog.trace('adding buffer to', '/buffer/' + options.to, new_data_obj.slice(0,3), '...');\n\t\t\t\tdb.update('/buffer/' + options.to, new_data_obj, true, function(act){\n\t\t\t\t\tif(act === 'add'){\n\t\t\t\t\t\tpage_buffer(function(data){\n\t\t\t\t\t\t if(options.is_pm){\n\t\t\t\t\t\t\t\tdata = _this.t.highlight('To page through buffer, type ' + config.command_prefix + 'next. (type ' + config.command_prefix + 'next help for more info)\\n') + data;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlog.trace('added to ' + options.to + '\\'s buffer!')\n\t\t\t\t\t\t\tcallback(data);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.trace('cleared ' + options.to + '\\'s buffer!')\n\t\t\t\t\t}\n\t\t\t\t}, options.to);\n\t\t\t}\n\t\t}\n\n\t\t//activated when user sends !next in PM to bot\n\t\t//pages thru buffer, removes paged buffer lines\n\t\tfunction page_buffer(callback){\n\t\t\tif(options.join === '\\n'){\n\t\t\t\toptions.lines = options.lines !== undefined && +options.lines < 11 && +options.lines > 0 ? options.lines : options.force_lines ? options.lines : 5;\n\t\t\t} else if(options.join === ' ') {\n\t\t\t\toptions.lines = options.lines !== undefined && +options.lines < 21 && +options.lines > 0 ? options.lines : options.force_lines ? options.lines : 5;\n\t\t\t} else {\n\t\t\t\toptions.join = ' ' + _this.t.highlight(options.join) + ' ';\n\t\t\t\toptions.lines = options.lines !== undefined && +options.lines < 21 && +options.lines > 0 ? options.lines : options.force_lines ? options.lines : 5;\n\t\t\t}\n\n\t\t\tlog.trace('page_buffer', options);\n\n\t\t\tdb.get_data('/buffer/' + options.to, function(old_buffer){\n\t\t\t\tlog.trace('get buffer from', '/buffer/' + options.to, old_buffer === null ? null : old_buffer.slice(0, 3) +'...');\n\t\t\t\tif(old_buffer !== null && old_buffer.length > 1){\n\t\t\t\t\toptions.join = options.join === ' ' && old_buffer[0].join !== ' ' ? old_buffer[0].join : options.join;\n\n\t\t\t\t\t//if we're joining with a space, then lines becomes about send messages, instead of data lines\n\t\t\t\t\t//by default the bot splits messages at 512 characters, so we'll round down to 400\n\t\t\t\t\tif(options.join === ' ') {\n\t\t\t\t\t\tvar send_data = [];\n\t\t\t\t\t\tvar send_data_i = 0;\n\n\t\t\t\t\t\tfunction add_to(buff){\n\t\t\t\t\t\t\tif(send_data.length < options.lines){\n\t\t\t\t\t\t\t\tif(!send_data[send_data_i]){ //send data arr doesn't have this val yet\n\t\t\t\t\t\t\t\t\tif(buff.length <= _this.max_str_len){ //buffer data is less than max char per line\n\t\t\t\t\t\t\t\t\t\tsend_data.push(buff);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tsend_data.push(buff.slice(0, _this.max_str_len));\n\t\t\t\t\t\t\t\t\t\tadd_to(buff.slice((_this.max_str_len + 1), buff.length));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else { //send data has existing data in this iteration\n\t\t\t\t\t\t\t\t\tif(send_data[send_data_i].length < _this.max_str_len){ //data is under cutoff length\n\t\t\t\t\t\t\t\t\t\tif(buff.length <= _this.max_str_len){ //buffer data is less than max char per line\n\t\t\t\t\t\t\t\t\t\t\tsend_data[send_data_i] = send_data[send_data_i] + buff;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tsend_data[send_data_i] = send_data[send_data_i] + buff.slice(0, _this.max_str_len);\n\t\t\t\t\t\t\t\t\t\t\tadd_to(buff.slice((_this.max_str_len + 1), buff.length));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tsend_data_i++;\n\t\t\t\t\t\t\t\t\t\tadd_to(buff);\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\treturn true;\n\t\t\t\t\t\t\t} else {\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}\n\n\t\t\t\t\t\tvar spliced = false;\n\t\t\t\t\t\tfor(var i = 1; i < old_buffer.length; i++){\n\t\t\t\t\t\t\tif(!add_to(old_buffer[i] + ' ')){\n\t\t\t\t\t\t\t\tlog.trace('splice part old buffer 1 -> ', i);\n\t\t\t\t\t\t\t\told_buffer.splice(1, i);\n\t\t\t\t\t\t\t\tspliced = true;\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\tif(spliced === false){\n\t\t\t\t\t\t\tlog.trace('splice full old buffer 1 -> ', old_buffer.length);\n\t\t\t\t\t\t\told_buffer.splice(1, old_buffer.length);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar send_data = old_buffer.splice(1, options.lines);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(old_buffer.length === 1){\n\t\t\t\t\t\told_buffer = '';\n\t\t\t\t\t\toptions.next_info = '';\n\t\t\t\t\t\toptions.ellipsis = false;\n\t\t\t\t\t\toptions.skip_buffer = true;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\toptions.next_info = _this.t.highlight('(' + (old_buffer[0].first_len - (old_buffer.length - 1)) + '/' + old_buffer[0].first_len + ')');\n\t\t\t\t\t\toptions.ellipsis = old_buffer[0].ellipsis !== undefined && old_buffer[0].ellipsis !== null ? old_buffer[0].ellipsis : options.ellipsis;\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.trace('update to buffer', '/buffer/' + options.to, old_buffer.slice(0, 3), '...');\n\n\t\t\t\t\tdb.update('/buffer/' + options.to, old_buffer, true, function(act){\n\t\t\t\t\t\tif(act === 'add'){\n\t\t\t\t\t\t\tlog.trace('updated ' + options.to + '\\'s buffer!')\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.trace('cleared ' + options.to + '\\'s buffer!')\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback(send_data.join(options.join + '\\u000f'));\n\t\t\t\t\t}, options.to);\n\t\t\t\t} else {\n\t\t\t\t\t_this.say({'err': 'No buffer to page through.'}, 2, {to: options.to});\n\t\t\t\t}\n\t\t\t}, options.to);\n\t\t}\n\n\t\tfunction copy_buffer(from, to, callback){\n\t\t\tlog.trace('copy_buffer', from, '->', to);\n\t\t\tif(!from || from === 'undefined' || !to || to === 'undefined'){\n\t\t\t\tlog.error('from and to required');\n\t\t\t\tcallback();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdb.get_data('/buffer/' + from, function(from_buffer){\n\t\t\t\tlog.trace('/buffer/' + from, from_buffer === null ? null : from_buffer.slice(0, 3), '...');\n\t\t\t\tif(from_buffer === null){\n\t\t\t\t\tlog.trace('no buffer to copy from', from);\n\t\t\t\t\tcallback();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdb.get_data('/buffer/' + to, function(to_buffer){\n\t\t\t\t\tlog.trace('copy_buffer from:', from, 'to:', to, 'from_buffer_id:', from_buffer[0].id, 'to_buffer_id:', to_buffer && to_buffer[0] && to_buffer[0].id ? to_buffer[0].id : null);\n\n\t\t\t\t\t//don't copy buffer again if it's already got the same buffer id\n\t\t\t\t\tif(to_buffer !== null && from_buffer[0].id === to_buffer[0].id){\n\t\t\t\t\t\tlog.trace('skipping copy, buffer from ', from, 'already coppied to ', to);\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t//if there is a from buffer, set coppied to true, and update user buffer\n\t\t\t\t\tif(from_buffer.length > 1){\n\t\t\t\t\t\tvar new_buffer = from_buffer.slice(0);\n\t\t\t\t\t\tnew_buffer[0].coppied = true;\n\t\t\t\t\t\tdb.update('/buffer/' + to, new_buffer, true, function(act){\n\t\t\t\t\t\t\tif(act === 'add'){\n\t\t\t\t\t\t\t\tlog.trace('copied ' + from + ' to ' + to + '\\'s buffer!')\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.trace('cleared ' + to + '\\'s buffer!')\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t}, to);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback({'err': 'No buffer to page through.'});\n\t\t\t\t\t}\n\t\t\t\t}, to);\n\t\t\t}, from);\n\t\t}\n\n\t\t//color arr/obj levels\n\t\tfunction c_obj(level, str){\n\t\t\tif(_this.config.disable_colors){\n\t\t\t\treturn str;\n\t\t\t} else {\n\t\t\t\tvar col_arr = [13,4,7,8,9,12];\n\t\t\t\tif(col_arr[level] < 0){\n\t\t\t\t\treturn str;\n\t\t\t\t} else if(level >= col_arr.length){\n\t\t\t\t\tvar l = level % col_arr.length;\n\t\t\t\t\tvar c = '\\u0003' + col_arr[l];\n\t\t\t\t\treturn c + str + '\\u000f';\n\t\t\t\t} else {\n\t\t\t\t\tvar c = '\\u0003' + col_arr[level];\n\t\t\t\t\treturn c + str + '\\u000f';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//if say is an obj instead of string, int, etc\n\t\tfunction format_obj(obj, level) {\n\t\t\tlevel = level || 1;\n\t\t\tobj = obj || {};\n\n\t\t\tvar ret_arr = [];\n\t\t\tvar indent = Array(level).join(' ');\n\n\t\t\tif(Array.isArray(obj)){\n\t\t\t\tvar first = indent + c_obj(level, '[ ');\n\t\t\t} else {\n\t\t\t\tvar first = indent + c_obj(level, '{ ');\n\t\t\t}\n\n\t\t\tvar i = 0;\n\t\t\tvar arr_key = 0;\n\t\t\tfor(var key in obj)\t{\n\t\t\t\tvar k = c_obj(level, (Array.isArray(obj) ? '[' + arr_key + '] ' : key + ': '));\n\n\t\t\t\tif(i === 0){\n\t\t\t\t\tvar str = first + k;\n\t\t\t\t} else {\n\t\t\t\t\tvar str = indent + ' ' + k;\n\t\t\t\t}\n\n\t\t\t\tif(typeof obj[key] === 'function'){\n\t\t\t\t\tstr += '\\u000310function()\\u000f';\n\t\t\t\t\tret_arr.push(str);\n\t\t\t\t} else if(obj[key] == null){\n\t\t\t\t\tstr += '\\u000314NULL\\u000f';\n\t\t\t\t\tret_arr.push(str);\n\t\t\t\t} else if(obj[key] == undefined){\n\t\t\t\t\tstr += '\\u000314UNDEFINED\\u000f';\n\t\t\t\t\tret_arr.push(str);\n\t\t\t\t} else if(!isNaN(obj[key]) && +obj[key] > 1000000000000){\n\t\t\t\t\tstr += '\\u000310\\uFEFF' + obj[key] + ' (' + x.epoc_to_date(obj[key]) + ')\\u000f';\n\t\t\t\t\tret_arr.push(str);\n\t\t\t\t} else if(typeof obj[key] === 'string'){\n\t\t\t\t\tstr += '\\u000315\"' + obj[key] + '\"\\u000f';\n\t\t\t\t\tret_arr.push(str);\n\t\t\t\t} else if(typeof obj[key] === 'object'){\n\t\t\t\t\tvar comb_arr = format_obj(obj[key], level + 1);\n\t\t\t\t\tif(comb_arr.length < 2) {\n\t\t\t\t\t\tstr += comb_arr.join(' ').trim();\n\t\t\t\t\t\tret_arr.push(str);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tret_arr.push(str);\n\t\t\t\t\t\tret_arr = ret_arr.concat(comb_arr);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstr += '\\u000310\\uFEFF' + obj[key] + '\\u000f';\n\t\t\t\t\tret_arr.push(str);\n\t\t\t\t}\n\n\t\t\t\ti++;\n\t\t\t\tarr_key++;\n\t\t\t}\n\n\t\t\tif(Array.isArray(obj)){\n\t\t\t\tvar last = (i < 2 ? ' ' : indent) + c_obj(level, ']');\n\t\t\t} else {\n\t\t\t\tvar last = (i < 2 ? ' ' : indent) + c_obj(level, '}');\n\t\t\t}\n\n\t\t\tif(i < 2){\n\t\t\t\tret_arr[ret_arr.length - 1] = ret_arr[ret_arr.length - 1] + last;\n\t\t\t} else {\n\t\t\t\tret_arr.push(last);\n\t\t\t}\n\n\t\t\treturn ret_arr;\n\t\t}\n\t}", "function printWelcomeMessage(){\r\n console.log(figlet.textSync('Hang Man!', {\r\n font: 'Standard'\r\n })\r\n ); \r\n}", "function newVoice(e){\n\n // handleEvent(e);\n // alert('new voice')\n /* var saying = Math.floor(Math.random()*setting.phrases.length)\n msg.text = setting.phrases[saying].salutation + ' '+ setting.phrases[saying].comment;\n\n */\n\n\n var voices = window.speechSynthesis.getVoices();\n randomVoice = voiceList[Math.floor(Math.random()*voiceList.length)];\n // randomVoice = 'Fred';\n // console.log(randomVoice)\n msg.voice = voices.filter(function(voice) { return voice.name == randomVoice })[0];\n window.speechSynthesis.speak(msg);\n\n $('.logo').addClass(\"touched\");\n $('body').removeClass(\"thinking\");\n // showName();\n }", "function aiReply(reply) {\n document.getElementById(\"ai\").innerHTML = reply;\n}", "function tellMe(joke) {\n VoiceRSS.speech({\n key: \"c6335045100f481daec833cf10c237aa\",\n src: joke,\n hl: \"en-us\",\n v: \"Linda\",\n r: 0,\n c: \"mp3\",\n f: \"44khz_16bit_stereo\",\n ssml: false,\n });\n}", "say() { //method\n\t\t\tconsole.log('Saying');\n\t\t}", "function storyOne() {\n console.log(\"story there\");\n $('#instructions').text('story time');\n// varible to make a random story\n var story = {\n \"start\": \"Once upon a time, #name# the #animal# #action# #moment# #place#\",\n// the different variable that the player chose\n \"name\": [chosenName],\n \"animal\": [chosenAnimal],\n \"action\": [chosenAction],\n \"moment\": [chosenMoment],\n \"place\": [chosenPlace]\n }\n\n// variable to use tracery\n var grammar = tracery.createGrammar(story);\n var result = grammar.flatten(\"#start#\");\n console.log(result);\n $('#story').show();\n $('#story').text(result);\n responsiveVoice.speak(result, 'UK English Female',{pitch:1},{rate:1});\n// set a timeout before showing the next step of the story\n setTimeout(narrator,5000);\n}", "function inicio(){\n let paragraph1 = document.getElementById(\"paragraph1\").textContent;\n speechTitle(\"¿Quiénes Somos?\",paragraph1)\n }", "function SendToChat(text) {\n client.say(current_channel, text);\n}", "function yoMamaJoke() {\n axios.get('http://api.yomomma.info').then(res => {\n const joke = res.data.joke;\n\n const params = {\n icon_emoji: ':laughing:'\n };\n\n bot.postMessageToChannel('general', `Yo Mama: ${joke}`, params);\n });\n}", "function textToSpeech(){\n speech.speak(\"你說: \" + msg);\n }", "function say(message) {\n console.log(cowsay.say({\n text: message\n }));\n}", "function followed(eventMsg){ //thank follower via reply tweet\r\n\tconsole.log(\"New Follower! \\n replying...\");\r\n\t// var name= eventMsg.source.name;\r\n\tvar screenName= eventMsg.source.screen_name;\r\n\ttweetIt('@' + screenName + ' thanks for the follow!');\r\n}" ]
[ "0.7363197", "0.7236393", "0.72353745", "0.7078629", "0.6525562", "0.65120333", "0.6509771", "0.6442375", "0.64272416", "0.63740355", "0.6295206", "0.62834585", "0.6275735", "0.6269438", "0.6239409", "0.6236625", "0.62247294", "0.6213793", "0.6135503", "0.6116226", "0.6095478", "0.60573435", "0.60563576", "0.60484684", "0.60378844", "0.6013549", "0.60082114", "0.600208", "0.59953886", "0.5976674", "0.5968382", "0.596677", "0.5966526", "0.59660834", "0.59583473", "0.5941487", "0.59396744", "0.59340984", "0.5905002", "0.58945847", "0.5889755", "0.58707565", "0.58564997", "0.58564055", "0.58554137", "0.5853525", "0.58491623", "0.5845019", "0.5837602", "0.5819929", "0.5815755", "0.5814184", "0.58103263", "0.58053666", "0.58037287", "0.5801726", "0.58001137", "0.57979196", "0.57821846", "0.5777501", "0.5773922", "0.57667595", "0.5764434", "0.575936", "0.57540673", "0.575377", "0.57468486", "0.574547", "0.57454693", "0.5744745", "0.5742437", "0.5741426", "0.5740197", "0.5739357", "0.57245237", "0.57201076", "0.57187593", "0.5715966", "0.5705893", "0.56994903", "0.5693241", "0.56901103", "0.56851006", "0.5682576", "0.5681649", "0.5680201", "0.56736887", "0.5668072", "0.5666408", "0.5664456", "0.5664403", "0.56598", "0.5657285", "0.56534076", "0.56530863", "0.5651646", "0.5650269", "0.5645212", "0.5643365", "0.56429946", "0.5642307" ]
0.0
-1
Set tutti i nodi
setNodes(nodes) { this._nodes = nodes }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function atualizaTempo(tempo) {\n\ttempoInicial = tempo;\n\t$(\"#tempo-digitacao\").text(tempo);\n}", "function setNew() {\n curPos = 4\n rndT = nextRnd\n nextRnd = Math.floor(Math.random()*tetrominoes.length)\n curT = tetrominoes[rndT][curRot]\n }", "function setPlayTime(t) {\n console.log(\"setPlayTime \" + t);\n pano.setPlayTime(t);\n if (PC)\n PC.sendMessage({ 'type': 'pano.control', time: t });\n}", "function setarTempo(pausa){\n\tvar segundos = parseInt(document.getElementById('segundos').innerHTML);\n\tvar minutos = parseInt(document.getElementById('minutos').innerHTML);\n\tvar soma = 0;\n\tvar tempo = \"\";\n\n\t//Se o jogo foi pausado ou verificado, adiciona 29 segundos ao tempo\n\t//(29 porque 1 segundo já está sendo incrementado pela função)\n\tif (pausa)\n\t\tsoma = 29;\n\n\tif (segundos < 59){ \n \tsegundos = segundos + 1 + soma;\n \tif ((segundos - 60) > 0){\n \t\tsegundos = segundos - 60;\n \t\tminutos = minutos + 1;\n \t}\n }\n else{\n \tsegundos = soma;\n \tminutos = minutos + 1;\n }\n document.getElementById('minutos').innerHTML = minutos;\n tempo = minutos;\n\n if (segundos < 10){\n \tdocument.getElementById('segundos').innerHTML = \"0\" + segundos;\n \ttempo = tempo + \":0\" + segundos;\n }\n else{\n \tdocument.getElementById('segundos').innerHTML = segundos;\n \ttempo = tempo + \":\" + segundos;\n }\n\n $(\"#hTempo\").val(tempo);\n}", "get tus() { return tus; }", "setInactiveTetrinos () {\n var x, y\n // Set active pieces in board to not being active.\n for (y = 0; y < Y_SPACES; y++) {\n for (x = 0; x < X_SPACES; x++) {\n if (this.board[y][x].activePiece) {\n this.board[y][x].activePiece = false\n }\n }\n }\n // When a tetrino is set to inactive a new one needs to be generated\n this.needsNewPiece = true\n }", "set TizenPlayer(value) {}", "function setTIcu(tView, index, tIcu) {\n var tNode = tView.data[index];\n ngDevMode && assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n\n if (tNode === null) {\n tView.data[index] = tIcu;\n } else {\n ngDevMode && assertTNodeType(tNode, 32\n /* Icu */\n );\n tNode.value = tIcu;\n }\n }", "function setTempo(){\n\ttempo = $(\"#metronomo\").val();\n\tconsole.log(\"new Tempo value is:\",tempo);\n}", "function setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode &&\n assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n if (tNode === null) {\n tView.data[index] = tIcu;\n }\n else {\n ngDevMode && assertTNodeType(tNode, 32 /* Icu */);\n tNode.value = tIcu;\n }\n}", "function setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode &&\n assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n if (tNode === null) {\n tView.data[index] = tIcu;\n }\n else {\n ngDevMode && assertTNodeType(tNode, 32 /* Icu */);\n tNode.value = tIcu;\n }\n}", "function setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode &&\n assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n if (tNode === null) {\n tView.data[index] = tIcu;\n }\n else {\n ngDevMode && assertTNodeType(tNode, 32 /* Icu */);\n tNode.value = tIcu;\n }\n}", "function setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode &&\n assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n if (tNode === null) {\n tView.data[index] = tIcu;\n }\n else {\n ngDevMode && assertTNodeType(tNode, 32 /* Icu */);\n tNode.value = tIcu;\n }\n}", "function setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode &&\n assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n if (tNode === null) {\n tView.data[index] = tIcu;\n }\n else {\n ngDevMode && assertTNodeType(tNode, 32 /* Icu */);\n tNode.value = tIcu;\n }\n}", "function setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode &&\n assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n if (tNode === null) {\n tView.data[index] = tIcu;\n }\n else {\n ngDevMode && assertTNodeType(tNode, 32 /* Icu */);\n tNode.value = tIcu;\n }\n}", "function setSelectModif(etat, poste){\n document.getElementById(\"etat\").selectedIndex = etat;\n document.getElementById(\"poste\").selectedIndex = poste;\n}", "function setData() {\r\n // Uzmemo trenutni grad iz niza\r\n const city = cityNames[currentCity];\r\n\r\n // Dohvatimo podatke za trenutni grad.\r\n getTemperatureDataForCity(city).then(({ temp, temp_max, temp_min }) => {\r\n // Upisemo podatke u html.\r\n document.getElementById('city').innerHTML = `${city}`;\r\n document.getElementById('currentTemp').innerHTML = `${temp} celzijusa`;\r\n document.getElementById('minTemp').innerHTML = `${temp_min} celzijusa`;\r\n document.getElementById('maxTemp').innerHTML = `${temp_max} celzijusa`;\r\n });\r\n\r\n // Uvecava indeks trenutnog grada. Vraca na 0 kada dodje do kraja.\r\n currentCity = (currentCity + 1) % cityNames.length;\r\n}", "function setTIcu(tView, index, tIcu) {\n var tNode = tView.data[index];\n ngDevMode && assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n\n if (tNode === null) {\n tView.data[index] = tIcu;\n } else {\n ngDevMode && assertTNodeType(tNode, 32\n /* Icu */\n );\n tNode.value = tIcu;\n }\n}", "function Temperatura(numero, unidad){\n //Atributos de la clase\n Medida.call(this,numero,unidad); //Llamada al constructor de la clase padre\n\n }", "function setSettings(t1Name, t2Name, timerMins, startingTeam)\n{\n t1_name = t1Name;\n t2_name = t2Name;\n timer_mins = timerMins;\n starting_team = startingTeam;\n\n document.getElementsByClassName(\"team-one\")[0].innerHTML = t1Name;\n T1.name = t1Name;\n\n document.getElementsByClassName(\"team-two\")[0].innerHTML = t2Name;\n T2.name = t2Name;\n\n document.getElementsByClassName(\"minutes\")[0].innerHTML = timer_mins;\n timer.minutes = timer_mins;\n\n document.getElementsByClassName(\"input-team\")[0].innerHTML = \"<b>Possession: \" + starting_team + \"</b>\";\n currTeam = starting_team;\n}", "function tarkistaPari() {\r\n let ovatPari = ekaKortti.dataset.kehys === tokaKortti.dataset.kehys;\r\n //jos kortit ovat pari estetään niitä kääntymästä ja\r\n //jos kortit eivät ole pari käännetään ne takaisin\r\n ovatPari ? disable() : unflip();\r\n}", "function setTutorName(tutorElement, tutorID) {\n var tutor;\n return getUser(tutorID).then(user => tutor = user).then(() => {\n // If the tutur is also a student get the information that relates to the tutor\n if (tutor.student != null) {\n tutor = tutor.tutor;\n }\n tutorElement.innerHTML = \"Tutoring Session with \" + tutor.name;\n });\n}", "function t(e, t, n, i) {\n var r = {\n m: [\"eine Minute\", \"einer Minute\"],\n h: [\"eine Stunde\", \"einer Stunde\"],\n d: [\"ein Tag\", \"einem Tag\"],\n dd: [e + \" Tage\", e + \" Tagen\"],\n w: [\"eine Woche\", \"einer Woche\"],\n M: [\"ein Monat\", \"einem Monat\"],\n MM: [e + \" Monate\", e + \" Monaten\"],\n y: [\"ein Jahr\", \"einem Jahr\"],\n yy: [e + \" Jahre\", e + \" Jahren\"]\n };\n return t ? r[n][0] : r[n][1]\n }", "function t(e, t, n, i) {\n var r = {\n m: [\"eine Minute\", \"einer Minute\"],\n h: [\"eine Stunde\", \"einer Stunde\"],\n d: [\"ein Tag\", \"einem Tag\"],\n dd: [e + \" Tage\", e + \" Tagen\"],\n w: [\"eine Woche\", \"einer Woche\"],\n M: [\"ein Monat\", \"einem Monat\"],\n MM: [e + \" Monate\", e + \" Monaten\"],\n y: [\"ein Jahr\", \"einem Jahr\"],\n yy: [e + \" Jahre\", e + \" Jahren\"]\n };\n return t ? r[n][0] : r[n][1]\n }", "function t(e, t, n, i) {\n var r = {\n m: [\"eine Minute\", \"einer Minute\"],\n h: [\"eine Stunde\", \"einer Stunde\"],\n d: [\"ein Tag\", \"einem Tag\"],\n dd: [e + \" Tage\", e + \" Tagen\"],\n w: [\"eine Woche\", \"einer Woche\"],\n M: [\"ein Monat\", \"einem Monat\"],\n MM: [e + \" Monate\", e + \" Monaten\"],\n y: [\"ein Jahr\", \"einem Jahr\"],\n yy: [e + \" Jahre\", e + \" Jahren\"]\n };\n return t ? r[n][0] : r[n][1]\n }", "function t(e, t, n, i) {\n var r = {\n m: [\"eine Minute\", \"einer Minute\"],\n h: [\"eine Stunde\", \"einer Stunde\"],\n d: [\"ein Tag\", \"einem Tag\"],\n dd: [e + \" Tage\", e + \" Tagen\"],\n w: [\"eine Woche\", \"einer Woche\"],\n M: [\"ein Monat\", \"einem Monat\"],\n MM: [e + \" Monate\", e + \" Monaten\"],\n y: [\"ein Jahr\", \"einem Jahr\"],\n yy: [e + \" Jahre\", e + \" Jahren\"]\n };\n return t ? r[n][0] : r[n][1]\n }", "function t(e, t, n, i) {\n var r = {\n m: [\"eine Minute\", \"einer Minute\"],\n h: [\"eine Stunde\", \"einer Stunde\"],\n d: [\"ein Tag\", \"einem Tag\"],\n dd: [e + \" Tage\", e + \" Tagen\"],\n w: [\"eine Woche\", \"einer Woche\"],\n M: [\"ein Monat\", \"einem Monat\"],\n MM: [e + \" Monate\", e + \" Monaten\"],\n y: [\"ein Jahr\", \"einem Jahr\"],\n yy: [e + \" Jahre\", e + \" Jahren\"]\n };\n return t ? r[n][0] : r[n][1]\n }", "function t(e, t, n, i) {\n var r = {\n m: [\"eine Minute\", \"einer Minute\"],\n h: [\"eine Stunde\", \"einer Stunde\"],\n d: [\"ein Tag\", \"einem Tag\"],\n dd: [e + \" Tage\", e + \" Tagen\"],\n w: [\"eine Woche\", \"einer Woche\"],\n M: [\"ein Monat\", \"einem Monat\"],\n MM: [e + \" Monate\", e + \" Monaten\"],\n y: [\"ein Jahr\", \"einem Jahr\"],\n yy: [e + \" Jahre\", e + \" Jahren\"]\n };\n return t ? r[n][0] : r[n][1]\n }", "function setJoueurEdite(Nojoueur) {\r\n\tvar arguments = \"nojoueur=\" + Nojoueur;\r\n\trequest(\"POST\", \"admin.php?methode=JOUEUR_edite\", true, setData, arguments );\r\n}", "setTempo(tempo) {\r\n // Sanity check just in case.\r\n if (!(tempo > 0) || tempo == Infinity) return;\r\n this.renderer.renderTempo(tempo);\r\n this.audioPlayer.setTempo(tempo);\r\n }", "function setTime( t ){\n\n this.time = t;\n\n }", "function setSubunit(m, n)\n {\n my.current.unitNo = m\n my.current.subunitNo = n\n\n my.current.unit = unit(m)\n\n my.current.subunitTitles.length = 0\n for (var subunitTitle in my.current.unit.subunits) {\n my.current.subunitTitles.push(subunitTitle)\n }\n\n var subunitTitle = my.current.subunitTitles[n - 1]\n my.current.subunitText = my.current.unit.subunits[subunitTitle]\n }", "function setAt(e) {\r\n var at = document.getElementById(\"at\");\r\n if (at) {\r\n // d = 'top of the timeline time' \r\n var n = new Date();\r\n n.setTime(tl_t_time.getTime() + (tl_unwarp(e.pageY) - tl_scroll_offset) *60*1000);\r\n s=(n.getFullYear())+\"/\"+(n.getMonth()+1)+\"/\"+n.getDate()+\" \"+n.getHours()+\":\"+pad2(n.getMinutes())+\":\"+pad2(n.getSeconds());\r\n at.value=s;\r\n }\r\n }", "function t(e, t, n, i) {\n var r = {\n s: [\"mõne sekundi\", \"mõni sekund\", \"paar sekundit\"],\n ss: [e + \"sekundi\", e + \"sekundit\"],\n m: [\"ühe minuti\", \"üks minut\"],\n mm: [e + \" minuti\", e + \" minutit\"],\n h: [\"ühe tunni\", \"tund aega\", \"üks tund\"],\n hh: [e + \" tunni\", e + \" tundi\"],\n d: [\"ühe päeva\", \"üks päev\"],\n M: [\"kuu aja\", \"kuu aega\", \"üks kuu\"],\n MM: [e + \" kuu\", e + \" kuud\"],\n y: [\"ühe aasta\", \"aasta\", \"üks aasta\"],\n yy: [e + \" aasta\", e + \" aastat\"]\n };\n return t ? r[n][2] ? r[n][2] : r[n][1] : i ? r[n][0] : r[n][1]\n }", "function SetSDT( s, d, t ){\n if( s ){\n console.log( \"Setting speed to \"+s);\n speed = s;\n }\n if( d ){\n distance = d;\n }\n if( t ){\n time = t;\n }\n }", "function _setVario(vario){\n\n var deg = Math.sign(vario) * Math.min(Math.abs(vario), 20) * 8.2;\n if (vario > 20 || vario < - 20) deg += vario % 2;\n\n placeholder.each(function(){\n $(this).find('div.instrument.vario div.vario_hand')\n .css('transform', 'rotate(' + deg + 'deg)')\n .css('transition', 'transform 1.0s linear');\n\n }); \n }", "function setIndiceEdite(Nojoueur) {\r\n\tvar arguments = \"nojoueur=\" + Nojoueur;\r\n\trequest(\"POST\", \"admin.php?methode=INDICE_edite\", false, setData, arguments ); /*pas d'AJAX asynchrone, car manipulation sur champ*/\r\n\t/*champ date*/\r\n\t$(function() {\r\n\t\t$( \"#Datedebut\" ).datepicker({ numberOfMonths: 3, showButtonPanel: true});\r\n\t\t$( \"#Datefin\" ).datepicker({ numberOfMonths: 3, showButtonPanel: true});\r\n\t});\r\n\t/*champ heure*/\r\n\t$('#Heuredebut').timepicker({hourText: 'Heures', minuteText: 'Minutes', amPmText: ['Matin', 'Aprem'], timeSeparator: ':'});\r\n\t$('#Heurefin').timepicker({hourText: 'Heures', minuteText: 'Minutes', amPmText: ['Matin', 'Aprem'], timeSeparator: ':'});\r\n\t/*champ commentaire avec editeur HTML*/\r\n\t$(document).ready(function() {\r\n $(\"#Libelle\").cleditor()[0].focus();\r\n\t});\r\n}", "set tvOS(value) {}", "set tramite(valor)\r\n\t{\t\t\r\n\t\t$('#idFormularioInput').val(valor.id);\r\n\t\t$('#nombreTramiteFormularioInput').val(valor.nombreTramite);\t\t\r\n\t}", "function setPosicion() {\n\t\tvar id1 = \"TITULO_BANDEJA\";\n\t\tvar id2 = \"TITULO_BANDEJA_2\";\n\t\tif ( document.getElementById(id1) != null )\n\t\t modificaPosicion( id1, 208 );\n\t\t//if ( document.getElementById(id2) != null )\n\t\t //modificaPosicion( id2, 300 );\n }", "function t(e, t, n, i) {\n var r = {\n s: [\"thoddea sekondamni\", \"thodde sekond\"],\n ss: [e + \" sekondamni\", e + \" sekond\"],\n m: [\"eka mintan\", \"ek minut\"],\n mm: [e + \" mintamni\", e + \" mintam\"],\n h: [\"eka voran\", \"ek vor\"],\n hh: [e + \" voramni\", e + \" voram\"],\n d: [\"eka disan\", \"ek dis\"],\n dd: [e + \" disamni\", e + \" dis\"],\n M: [\"eka mhoinean\", \"ek mhoino\"],\n MM: [e + \" mhoineamni\", e + \" mhoine\"],\n y: [\"eka vorsan\", \"ek voros\"],\n yy: [e + \" vorsamni\", e + \" vorsam\"]\n };\n return i ? r[n][0] : r[n][1]\n }", "function t(e, t, n, i) {\n var r = {\n s: [\"thoddea sekondamni\", \"thodde sekond\"],\n ss: [e + \" sekondamni\", e + \" sekond\"],\n m: [\"eka mintan\", \"ek minut\"],\n mm: [e + \" mintamni\", e + \" mintam\"],\n h: [\"eka voran\", \"ek vor\"],\n hh: [e + \" voramni\", e + \" voram\"],\n d: [\"eka disan\", \"ek dis\"],\n dd: [e + \" disamni\", e + \" dis\"],\n M: [\"eka mhoinean\", \"ek mhoino\"],\n MM: [e + \" mhoineamni\", e + \" mhoine\"],\n y: [\"eka vorsan\", \"ek voros\"],\n yy: [e + \" vorsamni\", e + \" vorsam\"]\n };\n return i ? r[n][0] : r[n][1]\n }", "function setSquadre(t) {\r\n teams = t;\r\n for(var i=0;i < teams.length; i++){\r\n teamsIdByShortName[teams[i].shortName.toLowerCase()] = {\r\n \"id\": teams[i].id,\r\n \"name\": teams[i].name,\r\n \"shortName\": teams[i].shortName\r\n };\r\n\r\n teamsIdByName[teams[i].name] = {\r\n \"id\": teams[i].id,\r\n \"name\": teams[i].name,\r\n \"shortName\": teams[i].shortName.toLowerCase()\r\n };\r\n }\r\n}", "function changeObs()\n{\n T1.name = t1_name;\n T2.name = t2_name;\n timer.minutes = timer_mins;\n timer.halves = timer_halves;\n currTeam = starting_team;\n}", "asetaKupla(nimi,kupla){\n for(var i = 0; i < this.hahmot.length; i++){\n var hahmo = this.hahmot[i];\n if (hahmo.nimi == nimi) hahmo.asetaKupla(kupla);\n }\n }", "function selectTempo() {\n\tlet sel = document.getElementById('tempoSelect');\n\tlet selected = sel.value;\n\tbpm = MM2Tempos[selected].bpm * (4 / blocksPerBeat);\n\tbuildSetups = MM2Tempos[selected].setups;\n\tif (buildSetups === undefined) buildSetups = defaultSetups;\n\tcancelPlayback();\n\tsoftRefresh();\n}", "function HoraInicioTPChange() {\n realizarCambioHora();\n}", "function rotacionarSetaDoVetor(val, vetor) {\r\n let seta = vetor.querySelector('.seta');\r\n seta.style.transform = 'rotate(' + (-val) + 'deg)';\r\n}", "function change(ime, godini, programer, lokacija) {\n ime = 'Vancho';\n godini = 40;\n programer = false;\n lokacija.grad = 'Bitola';\n}", "function C012_AfterClass_Jennifer_ChangeToTrain() {\n\tif (ActorGetValue(ActorCloth) != \"Tennis\") {\n\t\tCurrentTime = CurrentTime + 50000;\n\t\tActorSetCloth(\"Tennis\");\n\t\tOverridenIntroText = GetText(\"TennisToTrain\");\n\t}\n}", "set SamsungTVPlayer(value) {}", "function setTurnOnView(){\n \tconsola.innerHTML = \"PLAYER\" + (turno + 1);\n }", "set nombre(nom){\n this._nombres = nom;\n }", "function setDosesValue(value, type, index, injTime) {\n let doses = Common.lsGet(\"doses\"),\n obj = doses[injTime] || {},\n hasDoseArr = obj[type] || [];\n\n if (hasDoseArr.length !== 0) {\n hasDoseArr.forEach(elem => {\n if (elem.to == index) {\n elem.dose = Number(value);\n }\n });\n } else {\n fm.forEach((from, idx) => {\n hasDoseArr.push({\n dose: to[idx] == index ? Number(value) : 0,\n from,\n to: to[idx]\n });\n });\n }\n\n if (doses[injTime] !== undefined) {\n obj[type] = hasDoseArr;\n doses[injTime] = obj;\n\n Common.lsSet(\"doses\", doses);\n }\n }", "set modificarNombre(nuevoNombre) {\n this.nombre = nuevoNombre;\n }", "function zmienAtrybut()\n{\n var tytul = document.getElementById(\"tytul\");\n tytul.setAttribute(\"title\", \"Kurs PHP akuku\"); // w nawiasie nazwa atrybutu i jego wartosc\n}", "function updateTeddyInfo(teddy) {\n //On injecte les données du teddy API dans le currentTeddy.\n currentTeddy.id = teddy._id\n currentTeddy.name = teddy.name\n currentTeddy.image = teddy.imageUrl\n currentTeddy.description = teddy.description\n currentTeddy.price = teddy.price/100\n currentTeddy.quantity = 1\n \n displayImageTeddy(currentTeddy)\n displayDescriptionTeddy(currentTeddy.description)\n displayPriceTeddy(currentTeddy)\n displayColorsTeddy(teddy) \n}", "function pisarTerreno(nuevo){\n // Recorrer cada terreno del jugador\n for(var a = 0; a < jugando.terrenos.length; a++){\n // Si el ID coincide con el nuevo terreno\n if(nuevo.id == jugando.terrenos[a][0]){\n // Si tiene un peso, entonces aplica\n if(jugando.terrenos[a][1] != \"\"){\n return true;\n }\n else{\n return false;\n }\n }\n }\n}", "anadirTP() {\n this.TP = parseInt(this.TP) + 1;\n }", "function modificado(t) {\n datos();\n}", "setWords(words) {\n\n let r = Dictionnary.getRndInteger(0, 3);\n this.joueurs[r].word = words[0];\n this.joueurs[r].solo = true;\n for (let i = 0; i < this.joueurs.length; i++) {\n\n if (i === r) continue;\n this.joueurs[i].word = words[1];\n this.joueurs[i].solo = false;\n\n }\n\n }", "function atualizaTempoNaPagina(){\n\ttempo = horas+\"<font color=#000000>:</font>\"+minutos+\"<font color=#000000>:</font>\"+segundos; // procura o local onde o tempo deve aparecer\n\tdocument.getElementById('clock1').innerHTML=tempo; //mostra o tempo atual na pagina\n}", "set_hasil() {\n this.get_hasil();\n document.getElementById(\"nilai-hasil\").innerHTML = this.nilai_hasil;\n }", "function fasesTorneo() {\n vm.paso = 3;\n obtenerFases();\n obtenerTiposDeFase();\n obtenerPenalizaciones();\n }", "function setTribeChoice(choice) {\r\n\r\n // Update the title bar to reflect the tribe choice\r\n var tagElem = $(\"#hero-villian-tag\");\r\n tagElem.text(choice);\r\n\r\n tribe = choice;\r\n}", "function t(e, t, n, i) {\n var r = {\n s: [\"mõne sekundi\", \"mõni sekund\", \"paar sekundit\"],\n ss: [e + \"sekundi\", e + \"sekundit\"],\n m: [\"ühe minuti\", \"üks minut\"],\n mm: [e + \" minuti\", e + \" minutit\"],\n h: [\"ühe tunni\", \"tund aega\", \"üks tund\"],\n hh: [e + \" tunni\", e + \" tundi\"],\n d: [\"ühe päeva\", \"üks päev\"],\n M: [\"kuu aja\", \"kuu aega\", \"üks kuu\"],\n MM: [e + \" kuu\", e + \" kuud\"],\n y: [\"ühe aasta\", \"aasta\", \"üks aasta\"],\n yy: [e + \" aasta\", e + \" aastat\"]\n };\n if (t) {\n return r[n][2] ? r[n][2] : r[n][1]\n }\n return i ? r[n][0] : r[n][1]\n }", "function pos_pianeti(njd,np){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) novembre 2010\n // calcola la posizione dei pianeti \n // njd= numero del giorno giuliano della data in T.U.\n // np= numero identificativo del pianeta 0,1,2,3,4,5,6,7,8 mercurio,venere... 2 per la Terra\n // coordinate geocentriche del pianeta riferite all'equinozio della data (njd).\n // calcola le principali perturbazioni planetarie.\n\n // new Array(Periodo , Long_media , Anomalia_media , Long_perielio , eccentr , Semiasse , Inclinazione , Long_nodo , dim_ang , magnitudine);\n // 0 1 2 3 4 5 6 7 8 9\n\n var tempo_luce=t_luce(njd,np);\n \n njd=njd-tempo_luce; // correzione per il tempo luce.\n\n var el_orb=orb_plan(njd,np); // recupera gli elementi orbitali del pianeta.\n\n var periodo= el_orb[0]; // periodo.\n var L= el_orb[1]; // longitudine media all'epoca.\n var AM_media= el_orb[2]; // anomalia media. \n var long_peri= el_orb[3]; // longitudine del perielio.\n var eccent= el_orb[4]; // eccentricità dell'orbita.\n var semiasse= el_orb[5]; // semiasse maggiore.\n var inclinaz= el_orb[6]; // inclinazione.\n var long_nodo= el_orb[7]; // longitudine del nodo.\n var dimens= el_orb[8]; // dimensioni apparenti.\n var magn= el_orb[9]; // magnitudine.\n\n \n var correzioni_orb=pos_pianeticr(njd,np); // calcolo delle correzioni per il pianeta (np).\n \n// Array(Delta_LP , Delta_R , Delta_LL , Delta_AS , Delta_EC , Delta_MM , Delta_LAT_ELIO);\n// 0 1 2 3 4 5 6 \n// lperiodo, rvett long. assemagg ecc M lat\n\n// CORREZIONI \n\n L=L+correzioni_orb[0]; // longitudine media.\n AM_media= AM_media+correzioni_orb[5]; // anomalia media + correzioni..\n semiasse= semiasse+correzioni_orb[3]; // semiasse maggiore.\n eccent= eccent+correzioni_orb[4]; // eccentricità.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ***************************************************** inizio:\n\n var M=AM_media; // anomalia media \n \n M=gradi_360(M); // intervallo 0-360;\n\n var E=eq_keplero(M,eccent); // equazione di Keplero.E[0]=Anomalia eccentrica E[1]=Anomalia vera in radianti.\n \n var rv=semiasse*(1-eccent*Math.cos(E[0])); // calcolo del raggio vettore (distanza dal Sole).\n rv=rv+correzioni_orb[1]; // raggio vettore più correzione.\n\n\n var U=gradi_360(L+Rda(E[1])-M-long_nodo); // argomento della latitudine.\n\n var long_eccliticay=Math.cos(Rad(inclinaz))*Math.sin(Rad(U));\n var long_eccliticax=Math.cos(Rad(U));\n\n var long_ecclitica=quadrante(long_eccliticay,long_eccliticax)+long_nodo;\n var l=gradi_360(long_ecclitica);\n l=l+correzioni_orb[2]; // longitudine del pianeta + correzione.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ********************************************************* fine: \n\n var b=Rda(Math.asin(Math.sin(Rad(U))*Math.sin(Rad(inclinaz)))); // latitudine ecclittica in gradi (b)\n\n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** inizio:\n\n njd=njd+tempo_luce; \n\n var eff_sole=pos_sole(njd);\n var LS=eff_sole[2]; // longitudine geocentrica del Sole.\n var RS=eff_sole[4]; // raggio vettore.\n \n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** fine: \n\n // longitudine geocentrica.\n\n var Y=rv*Math.cos(Rad(b))*Math.sin(Rad(l-LS));\n var X=rv*Math.cos(Rad(b))*Math.cos(Rad(l-LS))+RS;\n\n var long_geo=gradi_360(quadrante(Y,X)+LS); // longitudine geocentrica.\n\n var dist_p=Y*Y+X*X+(rv*Math.sin(Rad(b)))*(rv*Math.sin(Rad(b))); \n dist_p=Math.sqrt(dist_p); // distanza del pianeta dalla Terra.\n\n var beta=(rv/dist_p)*Math.sin(Rad(b));\n var lat_geo=Rda(Math.asin(beta));\n lat_geo=lat_geo+correzioni_orb[6]; // latitudine + correzione.\n\n \n// fase del pianeta.\n\nvar fase=0.5*(1+Math.cos(Rad(long_geo-long_ecclitica)));\n fase=fase.toFixed(2);\n\n// parallasse del pianeta in gradi.\n\nvar pa=(8.794/dist_p)/3600;\n\nvar coo_pl=trasf_ecli_equa(njd,long_geo,lat_geo); // coordinate equatoriali. \n\n // diametro apparente in secondi d'arco.\n\nvar diam_app=dimens/dist_p; \n\n// magnitudine del pianeta.\n\nvar magnitudine=(5*(Math.log(rv*dist_p/(magn*Math.sqrt(fase))))/2.302580)-27.7;\n magnitudine=magnitudine.toFixed(1);\n\nif (magnitudine==Infinity) {magnitudine=\"nd\"; }\n\nvar elongaz=elong(coo_pl[0],coo_pl[1],eff_sole[0],eff_sole[1]); // elongazione in gradi dal Sole.\n \n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_p; // distanza pianeta-terra.\n var Dts= RS; // distanza terra-sole.\n var Dps= rv; // distanza pianeta-sole.\n\n // teorema del coseno\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-Math.abs(elongaz)-delta_fase; // angolo di fase in gradi.\n \nvar dati_pp= new Array(coo_pl[0],coo_pl[1],fase,magnitudine,dist_p,diam_app,elongaz,LS,RS,long_ecclitica,pa,rv,angolo_fase);\n// 0 1 2 3 4 5 6 7 8 9 10 11 12 \n\n\n\n// risultati: ARetta,Declinazione,fase,magnitudine,distanza pianeta,diametro apparente, elongazione, long. sole,raggio vettore Terra, longituddine elio. pianeta, parallase,dist sole-pianeta. \n\nreturn dati_pp;\n}", "function nhanvatgame(ten_nhanvat, slogan, mau) {\n this.ten_nhanvat = ten_nhanvat;\n this.slogan = slogan;\n this.mau = mau;\n }", "function ucitajPodatkeImpl(periodicna, vanredna){\r\n //ucitavanje podataka\r\n glavniNizP=periodicna;\r\n glavniNizV=vanredna;\r\n }", "function setCamposTipoA(id, value, dc, dp, dt){\n $('#'+id).val(value);\n $('#'+id).attr('placeholder', value);\n $('#'+id).attr('data-account', dc);\n $('#'+id).attr('data-person', dp);\n $('#'+id).attr('data-target', dt);\n\n}", "function setCurrentTime(){\n let now = new Date();\n let hours = now.getHours();\n let setHours = hours > 9 ? hours : `0${hours}`\n let minutes = now.getMinutes();\n let setMinutes = minutes > 9 ? minutes : `0${minutes}`;\n TIME.textContent = `${setHours}:${setMinutes}`;\n DATE.textContent = `${now.toLocaleDateString('en-US', { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric'})}`;\n }", "function otvaranje(nivo) {\r\n otvoreneKartice.push(izabrano);\r\n //aktiviranje tajmera klikom na prvu karticu:\r\n let duzina = otvoreneKartice.length;\r\n if (duzina === 1) {\r\n timer();\r\n };\r\n //broj razlicitih kartica u zavisnosti od nivoa:\r\n let brojRazlicitihKartica;\r\n if (nivo === 'easy') {\r\n brojRazlicitihKartica = easy_razliciteKartice;\r\n\r\n } else if (nivo === 'medium') {\r\n brojRazlicitihKartica = medium_razliciteKartice;\r\n \r\n } else {\r\n brojRazlicitihKartica = hard_razliciteKartice;\r\n }\r\n //kad se upare sve kartice pozivanje modala:\r\n if (upareneKartice.length == brojRazlicitihKartica) {\r\n clearInterval(interval);\r\n setTimeout(() => cestitamo(nivo), 1500);\r\n };\r\n}", "setTime(time) {\n this.time.setTime(time);\n }", "set setRaza(newName){\n this.raza = newName;\n }", "function tiempoJugadores() {\n\n var ms = tiempo * 60000;\n //Primero guarda cuanto aguanta el j1\n if (partidas == 1)\n tj1 = (ms - game.time.events.duration) / 1000;\n\n //Luego cuanto tarda el j2\n else\n tj2 = (ms - game.time.events.duration) / 1000;\n\n}", "function lisaaJoukkueTilasto(tilasto, joukkue, tulos, pvm){\n\n\t// Jos joukkuella ei ole aikaisempia merkintöjä, alustetaan merkinnät\n\tif( !(joukkue in tilasto) ){\n\t\ttilasto[joukkue] = [0,0,0];\t// Nolla voittoa, tasapeliä, tappiota\n\t}\n\n\t// Lisätään: voitto\n\tif(tulos === \"voitto\"){\n\t\ttilasto[joukkue][0] = tilasto[joukkue][0] + 1;\n\n\t} else if(tulos === \"tasapeli\"){\t// Lisätään: tasapeli\n\t\ttilasto[joukkue][1] = tilasto[joukkue][1] + 1;\n\n\t} else if(tulos === \"tappio\"){ // Lisätään: tappio\n\t\ttilasto[joukkue][2] = tilasto[joukkue][2] + 1;\n\n\t} else{\n\t\talert(\"Virhe! Päiväyksellä \" + pvm + \" oli peli, jolla ei ollut voittajaa, häviäjää eikä tasapelin pelannutta.\")\n\t}\n\n\treturn tilasto;\n}", "function setTime(value,tagID){\n document.getElementById(tagID).innerText = value;\n}", "setTimeWrite ( value ) {\n this.time = value;\n }", "function thememascot_twittie() {\n $('.twitter-feed').twittie({\n username: 'Envato',\n dateFormat: '%b. %d, %Y',\n template: '{{tweet}} <div class=\"date\">{{date}}</div>',\n count: 2,\n loadingText: 'Loading!'\n }, function() {\n $(\".twitter-carousel ul\").owlCarousel({\n autoplay: true,\n autoplayTimeout: 2000,\n loop: true,\n items: 1,\n dots: true,\n nav: false\n });\n });\n }", "function modificarEstudiante(id_estudiante,nombre){\n\tgrupoestudiante.id_estudiante=id_estudiante;\n\tgrupoestudiante.nombre=nombre;\n\t\n\t$(\"#CampoidEstu2\").val(grupoestudiante.id_estudiante);\n\t$(\"#CampoEstudiante2\").val(grupoestudiante.nombre);\n}", "nuevoSitio(state, nuevoSitio) {\n state.sitio = nuevoSitio\n }", "set NomFilm(_nomFilm) {\n this.nomFilm = _nomFilm;\n }", "set notchId(value) {\n if (this.notchId == value)\n return;\n $(this).trigger(\"notchIdChange\", [value, this._notchId]);\n this._notchId = value;\n this.refresh();\n }", "function setGnomon( gnomon){\n\tgnomonDeg = gnomon;\n}", "function ustawId(pole) {\r\n aktualnePole = pole.id; \r\n aktualnaWartosc = pole.value;\r\n}", "function setStandupTime(channel, standupTimeToSet) {\n \n controller.storage.teams.get('standupTimes', function(err, standupTimes) {\n\n if (!standupTimes) {\n standupTimes = {};\n standupTimes.id = 'standupTimes';\n }\n\n standupTimes[channel] = standupTimeToSet;\n controller.storage.teams.save(standupTimes);\n });\n}", "function tarea(nombre,urgencia){\n this.nombre = nombre;\n this.urgencia=urgencia;\n}", "function setNewPostion(t, type){\n\tvar index : int = Time.time * framesPerSecond;\n\t//\n\tcurrentDirection = type;\n\tvar pos = positions[type];\n\tvar line = numberlines * pos[0];\n\tvar ct = pos[1].length;\n\tindex = index % (ct);\n\tvar currentPos = (1.0/totalFramesPerLine) * pos[1][index];\n\tt.renderer.material.mainTextureOffset = Vector2 (currentPos, line);\n}", "function _AtualizaTalento(indice_talento, talento_personagem, div_talento, chave_classe, div_pai) {\n if (div_talento == null) {\n div_talento = AdicionaTalento(indice_talento, chave_classe, div_pai);\n }\n // A verificacao de pre-requisitos de talento pode gerar um talento null.\n if (talento_personagem.chave == null || talento_personagem.chave.length == 0) {\n return;\n }\n var talento = tabelas_talentos[talento_personagem.chave];\n for (var i = 0; i < div_talento.childNodes.length; ++i) {\n var filho = div_talento.childNodes[i];\n if (filho.name == 'chave-talento') {\n filho.disabled = talento_personagem.imutavel;\n SelecionaValor(talento_personagem.chave, filho);\n } else if (filho.name == 'complemento-talento') {\n filho.disabled = !('complemento' in talento);\n filho.value = talento_personagem.complemento;\n }\n }\n if (talento.descricao != null && talento.descricao.length > 0) {\n TituloSimples(Traduz(talento.descricao), div_talento);\n } else {\n TituloSimples('', div_talento);\n }\n}", "function continuaPregunta () {\r\n this.wordActual = this.getNewWord ();\r\n this.actual = \"\";\r\n this.init ();\r\n}", "function maakSom() {\n\t// Maak de som\n\tgetal1 = parseInt((9 * Math.random()) + 2);\n\tgetal2 = parseInt((9 * Math.random()) + 2);\n\tantwoord = parseInt(getal1) * parseInt(getal2);\n\n\t// Toon som in vak met id 'som'\n\tdocument.getElementById(\"som\").innerHTML = getal1 + \" x \" + getal2 + \" =\";\n}", "setTeacher() {\n let name = prompt(\"Enter teacher full name: \", \"Steve Martin\");\n let email = prompt(\"Enter teacher email: \", \"[email protected]\");\n let honorific = prompt(\"Enter honorific: \", \"Prof.\");\n let newTeacher = new Teacher(name, email, honorific);\n this.teacher = newTeacher;\n updateRoster(this);\n }", "function t(e,t,n,o){var i={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?i[n][0]:i[n][1]}", "function t(e,t,n,o){var i={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?i[n][0]:i[n][1]}", "function t(e,t,n,o){var i={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?i[n][0]:i[n][1]}", "probarFechaNacimiento(){\n //lectura del atributo fecha\n console.log(this.fecha.getFecha())\n\n //escritura del atributo\n console.log(this.fecha.setFecha(new Date(2000, 4, 6)))\n console.log(this.fecha.getFormatoLargo())\n console.log(this.fecha.setFecha(new Date(2000, 4, 6)))\n console.log(this.fecha.getFormatoLargo())\n\n //acceso a los metodos\n console.log(this.fecha.getFormatoCorto())\n console.log(this.fecha.getFormatoLargo())\n console.log(this.fecha.getEdad())\n \n }", "function resetTabuleiro(){\n t.celulas = [0, 1, 2, 3, 4, 5, 6, 7, 8];\n textoVencedor = \"\";\n contadorChamadas = 0;\n}", "function setCurrentPlayerArtist_Song(){\n\t\t//A volte dice null, altre dice empty, who knows.\n\t\t$.get('/artist_title',{\n \ttitle: getCurrentPlayerTitle()\n \t}).done((data)=>{\n \t\tconsole.log('artist data: ', data);\n \t\tif(data[0] != null){\n\t\t\t\tcurrentPlayerArtist = data[0];\n\t\t\t\tcurrentPlayerSong = data[1];\n\t\t\t\tsetContentBrano();\n\t\t\t\tsetArtistSimilarity();\n \tsetGenreSimilarity();\n }else{\n \t//nel caso ritorni NULL, l'artista è il channelTitle.\n \tcurrentPlayerArtist = currentPlayerVideo.snippet.channelTitle;\n \t//nel caso ritorni NULL, la canzone è il nome del video.\n \tcurrentPlayerSong = currentPlayerVideo.snippet.title;\n\t\t\t\tsetContentBrano();\n\t\t\t\tsetArtistSimilarity();\n \tsetGenreSimilarity();\n }\n\t\t}).fail((data)=>{\n\t\t\t//Risposta empty o errore, assegno default.\n\t\t\tcurrentPlayerArtist = currentPlayerVideo.snippet.channelTitle;\n currentPlayerSong = currentPlayerVideo.snippet.title;\n\t\t\tsetContentBrano();\n\t\t\tsetArtistSimilarity();\n setGenreSimilarity();\n\t\t})\n\t}", "function Tt(e,t,a,s){var n=e+\" \";switch(a){case\"s\":return t||s?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return n+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||s?\"sekundi\":\"sekundah\":e<5?t||s?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return n+=1===e?t?\"minuta\":\"minuto\":2===e?t||s?\"minuti\":\"minutama\":e<5?t||s?\"minute\":\"minutami\":t||s?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return n+=1===e?t?\"ura\":\"uro\":2===e?t||s?\"uri\":\"urama\":e<5?t||s?\"ure\":\"urami\":t||s?\"ur\":\"urami\";case\"d\":return t||s?\"en dan\":\"enim dnem\";case\"dd\":return n+=1===e?t||s?\"dan\":\"dnem\":2===e?t||s?\"dni\":\"dnevoma\":t||s?\"dni\":\"dnevi\";case\"M\":return t||s?\"en mesec\":\"enim mesecem\";case\"MM\":return n+=1===e?t||s?\"mesec\":\"mesecem\":2===e?t||s?\"meseca\":\"mesecema\":e<5?t||s?\"mesece\":\"meseci\":t||s?\"mesecev\":\"meseci\";case\"y\":return t||s?\"eno leto\":\"enim letom\";case\"yy\":return n+=1===e?t||s?\"leto\":\"letom\":2===e?t||s?\"leti\":\"letoma\":e<5?t||s?\"leta\":\"leti\":t||s?\"let\":\"leti\"}}", "function addTela(n) {\r\n //\r\n var telaTemp = n;\r\n let tela = document.getElementById(\"iOutput\");\r\n tela.value = telaTemp;\r\n\r\n}", "function setTime() {\n // Create date instance\n var date = new Date();\n // Get hours and minutes and store in variables\n var hours = date.getHours(),\n minutes = date.getMinutes();\n // If number of minutes < 10, the time looks like this: 6:6. We want 6:06 instead, so add a 0\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n // Define elements where to put hours and minutes\n var $hoursElement = $('#time .time-hours'),\n $minutesElement = $('#time .time-minutes');\n // Put hours and minutes in the elements\n $hoursElement.text(hours);\n $minutesElement.text(minutes);\n }" ]
[ "0.561847", "0.55432373", "0.5407266", "0.53629464", "0.52583545", "0.52383024", "0.5214047", "0.5199282", "0.5180894", "0.5179572", "0.5179572", "0.5179572", "0.5179572", "0.5179572", "0.5179572", "0.5148836", "0.5132693", "0.5121814", "0.5112944", "0.51042587", "0.5094677", "0.5070368", "0.506389", "0.506389", "0.506389", "0.506389", "0.506389", "0.506389", "0.5052989", "0.5029993", "0.5007161", "0.49986762", "0.49799493", "0.4974839", "0.49362114", "0.49309337", "0.49200845", "0.48945907", "0.48861465", "0.4879431", "0.487755", "0.487755", "0.48753023", "0.48732722", "0.48716968", "0.48699474", "0.48458356", "0.48423097", "0.48335886", "0.48313865", "0.48308033", "0.48271093", "0.48252085", "0.4821633", "0.4815316", "0.48108175", "0.4794908", "0.47915214", "0.47906822", "0.47898003", "0.4786937", "0.4780239", "0.47716403", "0.4766966", "0.47632328", "0.47630906", "0.47624418", "0.47553197", "0.47484195", "0.47439647", "0.47420555", "0.47377828", "0.47375676", "0.47369877", "0.47320423", "0.4729521", "0.47237763", "0.4719199", "0.4718976", "0.4717781", "0.47164813", "0.47157168", "0.4712905", "0.47103116", "0.47092748", "0.47091973", "0.47091043", "0.47073823", "0.4701033", "0.4695335", "0.46947655", "0.46934232", "0.46851683", "0.46851683", "0.46851683", "0.4684868", "0.4684752", "0.468209", "0.46805352", "0.46754348", "0.46732354" ]
0.0
-1
Runtime Imperatives Dialogs Open
PresentUIToScanOneQRCodeString ( fn // (err?, string) -> Void ) { const self = this const errStr = 'Override PresentUIToScanOneQRCodeString in ' + self.constructor.name fn(new Error(errStr)) throw errStr // to break development builds }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function open(dialog) {\n\t\n}", "function dialogOn() {\n\n if (typeof uiVersion != 'undefined' && uiVersion === 'Minuet' && dialog !== 'active') {\n openMinuetWarningDialog();\n }\n else {\n dialog = openWarningDialog();\n }\n isDialogOn = true;\n setCounter();\n\n\n }", "openFeedbackDialog() {}", "function showDialog() {\n var ui = HtmlService.createTemplateFromFile('Dialog')\n .evaluate()\n .setWidth(400)\n .setHeight(150);\n DocumentApp.getUi().showModalDialog(ui, DIALOG_TITLE);\n}", "openDialog() {\n var message = this.getQuestion() + chalk.dim(this.messageCTA + ' Waiting...');\n this.screen.render(message, '');\n\n // Pause Readline to prevent stdin and stdout from being modified while the editor is showing\n this.rl.pause();\n this.dialog.open(this.endDialog.bind(this));\n }", "function Dialog(a,c,d){if(typeof d==\"undefined\"){d=window}if(typeof window.showModalDialog==\"function\"&&!Xinha.is_webkit){Dialog._return=function(e){if(typeof c==\"function\"){c(e)}};var b=window.showModalDialog(a,d,\"dialogheight=300;dialogwidth=400;resizable=yes\")}else{Dialog._geckoOpenModal(a,c,d)}}", "function showDialogPopups (){\n //Bug 18403444 \n removePopupCloseBar();\n showPopup(document.getElementById(DEFAULT_DIALOG_POPUP_ID),DEFAULT_DIALOG_POPUP_ID); \n}", "function _openDialog( pDialog ) {\n var lWSDlg$, lTitle, lId,\n lButtons = [{\n text : MSG.BUTTON.CANCEL,\n click : function() {\n lWSDlg$.dialog( \"close\" );\n }\n }];\n\n function _displayButton(pAction, pLabel, pHot, pClose ) {\n var lLabel, lStyle;\n\n if ( pLabel ) {\n lLabel = pLabel;\n } else {\n lLabel = MSG.BUTTON.APPLY;\n }\n if ( pHot ) {\n lStyle = 'ui-button--hot';\n }\n lButtons.push({\n text : lLabel,\n class : lStyle,\n click : function() {\n that.actions( pAction );\n if ( pClose ) {\n lWSDlg$.dialog( \"close\" );\n }\n }\n });\n }\n\n if ( pDialog==='WEBSHEET' ) {\n lTitle = MSG.DIALOG_TITLE.PROPERTIES;\n _displayButton( 'websheet_properties_save', null, true, false );\n } else if ( pDialog==='ADD_COLUMN' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_COLUMN;\n _displayButton( 'column_add', null, true, false );\n } else if ( pDialog==='COLUMN_PROPERTIES' ) {\n lTitle = MSG.DIALOG_TITLE.COLUMN_PROPERTIES;\n _displayButton( 'column_properties_save', null, true, false );\n } else if ( pDialog==='LOV' ) {\n lTitle = MSG.DIALOG_TITLE.LOV;\n lId = apex.item( \"apexir_LOV_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'lov_delete', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'lov_save', null, true, false );\n } else if ( pDialog==='GROUP' || pDialog==='GROUP2' ) {\n lTitle = MSG.DIALOG_TITLE.COLUMN_GROUPS;\n lId = apex.item( \"apexir_GROUP_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'column_groups_delete', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'column_groups_save', null, true, false );\n } else if ( pDialog==='VALIDATION' ) {\n lTitle = MSG.DIALOG_TITLE.VALIDATION;\n lId = apex.item( \"apexir_VALIDATION_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'VALIDATION_DELETE', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'VALIDATION_SAVE', null, true, false );\n } else if ( pDialog==='REMOVE_COLUMN' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_COLUMNS;\n _displayButton( 'column_remove', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='SET_COLUMN_VALUE' ) {\n lTitle = MSG.DIALOG_TITLE.SET_COLUMN_VALUES;\n _displayButton( 'set_column_value', null, true, false );\n } else if ( pDialog==='REPLACE' ) {\n lTitle = MSG.DIALOG_TITLE.REPLACE;\n _displayButton( 'replace_column_value', null, true, false );\n } else if ( pDialog==='FILL' ) {\n lTitle = MSG.DIALOG_TITLE.FILL;\n _displayButton( 'fill_column_value', null, true, false );\n } else if ( pDialog==='DELETE_ROWS' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_ROWS;\n _displayButton( 'delete_rows', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='COPY' ) {\n lTitle = MSG.DIALOG_TITLE.COPY_DATA_GRID;\n _displayButton( 'copy', MSG.BUTTON.COPY, true, false );\n } else if ( pDialog==='DELETE' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_DATA_GRID;\n _displayButton( 'delete_websheet', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='ATTACHMENT' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_FILE;\n _displayButton( 'ATTACHMENT_SAVE', null, true, true );\n } else if ( pDialog==='NOTE' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_NOTE;\n _displayButton( 'NOTE_SAVE', null, true, false );\n } else if ( pDialog==='LINK' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_LINK;\n _displayButton( 'LINK_SAVE', null, true, false );\n } else if ( pDialog==='TAGS' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_TAGS;\n _displayButton( 'TAG_SAVE', null, true, false );\n }\n\n lWSDlg$ = $( \"#a-IRR-dialog-js\", apex.gPageContext$ ).dialog({\n modal : true,\n dialogClass: \"a-IRR-dialog\",\n width : \"auto\",\n height : \"auto\",\n minWidth : \"360\",\n title : lTitle,\n buttons : lButtons,\n close : function() {\n lWSDlg$.dialog( \"destroy\");\n }\n });\n }", "function showDialog() {\n printDebugMsg(\"Show dialog\");\n var ui = HtmlService.createTemplateFromFile('Dialog')\n .evaluate()\n .setWidth(400)\n .setHeight(190)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n SpreadsheetApp.getUi().showModalDialog(ui, DIALOG_TITLE);\n}", "function openDialog()\n{\n\tif (inviteOrCall==\"invite\")\n\t{\n\t\t$.dialog.buttonNames= ['Invite', 'Cancel'],\n\t\t$.dialog.message=\"Do you want to invite \"+ contact.getFullName();+\" to become a bofff ?\";\n\t\t$.dialog.show();\n\t}\n\telse\n\tif (inviteOrCall==\"call\")\n\t{\n\t\t$.dialog.buttonNames= ['Call', 'Cancel'],\n\t\t$.dialog.message=\"Are you sure want to call \"+ contact.getFullName()+\" on this number: \"+numberToCall+\" ?\";\n\t\t$.dialog.show();\n\t}\n\t\t\n}", "function userOpensHandler() {\n\tdialog.showOpenDialog({\n\t\tproperties: ['openFile']\n\t}, function (filepath) {\n\t\tnewWindowWithContent(filepath.toString());\n\t});\n}", "function TRiotDialog(){\r\n\r\n }", "onOpenForm() {\n// Add a timeout to allow the active window to close...\nthis.runDelayed(() => {\nif (!this._settings.getShowProperties() && !this._settings.getDontShowOpenForm()) {\ndispatcher.dispatch('Dialog.Hint.OpenForm', {});\n}\n});\n}", "function showStartScreen(){ \n var dialogVariables = Dialogs.showDialog(new optionsDialog(), Constants.DIALOG_TYPE_WIZARD, \"Choose Attribute and Objects\"); \n return dialogVariables; \n}", "function main(){\r\t//Make certain that user interaction (display of dialogs, etc.) is turned on.\r\tapp.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;\r\tif (app.documents.length != 0){\r\t\tif (app.selection.length != 0){\r\t\t\tfor(var myCounter = 0;myCounter < app.selection.length; myCounter++){\r\t\t\t\tswitch (app.selection[myCounter].constructor.name){\r\t\t\t\t\tcase \"Rectangle\":\r\t\t\t\t\tcase \"TextFrame\":\r\t\t\t\t\tcase \"Oval\":\r\t\t\t\t\tcase \"Polygon\":\r\t\t\t\t\tcase \"GraphicLine\":\r\t\t\t\t\tcase \"Group\":\r\t\t\t\t\tcase \"PageItem\":\r\t\t\t\t\tmyObjectList.push(app.selection[myCounter]);\r\t\t\t\t\tbreak;\r\t\t\t\t}\r\t\t\t}\r if (myObjectList.length != 0){\r\t\t\t\tdisplayDialog(myObjectList);\r }\r else{\r\t\t\t\talert (\"Select a rectangle or text frame and try again.\");\r\t\t\t}\r\t\t}\r\t\telse{\r\t\t\talert (\"Select a frame and try again.\");\r\t\t}\r\t}\r\telse{\r\t\talert (\"Open a document, select a frame and try again.\");\r\t}\r}", "function open()\n{\n GC.initial_video_path = dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] });\n}", "function ShowWaitDialog() {\n}", "function dialogAlerter(){\n //Method to Open a Alertbox\nnavigator.notification.alert(\"This is an Alert box created using Notification Plugin\",alertExit,\"Alert Dialog\",\"Understood\");\n}", "function initModalDialog () {\n initSubmitButton();\n initClickToClose();\n initKeyboardInput();\n}", "function popup(){\r\n\talert(\"You opened a popup!\")\r\n\t}", "openDialog() {\n // assemble everything in the slot\n let nodes = dom(this).getEffectiveChildNodes();\n let h = document.createElement(\"span\");\n let c = document.createElement(\"span\");\n let node = {};\n for (var i in nodes) {\n if (typeof nodes[i].tagName !== typeof undefined) {\n switch (nodes[i].getAttribute(\"slot\")) {\n case \"toolbar-primary\":\n case \"toolbar-secondary\":\n case \"toolbar\":\n case \"header\":\n node = nodes[i].cloneNode(true);\n node.removeAttribute(\"slot\");\n h.appendChild(node);\n break;\n case \"button\":\n // do nothing\n break;\n default:\n node = nodes[i].cloneNode(true);\n node.removeAttribute(\"slot\");\n if (this.dynamicImages && node.tagName === \"IRON-IMAGE\") {\n node.preventLoad = false;\n node.removeAttribute(\"prevent-load\");\n }\n c.appendChild(node);\n break;\n }\n }\n }\n const evt = new CustomEvent(\"simple-modal-show\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n title: this.header,\n elements: {\n header: h,\n content: c\n },\n invokedBy: this.$.dialogtrigger,\n clone: true\n }\n });\n this.dispatchEvent(evt);\n }", "function openModalForm(){\n createForm();\n openModalWindow();\n}", "function launchApp() {\r\n console.log(\"Hypersubs: Launching.\");\r\n $('#hypersubs-main-dialog').dialog('open');\r\n $('#hypersubs-splash').css('display', 'none');\r\n loadFlange(0, userPreferences.smartFill);\r\n }", "function startDialog() {\r\n\t// set server to appropriate value\r\n\tserver = window.arguments[0];\r\n\t\r\n\t// generate step list\r\n\tsetSteps();\r\n\t\r\n\t// move to center of parent window\r\n\tcenterWindowOnScreen();\r\n}", "inititateAcSetupMessage(window) {\n if (!window) {\n window = this.getBestParentWin();\n }\n\n window.openDialog(\n \"chrome://openpgp/content/ui/autocryptInitiateBackup.xhtml\",\n \"\",\n \"dialog,centerscreen\"\n );\n }", "function initDialog() {\n let dialog = document.querySelector('#dialog');\n if (!dialog.showModal) {\n dialogPolyfill.registerDialog(dialog);\n }\n\n dialogButton.addEventListener('click', () => {\n let rowsSliderPromise = waitForSlider('rowsSlider');\n let colsSliderPromise = waitForSlider('colsSlider');\n let typingSpeedPromise = waitForSlider('typingSpeed');\n Promise.all([rowsSliderPromise, colsSliderPromise, typingSpeedPromise])\n .then(values => {\n values[0].MaterialSlider.change(config.numRows);\n values[1].MaterialSlider.change(config.numCols);\n values[2].MaterialSlider.change(config.typingSpeed);\n dialog.showModal();\n });\n });\n dialog.querySelector('button:not([disabled])')\n .addEventListener('click', function() {\n dialog.close();\n });\n}", "click() {\n // construct the select file dialog \n dialog.showOpenDialog({\n properties: ['openFile']\n })\n .then(function(fileObj) {\n // the fileObj has two props \n if (!fileObj.canceled) {\n mainWindow.webContents.send('FILE_OPEN', fileObj.filePaths)\n }\n })\n .catch(function(err) {\n console.error(err)\n })\n }", "showInteliUiInModal(dialog, options) {\n if (options.context) {\n window.inteliUiContext = options.context;\n }\n\n this.inteliUi.view.showInteliUiInModal(dialog, options);\n }", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "function JSI_initializeDialog(dialog, okFunction, cancelFunction, openFunction)\r\n{\r\n $(\"#Btn_Start\" + dialog).click(function()\r\n {\r\n if(openFunction) {\r\n var ret = openFunction();\r\n if(!ret && ret != undefined) {\r\n return;\r\n }\r\n }\r\n $(\"#Dialog_\" + dialog).addClass(\"visible\");\r\n });\r\n\r\n $(\"#Btn_Cancel\" + dialog).click(function()\r\n {\r\n if(cancelFunction) {\r\n var ret = cancelFunction();\r\n if(!ret && ret != undefined) {\r\n return;\r\n }\r\n }\r\n JSI_closeDialog(dialog);\r\n });\r\n\r\n $(\"#Btn_Ok\" + dialog).click(function()\r\n {\r\n if(okFunction) {\r\n var ret = okFunction();\r\n if(!ret && ret != undefined) {\r\n return;\r\n }\r\n }\r\n JSI_closeDialog(dialog)\r\n });\r\n}", "function ShowageDialog(modal)\n {\n $(\"#ageoverlay\").show();\n $(\"#agedialog\").fadeIn(300);\n\n if (modal)\n {\n $(\"#ageoverlay\").unbind(\"click\");\n }\n else\n {\n $(\"#ageoverlay\").click(function (e)\n {\n HideageDialog();\n });\n }\n }", "function openLibInfoPopup(action_text) {\r\n\t$.post(app_path_webroot+'SharedLibrary/info.php?pid='+pid, { action_text: action_text }, function(data){\r\n\t\t// Add dialog content\r\n\t\tif (!$('#sharedLibInfo').length) $('body').append('<div id=\"sharedLibInfo\"></div>');\r\n\t\t$('#sharedLibInfo').html(data);\r\n\t\t$('#sharedLibInfo').dialog({ bgiframe: true, modal: true, width: 650, open: function(){fitDialog(this)}, \r\n\t\t\tbuttons: { Close: function() { $(this).dialog('close'); } }, title: 'The REDCap Shared Library'\r\n\t\t});\r\n\t});\t\t\t\r\n}", "openInternetDetailDialog_() {\n chrome.send('launchInternetDetailDialog');\n }", "function showCloudAppDialog() {\r\n\tif(cloudAppDialog == undefined)\r\n\t{\r\n\t\tcloudAppDialog = $('<div><p>' + language.data.cloudapp_1 + '<br><br>' + language.data.cloudapp_2 + '</p></div>').dialog({\r\n\t\t\tautoOpen : true,\r\n\t\t\tdraggable : false,\r\n\t\t\tmodal : false,\r\n\t\t\ttitle : 'Are you sure to publish your tasks?',\r\n\t\t\tbuttons : {\r\n\t\t\t\t'No' : function() {\r\n\t\t\t\t\t$(this).dialog('close');\r\n\t\t\t\t},\r\n\t\t\t\t'Yes' : function() {\r\n\t\t\t\t\tshare.share_with_cloudapp();\r\n\t\t\t\t\t$(this).dialog('close');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\telse\r\n\t\topenDialog(cloudAppDialog);\r\n}", "function openProposedObjectiveModal(){\n $(\"#obj-modal-type\").val('propose');\n\tsetObjectiveModalContent('', '', '', getToday(), 0, 2);\n\tshowObjectiveModal(true);\n}", "function popupModal(strUrl, strWindowName, strComplement, strJsExecOnClose)\n{\n var windowOpen = popup(strUrl, strWindowName, strComplement, strJsExecOnClose);\n if (!windowOpen)\n return false;\n// openBackground();\n return true;\n}", "function showDoorbellModal() \r\n{ doorbell.show(); // The doorbell object gets created by the doorbell.js script \r\n}", "function motionDialog(choose, sw)\n\t\t{\n\t closeDialog();\n\t $(\"#dialog\").fadeIn(\"slow\", function()\n\t\t\t\t{\n\t\t\t\t\tshowDialog(choose);\n\t\t\t\t});\n\t\t}", "function admissionOpen(){\n window.open('/admissionopen.html','popUpWindow','height=470,width=960,left=100,top=100,resizable=no,scrollbars=no,toolbar=yes,menubar=no,location=no,directories=no, status=yes');\n}", "function init_dialogs()\n{\n\tconsole.log(navigator.appName, navigator.appVersion, navigator.appCodeName);\n\tconsole.log(navigator.userAgent);\n\tif (navigator.userAgent.indexOf('Chrome')== -1){\n\t\t//a ne pas faire avec chrome qui supporte les <dialog>\n\t\t document.getElementById('selectDlg').style.display = 'none' ;\n\t\t document.getElementById('editDlg').style.display = 'none' ;\n\t}\n}", "function promptUser() {\n resetOutput();\n let promptDialog = document.getElementById(\"promptCustomDialog\");\n promptDialog.showModal();\n \n}", "function showDialog(file, title)\n{\n \tvar html = HtmlService.createTemplateFromFile(file).evaluate();\n\tSpreadsheetApp.getUi().showModalDialog(html, title);\n}", "function startDialogValidator()\n{\n dialogsValidator(ig.global.data.dialogs);\n}", "show() {\n this.style.pointerEvents = 'none'; // To \"allow interaction outside dialog\"\n this.open = true;\n }", "function launchArcIMS(ims) {\n var Win1 = open(ims,\"ArcIMSWindow\",\"height=800,width=1000,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes\");\n Win1.focus();\n }", "displayPrompt() {\n // Before displaying, check whether the user has recently interacted with the UI.\n // If this fires on page load (i.e. the timer has already expired), then the last\n // interaction time is 1/1/1970.\n const secondsSinceLastInteraction = getSecondsSinceLastInteraction(this.userActivity.lastActivityTime);\n if(secondsSinceLastInteraction < this.options.interactionDelaySeconds){\n window.setTimeout(this.displayPrompt.bind(this), 1000); // Retry in a second.\n return;\n }\n\n // Create the pop up.\n const popupMarkup = `\n <a class=\"close\">X</a>\n ${this.options.popupBody}\n `;\n const popupElement = document.createElement('div');\n popupElement.id = this.options.popupID;\n popupElement.classList.add('ProactiveLiveHelpPrompt');\n popupElement.innerHTML = popupMarkup;\n document.querySelector('body').appendChild(popupElement);\n\n const popupLiveHelpHandler = () => {\n if(this.options.popupID === 'Spanish-CTSPrompt'){\n LiveChat.openSpanishChatWindow();\n } else {\n LiveChat.openChatWindow();\n }\n\n this.dismissPrompt();\n }\n document.getElementById('chat-button').addEventListener('click', popupLiveHelpHandler);\n\n // Center and display the pop up.\n this.makePromptVisible();\n\n // Set up event handlers for the various ways to close the pop up\n const popupCloseButton = document.querySelector('.ProactiveLiveHelpPrompt .close');\n const popupCloseButtonHandler = () => this.dismissPrompt();\n popupCloseButton.addEventListener('click', popupCloseButtonHandler);\n\n const liveHelpKeypressListener = (e) => {\n if(e.keyCode === 27 && this.popupStatus === true) {\n this.dismissPrompt();\n document.removeEventListener('keyup', liveHelpKeypressListener)\n }\n }\n document.addEventListener('keyup', liveHelpKeypressListener)\n\n // Hook up analytics for the dynamically created elements.\n activatePromptAnalytics();\n }", "function show(name) {\r\n var dialogEl = $('#' + name),\r\n dialog = dialogs[name].dialog;\r\n\r\n // Show the dialog.\r\n dialogEl.show().addClass(\"in\");\r\n\r\n // Run onOpen function\r\n dialog.onOpen(dialogEl);\r\n\r\n // Check for auto close of dialog.\r\n dialog.autoClose();\r\n\r\n // Close on Esc key.\r\n checkEsc(name);\r\n\r\n // Close on Cancel button.\r\n dialogEl.find(\".cancel, .ok, .\" + settings.confirm.option_btn_class).on(\"click.dialog\", function () {\r\n close(name);\r\n });\r\n }", "onLoad() {\n this.openType = 'popup';\n this.opened = false;\n // this.open();\n }", "function clickMenu_res022(menuObject){\n\tDialog.open({\n\t\tdiv : '#dialogContent', \n\t\turl : baseUrl+\"res/res022?dialogName=dialogContent\", \n\t\ttitle : 'Number Pattern Pool', \n\t\twidth : 1000, \n\t\theight : 600, \n\t\tmodal : true\n\t});\n}", "function openDialog(dialogID, url, ancho, altura)\n{\t\n\tthis.dialogID = dialogID;\n\t//mostrar popup dhtml\n\tshowBox(dialogID, ancho, altura, url, true, true);\n}", "function AdvCallAlert()\n{\nvar buttonList = [\"Yes\", \"No\", \"Cancel\"] ;\nvar buttonListFunc = [\"YesFunction()\", \"NoFunction()\", \"CancelFunction()\"] ;\nalert(\"Do you want to enable auto slideshow on desktop?\", buttonList, buttonListFunc, \"SlideShow Wallpaper\", \"../assets/img/favicon.ico\") ;\n}", "function MonitorImpresiones()\n{\n\t//Monitor de impresiones\t\n\t\tif(ventana_monitor==\"VentanaMonitor\")\t\t\t\n\t {\n\t\t\tventana_monitor= window.open('/ElektraFront/Surtimiento/Impresion/Monitor.aspx','','scrollbars=no,resizable=no,width=520,height=300'); \n\t\t\tif(ventana_monitor.error_impresion == 1)\t\t\t\n\t {\t \t \n\t\t \t\tthrow new Error(ventana_monitor.vError);\t \n\t }\n\t }\n}", "function AlertTest()\n{\n Log.AppendFolder(\"Alert Test\");\n let page = Aliases.browser.Page;\n page.panelPage.panelDialogbox.link.Click();\n page.Alert.buttonOk.ClickButton();\n page.Wait();\n Log.PopLogFolder();\n}", "function OpenDialog() {\t\n\t\t$('#'+AppObjectParams.ObjectsID.DialogContent).empty();\n\t\t\n\t\tif(EventDataFromCalendar.IsNew) {\n\t\t\t$('#AppCalendar-Dialog .ui-dialog-title').text(AppObjectTextsData.DialogObj.Header.Add);\n\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonAdd).css({'display':'inline'});\n\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonEdit).css({'display':'none'});\n\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonDelete).css({'display':'none'});\n\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonDeleteAll).css({'display':'none'});\n\t\t} else {\n\t\t\t$('#AppCalendar-Dialog .ui-dialog-title').text(AppObjectTextsData.DialogObj.Header.Edit);\n\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonAdd).css({'display':'none'});\n\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonEdit).css({'display':'inline'});\n\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonDelete).css({'display':'inline'});\n\t\t\tif(EventDataFromCalendar.AppEventType === \"general\") {\n\t\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonDeleteAll).css({'display':'none'});\n\t\t\t} else {\n\t\t\t\t$('#'+AppObjectParams.ObjectsID.ButtonDeleteAll).css({'display':'inline'});\n\t\t\t}\n\t\t}\n\t\t\n\t\tvar timeArrLen = AppConfigData.Time.Labels.length;\n\t\tvar startMoment = EventDataFromCalendar.Start.clone(), endMoment = EventDataFromCalendar.End.clone(), \n\t\tstartMomentArr = startMoment.toArray(), endMomentArr = endMoment.toArray();\n\t\tvar startTimeInx = 0, endTimeInx = 0;\n\t\t\n\t\tstartMomentArr[4] = 15 * parseInt(startMomentArr[4] / 15);\n\t\tstartMoment = moment.utc(startMomentArr);\n\t\tstartTimeInx = $.inArray(startMoment.format('HH:mm'), AppConfigData.Time.Labels);\n\t\tif(startTimeInx < 0) {\n\t\t\tstartTimeInx = 0;\n\t\t\tstartMomentArr[3] = 0;\n\t\t\tstartMomentArr[4] = 0;\n\t\t\tstartMoment = moment.utc(startMomentArr);\n\t\t}\n\t\tEventDataFromCalendar.StartArr = startMomentArr;\n\t\tEventDataFromCalendar.StartTimeInx = startTimeInx;\n\t\t\n\t\tif(endMomentArr[3] == 0 && endMomentArr[4] == 0) {\n\t\t\tendMoment = moment.utc(endMomentArr).add(-1, 'minutes');\n\t\t\tendMomentArr = endMoment.toArray();\n\t\t\tendTimeInx = timeArrLen - 1;\n\t\t} else {\n\t\t\tendMomentArr[4] = 15 * parseInt(endMomentArr[4] / 15);\n\t\t\tendMoment = moment.utc(endMomentArr);\n\t\t\tendTimeInx = $.inArray(endMoment.format('HH:mm'), AppConfigData.Time.Labels);\n\t\t\tif(endTimeInx <= 0) { \n\t\t\t\tendTimeInx = 1;\n\t\t\t\tendMomentArr[3] = 0;\n\t\t\t\tendMomentArr[4] = 1;\n\t\t\t\tendMoment = moment.utc(endMomentArr);\n\t\t\t}\n\t\t}\n\t\tEventDataFromCalendar.EndArr = endMomentArr;\n\t\tEventDataFromCalendar.EndTimeInx = endTimeInx;\n\t\t\n\t\t$('#'+AppObjectParams.ObjectsID.DialogDateStart).val(startMoment.format('DD MMMM YYYY'));\n\t $('#'+AppObjectParams.ObjectsID.DialogDateEnd).val(endMoment.format('DD MMMM YYYY'));\n\t \n\t $('#'+AppObjectParams.ObjectsID.DialogTimeStart).empty();\n\t $('#'+AppObjectParams.ObjectsID.DialogTimeEnd).empty();\n\t \n\t if(EventDataFromCalendar.IsAllDay) {\n\t \t$('#'+AppObjectParams.ObjectsID.DialogTimeStart).append($('<option>').attr({'value':startTimeInx}).text(AppConfigData.Time.Labels[startTimeInx]));\n\t \t$('#'+AppObjectParams.ObjectsID.DialogTimeEnd).append($('<option>').attr({'value':endTimeInx}).text(AppConfigData.Time.Labels[endTimeInx]));\n\t } else {\n\t \t$.each(AppConfigData.Time.Labels, function(time_index, time_label) {\n\t\t \tif((time_index + 1) < timeArrLen) {\n\t\t \t\t$('#'+AppObjectParams.ObjectsID.DialogTimeStart).append($('<option>').attr({'value':time_index}).text(time_label));\n\t\t \t}\n\t\t \t$('#'+AppObjectParams.ObjectsID.DialogTimeEnd).append($('<option>').attr({'value':time_index}).text(time_label));\n\t\t });\n\t }\n\t \n\t $('#'+AppObjectParams.ObjectsID.DialogTimeStart).val(startTimeInx);\n\t $('#'+AppObjectParams.ObjectsID.DialogTimeEnd).val(endTimeInx);\n\t \n\t\tif(AppConfigData.RepeatInterval.hasOwnProperty(EventDataFromCalendar.RepeatInterval)) {\n\t\t\t$('#'+AppObjectParams.ObjectsID.DialogRepeatInterval).val(EventDataFromCalendar.RepeatInterval);\n\t\t}\n\t\tif(AppConfigData.RepeatTimes.hasOwnProperty(EventDataFromCalendar.RepeatTimes)) {\n\t\t\t$('#'+AppObjectParams.ObjectsID.DialogRepeatTimes).val(EventDataFromCalendar.RepeatTimes);\n\t\t}\n\t\tif(AppConfigData.ReminderTime.hasOwnProperty(EventDataFromCalendar.ReminderTime)) {\n\t\t\t$('#'+AppObjectParams.ObjectsID.DialogReminderTime).val(EventDataFromCalendar.ReminderTime);\n\t\t}\n\t\t\n\t\tswitch(EventDataFromCalendar.AppEventType) {\n\t\t\tcase \"general\":\n\t\t\t\tOpenDialogGeneral();\n\t\t\tbreak;\n\t\t\tcase \"medical\":\n\t\t\t\tOpenDialogMedical();\n\t\t\tbreak;\n\t\t\tcase \"measurements\":\n\t\t\t\tOpenDialogMeasurements();\n\t\t\tbreak;\n\t\t\tcase \"eating\":\n\t\t\t\tOpenDialogEating();\n\t\t\tbreak;\n\t\t\tcase \"physical\":\n\t\t\t\tOpenDialogPhysical();\n\t\t\tbreak;\n\t\t\tcase \"cognitive\":\n\t\t\t\tOpenDialogCognitive();\n\t\t\tbreak;\n\t\t\tcase \"shower\":\n\t\t\t\tOpenDialogShower();\n\t\t\tbreak;\n\t\t\tcase \"socializing\":\n\t\t\t\tOpenDialogSocializing();\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tViewOrHideOverlayElement(true);\n\t}", "focus() {\n this.openDialog();\n }", "focus() {\n this.openDialog();\n }", "function onLoad() {\n let windowArgs = window.arguments[0];\n\n dialog = {};\n\n dialog.OKButton = document.querySelector(\"dialog\").getButton(\"accept\");\n dialog.nameField = document.getElementById(\"name\");\n dialog.nameField.focus();\n\n // call this when OK is pressed\n dialog.okCallback = windowArgs.okCallback;\n if (windowArgs.keyToEdit) {\n initializeForEditing(windowArgs.keyToEdit);\n document.addEventListener(\"dialogaccept\", onOKEditTag);\n } else {\n document.addEventListener(\"dialogaccept\", onOKNewTag);\n }\n\n doEnabling();\n}", "function goOpenPresent(arrayNr) {\n\tyourPresents[arrayNr].enabled = false;\n\tvar giftDelays = [];\n\tif (state.impatientMode) {\n\t\tgiftDelays = [50,100];\n\t} else {\n\t\tgiftDelays = [1500,2000];\n\t}\n\tchangeScene(\"Let's open this bad boy\",yourPresents[arrayNr].image);\n\tsetTimeout(function() {\n\t\tplaySound(soundEffect.explosion);\n\t\tchangeScene(\"GIFT EXPLOSION!!!\",\"explosion\");\n\t},giftDelays[0]);\n\tsetTimeout(function() {\n\t\tvar prize = pickPrize(yourPresents[arrayNr]);\n\t\tchangeScene(\"You get \" + prize.navn + \"!! Yay\",prize.img);\n\t\tif (place == \"newPresent\") {\n\t\t\tcreateButton(\"Well well\",slotMachine);\n\t\t} else if (place == \"dungeonSummary\") {\n\t\t\tcreateGoButton(\"Well well\",\"talk\",backFromPresent,true);\n\t\t} else {\n\t\t\tcreateButton(\"Well well\",\"talk\",backFromGift);\n\t\t}\n\t\t\n\t},giftDelays[1]);\n}", "function openAdjustGapRulesModal() {\n //TODO openAdjustGapRulesModal\n}", "openModal(){\n\n }", "function sleepScoreCalculatorOpen() {\n $('.get-sleep-score .get-sleep-score--access').on('click',function(e) {\n e.preventDefault();\n $('.slide-menu--close a').trigger('click');\n $('.sleep-score-calculator-popup').fadeIn(500);\n $('.body-overlay').addClass('sleep-score-popup--visible');\n \n $(\"body\").addClass('sleep-score-popup-open-scroll-lock');\n });\n }", "function popup() {\n alertify.set('notifier', 'position', 'bottom-left');\n alertify.success('click the arrow button for the project').delay(3);\n // setTimeout(function () {\n // alertify.success('use scroll or spacebar for a new project');\n // }, 2000);\n // alertify.message('test')\n }", "function CHMopenModalDialog(pageName,left,top,height,width)\r\n{\r\n if(window.showModalDialog)\r\n {\r\n return window.showModalDialog(pageName,window,'dialogWidth:'+width/13+';dialogHeight:'+height/13+';scrollbars=no;status:no;dialogTop=' + top + ';dialogLeft=' + left + ';');\r\n }\r\n else\r\n {\r\n try{\r\n\t\twindow.top.captureEvents (Event.CLICK|Event.FOCUS)\r\n\t\twindow.top.onclick=IgnoreEvents\r\n\t\twindow.top.onfocus=HandleFocus \r\n\t\twinModalWindow = openChildWindow(pageName,width,height);\r\n\t\twinModalWindow.focus()\r\n\t}\r\n\tcatch(exception){\r\n\t\talert(exception);\r\n\t} \r\n }\r\n return;\r\n}", "function dialog(arg) {\n var x = document.createElement(\"DIALOG\");\n var t = document.createTextNode(arg);\n x.setAttribute(\"open\", \"open\");\n x.appendChild(t);\n document.body.appendChild(x);\n\n /*close dialog after 3sec*/\n setTimeout(function(){ \n x.removeAttribute(\"open\", \"open\");\n /* x.setAttribute(\"close\", \"close\");*/\n }, 3000);\n\n }", "function openModal () {\n setVisablity(true)\n }", "function ts_skip_or_boost()\n{\n// open_application(\"INRstarWindows\");\n\n ts_skip_or_boost_sorb_button_user_permissions();\n ts_skip_or_boost_sorb_button_dosing_method_validation();\n ts_skip_or_boost_sorb_button_review_period_validation();\n ts_skip_or_boost_sorb_button_self_test_validation();\n ts_skip_or_boost_sorb_button_omit_validation();\n// ts_sorb_schedule(); // Needs to be refactored removed the 3 days form the view only displayed after ok button now\n ts_treatment_button_disabling();\n\n// close application needed here ?\n}", "actionModalDialog() {\n this.send(this.get('action'));\n this.controller.set('showModal', false);\n }", "function showTemplateDialog() {\n\tvar dialog = document.getElementById('my-dialog');\n\t\n\tif (dialog) {\n\t\tdialog.show();\n\t\t} else {\n\t\tons.createElement('dialog.html', { append: true })\n\t\t.then(function(dialog) {\n\t\t\tdialog.show();\n\t\t});\n\t}\n}", "homeOpen(){WM.open(windowName)}", "onOpen() { }", "openDialog(e) {\n let children = FlattenedNodesObserver.getFlattenedNodes(this).filter(\n n => n.nodeType === Node.ELEMENT_NODE\n );\n let c = document.createElement(\"div\");\n for (var child in children) {\n c.appendChild(children[child].cloneNode(true));\n }\n const evt = new CustomEvent(\"simple-modal-show\", {\n bubbles: true,\n cancelable: true,\n detail: {\n title: this.term,\n elements: {\n content: c\n },\n invokedBy: this.shadowRoot.querySelector(\"#button\")\n }\n });\n window.dispatchEvent(evt);\n }", "function nag_init()\n {\n $( \"#nag_dialog\" ).dialog({modal:true});\n hide_nag()\n }", "function alertUser() {\n resetOutput();\n let alertDialog = document.getElementById(\"alertCustomDialog\");\n alertDialog.showModal();\n\n}", "function openCreditsDialog() {\n\tdialogs.openDialog(dialogs.generateDialog('What is Wunderlist?', html.generateCreditsDialogHTML(), 'dialog-credits'));\n}", "function configure() {\n\n const popupUrl = `${window.location.origin}/dialog.html`;\n\n let input = \"\";\n\n tableau.extensions.ui.displayDialogAsync(popupUrl, input, { height: 540, width: 800 }).then((closePayload) => {\n // The close payload is returned from the popup extension via the closeDialog method.\n $('#interval').text(closePayload);\n }).catch((error) => {\n // One expected error condition is when the popup is closed by the user (meaning the user\n // clicks the 'X' in the top right of the dialog). This can be checked for like so:\n switch (error.errorCode) {\n case tableau.ErrorCodes.DialogClosedByUser:\n console.log(\"Dialog was closed by user\");\n break;\n default:\n console.error(error.message);\n }\n });\n }", "function showApplicationDialog(options) {\n return appElementDialog.showDialog(options);\n }", "function showPayeePage() {\n gTrans.showDialogCorp = true;\n document.addEventListener(\"evtSelectionDialogInput\", handleInputPayeeAccOpen, false);\n document.addEventListener(\"evtSelectionDialogCloseInput\", handleInputPayeeAccClose, false);\n document.addEventListener(\"tabChange\", tabChanged, false);\n document.addEventListener(\"onInputSelected\", okSelected, false);\n //Tao dialog\n dialog = new DialogListInput(CONST_STR.get('TRANS_LOCAL_DIALOG_TITLE_ACC'), 'TH', CONST_PAYEE_INTER_TRANSFER);\n dialog.USERID = gCustomerNo;\n dialog.PAYNENAME = \"1\";\n dialog.TYPETEMPLATE = \"0\";\n dialog.showDialog(callbackShowDialogSuccessed, '');\n}", "openCateringModal() {\n console.log('Open Catering Modal');\n }", "openCateringModal() {\n console.log('Open Catering Modal');\n }", "function DialogLayerController() {}", "function openModal() {\n getRecipeDetails();\n handleShow();\n }", "function popupScripts() {\n\t\t\t\tif (!o.dontTouchForm) {\n\t\t\t\t\tformCheck();\n\t\t\t\t}\n\t\t\t}", "function __open($sUrl, $params, $fct, $bWOpen) {\r\n var bInDialog = typeof(top._isModalWin)!='undefined';\r\n var bForce = false;\r\n var bWOpen = $bWOpen==null?false:true;\r\n if (!bWOpen) {\r\n if (__get(\"docFrame\")!=null || bInDialog || bForce) {\r\n if (window.__docFrameView==true || bInDialog || bForce) {\r\n if ($sUrl.indexOf(\"/\")==0 && $sUrl.indexOf(_c)!=0) {\r\n $sUrl = _c + $sUrl;\r\n }else {\r\n if ($sUrl.indexOf(_c)!=0) {\r\n var curl = document.location.toString();\r\n curl = curl.substr(0,curl.lastIndexOf(\"/\")+1);\r\n $sUrl = curl + $sUrl;\r\n }\r\n }\r\n var ps = __parseParams($params);\r\n var w,h;\r\n if (ps['relate']!=null) {\r\n w = document.body.clientWidth * ps['relate'];\r\n h = document.body.clientHeight * ps['relate'];\r\n }else {\r\n w = ps['width']!=null?ps['width']:screen.availWidth;\r\n h = ps['height']!=null?ps['height']:screen.availHeight;\r\n }\r\n h = h*1+24;\r\n var sOptions = \"dialogHeight:\" + h + \"px;dialogWidth:\" + w + \"px;resizable:no;status:no;help:no\";\r\n var arg = \"\";\r\n if (ps['title']!=null) {\r\n arg = ps['title'];\r\n }\r\n dialog($sUrl, arg, window, sOptions);\r\n if ($fct!=null) {\r\n $fct();\r\n }\r\n return;\r\n }\r\n }\r\n } \r\n\r\n if (window.STATICCLASS_JWINDOW==null) {\r\n window.STATICCLASS_JWINDOW = __loadScript(\"JWindow\", 1);\r\n }\r\n window.STATICCLASS_JWINDOW.open($sUrl, $params);\r\n window.JWINDOW_AFTERCLOSE = $fct;\r\n}", "function showDialog() {\n\tdialog.show();\n\tbuttonOpen.setAttribute(\"class\", \"close\");\n\tbuttonOpen2.setAttribute(\"class\", \"close\");\n}", "function pveModuleOpen() {\n let selection = document.querySelector('.pveSelect');\n let pve = document.querySelector('.pveModal');\n let pvePlay = document.querySelector('.pvePlay');\n \n // styles for different elements\n playStyleModal.style.cssText = 'display: none; ';\n pvpModal.style.cssText = 'display: none;';\n pve.style.cssText = 'display: grid;';\n gameContainer.style.cssText = 'transition: all 0.4s ease; -webkit-transform: scale(1); -webkit-filter: blur(0px) grayscale(0px); background-color: transparent;'\n body.style.cssText = 'background-color: white;'\n first.value = null;\n second.value = null;\n // event listener to start game vs computer\n pvePlay.addEventListener('click', selectOption);\n\n \n\n }", "function EnviarAviso(){\n\t$(\"#dialogEnviarAviso\").dialog(\"open\");\n}", "function showAgents(objTextBox, objLabel)\r\n{\r\n objChannelTypeInvokerTextBox = objTextBox;\r\n objChannelTypeInvokerLabel = objLabel;\r\n openModalDialog('../popup/cm_agent_search_listing.htm',screen.width-50,'400');\r\n \r\n return;\r\n}", "onOpenedWindow() {\n throw new NotImplementedException();\n }", "function promptBeforeClosingAJob( elem )\n{ \n $( \"div#close_job_dialog_confirm\" ).data('thisss', elem).dialog( \"open\" );\n}", "function choose_297e201048183a730148183ad85c0001() {\n if (typeof(windowapi) == 'undefined') {\n $.dialog({content: 'url:departController.do?departSelect', zIndex: 2100, title: '<t:mutiLang langKey=\"common.department.list\"/>', lock: true, width: 400, height: 350, left: '85%', top: '65%', opacity: 0.4, button: [\n {name: '<t:mutiLang langKey=\"common.confirm\"/>', callback: clickcallback_297e201048183a730148183ad85c0001, focus: true},\n {name: '<t:mutiLang langKey=\"common.cancel\"/>', callback: function () {\n }}\n ]});\n } else {\n $.dialog({content: 'url:departController.do?departSelect', zIndex: 2100, title: '<t:mutiLang langKey=\"common.department.list\"/>', lock: true, parent: windowapi, width: 400, height: 350, left: '85%', top: '65%', opacity: 0.4, button: [\n {name: '<t:mutiLang langKey=\"common.confirm\"/>', callback: clickcallback_297e201048183a730148183ad85c0001, focus: true},\n {name: '<t:mutiLang langKey=\"common.cancel\"/>', callback: function () {\n }}\n ]});\n }\n}", "function showOverlay(){\n \tjQuery('#processing').dialog('open');\n \tsetTimeout(validateInfo, 1500)\n }", "function getUserCreateForm(){\n showCreateDialog();\n}", "function showDesignations(objTextBox, objLabel)\r\n{\r\n objDesignationInvokerTextBox = objTextBox;\r\n objDesignationInvokerLabel = objLabel;\r\n openModalDialog('../popup/cm_designation_search_listing.htm',screen.width-50,'400');\r\n return;\r\n}", "function AppCommonWindowBegin() {\n\n OpenAppProgressWindow();\n\n}", "function openDialog(customDialog) {\r\n\t$(customDialog).dialog('open');\r\n}", "function openModal() {\n setOpen(true);\n }", "function popup(){\n $( \"#dialog-message\" ).dialog({\n modal: true,\n buttons: {\n Start: function() {\n level ++;\n $( this ).dialog( \"close\" );\n callTimer(15);\n makeTrash(5, trashArray1);\n \n \n }\n }\n });\n}", "function dialog(url,name,feature,isModal)\r\n{\r\n if(url==null){return false;}\r\n url = url\r\n if(name==null){name=\"\"}\r\n if(feature==null){feature=\"\"};\r\n if(window.showModelessDialog)\r\n {\r\n \tvar WindowFeature = new Object();\r\n\tWindowFeature[\"width\"] = 800;\r\n\tWindowFeature[\"height\"] =600;\r\n\tWindowFeature[\"left\"] = \"\";\r\n\tWindowFeature[\"top\"] = \"\";\r\n\tWindowFeature[\"resizable\"] = \"\";\r\n\r\n\tif(feature !=null && feature!=\"\")\r\n\t{\r\n feature = ( feature.toLowerCase()).split(\",\");\r\n\t\r\n for(var i=0;i< feature.length;i++)\r\n\t\t{\r\n if( feature[i].isArgument())\r\n\t\t\t{\r\n var featureName = feature[i].split(\"=\")[0];\r\n\t var featureValue = feature[i].split(\"=\")[1];\r\n\t \r\n\t if(WindowFeature[featureName]!=null){WindowFeature[featureName] = featureValue; }\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n \r\n if(WindowFeature[\"resizable\"]==1 || WindowFeature[\"resizable\"]==\"1\" || WindowFeature[\"resizable\"].toString().toLowerCase()==\"yes\"){WindowFeature[\"resizable\"] = \"resizable:1;minimize:1;maximize:1;\"}\r\n if(WindowFeature[\"left\"]!=\"\"){WindowFeature[\"left\"] =\"dialogLeft:\" + WindowFeature[\"left\"] +\"px;\";}\r\n if(WindowFeature[\"top\"]!=\"\"){WindowFeature[\"top\"] =\"dialogTop:\" + WindowFeature[\"Top\"] +\"px;\"; }\r\n if(window.ModelessDialog ==null){window.ModelessDialog = new Object() ; };\r\n if(name!=\"\")\r\n {\r\n if(window.ModelessDialog[name]!=null && !window.ModelessDialog[name].closed )\r\n {\r\n window.ModelessDialog[name].focus();\r\n\t return window.ModelessDialog[name];\r\n }\r\n }\r\n\tvar F = WindowFeature[\"left\"] +WindowFeature[\"top\"] + \"dialogWidth:\"+WindowFeature[\"width\"] +\" px;dialogHeight:\"+WindowFeature[\"height\"]+\"px;center:1;help:0;\" + WindowFeature[\"resizable\"] +\"status:0;unadorned:0;edge: raised; ;border:thick;\"\r\n\tif(isModal)\r\n\t{\r\n\t\twindow.showModalDialog(url,self,F);\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\twindow.ModelessDialog[name] = window.showModelessDialog(url,self,F);\r\n\t\treturn window.ModelessDialog[name];\r\n\t}\t\r\n }\r\n else\r\n {\r\n if(document.getBoxObjectFor)\r\n {\r\n\t\r\n\r\n\t if(isModal)\r\n\t {\t\t \r\n\t\t var Modal = window.open(url,name,\"modal=1,\" + feature);\r\n\t\t var ModalFocus = function()\r\n\t\t {\r\n\t\t\tif(!Modal.closed){Modal.focus();}\r\n\t\t\telse{Modal =null;window.removeEventListener(ModalFocus,\"focus\");ModalFocus = null; };\t\t\t\t\t\r\n\t\t }\r\n\t\t window.addEventListener( \"focus\",ModalFocus, false ); \r\n\t\t return false;\r\n\t }\r\n\t else\r\n\t {\r\n\t\treturn window.open(url,name,\"modal=1,\" + feature);\r\n\t }\t \r\n }\r\n else\r\n { \r\n return window.open(url,name,feature);\r\n }\r\n //\r\n }\r\n return null;\r\n}", "function showDialog() {\r\ttry {\r\t\tvar win = new Window('dialog', localize(text.title));\r\r\t\t// description\r\t\twin.desc = win.add('panel');\r\t\twin.desc.orientation = 'row';\r\t\twin.desc.alignment = 'fill';\r\t\twin.desc.alignChildren = 'left';\r\r\t\twin.desc.coords = win.desc.add('group');\r\t\twin.desc.coords.orientation = 'row';\r\t\twin.desc.coords.add('statictext', undefined, localize(text.desc));\r\r\t\t// vertical guide settings\r\t\twin.vSettings = win.add('panel', undefined, localize(text.vSettings));\r\t\twin.vSettings.orientation = 'row';\r\t\twin.vSettings.alignment = 'fill';\r\t\twin.vSettings.alignChildren = 'center';\r\r\t\twin.vSettings.coords = win.vSettings.add('group');\r\t\twin.vSettings.coords.orientation = 'row';\r\t\twin.vSettings.coords.add('statictext', undefined, \"x:\");\r\t\twin.vSettings.coords.input = win.vSettings.coords.add('edittext', undefined, \"\");\r\t\twin.vSettings.coords.input.preferredSize = [ 125, 20 ];\r\r\t\twin.vSettings.repeat = win.vSettings.add('group');\r\t\twin.vSettings.repeat.orientation = 'row';\r\t\twin.vSettings.repeat.checkBox = win.vSettings.repeat.add('checkbox', undefined, localize(text.repeat));\r\t\twin.vSettings.repeat.checkBox.value = true;\r\r\t\t// horizontal guide settings\r\t\twin.hSettings = win.add('panel', undefined, localize(text.hSettings));\r\t\twin.hSettings.orientation = 'row';\r\t\twin.hSettings.alignment = 'fill';\r\t\twin.hSettings.alignChildren = 'center';\r\r\t\twin.hSettings.coords = win.hSettings.add('group');\r\t\twin.hSettings.coords.orientation = 'row';\r\t\twin.hSettings.coords.add('statictext', undefined, \"y:\");\r\t\twin.hSettings.coords.input = win.hSettings.coords.add('edittext', undefined, \"\");\r\t\twin.hSettings.coords.input.preferredSize = [ 125, 20 ];\r\r\t\twin.hSettings.repeat = win.hSettings.add('group');\r\t\twin.hSettings.repeat.orientation = 'row';\r\t\twin.hSettings.repeat.checkBox = win.hSettings.repeat.add('checkbox', undefined, localize(text.repeat));\r\t\twin.hSettings.repeat.checkBox.value = true;\r\r\t\t// buttons\r\t\twin.buttons = win.add('group');\r\t\twin.buttons.orientation = 'row';\r\t\twin.buttons.alignment = 'center';\r\r\t\t// ok button\r\t\twin.okBtn = win.buttons.add('button', undefined, localize(text.ok));\r\t\twin.okBtn.onClick = function() {\r\t\t\tmakeGuides(win.hSettings.coords.input.text, 'Hrzn', win.hSettings.repeat.checkBox.value);\r\t\t\tmakeGuides(win.vSettings.coords.input.text, 'Vrtc', win.vSettings.repeat.checkBox.value);\r\t\t\twin.close();\r\t\t};\r\r\t\t// cancel button\r\t\twin.cancelBtn = win.buttons.add('button', undefined, localize(text.cancel));\r\t\twin.cancelBtn.onClick = function() {\r\t\t\twin.close();\r\t\t};\r\r\t\twin.show();\r\r\t} catch (error) {}\r}", "function tourpopup()\n{\t\n\tMM_openBrWindow('/admission/flash/onlinetour_detect.html','flashpopup','width=768,height=500');\n\treturn false;\n\twindow.focus()\n}" ]
[ "0.67283064", "0.6519391", "0.6389133", "0.6356131", "0.6249224", "0.61392623", "0.6110857", "0.6091912", "0.60681", "0.6066794", "0.6047171", "0.5985506", "0.5968233", "0.5964155", "0.5946293", "0.5939286", "0.59347177", "0.5853696", "0.58450145", "0.5833979", "0.5821221", "0.5792078", "0.5791382", "0.5790513", "0.57763964", "0.5760704", "0.5759402", "0.5753364", "0.57412195", "0.57412195", "0.5739622", "0.5739126", "0.57339096", "0.57325655", "0.5717998", "0.57080454", "0.5704627", "0.56941146", "0.5690753", "0.5686756", "0.56745017", "0.5667623", "0.5653113", "0.56530416", "0.56524676", "0.5631445", "0.56085753", "0.5582752", "0.557991", "0.557964", "0.5569184", "0.55669904", "0.55656624", "0.5561838", "0.55565315", "0.5554416", "0.5554416", "0.55530167", "0.5552948", "0.55516326", "0.55486983", "0.5547247", "0.5545435", "0.55418813", "0.5541377", "0.55353147", "0.5525512", "0.5522613", "0.55167276", "0.5501092", "0.5500682", "0.54944223", "0.54930884", "0.54859513", "0.54832435", "0.54820627", "0.547809", "0.5473327", "0.5472905", "0.5472905", "0.54524404", "0.5451402", "0.5448438", "0.54447097", "0.54426074", "0.5440288", "0.5435983", "0.5435767", "0.54342717", "0.54286295", "0.5428165", "0.5420812", "0.5418468", "0.5418157", "0.54159415", "0.5409837", "0.5408802", "0.5403458", "0.5402407", "0.5398135", "0.5393031" ]
0.0
-1
Call the Will Mount to set the auth Flag to false
componentWillMount() { this.setState({ authFlag: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillMount() {\r\n this.setState({\r\n authFlag: false\r\n })\r\n }", "componentWillMount() {\n this.setState({\n authFlag: false,\n });\n }", "componentWillMount () {\n this.setState({\n authFlag: false\n })\n }", "componentWillMount() {\n this.setState({\n authFlag: false\n })\n }", "componentWillMount() {\n this.setState({\n authFlag: false\n })\n }", "componentWillMount() {\n this.setState({\n authFlag: false\n });\n }", "componentWillMount() {\n this.setState({\n authFlag: false\n });\n }", "componentWillMount() {\n this.setState({\n authFlag: false\n });\n }", "componentWillMount() {\n this.setState({\n authFlag: false\n });\n }", "componentWillMount(){\n this.setState({\n authFlag : false\n })\n }", "componentWillMount(){\n this.setState({\n authFlag : false\n })\n }", "componentWillMount(){\n this.setState({\n authFlag : false\n })\n }", "componentWillMount(){\n this.setState({\n authFlag : false\n })\n }", "componentDidMount(){\n this.setState({\n authFlag : false\n })\n }", "checkAuth() { }", "clearAuthState() {\n this.extendState({\n authenticated: null,\n });\n }", "unsetAuthUser(state){\n Vue.set(state, 'authUser', {});\n Vue.set(state, 'isAuthenticated', false)\n }", "function isUnauth() {\n\t\tglobal.bom.settings.btnLogin.innerHTML = global.bom.settings.textLogin;\n\t\tglobal.bom.settings.btnLogin.addEventListener(clickEvent, authentication.login);\n\t}", "function isAuth() {\n\t\tglobal.bom.settings.btnLogin.innerHTML = global.bom.settings.textLogout;\n\t\tglobal.bom.settings.btnLogin.addEventListener(clickEvent, authentication.logout);\n\t}", "function authenticationMiddleware(req, res, next) {\n if (req.isAuthenticated() && require('./permissions')(req))\n // se o usuario tiver autenticado e a funcao do permissions der TRUE ele consegue seguir adiante, se não ele é direcionado para /off\n return next()\n res.redirect('/off')\n }", "componentDidMount(){\n console.log('requireNoAuth.did.mount isAuthenticated:', this.props.isAuthenticated);\n this.onAuthCheck(this.props);\n }", "componentWillMount() {\n this.setState({\n authFlag: false,\n t_flag: false,\n s_flag: false\n });\n }", "onAuth(options) {\n return true;\n }", "preventAccessWhenAuth() {\n return [];\n }", "function cleanDefaultAuth () {\n defaultAuth = undefined;\n}", "function checkAuth() {\n $(() => {\n riot.mount('*');\n RiotControl.trigger('init');\n gapi.auth.authorize({\n 'client_id': CLIENT_ID,\n 'scope': SCOPES.join(' '),\n 'immediate': true\n }, handleAuthResult);\n // My app routes\n route.start(true);\n })\n}", "unguard() {\n this.guardMode = false;\n }", "prepareReauthenticate() {\n localStorage.removeItem('authToken');\n }", "authRequest(state, status) {\n state.status = status;\n state.isAuthenticated = false;\n }", "function initAuth() {\n // Check initial connection status.\n if (localStorage.token) {\n processAuth();\n }\n if (!localStorage.token && localStorage.user) {\n // something's off, make sure user is properly logged out\n GraphHelper.logout();\n }\n }", "function switchAuthModeHandler() {\n setIsLogin((prevState) => !prevState);\n }", "supportsAuth() {\n return this.dbms.authEnabled === 'true';\n }", "supportsAuth() {\n return this.dbms.authEnabled === 'true';\n }", "componentWillMount() {\n if(!this.state.authenticated) {\n \n }\n }", "autoAuthUser() {\n const authInformation = this.getAuthData();\n if (!authInformation) {\n return;\n }\n const now = new Date();\n const expiresIn = authInformation.expirationDate.getTime() - now.getTime();\n if (expiresIn > 0) {\n this.token = authInformation.token;\n this.isAuth = true;\n this.setAuthTimer(expiresIn / 1000);\n this.authStatusListener.next(true);\n if (authInformation.admin) {\n this.isAdmin = true;\n this.adminStatusListener.next(true);\n }\n }\n }", "isAuthenticated() {\n if (this.getUserLS())\n return true;\n else \n return false;\n }", "componentWillUnmount() {\n AuthService.shared.off();\n }", "onStart(state) {\n state.token = localStorage.getItem(\"token\");\n if (state.token && state.token != \"\") state.isAuthtenticated = true;\n else state.isAuthtenticated = false;\n }", "checkLoggedIn() {\n this.isLoggedIn(null);\n }", "function authNeeded () {\n\n if (args.write === true) {\n return true\n }\n\n if (args.channel.indexOf('private-') === 0) {\n return true\n }\n\n if (args.channel.indexOf('presence-') === 0) {\n return true\n }\n\n return false;\n }", "dontAuthenticate()\n {\n delete this.$http.defaults.headers.common[ApiService.AUTH_TOKEN_HEADER_NAME];\n }", "static get NEED_AUTH() { return 5; }", "clearAuth() {\n this.accessToken = false;\n this.meToken = false;\n this.expires = false;\n this.accountId = false;\n this.externalAccountId = false;\n this.accountName = false;\n this.baseUri = false;\n this.name = false;\n this.email = false;\n }", "login() {\n if (!this.API)\n return;\n this.API.redirectAuth();\n }", "onAuth(client, options, request) {\n return true;\n }", "function checkAuth(next){\r\n\tif(true)\r\n\tnext();\r\n}", "deauthenticate(): void {}", "function sync() {\n var session = JWT.remember();\n user = session && session.claim && session.claim.user;\n $rootScope.authenticated = !!user;\n }", "componentWillMount() {\n this.setState({\n authFlag : false,\n token: \"\"\n })\n }", "function Auth() {\n}", "function requireAut(req, res, next)\n{\n if(!req.isAuthenticated())\n {\n return res.redirect('/login')\n }\n next();\n}", "componentDidMount() {\n Tracker.autorun(() => {\n var userId = Meteor.userId();\n if (!userId) {\n this.setState({ loggedIn: userId });\n } else {\n this.setState({ loggedIn: userId });\n }\n });\n }", "function authenticationHook($transition$) {\n var state = $transition$.router.stateService;\n if (!userService.isAuthenticated())\n return userService.logOff(state);\n }", "function _unlockFunctionality() {\n lockUserActions = false;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "canHandleAuthentication() {\n return false;\n }", "onFail_() {\n this.canAccess = false;\n }", "componentDidMount() {\n this.checkAuth();\n }", "componentWillMount() {\n this.setState({\n authFlag: false,\n usererr: \"\",\n passerr: \"\",\n });\n }", "componentWillUnmount() {\n\n authUi.reset();\n\n }", "get isAuthenticated() {\n return this.use().isAuthenticated;\n }", "function unauthRedirect() {\r\n if(!$rootScope.devices || !$rootScope.devices.length) {\r\n $location.path( \"/pair\" );\r\n }\r\n }", "function setAuthorization(){\n let username = '';\n let password = '';\n let authorization = Utilities.base64Encode(username + ':' + password);\n let userProperties = PropertiesService.getUserProperties();\n userProperties.setProperty('CAPWATCH_AUTHORIZATION', authorization);\n}", "function passwordProtected(req, res, next) {\n res.set(\"WWW-Authenticate\", 'Basic realm=\"Simple Todo App\"');\n if (req.headers.authorization == \"Basic bm9kZWpzOm5vZGVqcw==\") {\n next();\n } else {\n res.status(401).send(\"Authentication Required!\");\n }\n}", "function setHelp(){\n if(!$rootScope.home && !$rootScope.sandbox){\n $auth.updateAccount({help: false})\n .then(function(resp) {\n console.log('Ok: Help set to false')\n })\n .catch(function(resp) {\n console.log(resp)\n });\n }\n }", "componentDidMount() {\n this.setState({ isSignedIn: !!firebase.auth().currentUser });\n\n this.unregisterAuthObserver = firebase\n .auth()\n .onAuthStateChanged((user) => this.setState({ isSignedIn: !!user }));\n }", "_deauthenticate() {\n /* istanbul ignore next */\n if (this._type !== ServiceType.PRIVATE) {\n throw new Error(\n '_deauthenticate must not be called on a Local or Public Service'\n );\n }\n\n if (\n this._state.inState([ServiceState.READY, ServiceState.AUTHENTICATING])\n ) {\n this._authPromise = null;\n this._state.transitionTo(ServiceState.ONLINE);\n }\n }", "isAuthenticated() {\r\n return !(this.user instanceof core.User);\r\n }", "function passwordProtected(req, res, next) {\n res.set(\"WWW-Authenticate\", \"Basic realm= 'Simple Todo App'\");\n console.log(req.headers.authorization);\n if (req.headers.authorization == \"Basic Z3Vlc3Q6c2VjcmV0\") {\n next();\n } else {\n res.status(401).send(\"Authentication required\");\n }\n}", "async setUserFlags () {\n\t\tif (Commander.dryrun) {\n\t\t\tthis.log('\\tWould have set user flags');\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tthis.log('\\tSetting user flags...');\n\t\t}\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tinMaintenanceMode: true,\n\t\t\t\tmustSetPassword: true,\n\t\t\t\tclearProviderInfo: true\n\t\t\t}\n\t\t};\n\n\t\tawait this.data.users.updateDirect({ teamIds: this.team.id }, op);\n\t\tawait this.sendOpsToUsers(op);\n\t}", "function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\t//res.send('error_no_logat');\n\tres.send(JSON.stringify({ \"authorized\": false }));\n}", "setAuth(state, userData) {\n state.authenticated = true\n localStorage.setItem('id_token', userData.id_token)\n if (userData.refresh_token) {\n localStorage.setItem('refresh', userData.refresh_token)\n }\n ApiService\n .setHeader(userData.id_token)\n }", "function isLoggedInSendUnauth(req, res, next) {\n\t\t// if user is authenticated in the session, carry on\n\t\tif (req.isAuthenticated())\n\t\t\treturn next();\n\n\t\t// if they aren't send unauthorized message\n\t\tres.send(401, \"Unauthorized\"); \n\t}" ]
[ "0.62727404", "0.62294865", "0.6215816", "0.6198193", "0.6198193", "0.6163447", "0.6163447", "0.6163447", "0.6163447", "0.6154269", "0.6154269", "0.6154269", "0.6154269", "0.6104157", "0.58736676", "0.5744775", "0.56929594", "0.56440467", "0.5640474", "0.56115484", "0.5599078", "0.55489194", "0.55324405", "0.55162036", "0.5512941", "0.5481472", "0.5480254", "0.54678565", "0.5442803", "0.5440692", "0.54370284", "0.54351133", "0.54351133", "0.54282486", "0.54257995", "0.540504", "0.53850746", "0.5382551", "0.5366198", "0.5355001", "0.5337032", "0.5333647", "0.53095657", "0.5299456", "0.52862406", "0.5280948", "0.5268157", "0.5263157", "0.5262011", "0.52513635", "0.5238998", "0.5236362", "0.5231412", "0.52267534", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52206343", "0.52080154", "0.5205671", "0.5193268", "0.5183332", "0.5175477", "0.5172773", "0.517035", "0.5170157", "0.516938", "0.5161664", "0.5150835", "0.51476353", "0.5143196", "0.51416475", "0.5137049", "0.5133274", "0.5132657" ]
0.6257303
3
increment speed. Object for the cloud in order to do lerps based on initial values or with a persistent lerp.
function Cloud(p_object, p_initialSize, p_initialLocation){ this.object = p_object; this.initialSize = p_initialSize; this.initialLoc = p_initialLocation; this.animationFloat = 0; this.animationBounces = true; this.animationReversing = false; } // END - constructor.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "accelerate(){\n this.speed += 10;\n }", "function inc_speed()\n{\n if(speed == speed_normal)\n speed = speed_fast;\t\n}", "updateSpeed (speed) {\n this.speed = speed;\n }", "increaseSpeed() {\n\n this.speed = Math.max(this.speed - Snake.SPEED_INCREMENT, Snake.MAX_SPEED);\n\n }", "increaseSpeedFall(){\n\t\t// if(this.breakedLine >= NB_OF_LINES_TO_BREAK_TO_SPEED_UP){\n\t\t// \tthis.speedPoint++;\n\t\t// \tthis.breakedLine-= NB_OF_LINES_TO_BREAK_TO_SPEED_UP;\n\t\t// }\n\n\t\tthis.speedPoint = Math.trunc(this.breakedLine/NB_OF_LINES_TO_BREAK_TO_SPEED_UP);\n\n\t\ttrace(\"SPEED POINT\", this.speedPoint);\n\n\t\t//this.mvc.controller.tick = STARTING_TICK - (this.speedPoint*10);\n\n\t\tthis.mvc.controller.tick = STARTING_TICK * 1/(this.speedPoint + 1);\n\n\t\ttrace(\"this.mvc.controller.tick\", this.mvc.controller.tick);\n\t}", "accelerate(amount) {\n\t\tthis.speed += amount;\n\t}", "accelerate(amount) {\n\t\tthis.speed += amount;\n\t}", "function incrementSpeed() {\n setInterval(function() {\n // This will work only when game is not paused or over.\n if (checkGamePause === false) {\n spikeSpeed = spikeSpeed + 0.05;\n otherCarsspeed = otherCarsspeed + 0.05;\n coinSpeed = coinSpeed + 0.05;\n // console.log(\"spike,car,coin: \"+spikeSpeed+\" \"+otherCarsspeed+\" \"+coinSpeed);\n }\n }, 4000);\n\n }", "accelerate(amount) {\n // It's virtually impossible for this data to be\n // accidentally accessed.\n this.#speed += amount;\n this.#milesDriven += speed;\n }", "setSpeed(speed) {\n this.speed = speed;\n }", "function changeSpeed(s) {\n player.speed += s;\n}", "addSpeed(speedChange) {\n this.kinematicQuantity.addSpeed(speedChange);\n }", "function speedUpdate() {\n\tvar r = this.rotation;\n\tif (r < 0) {\n\t\tspeed = 1+(r/150);\n\t} else {\n\t\tspeed = (r/25)+1;\n\t} \n\ttl.timeScale(speed.toFixed(2));\n}", "function adjustSpeed(n) {\n\tsetSpeed(speed+n);\n}", "addSpeed(speedChange) {\n this.velocity.setMag(Math.max(0, this.velocity.mag() + speedChange));\n }", "update() {\n this.xsky -= this.speedSky;\n }", "function turboSpeed() {\r\n\t \tdelta = 500;\r\n\t}", "update () {\n this.y += this.speed;\n }", "constructor() {\n this.speed = 0;\n }", "update(dt) {\n this.x += this.speed*dt;\n }", "update() {\n // Don't update when dead\n if (this.isDead()) {\n return;\n }\n\n this._applyConstantForces();\n\n this.vel = this.vel.add(this.acc);\n if (this.maxSpeed) {\n this.vel = this.vel.limit(this.maxSpeed);\n }\n\n this.prevPos = this.pos.clone();\n this.pos = this.pos.add(this.vel);\n\n // Reset acc for each cycle\n this.acc = this.acc.multiply(0);\n\n if (this.bindToScreen) {\n this._bindToScreen();\n }\n\n if (this.showTrail) {\n this.trail.push(this.pos.clone());\n this.trail = this.trail.splice(this.trail.length - this.trailLimit);\n }\n\n this.count += 1;\n }", "function incrementProjectileSpeed()\n{\n if(enemySpeed <= 2)\n {\n enemySpeed = enemySpeed + 0.1;\n }\n}", "update() {\n this.steps += 1;\n }", "function increase() {\n setSeconds(seconds => seconds + 1)\n if (isSingle) setElixir(elixir => add_or_max(elixir, (1 / SINGLE_RATE), 10))\n else if (isDouble) setElixir(elixir => add_or_max(elixir, (1 / DOUBLE_RATE), 10))\n else if (isTriple) setElixir(elixir => add_or_max(elixir, (1 / TRIPLE_RATE), 10))\n }", "accelerate(amount) {\n\t\tthis.speed += amount;\n\t\tthis.movement = true;\n\t}", "function onUpdate() {\n timeline.currentTime += 10 * currentSpeed;\n timeline.line.setCustomTime(timeline.currentTime, 0);\n}", "function increaseSpeed(increase, step) {\n if (increase) {\n player.sprite.speed = playerRoadSpeed + step;\n for (var i=0; i<playerRoad.length; i++) {\n playerRoad[i].pos[1] += playerRoadSpeed + step;\n if (playerRoad[i].pos[1] >= 400) {\n playerRoad[i].pos[1] = -200;\n }\n }\n } else {\n console.log('down');\n player.sprite.speed = playerRoadSpeed - step;\n console.log(playerRoadSpeed + \"asdf\" + player.sprite.speed);\n for (var i=0; i<playerRoad.length; i++) {\n playerRoad[i].pos[1] -= playerRoadSpeed + step;\n // playerRoad[i].sprite.update(dt);\n if (playerRoad[i].pos[1] >= 400) {\n playerRoad[i].pos[1] = -200;\n }\n }\n }\n}", "setSpeed(speed) {\r\n this.lottieAnimation.setSpeed(speed);\r\n }", "getSpeed() { return this.speed; }", "update() {\n\n\n this.i++;\n\n if (this.i === this.update_interval)\n {\n this.changeWindDirection();\n this.update_interval = Math.floor(Math.random() * 20) * 60; // 0 - 20sec @ 60fps\n this.i = 0;\n }\n\n }", "function doSpeeding()\r\n{\r\n\tplaySound(\"speeding\");\r\n\tspeed += speedingIncrementSpeed;\r\n\tchangeInterval(speed);\r\n\taddMessage(\"Current Speed: \"+(speed), \"speed\");\r\n}", "function changeSpeed() {\n\t\tcurrentSpeed = getSpeed();\n\t\tif (running) {\n\t\t\tclearInterval(currentInterval);\n\t\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t\t}\n\t}", "update() {\r\n // Update velocity\r\n this.velocity.add(this.acceleration);\r\n // Limit speed\r\n this.velocity.limit(this.maxspeed);\r\n this.position.add(this.velocity);\r\n // Reset acceleration to 0 each cycle\r\n this.acceleration.mult(0);\r\n }", "update() {\n // Update velocity\n this.velocity.add(this.acceleration);\n // Limit speed\n this.velocity.limit(this.maxspeed);\n this.position.add(this.velocity);\n // Reset acceleration to 0 each cycle\n this.acceleration.mult(1);\n }", "forwards(speed) {\n if (speed === undefined) {\n this._speed = 100;\n } else {\n if (speed < 0 || speed > 100) {\n throw \"Speed must be between 0 and 100\"\n }\n this._speed = speed;\n }\n this._applySpeed();\n }", "start() {\n let timeoutMs = this.options.speed * 1000;\n this.speedTimeot = this._setIntervalAndExecute(this.moveNext.bind(this), timeoutMs);\n }", "update() {\r\n this.x += this.xspeed;\r\n this.y += this.yspeed;\r\n }", "static set acceleration(value) {}", "function setSpeed(\r\n speed_)\r\n {\r\n speed = speed_;\r\n }", "update() {\n // Update this.velocity\n this.vel.add(this.acc);\n // Limit this.speed\n this.vel.limit(this.speed);\n this.pos.add(this.vel);\n // Reset accelertion to 0 each cycle\n this.acc.mult(0);\n }", "run(speed = 0){\n this.speed += speed;\n console.log(`${this.name} runs with speed ${this.speed}.`);\n }", "function setSpeed(speed){\n for (m in motors){\n ms.setMotorSpeed(motors[m], speed);\n }\n //currentSpeed = speed;\n console.log(\"Speed set to\" + speed);\n }", "function changeSpeed() {\n gameSpeed = (gameSpeed % 3) + 1;\n updateSpeedOption();\n}", "function increaseBallSpeed()\n{\n\tballSpeed = ballSpeed + (2 / numBlocks);\n}", "moveForward() {\n this._currentLinearSpeed = this._linearSpeed;\n this._currentAngularSpeed = 0;\n }", "function updateSpeed() {\n\tif(!paused) {\n\t\tclearInterval(interval);\n\t\tinterval = setInterval(doTick, speed);\n\t}\n\t$('#speed-input').val(speed);\n\t$('#speed-text').html(speed);\n\n\tlet rotation = (speed / (MAX_SPEED - MIN_SPEED) ) * 180 - 90;\n\trotation *= -1;\n\t$('#speed-line').css('transform', 'rotate('+rotation+'deg)');\n}", "function setSpeed(newSpeed) {\n\tnewSpeed = Math.max(newSpeed, 1);\n\tnewSpeed = Math.min(newSpeed, 999);\n\t\t\n\tspeed = newSpeed;\t\n}", "function calcuteCloudOffset() {\n setInterval(function () {\n cloudoffset = cloudoffset + 0.25;\n }, 50)\n}", "vel() {\n this.y += this.speed;\n }", "function changeSpeed(speed) {\n var newSpeed = videoSpeed + speed;\n setSlider(newSpeed);\n }", "_updateGenerationSpeed(speed) {\n this['generationSpeed'] = parseInt(speed, 10);\n this._layoutWords();\n }", "function incSpeed() {\n\n allEnemies.forEach(function(enemy) {\n enemy.speed=enemy.speed+50;\n \n });\n\n\n}", "update() {\n this.velocity.add(this.acceleration);\n this.velocity.limit(p.topspeed2);\n this.location.add(this.velocity);\n this.acceleration.mult(0);\n }", "land() {\n this.velocity += 20; \n }", "update(){\n\t\tthis.position.add(this.velocity);\n\t\tthis.velocity.add(this.acceleration);\n\t\tthis.velocity.limit(this.maxSpeed);\n\t}", "function speedier() {\n //if (distance % 200 == 0 && distance != 0 && frameCount % 20 == 0) {\n if (meteorFrequency > 18) {\n meteorFrequency = round(meteorFrequency*.82);\n }\n //console.log(\"adding speed\");\n //console.log(\"Meteor Frequency: \" + meteorFrequency)\n //}\n}", "update()\n\t{\n\t\tthis.x += this.xspeed;\n\t\tthis.y += this.yspeed;\n\t}", "function incrementLat(dir) {\n\n\t\tvar deg = dir * latSens;\n\n\t\tvar tweenLat = {x: lat};\n\n\t\tvar tween = new TWEEN.Tween(tweenLat)\n\t\t.to({x: (lat + deg)}, keysTweenTime)\n\t\t.easing(TWEEN.Easing.Quadratic.Out)\n\t\t.onUpdate(function(){\n\t\t\t// console.log('lon should be updating');\n\t\t\t// console.log(tweenLat);\n\t\t\tlat = tweenLat.x;\n\t\t})\n\t\t.start();\n\n\t}", "function swap_Speed() {\r\n setInterval(next_Speed, 1200);\r\n}", "function accelerate(){this.velInfluence = accelerator;}", "function setSpeed(speed) {\n if (globals.speed == null) {\n globals.speed = 0;\n }\n globals.speed = speed;\n}", "accelerate(n) {\n this.gravity = n;\n }", "function increaseDecrease (car) {\n car.increaseSpeed();\n car.decreaseSpeed();\n }", "function speedUp(object) {\n while (object.getSpeed() < 100) {\n object.accelerate();\n }\n}", "rollSpeed() {\n this.xSpeed = Math.random() * (this.maxSpeed * 2) - this.maxSpeed;\n this.ySpeed = Math.random() * (this.maxSpeed * 2) - this.maxSpeed;\n }", "function snakeIncreaseSpeed() {\n var interval = 1;\n if (game.is_active) {\n interval = SPEED_INCREASING_INTERVAL;\n snake.speed++;\n }\n setTimeout(function () {\n snakeIncreaseSpeed();\n }, (interval * 1000));\n}", "setSimulationSpeed(speed) {\n this.speed = speed;\n }", "update() {\n this.vel.add(this.acc);\n this.pos.add(this.vel);\n this.lifespan -= 2;\n\n this.vel.limit(5);\n }", "update(){\n \n this.x+=this.xspeed;\n this.y+=this.gravity;\n \n }", "update() {\n this.location.add(this.velocity);\n\t}", "faster(){\n if(this.body.angularVelocity <= 800){\n this.body.angularVelocity += 200;\n }\n this.setVelocityX(this.body.velocity.x + 40);\n this.setVelocityY(this.body.velocity.y - 40);\n }", "function update(){\n\n\n var cloudElement = document.getElementById('jump1');\nspeed1.innerHTML= \"Speed \" + speed;\nvar animatedElem = cloudElement.animate(\n [\n { transform: 'translate(500px,0)' },\n { transform: 'translate(400px,0)' },\n { transform: 'translate(300px,0)' },\n { transform: 'translate(200px,0)' },\n { transform: 'translate(100px,0)' },\n { transform: 'translate(0px,0)' }\n ],\n {\n duration: speed,\n iterations: Infinity,\n\n }\n);\n\n\nvar cloudElement2 = document.getElementById('jump2');\n\nvar animatedElem = cloudElement2.animate(\n [\n { transform: 'translate(0px,0)' },\n { transform: 'translate(100px,0)' },\n { transform: 'translate(200px,0)' },\n { transform: 'translate(300px,0)' },\n { transform: 'translate(400px,0)' },\n { transform: 'translate(500px,0)' }\n ],\n {\n duration: speed,\n iterations: Infinity,\n\n }\n);\n\n\n}", "function speedBoostTime(){\r\n if(speedBoostOn) if(speedCD < 3){\r\n speedCD++;\r\n }else{\r\n clase.maxSpeed = clase.resetSpeed;\r\n speedCD = 0;\r\n }\r\n}", "function speedUp() {\n\n\t\tif(this.sKey && this.baseSpeed) {\n\n\t\t\tthis.speedY*=10;\n\t\t\tthis.speedX*=10;\n\t\t\tthis.baseSpeed = false;\n\n\t\t} else if (!this.sKey && !this.baseSpeed) {\n\n\t\t\tthis.speedY = (this.speedY/10);\n\t\t\tthis.speedX = (this.speedX/10);\n\t\t\tthis.baseSpeed = true\n\n\t\t}\n\n\t}", "setSpeed() {\n return Math.floor(Math.random() * 250) + 120;\n }", "function set_speed() {\r\n frameRate(speed_box.value * 1);\r\n}", "update() {\n this.vel.add(this.acc);\n this.pos.add(this.vel);\n // Multiplying by 0 sets the all the components to 0\n this.acc.mult(0);\n this.osc.update(this.vel.mag() / 10);\n }", "function increaseSpeed() {\n\tvideo.playbackRate *= 1.25;\n\tconsole.log(\"Speed is \"+ video.playbackRate);\n}", "function step(parallax) {\n const timeElapsed = new Date() - startTime;\n // Still going\n if (timeElapsed < totalTime) {\n const progress = (timeElapsed / totalTime);\n parallax.rotmax = existingRot + (progress * changeNeeded);\n parallax.rotate();\n requestAnimationFrame(() => step(parallax));\n } else parallax.rotmax = goal;\n }", "setSpeed(value) {\n\t\tthis.moveSpeed = value;\n\t\tthis.speed = Math.round((6.66666666667 * GAME_SPEED) / this.moveSpeed);\n\t}", "function update() {\r\n\r\n\tthis.loop.rotation += 0.1;\r\n}", "function _setTrueAirSpeed(speed){\n // Make me work!\n }", "update() {\n //Copied from side scroller and changed for my program\n this.vel.add(this.acc);\n this.pos.add(this.vel);\n this.acc.set(0, 0);\n }", "update() {\n\t\tthis.velocity.add(this.acceleration);\n\t\tthis.location.add(this.velocity);\n\t\tthis.acceleration.mult(0);\n\t}", "update(dt) {\n if(this.x < 500) {\n this.x += this.speed * dt;\n this.y = this.y;\n }\n else {\n this.x = -100;\n }\n }", "function handleRotorSpeed(newValue)\n{\n rot = newValue;\n r = rot * 0.8;\t\n PIErender();\n}", "update() {\n // Update velocity\n this.velocity.add(this.acceleration);\n // Limit speed\n this.velocity.limit(this.maxspeed);\n this.position.add(this.velocity);\n // Reset accelerationelertion to 0 each cycle\n this.acceleration.mult(0);\n }", "function main() {\n meter1.update(meter1.val + 0.1);\n}", "function incrementLon(dir) {\n\n\t\tvar deg = dir * lonSens;\n\n\t\tvar tweenLon = {x: lon};\n\n\t\tvar tween = new TWEEN.Tween(tweenLon)\n\t\t.to({x: (lon + deg)}, keysTweenTime)\n\t\t.easing(TWEEN.Easing.Quadratic.Out)\n\t\t.onUpdate(function(){\n\t\t\t// console.log('lon should be updating');\n\t\t\t// console.log(tweenLon);\n\t\t\tlon = tweenLon.x;\n\t\t})\n\t\t.start();\n\n\t}", "newPos() {\n this.gravitySpeed += this.gravity;\n this.y += this.speedY - this.gravitySpeed;\n }", "function set_speed(s) {\n\tspeed = s;\n}", "get speed () {\n if (this.pointers.length > 0)\n return (this.pointers.reduce((sum, pointer) => { return sum+pointer.speed}, 0) / this.pointers.length);\n else\n return 0;\n }", "setRandomSpeed() {\n const rand = Math.random();\n\n this.speed = rand > .5\n ? 1 + (rand / 2) // divide by two just so they don't get too far ahead\n : 1;\n }", "function changespeed(value) {\n if (startflag) { //change speed on run only in running mode on the game\n clearInterval(interval);\n interval = setInterval(\"gameoflife()\", parseInt(value));\n }\n}", "function update_Speed(){\n if (game.time.now > speedTime) {\n if (cursors.down.isDown && (projectileSpeed > MIN_BULLET_SPEED)){\n projectileSpeed = projectileSpeed -1;\n speedTime = game.time.now + 150;\n }\n if (cursors.up.isDown && (projectileSpeed < MAX_BULLET_SPEED)){\n projectileSpeed = projectileSpeed + 1;\n speedTime = game.time.now + 150;\n }\n }\n}", "function setSpeed(speed_data){\r\n\tif(speed_data == 0)\r\n\t\tset_speed = 40;\r\n\telse if(speed_data == 1)\r\n\t\tset_speed = 25;\r\n\telse\r\n\t\tset_speed = 15;\r\n}", "function moveT(){\n var t = timeStep / 1000;\n this.x += this.xSpeed * timeStep / 1000;\n this.y = this.y + this.ySpeed * timeStep / 1000;\n this.coll();\n}", "stepForward() {\n this.player_.volume(this.player_.volume() + 0.1);\n }", "function setSpeed() {\n return (Math.random()*(400 - 60)) + 60;\n}", "function speedIncrease() {\n if (score < 2500 && cnvsWidth < 600) {\n speed += 0.002;\n } else if (score < 2500 && cnvsWidth < 1200) {\n speed += 0.005;\n } else if (score < 2500) {\n speed += 0.007;\n } else if (score < 5000 && cnvsWidth < 600) {\n speed += 0.001;\n } else if (score < 5000 && cnvsWidth < 1200) {\n speed += 0.002;\n } else if (score < 5000) {\n speed += 0.002;\n } else if (score < 7500 && cnvsWidth < 600) {\n speed += 0.0005;\n } else if (score < 7500 && cnvsWidth < 1200) {\n speed += 0.0002;\n } else if (score < 7500) {\n speed += 0.001;\n }\n}", "getSpeed() {\n return this.speed;\n }" ]
[ "0.7287871", "0.7042348", "0.70416236", "0.6979714", "0.6919031", "0.6911426", "0.6911426", "0.6887514", "0.67779666", "0.66589713", "0.6555078", "0.65422153", "0.63737684", "0.6366733", "0.6334532", "0.63268137", "0.627877", "0.62686807", "0.62642294", "0.6257419", "0.62565607", "0.62500745", "0.624458", "0.62217504", "0.61955833", "0.61939555", "0.61805665", "0.6146811", "0.6137713", "0.612859", "0.6126385", "0.6117667", "0.6113035", "0.61059934", "0.610495", "0.61048806", "0.6094659", "0.60922486", "0.60917485", "0.60670453", "0.60567546", "0.6050963", "0.6043485", "0.60399735", "0.60383904", "0.60369897", "0.6032749", "0.6029807", "0.6020707", "0.6016533", "0.60159117", "0.6012483", "0.5999939", "0.5960315", "0.5956102", "0.59534717", "0.5951733", "0.59483594", "0.5946848", "0.59240425", "0.5922835", "0.5922495", "0.59164435", "0.5914135", "0.590194", "0.58988696", "0.58913594", "0.5887722", "0.5887162", "0.5871658", "0.5870198", "0.58551085", "0.5852728", "0.58496195", "0.5841777", "0.5837093", "0.5836917", "0.5836818", "0.58320117", "0.5826378", "0.58262163", "0.5825853", "0.5820896", "0.5819315", "0.58065253", "0.57937217", "0.57908374", "0.5780146", "0.5775194", "0.5774031", "0.5770982", "0.5752208", "0.57464194", "0.5735551", "0.5730171", "0.57274246", "0.57209957", "0.5720425", "0.5718457", "0.56961256", "0.5695916" ]
0.0
-1
CONVENIENCE FUNCTIONS. Returns a random integer within the provided minmax range.
function randomInt(min, max){ return Math.floor(Math.random() * (max - min) + min); } // END - random value.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "static getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min) + min)\n }", "getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "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 }", "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomIntegerInRange(min, max){\n\t\treturn Math.floor(min + Math.random() * (max - min));\n\t}", "getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n }", "getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n }", "randomIntFromInterval(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "generateRandomInteger(min, max){\n return Math.floor(min + Math.random()*(max+1 - min));\n }", "function getRandomIntInRange(min, max) {\r\n\t\treturn Math.random() * (max - min) + min;\r\n\t}", "function h_getRandomInt(min, max) \n{\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "getRandomInt(min, max)\n {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n } //max is excluded", "function getRandomInt(min, max) {\n\t\t\t\t\t\t\t\t\treturn Math.floor(Math.random()\n\t\t\t\t\t\t\t\t\t\t\t* (max - min + 1))\n\t\t\t\t\t\t\t\t\t\t\t+ min;\n\t\t\t\t\t\t\t\t}", "function intInRange(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "function getRandomInt(min, max) {\n \t\t\treturn Math.floor(Math.random() * (max - min)) + min;\n\t\t\t\t\t\t}", "static randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "static randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "static randomInt(min, max) {\n const minVal = Math.ceil(min);\n const maxVal = Math.floor(max);\n return Math.floor(Math.random() * (maxVal - minVal)) + minVal; //Inclusive min Esclusive max\n }", "getRandomInt(min: number = 0, max: number = Number.MAX_SAFE_INTEGER): number\n\t{\n\t\tconst range = max - min;\n\n\t\tconst float = Math.random() * range + min;\n\n\t\treturn Text.toInteger(float);\n\t}", "function getRandomInt(min, max) {\n \treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "function getRandomIntInRange(min, max) {\n\treturn Math.floor(Math.random() * (max-min+1)) - min; \n}", "function getRandomInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "function getRandomInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "function getRndInteger(max, min) {\n let plusOrMinus = Math.random() < 0.5 ? -1 : 1;\n return (Math.floor(Math.random() * (max - min)) + min) * plusOrMinus;\n}", "function getIntRandom(min, max) {\r\n return Math.round(Math.random() * (max - min) + min);\r\n}", "static getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.random() * (max - min) + min;\n }", "function randomIntFromInterval(min, max) {\n \treturn Math.floor(Math.random() * (max - min + 1) + min);\n\t}", "function randInt(min, max){\n return(Math.floor(Math.random() * (+max - +min)) + +min); \n }", "function getRandomInt(min, max) {\n\t\t\t\t return Math.floor(Math.random() * (max - min + 1) + min);\n\t\t\t\t}", "function randomizeInt(min,max){\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "function randint(min, max) {\n return Math.floor(Math.random() * ((max+1) - min) + min);\n }", "function getRandomInt(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n }", "randomIntFromInterval(min,max)\r\n {\r\n return Math.floor(Math.random()*(max-min+1)+min);\r\n }", "function _getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n \t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randInt(min, max) { return Math.random() * (max - min) + min; }", "function randInt(min, max) { return Math.random() * (max - min) + min; }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n }", "function generateRandomInteger(min, max) {\n return Math.floor(min + Math.random()*(max + 1 - min))\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "static randomInt(min, max){\n \n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n \n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min; \n }", "function getRandomInt(min,max)\n{\n\treturn Math.floor(Math.random()*(max-min+1)+min);\n}", "function getRandomInt(min, max) {\n\t return Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "function getRandomInt(min, max) {\n\t return Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "function getRandomIntEx(min, max) {//max not inclusive\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "function randomIntFromInterval(min,max) {\n\t\treturn Math.floor(Math.random()*(max-min+1)+min);\n\t}", "function randomIntFromInterval(min,max) {\n\t\treturn Math.floor(Math.random()*(max-min+1)+min);\n\t}", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "function randomInteger(min, max) {\n\t var rand = min - 0.5 + Math.random() * (max - min + 1)\n\t rand = Math.round(rand);\n\t return rand;\n\t }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "randomInt(min, max) {\n\n return Math.floor(Math.random() * (max - min)) + min\n }", "function randomIntFromInterval(min,max) {\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "function randomint(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "function getRandomInt(min, max) {\n \treturn Math.floor(Math.random() * (max - min)) + min;\n}", "function getRandomInt(min, max) {\n\t\treturn Math.floor(Math.random() * (max - min + 1) + min);\n\t}", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) ) + min;\r\n}", "function randomIntFromInterval(min,max)\n{return Math.floor(Math.random()*(max-min+1)+min);}", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRndInteger(min, max) {\n \treturn Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "function RandomInt(max, min)\n{\n return Math.floor(Math.random() * ( max + 1 - min) + min);\n}", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "function getRandomInt(min, max) {\n\t\treturn Math.floor(Math.random() * (max - min)) + min;\n\t}", "static randomInt(min, max){\n\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n\n }", "function getRandomInt(min, max) {\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "function getRandomInt(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n}", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }" ]
[ "0.79942477", "0.7969933", "0.7954734", "0.79384524", "0.7932309", "0.7930381", "0.79278", "0.7924837", "0.7904472", "0.78911096", "0.7887336", "0.78724295", "0.78685236", "0.785951", "0.7857231", "0.78558356", "0.7852983", "0.78521377", "0.78511405", "0.78481257", "0.78481257", "0.7845821", "0.78392804", "0.78335947", "0.7831652", "0.7828791", "0.7828791", "0.7828292", "0.782577", "0.78171945", "0.78160506", "0.78159267", "0.7814508", "0.7811701", "0.7811152", "0.7807399", "0.78063476", "0.7804587", "0.7801171", "0.7799964", "0.7798582", "0.77952904", "0.77943504", "0.77943504", "0.77919686", "0.77918637", "0.7790659", "0.77877367", "0.7783392", "0.778249", "0.7779449", "0.77788496", "0.77788496", "0.7777959", "0.77775073", "0.77775073", "0.77754414", "0.7773294", "0.77714264", "0.77700716", "0.77700716", "0.77700716", "0.7770062", "0.776489", "0.7763968", "0.7762869", "0.77614814", "0.7758997", "0.77575505", "0.77575505", "0.77575505", "0.7755238", "0.775429", "0.7753971", "0.7753818", "0.7752574", "0.77525395", "0.7752068", "0.7752068", "0.7752068", "0.77519274", "0.7751408", "0.77505916", "0.7750582", "0.77496266", "0.77496266", "0.77496266", "0.77456194", "0.77456194", "0.77456194", "0.77435625", "0.77435625", "0.77435625", "0.77435625", "0.77435625", "0.77435625", "0.77435625", "0.7743008", "0.7743008", "0.7743008" ]
0.7791904
45
Returns a random float within the provided minmax range.
function randomFloat(min, max){ return Math.random() * (max - min) + min; } // END - Random value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomFloat(min, max) {\n return min + Math.random() * (max - min);\n}", "function randomFloat(min, max) {\n return min + Math.random() * (max - min);\n }", "function getFloatRandom(min, max) {\r\n return Math.random() * (max - min) + min;\r\n}", "function getRandomFloat(min, max) {\n return Math.random() * (max - min) + min;\n}", "function getRandomFloat(min, max) {\n return Math.random() * (max - min) + min;\n}", "function randomFloat(min,max){\n return min+(Math.random()*(max-min));\n}", "function randomFloat(min, max) {\n return Math.random() * (max - min) + min;\n}", "function randomFloatFromRange(min, max){\n\treturn (Math.random() * (max - min + 1) + min);\n}", "function randomFloat(max = 1, min = 0) {\n return Math.random() * (max - min) + min;\n}", "function randFloat(min, max) {\n\n var absMin = Math.abs(min) || 0;\n var absMax = Math.abs(max) || 0;\n var minimum = Math.min(absMin, absMax);\n var maximum = Math.max(absMin, absMax);\n\n return minimum + Math.random() * (maximum - minimum);\n\n }", "function randomFloat (min, max) {\n var float = Math.random();\n var value;\n\n if (float < 0.5) {\n value = (1 - Math.random()) * (max-min) + min;\n } else {\n value = Math.random() * (max-min) + min;\n }\n\n return parseFloat(value.toFixed(2));\n}", "function random(min, max) {\n return (Math.round(min - 0.5 + Math.random() * (max - min + 1)));\n}", "function randomNumber(min, max) { \n min = Math.ceil(min); \n max = Math.floor(max); \n return Math.floor(Math.random() * (max - min + 0.01)) + min; \n}", "function getRandomNumber(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n }", "function randFloat(low, high) {\n return low + Math.random() * (high - low);\n}", "function getRandomNumber(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n}", "function rangedRandomVal(min, max) {\n return Math.floor(Math.random() * (max - min) + 1) + min;\n}", "function getRandomNumber(min, max) {\n return (Math.random() * (+max - +min) + min);\n }", "randf( min=0, max=1 ) {\n return min + ( max - min ) * this.random();\n }", "function randomNumberBetween(min, max) {\r\n\tvar decimal = Math.random() * (max - min) + min;\r\n\treturn Math.round(decimal); \r\n}", "function randomValue(min, max) {\n\n // both lowest and highest number in range can be selected\n min = Math.ceil(min);\n\n max = Math.floor(max);\n\n return Math.floor(Math.random() * (max - min + 1)) + min;\n\n }", "function getRandomValue(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "function GetRandomNumber (range_min, range_max) {\r\n return Math.floor(Math.random() * (range_max - range_min + 1)) + range_min;\r\n }", "function frand(min, max)\n\t\t{\n\t\t\treturn (min||0) + Math.random() * ((max||1) - (min||0));\n\t\t}", "function randFloat(low, high) {\n return low + Math.random() * (high - low);\n }", "function randomWithinRange(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n}", "function returnRandom(min, max) {\n return parseInt((Math.random() * (max - min) + min).toFixed(0));\n }", "function randFloat( low, high ) {\n\n\treturn low + Math.random() * ( high - low );\n\n}", "function randomNumber(min, max) {\r\n\treturn Math.round(Math.random() * (max - min) + min);\r\n}", "function randint(min, max) {\n let rand = min - 0.5 + Math.random() * (max - min + 1);\n return Math.round(rand);\n}", "function randomNumber(min, max){\n return Math.round( Math.random() * (max - min) + min);\n}", "function randInt(min, max) {\n return Math.floor(randFloat(min, max));\n }", "function getRandValue(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "function randomVal(min, max) {\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "getRandomInt(min: number = 0, max: number = Number.MAX_SAFE_INTEGER): number\n\t{\n\t\tconst range = max - min;\n\n\t\tconst float = Math.random() * range + min;\n\n\t\treturn Text.toInteger(float);\n\t}", "function getRandomNumber(min, max) {\r\n let random = Math.random(); // 0 - 1\r\n random = (random * (max - min + 1)) + min; // less than or equal max\r\n random = Math.floor(random); // remove fractions\r\n return random;\r\n}", "function randomNumber(min, max){\n return Math.round(Math.random() * (max - min + 1) + min);\n}", "function random( min, max ) {\n return Math.round(Math.random() * ( max - min ) + min);\n}", "function getRandom(max, min = 0) {\n return Math.round(Math.random() * (max - min)) + min;\n}", "function getRandomArbitrary(min, max) {\n return Math.random() * (max - min) + min;\n} //returns decimal number (ex. 1,323442)", "function getRandomNumber(min, max) {\n return Math.random() * (max - min) + min;\n }", "function getRandomNumber(min, max) {\n return Math.random() * (max - min) + min;\n }", "function getRandomNumber(min, max) {\n var random = Math.floor((Math.random() * max) + min);\n return random;\n}", "function getRandomNumber(min, max) {\n var random = Math.floor((Math.random() * max) + min);\n return random;\n}", "function getRandomDoubleInRange(min, max){\n\t\treturn min + Math.random() * (max - min);\n\t}", "function minMax(min, max){\n return (min) + (Math.random() * (max - min));\n }", "function random(min, max) {\n return Math.round(min + ((max - min) * (Math.random() % 1)));\n}", "function getRandomNumber(min, max) {\n const num = Math.random() * (max - min) + min;\n return Math.floor(num);\n}", "function randFloat( low, high ) {\n\n\t\treturn low + Math.random() * ( high - low );\n\n\t}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function randomNum(min, max){\n return(Math.random() * (+max - +min) + +min);\n }", "function getRandomNumber(min,max){\r\n return Math.floor(Math.random()*(max-min)+min);\r\n}", "function genValue(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * max) + min;\n}", "function generateNumberRandom(min, max) {\n var res = min + Math.random() * (max - min);\n return res.toFixed(2)\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "function getRandomNumber(min, max) {\n\treturn Math.floor(Math.random() * (max - min) + min);\n}", "function randomInteger(min, max) {\n let rand = min - 0.5 + Math.random() * (max - min + 1)\n rand = Math.round(rand);\n return rand;\n}", "getRandomNumber(max,min){\n return Math.floor(Math.random()*max+min);\n }", "function getRandomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n }", "function randomInteger(min, max) {\n\t var rand = min - 0.5 + Math.random() * (max - min + 1)\n\t rand = Math.round(rand);\n\t return rand;\n\t }", "function randomInt(min, max) {\n var r = Math.random();\n var i = max - min + 0.5;\n var q = r * i + (min - 0.5);\n\n return Math.round(q);\n}", "function getRandomNumber(min, max) {\n\t\tmin = Math.ceil(min);\n\t\tmax = Math.floor(max);\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "function getRandomNumber(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max)\n return Math.floor(Math.random() * (max - min)) + min;\n}", "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n }", "function getRndInteger(max, min) {\n let plusOrMinus = Math.random() < 0.5 ? -1 : 1;\n return (Math.floor(Math.random() * (max - min)) + min) * plusOrMinus;\n}", "function getRandomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n }", "function getRandomArbitrary(min, max, decPoints){\n\tvar n = (decPoints === 0 ? 0 : decPoints || 20)\n\treturn parseFloat((Math.random() * (max - min) + min).toFixed(n))\n}", "function getRandomNumber(max, min){\n var num = Math.floor(Math.random() * max) + min;\n return num\n}", "function getRandomNumber(min, max) {\n return Math.floor( Math.random() * (max - min + 1) ) + min;\n}", "range(max, min){\n let num = Math.round(Math.random()*(min-max)+max);\n return num;\n}", "function randomNumber(min, max) {\n return Math.floor(Math.random() * max) + min;\n }", "function randomNum(min, max){\n\tvar wait = 5000;\n\tvar result;\n var d1 = new Date().getTime();\n \tvar d2 = new Date().getTime() % wait;\n \td1 = d1 - d2;\n \td1 = Math.sin(d1);\n \td1 = d1 - Math.floor(d1);\n \tresult = Math.floor(((min + 0.5) + (max - min) * d1));\n \treturn result;\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function randval(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "function random(min=0, max=1) {\n let x = Math.sin(seed++) * 10000;\n x = x - Math.floor(x);\n let range = max - min;\n x *= range;\n x += min;\n return x;\n}", "function getRandomNumber(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomNumber(min, max) {\n\t\treturn Math.floor(Math.random() * (max - min + 1) + min);\n\t}", "function randomRange(max, min) {\n return Math.floor(Math.random()*(max-min +1))+ min;\n }", "function getRandomNumber(min, max) {\n return min + Math.random() * (max - min);\n}", "function getRandomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomNumber(min, max) {\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomNumber(min, max) {\n return Math.random() * (max - min) + min;\n }", "function randomNumber(min,max){\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "function getRandomNumber (min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min)\n}", "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function randomNumberInRange(minVal, maxVal) {\n const randomVariation = Math.ceil(Math.random() * (maxVal - minVal));\n return minVal + randomVariation;\n}", "getRandom(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "function randomNumberBetween(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "function getRandomNumber(min, max) {\n // ~~() negative-safe truncate magic\n return ~~(Math.random() * (max - min) + min);\n}", "getRandomNumber(min, max) {\n return Math.floor((Math.random() * max) + min);\n }", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}" ]
[ "0.87267464", "0.8724303", "0.8674062", "0.86646473", "0.86646473", "0.86058956", "0.86043423", "0.860126", "0.8513492", "0.8416304", "0.832141", "0.7852196", "0.78392047", "0.7715826", "0.76962894", "0.768729", "0.76603794", "0.7658741", "0.7655863", "0.7652018", "0.7635117", "0.76243573", "0.7623772", "0.76188916", "0.7616938", "0.76140624", "0.75978565", "0.7582988", "0.75544894", "0.75450623", "0.75411904", "0.7540471", "0.75396657", "0.75348204", "0.75272655", "0.7520425", "0.7519083", "0.75000846", "0.7479204", "0.747653", "0.7474001", "0.7474001", "0.74732476", "0.74732476", "0.74708307", "0.74668616", "0.74629223", "0.74594516", "0.7455453", "0.7450326", "0.7443884", "0.7440671", "0.7432376", "0.7429708", "0.7428769", "0.7428752", "0.74287194", "0.74284923", "0.74261206", "0.74220747", "0.7409426", "0.74072474", "0.7406988", "0.74068016", "0.7401744", "0.7401572", "0.74013364", "0.7394903", "0.73918694", "0.73917603", "0.7389539", "0.73874557", "0.73862606", "0.7383181", "0.7382572", "0.7379678", "0.7372669", "0.7372608", "0.7370556", "0.73700917", "0.7368033", "0.73613375", "0.73613375", "0.73613375", "0.73613375", "0.73609626", "0.73591805", "0.7359032", "0.7355714", "0.7351967", "0.73513997", "0.73507595", "0.7347458", "0.7346255", "0.7345996", "0.7345817", "0.7345434", "0.73451257", "0.7344212", "0.7344212" ]
0.8470013
9
Function to clean up 3D Objects from a scene by disposing of geometry and materials before removing the object from scene..
function cleanup3DObject(object){ object.geometry.dispose(); object.material.dispose(); scene.remove(object); } // END - Cleanup function
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this.myScene.remove(this.threeObject);\n this.threeObject = null;\n }", "removeFromScene() {\n if (this.scene)\n this.scene.remove(this.mObject3D);\n }", "cleanupScene(groupOrScene = null) {\n if (groupOrScene === null) {\n groupOrScene = this.scene;\n }\n const items = [...groupOrScene.children];\n for (let item of items) {\n if (item.children && item.children.length > 0) {\n this.cleanupScene(item);\n }\n const { geometry, material, texture } = item;\n if (geometry) {\n geometry.dispose();\n }\n if (material) {\n material.dispose();\n }\n if (texture) {\n texture.dispose();\n }\n if (typeof item.dispose === 'function') {\n item.dispose();\n }\n groupOrScene.remove(item);\n }\n }", "dispose() {\n\n\t\tconst materials = this.materials;\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0; i < materials.length; i ++ ) {\n\n\t\t\tmaterials[ i ].dispose();\n\n\t\t}\n\n\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\tconst child = children[ i ];\n\n\t\t\tif ( child.isMesh ) child.geometry.dispose();\n\n\t\t}\n\n\t}", "clean() {\n this.removeItem(this.scene);\n }", "destroy() {\n this._destroyed = true;\n\n if (typeof this.freeFromPool === 'function') {\n this.freeFromPool();\n }\n\n if (this.currentMap) {\n this.currentMap.removeObject(this);\n } else if (this.currentScene) {\n this.currentScene.removeObject(this);\n }\n\n this.children.forEach((child) => {\n child.destroy();\n });\n\n // triggers the wave end\n if (this.wave) {\n this.wave.remove(this);\n }\n }", "function clearScene() {\n for (var i = scene.children.length - 1; i >= 0; --i) {\n var obj = scene.children[i];\n scene.remove(obj);\n }\n}", "clear()\n {\n //this.object.geometry.dispose();\n //this.object.material.dispose();\n scene.remove(this.object);\n this.object = new THREE.Mesh();\n scene.add(this.object);\n\n this.points = new List();\n }", "erase(){\n this.scene.remove(this.graphicalObject);\n }", "clearScene(){\n $objs.spritesFromScene.forEach(cage => {\n $stage.scene.removeChild(cage);\n $objs.LIST[cage.dataObj._id] = void 0;\n });\n $objs.spritesFromScene = [];\n }", "destroy() {\n //--calls super function cleaning up this scene--//\n super.destroy();\n //--if you generate any textures call destroy(true) on them to destroy the base texture--//\n //texture.destroy(true);\n }", "cleanup() {\n this.physicsEngine.cleanup(this.toClean);\n const gameInstance = this;\n this.toClean.forEach(function (name) {\n if (typeof gameInstance.objects[name] !== 'undefined') {\n delete gameInstance.objects[name];\n }\n });\n this.physicsEngine.cleanup(this.toClean);\n }", "destroy() {\n\n if (this._navCubeCanvas) {\n\n this.viewer.camera.off(this._onCameraMatrix);\n this.viewer.camera.off(this._onCameraWorldAxis);\n this.viewer.camera.perspective.off(this._onCameraFOV);\n this.viewer.camera.off(this._onCameraProjection);\n\n this._navCubeCanvas.removeEventListener(\"mouseenter\", this._onMouseEnter);\n this._navCubeCanvas.removeEventListener(\"mouseleave\", this._onMouseLeave);\n this._navCubeCanvas.removeEventListener(\"mousedown\", this._onMouseDown);\n\n document.removeEventListener(\"mousemove\", this._onMouseMove);\n document.removeEventListener(\"mouseup\", this._onMouseUp);\n\n this._navCubeCanvas = null;\n this._cubeTextureCanvas.destroy();\n this._cubeTextureCanvas = null;\n\n this._onMouseEnter = null;\n this._onMouseLeave = null;\n this._onMouseDown = null;\n this._onMouseMove = null;\n this._onMouseUp = null;\n }\n\n this._navCubeScene.destroy();\n this._navCubeScene = null;\n this._cubeMesh = null;\n this._shadow = null;\n\n super.destroy();\n }", "destroy() {\n super.destroy(); // xeokit.Object\n this._putDrawRenderers();\n this._putPickRenderers();\n this._putOcclusionRenderer();\n this.scene._renderer.putPickID(this._state.pickID); // TODO: somehow puch this down into xeokit framework?\n if (this._isObject) {\n this.scene._deregisterObject(this);\n if (this._visible) {\n this.scene._objectVisibilityUpdated(this, false);\n }\n if (this._xrayed) {\n this.scene._objectXRayedUpdated(this, false);\n }\n if (this._selected) {\n this.scene._objectSelectedUpdated(this, false);\n }\n if (this._highlighted) {\n this.scene._objectHighlightedUpdated(this, false);\n }\n }\n if (this._isModel) {\n this.scene._deregisterModel(this);\n }\n this.glRedraw();\n }", "function clearScene (){\r\n for( var i = scene.children.length - 1; i >= 0; i--) {\r\n scene.remove(scene.children[i]);\r\n }\r\n }", "destroy() {\n super.destroy();\n if (this.material) {\n this.material.destroy();\n }\n if (this.geometry) {\n this.geometry.destroy();\n }\n }", "clearFromeScene()\r\n {\r\n for (var i=0;i<this.segMeshes.length;i++)\r\n {\r\n scene.remove(this.segMeshes[i]);\r\n }\r\n //alert(this.leafMeshes.length + \" \" +this.segMeshes.length);\r\n for (var i=0;i<this.leafMeshes.length;i++)\r\n {\r\n //alert(\"hm\");\r\n scene.remove(this.leafMeshes[i]);\r\n }\r\n }", "destroy() {\n this.children.forEach(mesh => mesh.destroy());\n }", "destroy() {\n this.meshes.forEach(mesh => {\n mesh.destroy();\n });\n this.meshes.clear();\n this.lights.clear();\n this.__deleted = true;\n }", "destroy(scene, layers) {\n if (this.meshInstance) {\n this.removeFromLayers(scene, layers);\n this.meshInstance.destroy();\n this.meshInstance = null;\n }\n }", "function clearScene(turtle) {\n var obj;\n for( var i = turtle.scene.children.length - 1; i > 3; i--) {\n obj = turtle.scene.children[i];\n turtle.scene.remove(obj);\n } \n}", "function scene::Destroy(system)\r\n{\r\n print(\"\\r\\nDestroy(system)\\r\\n\");\r\n loaded = false;\r\n delete bsp;\r\n delete splash;\r\n delete caption;\r\n delete menubar;\r\n //maps.resize(0);\r\n //menubar.resize(0);\r\n \r\n system.Stop(); \r\n}", "destroy() {\n for (var tileId in this._tiles) {\n if (this._tiles.hasOwnProperty(tileId)) {\n const tile = this._tiles[tileId];\n for (var i = 0, leni = tile.nodes.length; i < len; i++) {\n const node = tile.nodes[i];\n node._destroy();\n }\n putBatchingBuffer(tile.buffer);\n }\n }\n this.scene.camera.off(this._onCameraViewMatrix);\n for (var i = 0, len = this._layers.length; i < len; i++) {\n this._layers[i].destroy();\n }\n for (var i = 0, len = this._nodes.length; i < len; i++) {\n this._nodes[i]._destroy();\n }\n this.scene._aabbDirty = true;\n if (this._isModel) {\n this.scene._deregisterModel(this);\n }\n super.destroy();\n }", "destroy() {\n this.texture = null;\n this.matrix = null;\n }", "destroy() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.scene = undefined;\n this.bullets.destroy(true);\n }", "destroy() {\n this.container.removeChild(this.inspiredSprite);\n this.container.removeChild(this.sprite);\n this.container.removeChild(this.halo);\n this.container.removeChild(this.highlight);\n delete this.container;\n }", "clear() {\n this.stop();\n this.scene.remove.apply(this.scene, this.scene.children);\n this.scene.background = null;\n this.mixers.splice(0, this.mixers.length);\n this.sceneMeshes.splice(0, this.sceneMeshes.length);\n $(\"#picker\").spectrum(\"hide\");\n }", "function removeFromScene(object){\n\n\ttry{\n\n\t // remove object from scene\n\t\tscene.remove(object);\n\t\tobject.geometry.dispose();\n\n\t}catch(error){\n\n\t\t//update display\n status = 'Fehler beim Löschen';\n\n\t}\n}", "deleteMeshSelf(webGL_scene) {\r\n if (this.m_meshSelf != undefined) {\r\n webGL_scene.remove(this.m_meshSelf);\r\n this.m_meshSelf.geometry.dispose();\r\n this.m_meshSelf.material.dispose();\r\n delete this.m_meshSelf;\r\n }\r\n }", "resetObjects()\n {\n //remove rectangles for collidable bodies\n this.buttons.forEach(this.deleteBody, this, true);\n this.spikes.forEach(this.deleteBody, this, true);\n\n this.startdoors.destroy();\n this.enddoors.destroy();\n this.buttons.destroy();\n this.spikes.destroy();\n this.checkpoints.destroy();\n this.doors.destroy();\n }", "destroy() {\n this.stop();\n\n // Remove listeners\n this.off('controlsMoveEnd', this._onControlsMoveEnd);\n\n var i;\n\n // Remove all controls\n var controls;\n for (i = this._controls.length - 1; i >= 0; i--) {\n controls = this._controls[0];\n this.removeControls(controls);\n controls.destroy();\n };\n\n // Remove all layers\n var layer;\n for (i = this._layers.length - 1; i >= 0; i--) {\n layer = this._layers[0];\n this.removeLayer(layer);\n layer.destroy();\n };\n\n // Environment layer is removed with the other layers\n this._environment = null;\n\n this._engine.destroy();\n this._engine = null;\n\n // Clean the container / remove the canvas\n while (this._container.firstChild) {\n this._container.removeChild(this._container.firstChild);\n }\n\n this._container = null;\n }", "function removeScene () {\n cancelAnimationFrame(raf);\n\n stage.removeChildren();\n stage.destroy(true);\n\n container.removeChild(canvas);\n}", "function clearScene(crowd) {\n var obj;\n for( var i = crowd.scene.children.length - 1; i > 3; i--) {\n obj = crowd.scene.children[i];\n crowd.scene.remove(obj);\n }\n}", "removeFromScene(scene, isUpdating) {\n this.objects.forEach((obj) => {\n scene.remove(obj, true);\n });\n if (!isUpdating) {\n scene.remove(this.cursor, true);\n }\n }", "destroy()\n {\n this.#gameObject = null;\n }", "function dispose(object) {\n if (object.material) {\n object.material.dispose();\n }\n if (object.geometry) {\n object.geometry.dispose();\n }\n object.children.forEach((child) => dispose(child));\n}", "if (!this.History.inProgress()) {\n this.objects.all()\n .filter(obj => obj.name !== 'groundPlane')\n .forEach(obj => { this.scene.remove(obj) });\n }", "function destroyPlayer(){\n player.mesh.dispose();\n // then what?\n }", "destroyScene(scene){\n this.game.scene.remove(scene.key);\n }", "destroy(){\n\t\tthis._active = false\n\t\tthis.children.forEach(child => {\n\t\t\tif(child.type === 'GameObject' || child.type === 'GUIObject'){\n\t\t\t\tthis.remove(child)\n\t\t\t\tchild.destroy()\n\t\t\t\tdelete this[child]\n\t\t\t}\n\t\t})\n\t}", "destroy() {\n this.__anchors--;\n if (this.__anchors === 0) {\n this._program.destroy();\n Object.keys(this.textures).forEach(key => this.textures[key].destroy());\n }\n }", "function clear() {\n if (!scene)\n return;\n\n if (chartGrid) {\n scene.remove(chartGrid);\n chartGrid = undefined;\n }\n if (chartAxis) {\n scene.remove(chartAxis);\n chartAxis = undefined;\n }\n if (chartAxisLabels)\n chartAxisLabels.children.length = 0;\n if (chartMesh) {\n scene.remove(chartMesh);\n chartMesh = undefined;\n }\n }", "function removeObjects(){\n\tfor(var n=0; n<gameData.planes.length;n++){\n\t\tvar curAirplane = gameData.planes[n];\n\t\tif(curAirplane.destroy){\n\t\t\tgameData.planes.splice(n,1);\n\t\t\tn = gameData.planes.length;\n\t\t}\n\t}\t\n}", "cleanUp() {\n // clear activeEnemies\n this.activeEnemies.forEach(function(enemy) {\n enemy.cleanUp();\n });\n // clear active players\n this.activeObjects.forEach(function(object) {\n object.cleanUp();\n });\n // stop game loop\n this.animation.forEach(function(frame,index) {\n cancelAnimationFrame(frame);\n });\n }", "clearContainer(container) {\n if (container && container.children)\n while (container.children.length > 0) {\n let obj = container.children[0];\n if (obj && obj.children != null)\n for (let child in obj.children)\n this.clearContainer(obj.children[child]);\n //entfernt Geometry\n if (obj && obj.geometry) obj.geometry.dispose();\n //entfernt Material, egal ob Liste oder nur ein Material\n if (obj && obj.material) {\n if (Array.isArray(obj.material)) {\n for (let i = 0; i < obj.material.length; i++)\n this.disposeAllMaterialProperties(obj.material[i]);\n } else this.disposeAllMaterialProperties(obj.material);\n }\n //entfernt, nachdem alle Materialien und Geometrien entfernt wurden das Objekt aus der Liste\n container.remove(container.children[0]);\n }\n }", "destroy() {\n // unbind (texture) asset references\n for (const asset in this._assetReferences) {\n this._assetReferences[asset]._unbind();\n }\n this._assetReferences = null;\n\n super.destroy();\n }", "clearNavMesh () {\n const navMeshEl = this.sceneEl.querySelector('[nav-mesh]');\n if (navMeshEl) navMeshEl.removeObject3D('mesh');\n }", "_resetSphere() {\r\n var selectedObject = this.scene.getObjectByName('currentPhysicsSphere');\r\n this.scene.remove( selectedObject );\r\n this._createSphere()\r\n this.soundPlayed = false;\r\n }", "_cleanUp() {\n this.removeChildren();\n\n // Remove references to the old shapes to ensure that they're rerendered\n this._q2Box = null;\n this._q3Box = null;\n this._medianLine = null;\n this._outerBorderShape = null;\n this._innerBorderShape = null;\n }", "reset() {\n\t\tvar objects = this._vptGData.vptBundle.objects;\n\t\twhile (objects.length !== 0) {\n\t\t\tvar object = objects.pop();\n\t\t\tobject.switchRenderModes(false);\n\t\t\tvar tex = object.material.maps[0];\n\t\t\tthis._glManager._textureManager.clearTexture(tex);\n\t\t\tif (object._volumeTexture)\n\t\t\t\tthis._gl.deleteTexture(object._volumeTexture);\n\t\t\tif (object._environmentTexture)\n\t\t\t\tthis._gl.deleteTexture(object._environmentTexture);\n\t\t}\n\t\tthis._vptGData.vptBundle.mccStatus = false;\n\t\tthis._vptGData.vptBundle.resetBuffers = true;\n\t\t//this._vptGData._updateUIsidebar();\n\t}", "function destroyTextures () {\n\t for (var i = 0; i < numTexUnits; ++i) {\n\t gl.activeTexture(GL_TEXTURE0 + i);\n\t gl.bindTexture(GL_TEXTURE_2D, null);\n\t textureUnits[i] = null;\n\t }\n\t values(textureSet).forEach(destroy);\n\t\n\t stats.cubeCount = 0;\n\t stats.textureCount = 0;\n\t }", "function cleanScene() {\n gl.clearColor(0.3, 0.3, 0.3, 1.0); // Clear to black, fully opaque\n gl.clearDepth(1.0); // Clear everything\n gl.enable(gl.DEPTH_TEST); // Enable depth testing\n gl.depthFunc(gl.LEQUAL); // Near things obscure far things\n\n // Clear the canvas before we start drawing on it.\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n clearBuffers();\n}", "destroy() {\n // destroy everything related to WebGL and the slider\n this.destroyWebGL();\n this.destroySlider();\n }", "destroyAssets() {\n this.sprite.destroy();\n }", "dispose() {\n\n\t\tthis._dispose();\n\n\t\tif ( this._cubemapMaterial !== null ) this._cubemapMaterial.dispose();\n\t\tif ( this._equirectMaterial !== null ) this._equirectMaterial.dispose();\n\n\t}", "function editorDestroyAllMapObjects() {\n edPlayerStart.destroy();\n edPlayerStart = null;\n edExit.destroy();\n edExit = null;\n edTiles.forEach(o => {\n o.forEach(s => s.destroy());\n });\n edTiles = [];\n edEnemies.forEach(o => { if (o) o.destroy(); });\n edEnemies = [];\n edPickups.forEach(o => { if (o) o.destroy(); });\n edPickups = [];\n edSigns.forEach(o => { if (o) o.destroy(); });\n edSigns = [];\n}", "destroy()\n {\n this.removeAllListeners();\n if (this.parent)\n {\n this.parent.removeChild(this);\n }\n this.transform = null;\n\n this.parent = null;\n\n this._bounds = null;\n this._currentBounds = null;\n this._mask = null;\n\n this.filterArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n }", "dispose() {\n\n\t\t\tthis._blurMaterial.dispose();\n\n\t\t\tif ( this._cubemapShader !== null ) this._cubemapShader.dispose();\n\t\t\tif ( this._equirectShader !== null ) this._equirectShader.dispose();\n\n\t\t\tfor ( let i = 0; i < _lodPlanes.length; i ++ ) {\n\n\t\t\t\t_lodPlanes[ i ].dispose();\n\n\t\t\t}\n\n\t\t}", "clearCanvas( )\r\n {\r\n this.objs = [];\r\n console.log( \"Cleared scene and canvas.\" )\r\n\r\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0$1 + i)\n gl.bindTexture(GL_TEXTURE_2D$1, null)\n textureUnits[i] = null\n }\n values(textureSet).forEach(destroy)\n\n stats.cubeCount = 0\n stats.textureCount = 0\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0$1 + i);\n gl.bindTexture(GL_TEXTURE_2D$1, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function removeMesh() {\n\tfor (let i = scene.children.length - 1; i >= 0; i--) {\n\t\tif (scene.children[i].type === \"Mesh\") scene.remove(scene.children[i]);\n\t}\n}", "clear(){\n for(let i=0;i<this.array.length;i++){\n scene.remove(this.array[i]);\n }\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function clearCanvas() {\nscene.clearGeometry();\n}", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i)\n gl.bindTexture(GL_TEXTURE_2D, null)\n textureUnits[i] = null\n }\n values(textureSet).forEach(destroy)\n\n stats.cubeCount = 0\n stats.textureCount = 0\n }", "remove() {\r\n\t\t\tif (this.body) this.p.world.destroyBody(this.body);\r\n\t\t\tthis.removed = true;\r\n\r\n\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\r\n\t\t\twhile (this.groups.length > 0) {\r\n\t\t\t\tthis.groups[0].remove(this);\r\n\t\t\t}\r\n\t\t}", "repaintListGC() {\n for (const id in G.repaintList) {\n const item = G.repaintList[id];\n // remove items that is not belongs to current scene\n if (item.sceneName !== G.sceneName) {\n // G.repaintList[id].sprite.destroy();\n delete G.repaintList[id];\n }\n }\n G.rootStage.removeChild(this.stage);\n // this.stage.destroy();\n }", "dispose() {\n\n\t\t\tthis._dispose();\n\n\t\t\tif ( this._cubemapMaterial !== null ) this._cubemapMaterial.dispose();\n\t\t\tif ( this._equirectMaterial !== null ) this._equirectMaterial.dispose();\n\n\t\t}", "function remove_reduction_objects_from_canvas() {\n var objects = canvas.getObjects()\n $.each(objects,function(i,v){\n if(v.type=='reduc_rect') {\n canvas.remove(objects[i]);\n }\n });\n \n }", "componentWillUnmount() {\n this.threeRootElement.remove();\n glb.removePoints();\n }", "function gravestone_cleanup() {\n for (var i = 0; i < env.b.children.length; i++) {\n if ((env.b.children[i].tagName == 'DIV') && (env.b.children[i]._type == \"gravestone\")) {\n env.b.removeChild(env.b.children[i]);\n// b.children[i].destroy()\n i--;\n }\n }\n}", "clear() {\n let toRemove = [];\n for (let i = 0; i < this.scene.children.length; i++) {\n let obj = this.scene.children[i];\n if (obj.userData && obj.userData.isBodyElement) {\n toRemove.push(obj);\n }\n }\n for (let i = 0; i < toRemove.length; i++) {\n this.remove(toRemove[i]);\n }\n }", "function deleteObjects() {\r\n\r\n delete character;\r\n delete board;\r\n delete flag;\r\n\r\n leftFloorBlock=0;\r\n leftObastacleBlock=0;\r\n leftCoinBlock=0;\r\n leftPotionBlock=0;\r\n\r\n while(floor.length)\r\n floor.pop();\r\n\r\n while(obstacle.length)\r\n obstacle.pop();\r\n\r\n while(coin.length)\r\n coin.pop();\r\n\r\n while(potion.length)\r\n \tpotion.pop();\r\n}", "destroy() {\n if (this.frameBuffer.stencil) {\n this.gl.deleteRenderbuffer(this.frameBuffer.stencil);\n }\n this.frameBuffer.destroy();\n\n this.frameBuffer = null;\n this.texture = null;\n }", "removeGameObject(object) {\n Validation.validateType(object, GameObject);\n\n const removeSingleNode = object => {\n //engine should be running, so the start method should have been called\n object.end();\n //remove from parents children list\n this.childrenOf(this.parentOf(object)).delete(object);\n //remove from main list\n this.gameObjects.delete(object);\n //remove name hash\n if (object.name !== '') this.namedGameObjects.delete(object.name);\n };\n\n //remove children by post-order traversal\n this.postTraverseSceneGraph(object, removeSingleNode);\n }", "destroyWebGL() {\n // if you want to totally remove the WebGL context uncomment next line\n // and remove what's after\n //this.curtains.dispose();\n\n // if you want to only remove planes and shader pass and keep the context available\n // that way you could re init the WebGL later to display the slider again\n if(this.shaderPass) {\n this.curtains.removeShaderPass(this.shaderPass);\n }\n\n for(var i = 0; i < this.planes.length; i++) {\n this.curtains.removePlane(this.planes[i]);\n }\n }", "destroy() {\n this.domElementProvider.destroyCreatedElements();\n }", "cleanUp()\n {\n // Remove the contact listener\n this.physicsWorld.world.off( 'begin-contact', this.beginContact.bind(this) );\n this.physicsWorld.world.off( 'end-contact', this.endContact.bind(this) );\n this.physicsWorld.world.off( 'remove-fixture', this.removeFixture.bind(this) );\n \n unload();\n }", "function RestartScene() {\n\n\tsimulate = false;\n\n\ttransformControls.detach();\n\n\tfor (var i = objects.length - 1; i >= 0; i--) {\n\t\tscene.remove(objects[i]);\n\n\t\tobjects[i].material.dispose()\n\t\tobjects[i].geometry.dispose();\n\n\t\tobjects[i] = resetObjects[i];\n\n\t\tscene.add(objects[i]);\n\t}\n\n}", "destroy() {\n window.removeEventListener('resize', this.handleWindowResize);\n this.freeAreaCollection.removeAllListeners();\n this.keepoutAreaCollection.removeAllListeners();\n this.canvasElement.removeEventListener('wheel', this.handleZoom);\n this.scope.project.remove();\n }", "removeObject(objectId) {\n const id = new ID(Object.keys(objectId)[0],Object.values(objectId)[0]);\n const obj = this.scene.get(id.toString());\n const deleted = this.scene.delete(id.toString());\n this.log(\"deleted \"+this.scene.size+\" \"+id+\":\"+deleted);\n // notify listeners\n const e = new SceneEvent(this.scene, id.className, id, null, obj);\n this.sceneListeners.forEach((listener) => listener(e));\n }", "__$destroy() {\n if (this.isResFree()) {\n //console.log(\"MeshBase::__$destroy()... this.m_attachCount: \"+this.m_attachCount);\n this.m_ivs = null;\n this.m_bufDataList = null;\n this.m_bufDataStepList = null;\n this.m_bufStatusList = null;\n this.trisNumber = 0;\n this.m_transMatrix = null;\n }\n }", "function clearCube()\r\n{\r\n\r\n\t// Here we remove all the points contained in the cube.\r\n\tfor (var p = particles.length-1 ; p >= 0 ; p--){\r\n \tcube.remove(particleSystem[p]);\r\n\t\tpMaterial.splice(p,1);\r\n\t\tparticles.splice(p,1);\r\n\t\tparticleSystem.splice(p,1);\r\n\t}\r\n\r\n\twhile(flow_records.length!=0) flow_records.pop() ; \r\n\tindex = 0 ; // index reset\r\n\trenderer.render(scene, camera) ;\r\n}", "destroy () {\n\n this.particles.forEach((particle) => {\n\n this.emit('particle.destroy', particle)\n })\n\n this.recycleBin = []\n this.particles = []\n }", "destroy() {\n this.__anchors--;\n if (this.__anchors === 0) {\n this.buffer.forEach(buffer => this._context.gl.deleteBuffer(buffer));\n if (this._vao) {\n this._context.vao.deleteVertexArray(this._vao);\n }\n }\n }", "destroy() {\n textureAsset.destroy(); // Samplers allocated from `samplerLib` are not required and\n // should not be destroyed.\n // this._sampler.destroy();\n }", "destroy() {\n // TODO implement destroy method for ShaderSystem\n this.destroyed = true;\n }", "destroy() {\n this.__anchors--;\n if (this.__anchors === 0) {\n this._context.gl.deleteTexture(this.location);\n }\n }", "function jglDestroy(object) {\n\tif (object!=undefined && !object._destroyed && object.destroy!=undefined) {object.destroy();}\n\tobject = undefined;\n}", "clearGeometry() {\n this.geometries = [];\n this.texGeometries = [];\n this.render();\n }", "function removeLightning(lightningData){\n lightningData.meshes.forEach(function(mesh){\n scene.remove(mesh);\n mesh.geometry.dispose();\n });\n lightningData.materials.forEach((material) => { material.dispose(); });\n}", "function destroy(){\n\t\t// TODO\n\t}", "clean(scene, objs, key){\n for(let i = 0; i < objs.length; i++){\n if(objs[i].key === key){\n objs.splice(i, 1);\n }\n }\n scene.remove(this.playerObj || this);\n }" ]
[ "0.79019415", "0.7551317", "0.75387484", "0.7424245", "0.7419502", "0.74059635", "0.73851925", "0.73709524", "0.7346252", "0.732237", "0.7288052", "0.7280065", "0.7164749", "0.71505857", "0.7117825", "0.7110827", "0.7089376", "0.708164", "0.70516014", "0.7023211", "0.700483", "0.7001444", "0.6969041", "0.6938817", "0.6927045", "0.69144666", "0.6905769", "0.69050854", "0.6894454", "0.68864506", "0.6877817", "0.686141", "0.68538266", "0.68047863", "0.6803551", "0.6799308", "0.6792615", "0.6789278", "0.67409116", "0.67303824", "0.6723603", "0.6693048", "0.6687646", "0.6666522", "0.66658455", "0.6657994", "0.66353905", "0.6617514", "0.66102165", "0.66097534", "0.6553692", "0.6540808", "0.6512366", "0.65076405", "0.6481864", "0.6477068", "0.64703196", "0.64658874", "0.6441915", "0.6441213", "0.6437355", "0.64315784", "0.6409617", "0.6408931", "0.6408931", "0.6408931", "0.6408931", "0.6408931", "0.6408931", "0.6408931", "0.6408765", "0.64075845", "0.64029294", "0.6399848", "0.6399559", "0.6398579", "0.6391445", "0.6381773", "0.6376084", "0.63286763", "0.6328071", "0.63175863", "0.63123757", "0.6311934", "0.6305449", "0.6280031", "0.6277511", "0.62752604", "0.62727225", "0.6272203", "0.62702626", "0.6267949", "0.6265396", "0.625232", "0.62478197", "0.62455225", "0.62228227", "0.6215268", "0.62138325", "0.6210481" ]
0.889605
0
END OF CONVENIENCE FUNCTIONS
function createScene() { scene = new THREE.Scene(); aspect = window.innerWidth / window.innerHeight; fov = 60; nearVal = 1; farVal = 950; scene.fog = new THREE.Fog(0xff5566, 120, 800); camera = new THREE.PerspectiveCamera(fov,aspect,nearVal,farVal); camera.position.x = 0; camera.position.z = 500; camera.position.y = 100; renderer = new THREE.WebGLRenderer({alpha: true,antialias: true}); renderer.setSize(window.innerWidth, window.innerHeight); renderer.shadowMap.enabled = true; container = document.getElementById('bg'); container.appendChild(renderer.domElement); controls = new THREE.DeviceOrientationControls( camera );// <------------ //for the phone (also a variable in) pivPoint = new THREE.Object3D(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "function Constr() {}", "function Cnds() {}", "protected internal function m252() {}", "static private internal function m121() {}", "function CIQ(){}", "cocina(){}", "function Squaring(){\n }", "function comportement (){\n\t }", "private public function m246() {}", "function Copcar(){}", "function princeCharming() { /* ... */ }", "identifyConcavePoints() {\n\n //for each point in the fixture we need to remove it then calculate the area if the area is greater without it then that point was a concave point\n this.concavePoints = [];\n this.maybeConcave = [];\n let originalArea = this.calculateArea(this.pixelVectorsLeft);\n let concavePointLabels = [];\n for (let i = 0; i < this.pixelVectorsLeft.length; i++) {\n let newVecs = [];\n for (let v of this.pixelVectorsLeft) {\n if (v !== this.pixelVectorsLeft[i]) {\n newVecs.push(v);\n }\n }\n //if removing this point creates a line cross then our algorithm for calculating area doesnt work, so we need to assume its a concave point\n this.maybeConcave.push(this.anyLinesCross(newVecs));\n //if removing this point increases the area of the shape then this point is concave\n this.concavePoints.push(originalArea < this.calculateArea(newVecs));\n }\n }", "conjectureP2(x, y) {\n return 0;\n }", "conc(program, state) {\n const array = program.arguments[0].elements;\n return _.every(array, (sub) => {\n return isFinal(sub, state);\n });\n }", "function co(a,b){this.Wd=[];this.uf=a;this.kf=b||null;this.jd=this.Lc=!1;this.Qb=void 0;this.Ne=this.If=this.he=!1;this.Zd=0;this.Ca=null;this.ie=0}", "condense(v, e) { }", "transient protected internal function m189() {}", "function\nXATS2JS_strmcon_vt_cons(a1x1, a1x2)\n{\nlet xtmp35;\n;\n;\n{\nxtmp35 = [1, a1x1, a1x2];\n}\n;\nreturn xtmp35;\n} // function // XATS2JS_strmcon_vt_cons(14)", "function Cn(){}", "function\nXATS2JS_strmcon_cons(a1x1, a1x2)\n{\nlet xtmp24;\n;\n;\n{\nxtmp24 = [1, a1x1, a1x2];\n}\n;\nreturn xtmp24;\n} // function // XATS2JS_strmcon_cons(8)", "function cone() {\n\n}", "transient private protected internal function m182() {}", "export() {\n const wordToConll = (word, indexOverride = null) => {\n const stringifyList = object => {\n let pairs = []\n for (const key in object) {\n pairs.push(`${key}=${object[key]}`)\n }\n pairs.sort()\n let string = pairs.join(\"|\")\n return string ? string : \"_\"\n }\n let data = [].fill(\"_\", 0, 9)\n data[0] = indexOverride || word.index || \"_\"\n data[1] = word.inflection || \"_\"\n data[2] = word.lemma || \"_\"\n data[3] = word.uposTag || \"_\"\n data[4] = word.xposTag || \"_\"\n data[5] = stringifyList(word.features)\n data[6] = word.parent === 0 ? 0 : word.parent || \"_\"\n data[7] = this.settings.relations[word.relation] || \"_\"\n data[8] = word.dependencies || \"_\"\n data[9] = stringifyList(word.misc)\n let line = data.join(\"\\t\")\n //Add an extra line for each following empty node\n word.emptyNodes.forEach( (emptyNode, index) => {\n line = line + \"\\n\" + wordToConll(new Word(emptyNode), `${word.index}.${index+1}`)\n })\n return line\n }\n\n let lines = []\n this.sentences.forEach(sentence => {\n sentence.comments.forEach(comment => lines.push(comment))\n sentence.words.forEach(word => lines.push(wordToConll(word)))\n lines[lines.length-1] += \"\\n\" //sentence separator\n })\n\n return lines.join(\"\\n\")\n }", "compareDNA(pAequor) {\r\n let commonElement = 0;\r\n let commonBase = [];\r\n for(let i = 0; i < dna.length; i++) {\r\n if(this.dna[i] === pAequor.dna[i]){\r\n commonElement += 1;\r\n commonBase.push(this.dna[i]);\r\n }\r\n } \r\n // test:\r\n /* Print the specimen #1 dna and specimen #2 dna + all common base in an array. \r\n console.log(this.dna);\r\n console.log(pAequor.dna);\r\n console.log(commonBase)\r\n */\r\n console.log(`Specimen ${this.specimenNum} and specimen ${pAequor.specimenNum} have ${commonElement/15*100}% DNA in common.`)\r\n }", "transient final private protected internal function m167() {}", "function splitCoconuts(intSailors) {\n // Good luck!\n return true;\n}", "function\nXATS2JS_stream_vt_uncons_cfr(a1x1, a1x2, a1x3)\n{\nlet xtmp39;\nlet xtmp40;\nlet xtmp41;\nlet xtmp42;\nlet xtmp43;\n;\n;\n;\nxtmp40 = XATS2JS_llazy_eval(a1x1);\n{\nxtmp41 = 0;\ndo {\ndo {\nif(0!==xtmp40[0]) break;\nxtmp41 = 1;\n} while(false);\nif(xtmp41 > 0 ) break;\ndo {\nif(1!==xtmp40[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp41 = 2;\n} while(false);\nif(xtmp41 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp41) {\ncase 1:\n{\nxtmp39 = a1x2();\n}\n;\nbreak;\ncase 2:\nxtmp42 = xtmp40[1];\nxtmp43 = xtmp40[2];\n{\nxtmp39 = a1x3(xtmp42, xtmp43);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp39;\n} // function // XATS2JS_stream_vt_uncons_cfr(15)", "_fiterByWordCount() {\n let entitesCopy = [...this.state.entities];\n let filteredArray = [];\n let { pfa, cfa } = this.state;\n if(!pfa && !cfa) {\n filteredArray = entitesCopy;\n } else {\n let secondFilterArray = [];\n entitesCopy.forEach( entrie => {\n let titleLength = entrie.title.split(' ').length;\n if(cfa && titleLength > 5) {\n secondFilterArray.push(entrie);\n } else if(pfa && titleLength <= 5) {\n secondFilterArray.push(entrie);\n }\n });\n filteredArray = this._fiterByPoitsOrComm( cfa, secondFilterArray );\n };\n return filteredArray;\n }", "function Nc(a,b){this.b=[];this.v=b||r;this.a=this.e=w;this.ea=n;this.h=this.d=w;this.c=0;this.f=r;this.k=0}", "static final private internal function m106() {}", "function getConCluster(str){\n for(var n=0; n < word.length; n++){\n if(isCon(str[n])){\n conCluster = conCluster + str[n];\n console.log(conCluster); \n } else {\n break;\n }\n } return conCluster;\n }", "function findCanonicalReferences() {\n\n }", "function mbcs() {}", "function mbcs() {}", "function getRelevantScore(sourceArticle, targetArticle, callback) {\n if (sourceArticle.meta.url === targetArticle.meta.url) {\n callback(null)\n return\n }\n //some weird comparision function here, including ner in subject/object\n let returnObject = {}\n returnObject.meta = {}\n returnObject.meta.sourceUrl = sourceArticle.meta.url\n returnObject.meta.sourceTitle = sourceArticle.meta.title\n returnObject.meta.targetUrl = targetArticle.meta.url\n returnObject.meta.targetTitle = targetArticle.meta.title\n\n returnObject.meta.relatedSentencesCount = 0\n returnObject.meta.relatedTriplesCount = 0\n returnObject.meta.oppositeSentencesCount = 0\n returnObject.meta.oppositeTriplesCount = 0\n\n returnObject.sentences = []\n\n for (let i = 0; i < sourceArticle.data.length; i ++) {\n for (let j = 0; j < targetArticle.data.length; j ++) {\n\n let sentence = {}\n sentence.sourceIndex = i\n sentence.targetIndex = j\n sentence.sourceSentence = sourceArticle.data[i].text\n sentence.targetSentence = targetArticle.data[j].text\n sentence.relatedTriples = []\n sentence.oppositeTriples = []\n\n for (let a = 0; a < sourceArticle.data[i].triplets.length; a ++) {\n for (let b = 0; b < targetArticle.data[j].triplets.length; b ++) {\n let triple_1 = sourceArticle.data[i].triplets[a]\n let triple_2 = targetArticle.data[j].triplets[b]\n let triplesComparision = _getTriplesComparisionObject(triple_1, triple_2)\n if (triplesComparision != null) {\n if (!triplesComparision.isOpposite) {\n sentence.relatedTriples.push(triplesComparision)\n returnObject.meta.relatedTriplesCount ++\n } else {\n sentence.oppositeTriples.push(triplesComparision)\n returnObject.meta.oppositeTriplesCount ++\n }\n }\n }\n }\n\n if (sentence.relatedTriples.length > 0 || sentence.oppositeTriples.length > 0) {\n returnObject.sentences.push(sentence)\n returnObject.meta.relatedSentencesCount += sentence.relatedTriples.length > 0 ? 1 : 0\n returnObject.meta.oppositeSentencesCount += sentence.oppositeTriples.length > 0 ? 1 : 0\n }\n }\n }\n\n callback(returnObject)\n}", "transient private internal function m185() {}", "areCousins(node1, node2) {\n\n }", "areCousins(node1, node2) {\n\n }", "function causeOfEvent(obj){\n\tvar arr = [],obj1 = {};\n\tobj = corrList(obj);\n\tfor(var prop in obj){\n\t\tarr.push(obj[prop]);\n\t}\n\tvar posMax = Math.max(...arr);\n\tvar negMax = Math.min(...arr);\n\tfor(var prop2 in obj){\n\t\tif(obj[prop2] == posMax || obj[prop2] == negMax){\n\t\t\tobj1[prop2] = obj[prop2];\n\t\t}\n\t};\n\tconsole.log(\"The two factors that contribute mostly in squirrel transformation are: \");\n\tfor(var prop3 in obj1){\n\t\tconsole.log(prop3);\n\t}\n\treturn obj1;\n}", "function wc(a,b){this.Ua=[];this.pd=a;this.Hc=b||null}", "function parsing_conv_respone(convrespose){\r\n var entity_chemical_name = \"\";\r\n if(convrespose.entities.length !== 0){\r\n for(var i=0;i<convrespose.entities.length;i++){\r\n entity_chemical_name = convrespose.entities[i].value;\r\n //console.log(convrespose.entities[i].value);\r\n } \r\n } else {\r\n entity_chemical_name = null;\r\n //console.log(\"Entities are empty\");\r\n } \r\n return entity_chemical_name;\r\n}", "function Ha(){}", "function ContenedorImageness2r1rt1c1e1() {\n\t\tthis.initialize();\n\t}", "function c$1(e,o$1){if(o(o$1,0,0,0),e.length>0){for(let r=0;r<e.length;++r)u$1(o$1,o$1,e[r]);g(o$1,o$1,1/e.length);}}", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "compareDNA(obj) { \n //identical variable is the number of duplicates per index of both this.dna and obj.dna arrays\n let identical = 0\n this.dna.forEach( (element, index) => element === obj.dna[index] ? identical++ : identical += 0)\n\n //percentage variable, of course finds the percentage of duplicates both arrays\n let percentage = Math.floor(identical / this.dna.length * 100)\n\n return `specimen #1 and specimen #2 have ${percentage}% DNA in common.`\n }", "transient final private protected public internal function m166() {}", "compareDNA(pAeq2){\n let count = 0;\n dna.forEach((base1, index) => {\n const base2 = pAeq2.dna[index];\n if(base1 == base2){\n count++;\n }\n });\n let percent = (count/(dna.length+pAeq2.dna.length))*100;\n percent = percent.toFixed(2);\n console.log(`specimen #${this.specimenNum} and specimen #${pAeq2.specimenNum} have ${percent}% DNA in common.`)\n }", "function getReqAndProb(index, cov)//Find Code ---------- PR1001\r\n{\r\n \r\n //alert(probNames[index]);\r\n\tgetProb(probNames[index], cov, index);\r\n\tgetReq(probNames[index], index);\r\n\tcurrProblem = probNames[index];\r\n\tcoverage = 0;//cov;\r\n currIndex = index;\r\n}", "function solution(s) {\n\n}", "incapacitate(){\n\t\t//\n\t}", "function processParticipation(result) {\n \n}", "function consonantCounterRecursive2(sentences) {\n // Write your code here\n if(!sentences.length) {\n return 0\n }\n var vocnum='aiueo0123456789'\n for(var i=0;i<vocnum.length;i++) {\n if(vocnum[i]==sentences[0].toLowerCase()) {\n return consonantCounterRecursive2(sentences.slice(1))\n }\n }\n return 1+consonantCounterRecursive2(sentences.slice(1))\n}", "function wR(a,b){this.Fb=[];this.HF=a;this.YE=b||null;this.Pq=this.un=!1;this.ai=void 0;this.Gz=this.AK=this.ez=!1;this.uu=0;this.cb=null;this.az=0}", "function presActivePart(){\n\n class Verb{\n constructor(verbStem){\n this.verbForm = verbStem;\n }\n }\n\n\n var verbArray = [[\"loves\",\"loved\", \"used to love\", \"am\"], [\"praises\",\"praised\", \"was praising\", \"laud\"],[\"carries\",\"carried\", \"was carrying\", \"port\"],[\"greets\",\"greeted\", \"was greeting\", \"salut\"],[\"kills\",\"killed\", \"was killing\", \"nec\"],[\"fights\", \"fought\", \"was fighting\", \"pugn\"], [\"saves\",\"saved\", \"was saving\", \"serv\"], [\"looks at\", \"looked at\", \"was looking at\", \"spect\"], [\"calls\",\"called\", \"was calling\", \"voc\"], [\"annoys\",\"annoyed\", \"was annoying\", \"vex\"], [\"wounds\",\"wounded\", \"was wounding\", \"vulner\"], [\"beats\",\"beat\", \"was beating\", \"verber\"], [\"scolds\",\"scolded\", \"was scolding\", \"vituper\"], [\"hits\",\"hit\", \"was hitting\", \"puls\"], [\"frees\",\"freed\", \"was freeing\", \"liber\"], [\"waits for\",\"waited for\", \"was waiting for\", \"exspect\"], [\"avoids\",\"avoided\", \"was avoiding\", \"vit\"], [\"hides\",\"hid\", \"was hiding\", \"cel\"]];\n\n\n var randomVerbIndex = Math.floor(Math.random() * verbArray.length);\n newVerb = new Verb(verbArray[randomVerbIndex][3]);\n verbPresSing = newVerb.verbForm + pres3rdSing;\n\n verbPerSing = newVerb.verbForm + per3rdSing;\n\n verbImpSing = newVerb.verbForm + imp3rdSing;\n\n\n verbPresSingEng = new Verb(verbArray[randomVerbIndex][0]);\n verbPerSingEng = new Verb(verbArray[randomVerbIndex][1]);\n verbImpSingEng = new Verb(verbArray[randomVerbIndex][2]);\n\n var verbArrayPlural = [[\"love\",\"loved\", \"used to love\", \"am\"],[\"praise\",\"praised\", \"were praising\", \"laud\"], [\"carry\",\"carried\", \"were carrying\", \"port\"],[\"greet\",\"greeted\", \"were greeting\", \"salut\"],[\"kill\",\"killed\", \"were killing\", \"nec\"],[\"are fighting\", \"fought\", \"used to fight\", \"pugn\"], [\"save\",\"saved\", \"kept saving\", \"serv\"], [\"look at\", \"looked at\", \"were looking at\", \"spect\"], [\"are calling\",\"called\", \"were calling\", \"voc\"], [\"annoy\",\"annoyed\", \"were annoying\", \"vex\"], [\"wound\",\"wounded\", \"were wounding\", \"vulner\"], [\"beat\",\"beat\", \"were beating\", \"verber\"], [\"scold\",\"scolded\", \"used to scold\", \"vituper\"], [\"strike\",\"struck\", \"kept striking\", \"puls\"], [\"free\",\"freed\", \"were freeing\", \"liber\"], [\"wait for\",\"waited for\", \"were waiting for\", \"exspect\"], [\"avoid\",\"avoided\", \"were avoiding\", \"vit\"], [\"hide\",\"hid\", \"used to hide\", \"cel\"]];\n\nvar randomVerbPluralIndex = Math.floor(Math.random() * verbArrayPlural.length);\nnewVerbPlural = new Verb(verbArrayPlural[randomVerbIndex][3]);\nverbPresPl = newVerbPlural.verbForm + pres3rdPl;\n\nverbPerPl = newVerbPlural.verbForm + per3rdPl;\n\n\nverbImpPl = newVerbPlural.verbForm + imp3rdPl;\n\n\n class Subject {\n\n constructor(nounStem){\n this.nounForm = nounStem;\n }\n }\n\n var nounArray = [[\"puell\", \"girl\",\"girls\"], [\"regin\", \"queen\", \"queens\"],[\"fili\", \"daughter\", \"daughters\"],[\"domin\", \"mistress\", \"mistresses\"],[\"amic\", \"girl friend\", \"girl friends\"],[\"agricol\", \"farmer\", \"farmers\"],[\"besti\", \"beast\", \"beasts\"], [\"de\", \"goddess\", \"goddesses\"],[\"poet\", \"poet\", \"poets\"], [\"ancill\", \"maid servant\", \"maid servants\"], [\"naut\", \"sailor\", \"sailors\"],[\"femin\", \"woman\", \"women\"]];\n\n var nounArray2 = [[\"servus\", \"serv\",\"slave\",\"slaves\"],[\"libertus\", \"libert\",\"freedman\",\"freedmen\"],[\"inimicus\", \"inimic\",\"enemy\",\"enemies\"], [\"patronus\", \"patron\",\"patron\", \"patrons\"],[\"dominus\", \"domin\",\"master\", \"masters\"],[\"magister\", \"magistr\",\"teacher\", \"teachers\"],[\"nuntius\", \"nunti\",\"messenger\", \"messengers\"], [\"puer\", \"puer\",\"boy\", \"boys\"],[\"vilicus\", \"vilic\",\"overseer\", \"overseers\"],[\"vir\", \"vir\",\"man\", \"men\"][\"venalicius\", \"venalici\",\"slave dealer\", \"slave dealers\"],[\"coquus\", \"coqu\", \"cook\", \"cooks\"],[\"deus\", \"de\", \"god\", \"gods\"],[\"Graecus\", \"Graec\", \"Greek\", \"Greeks\"],[\"aper\", \"apr\", \"boar\", \"boars\"],[\"avarus\", \"avar\", \"miser\", \"misers\"]];\n\n var nounArray3 = [[\"canis\", \"can\",\"dog\",\"dogs\"],[\"pugil\", \"pugil\",\"boxer\",\"boxers\"],[\"fur\", \"fur\",\"thief\",\"thieves\"],[\"gladiator\", \"gladiator\",\"gladiator\",\"gladiators\"], [\"pater\", \"patr\", \"father\", \"fathers\"],[\"feles\", \"fel\", \"cat\", \"cats\"],[\"cliens\", \"client\", \"client\", \"clients\"],[\"hospes\", \"hospit\", \"guest\", \"guests\"],[\"infans\", \"infant\", \"infant\", \"infants\"],[\"senex\", \"sen\", \"old man\", \"old men\"],[\"venator\", \"venator\", \"hunter\", \"hunters\"],[\"hostis\", \"host\", \"enemy\", \"enemies\"],[\"mercator\", \"mercator\", \"merchant\", \"merchant\"],[\"mater\", \"matr\",\"mother\", \"mothers\"],[\"frater\", \"fratr\",\"brother\", \"brothers\"],[\"soror\", \"soror\",\"sister\", \"sisters\"],[\"homo\", \"homin\",\"man\", \"men\"],[\"uxor\", \"uxor\",\"wife\", \"wives\"],[\"iuvenis\", \"iuven\",\"young man\", \"young men\"]];\n\n\n var randomNounIndex = Math.floor(Math.random() * nounArray.length);\n var randomNoun2Index = Math.floor(Math.random() * nounArray2.length);\n var randomNoun3Index = Math.floor(Math.random() * nounArray3.length);\n\n\n\n newNoun = new Subject(nounArray[randomNounIndex][0]);\n subjectSing = newNoun.nounForm + nomPE1;\n subjectPl = newNoun.nounForm + nomPE1Pl;\n\n\n //subjectSing2 = newNoun2.nounForm;\n newNoun2 = new Subject(nounArray2[randomNoun2Index][0]);\n subjectSing2 = newNoun2.nounForm;\n newNoun2NomPl = new Subject(nounArray2[randomNoun2Index][1]);\n subjectPl2 = newNoun2NomPl.nounForm + nomPE2Pl;\n\n\n newNoun3 = new Subject(nounArray3[randomNoun3Index][0]);\n subjectSing3 = newNoun3.nounForm;\n newNoun3NomPl = new Subject(nounArray3[randomNoun3Index][1]);\n subjectPl3 = newNoun3NomPl.nounForm + nomPE3Pl;\n\n\nvar randomObjectIndex = Math.floor(Math.random() * nounArray.length);\n\n newObject = new Subject(nounArray[randomObjectIndex][0]);\n objectSing = newObject.nounForm + accPE1;\n objectPl = newObject.nounForm + accPE1Pl;\n\n\n\n\n\nvar randomObject2Index = Math.floor(Math.random() * nounArray2.length);\n newObject2 = new Subject(nounArray2[randomObject2Index][1]);\n\n objectSing2 = newObject2.nounForm + accPE2;\n objectPl2 = newObject2.nounForm + accPE2Pl;\n\n var randomObject3Index = Math.floor(Math.random() * nounArray3.length);\n newObject3 = new Subject(nounArray3[randomObject3Index][1]);\n objectSing3 = newObject3.nounForm + accPE3;\n objectPl3 = newObject3.nounForm + accPE3Pl;\n\n\n var presActPart = [[\"ambulans\",\"ambulant\", \"walking\"],[\"ridens\",\"rident\", \"smiling\"],[\"dormiens\",\"dormient\", \"sleeping\"],[\"cantans\",\"cantant\", \"singing\"],[\"cogitans\",\"cogitant\", \"thinking\"],[\"currens\",\"current\", \"running\"],[\"saliens\",\"salient\", \"jumping\"],[\"tremens\",\"trement\", \"trembling\"],[\"clamans\",\"clamant\", \"yelling\"],[\"discedens\",\"discedent\", \"departing\"]];\n\n var futActPart = [[\"ambulatur\",\"intending to walk\"],[\"risur\",\"about to laugh\"],[\"dormitur\",\"about to sleep\"],[\"cantatur\",\"about to sing\"],[\"cogitatur\",\"about to think\"],[\"cursur\",\"about to run\"],[\"saltur\",\"about to jump\"],[\"territur\",\"about to frighten\"],[\"clamatur\",\"intending to shout\"],[\"discessur\",\"intending to leave\"],[\"deceptur\",\"about to decieve\"]];\n\n var perPassivePart = [[\"vis\",\"seen\"],[\"capt\", \"captured\"],[\"audit\",\"heard\"],[\"territ\", \"frightened\"],[\"fract\",\"broken\"],[\"servat\",\"saved\"],[\"vulnerat\",\"wounded\"],[\"monit\",\"warned\"],[\"invent\",\"found\"],[\"decept\",\"deceived\"],[\"accusat\",\"accused\"],[\"necat\",\"killed\"],[\"liberat\",\"freed\"],[\"petit\",\"attacked\"],[\"sciss\",\"cut\"],[\"deris\",\"mocked\"]];\n\n\n var randomPAPIndex = Math.floor(Math.random() * presActPart.length);\n\n newPAP = new Subject(presActPart[randomPAPIndex][0]);\n nomPAP = newPAP.nounForm;\n stemPAP = new Subject(presActPart[randomPAPIndex][1]);\n dirObjSingPAP = stemPAP.nounForm + accPE3;\n nomAccPluralPAP = stemPAP.nounForm + nomPE3Pl;\n\n\n\n\ntimeleft = 25;\nresponseButton.innerHTML = \"\";\n\n\n countDownTimer();\n\n countdown = setInterval(countDownTimer,1000);\n\n\n\n\n startButton.disabled = true;\n\n\n\n\n ranISIndex = Math.floor(Math.random() * 5);\n\n\n if (ranISIndex == 0){\n\n sentence = \"The \" + nounArray3[randomNoun3Index][2] + \", while \" + presActPart[randomPAPIndex][2]+ \", \" + verbArray[randomVerbIndex][2] + \" the \" + nounArray3[randomObject3Index][3] + \".\";\n\n correctAnswer = subjectSing3 + \" \" + presActPart[randomPAPIndex][0] + \" \" + objectPl3 + \" \" + verbImpSing;\n\n wrongAnswer1 = subjectSing3 + \" \" + presActPart[randomPAPIndex][1] + accPE3 + \" \" + objectPl3 + \" \" + verbImpSing;\n\n wrongAnswer2 = subjectPl3 + \" \" + presActPart[randomPAPIndex][1] + nomPE3Pl + \" \" + objectPl3 + \" \" + verbPerPl;\n\n wrongAnswer3 = subjectSing3 + \" \" + presActPart[randomPAPIndex][0] + \" \" + objectPl3 + \" \" + verbPresSing;\n\n\n checkAnswers = [[correctAnswer,true],[wrongAnswer1,false],[wrongAnswer2,false],[wrongAnswer3,false]];\n shuffle(checkAnswers);\n\n} else if (ranISIndex == 1){\n\n\n sentence = \"The \" + nounArray[randomNounIndex][1] + \" \" + verbArray[randomVerbIndex][1] + \" the \" + presActPart[randomPAPIndex][2] + \" \" + nounArray2[randomObject2Index][2] + \".\";\n\n correctAnswer = subjectSing + \" \" + presActPart[randomPAPIndex][1] + accPE3 + \" \" + objectSing2 + \" \" + verbPerSing;\n\n wrongAnswer1 = subjectSing + \" \" + presActPart[randomPAPIndex][0] + \" \" + objectSing2 + \" \" + verbPerSing;\n\n wrongAnswer2 = subjectPl + \" \" + presActPart[randomPAPIndex][1] + nomPE3Pl + \" \" + objectSing2 + \" \" + verbImpPl;\n\n wrongAnswer3 = subjectSing + \" \" + presActPart[randomPAPIndex][1] + accPE3Pl + \" \" + objectPl2 + \" \" + verbPresSing;\n\n\n\ncheckAnswers = [[correctAnswer,true],[wrongAnswer1,false],[wrongAnswer2,false],[wrongAnswer3,false]];\nshuffle(checkAnswers);\n\n} else if (ranISIndex == 2) {\n\n sentence = \"The \" + nounArray2[randomNoun2Index][3] + \", who were \" + presActPart[randomPAPIndex][2] + \", \" + verbArrayPlural[randomVerbIndex][1] + \" the \" + nounArray3[randomObject3Index][2] + \".\";\n\n correctAnswer = subjectPl2 + \" \" + presActPart[randomPAPIndex][1] + nomPE3Pl + \" \" + objectSing3 + \" \" + verbPerPl;\n\n wrongAnswer1 = subjectPl2 + \" \" + presActPart[randomPAPIndex][1] + accPE3 + \" \" + objectSing3 + \" \" + verbPerPl;\n\n wrongAnswer2 = subjectPl2 + \" \" + presActPart[randomPAPIndex][1] + nomPE3Pl + \" \" + objectSing3 + \" \" + verbImpPl;\n\n wrongAnswer3 = subjectSing2 + \" \" + presActPart[randomPAPIndex][1] + accPE3 + \" \" + objectSing3 + \" \" + verbPresSing;\n\n\n checkAnswers = [[correctAnswer,true],[wrongAnswer1,false],[wrongAnswer2,false],[wrongAnswer3,false]];\n shuffle(checkAnswers);\n\n} else if (ranISIndex == 3) {\n\n sentence = \"The \" + nounArray[randomNounIndex][2] + \", while \" + presActPart[randomPAPIndex][2] + \", \" + verbArrayPlural[randomVerbIndex][0] + \" the \" + nounArray2[randomObject2Index][3] + \".\";\n\n correctAnswer = subjectPl + \" \" + presActPart[randomPAPIndex][1] + nomPE3Pl + \" \" + objectPl2 + \" \" + verbPresPl;\n\n wrongAnswer1 = subjectPl + \" \" + presActPart[randomPAPIndex][1] + accPE3 + \" \" + objectSing2 + \" \" + verbPresPl;\n\n wrongAnswer2 = subjectPl + \" \" + presActPart[randomPAPIndex][1] + nomPE3Pl + \" \" + objectPl2 + \" \" + verbPerPl;\n\n wrongAnswer3 = subjectSing + \" \" + presActPart[randomPAPIndex][1] + nomPE3Pl + \" \" + objectPl2 + \" \" + verbPerSing;\n\n\n checkAnswers = [[correctAnswer,true],[wrongAnswer1,false],[wrongAnswer2,false],[wrongAnswer3,false]];\n shuffle(checkAnswers);\n\n} else if (ranISIndex == 4) {\n\n sentence = \"The \" + nounArray3[randomNoun3Index][3] + \" \" + verbArrayPlural[randomVerbIndex][0] + \" the \" + nounArray[randomObjectIndex][2] + \" who are \" + presActPart[randomPAPIndex][2] + \".\";\n\n correctAnswer = subjectPl3 + \" \" + objectPl + \" \" + presActPart[randomPAPIndex][1] + accPE3Pl + \" \" + verbPresPl;\n\n wrongAnswer1 = subjectPl3 + \" \" + objectPl + \" \" + presActPart[randomPAPIndex][1] + accPE3Pl + \" \" + verbPerPl;\n\n wrongAnswer2 = subjectPl3 + \" \" + objectPl + \" \" + presActPart[randomPAPIndex][1] + accPE3Pl + \" \" + verbImpPl;\n\n wrongAnswer3 = subjectSing3 + \" \" + objectSing + \" \" + presActPart[randomPAPIndex][1] + accPE3 + \" \" + verbPresSing;\n\n\n\n checkAnswers = [[correctAnswer,true],[wrongAnswer1,false],[wrongAnswer2,false],[wrongAnswer3,false]];\n shuffle(checkAnswers);\n\n}\n\n\n\n\n\n startButton.innerHTML = sentence;\n\n document.getElementById(answers[0]).innerHTML = checkAnswers[0][0];\n\n document.getElementById(answers[1]).innerHTML = checkAnswers[1][0];\n\n document.getElementById(answers[2]).innerHTML = checkAnswers[2][0];\n\n document.getElementById(answers[3]).innerHTML = checkAnswers[3][0];\n\n\n\n responseButton.disabled = false;\n\n\n\n resetAnswerColors();\n\n enableButtons();\n\n decrementCount();\n\n\n\n\n\n\n if (count == 0){\n\n gameOverAudio();\n\n startButton.innerHTML = \"Select a New Game!\";\n\n answerOne.innerHTML = game1Title;\n answerTwo.innerHTML = game2Title;\n answerThree.innerHTML = game3Title;\n answerFour.innerHTML = game4Title;\n\n document.getElementById(\"boxThree\").innerHTML = \"Score\";\n responseButton.innerHTML = \"You earned \" + points + \" points!\";\n points = 0;\n\n stopTimer();\n document.getElementById(\"boxOne\").innerHTML = \"Timer\";\n\n answerOne.onclick = function(){selectGame1()};\n answerTwo.onclick = function(){selectGame2()};\n answerThree.onclick = function(){selectGame3()};\n answerFour.onclick = function(){selectGame4()};\n\n count = 11;\n\n\n }\n\n\n\n\n }", "function cargarpista1 (){\n \n}", "function findCourse(arr){\r\n let preReqObj={}\r\n let courseOb ={}\r\n let list=[]\r\n let temp=\"\"\r\n let iterator=0\r\n\r\n \r\n// for(let i =0 ; i<arr.length; i++){\r\n// preReqObj[arr[i][0]] ? preReqObj[arr[i][0]] +=1 : preReqObj[arr[i][0]] =1\r\n// courseOb[arr[i][1]] ? courseOb[arr[i][1]] +=1 : courseOb[arr[i][1]] =1\r\n// }\r\n\r\n arr.forEach((course)=>{\r\n let preReq=course[0]\r\n let singCourse=course[1]\r\n preReqObj[preReq] ? preReqObj[preReq] += 1 : preReqObj[preReq] = 1\r\n courseOb[singCourse] ? courseOb[singCourse] += 1 : courseOb[singCourse] =1\r\n })\r\n\r\n // console.log(preReqObj)\r\n // console.log(courseOb)\r\n\r\n\r\n //check to see if any of the prereqs are not listed in the course obj. make that prereq\r\n //the number one course \r\n for (var i in preReqObj){\r\n if(!courseOb.hasOwnProperty(i)){\r\n list.push(i)\r\n temp=i\r\n \r\n }\r\n }\r\n\r\n \r\n// while(iterator<(arr[0].length * arr.length)){\r\n// arr.forEach((course)=>{\r\n// let preReq=course[0]\r\n// let singleCourse=course[1]\r\n// if(preReq===temp){\r\n// list.push(singleCourse)\r\n// temp=singleCourse\r\n// }\r\n// })\r\n// iterator++\r\n// }\r\n\r\n\r\n\r\n let length=arr.length\r\n while(length > 0){\r\n for(let i in arr){\r\n if(arr[i][0]===temp){\r\n list.push(arr[i][1])\r\n temp=arr[i][1]\r\n }\r\n }\r\n length--\r\n} \r\n\r\n \r\n let middleIndex= list.length % 2===0 ? Math.floor(list.length/2)-1 : Math.floor(list.length/2)\r\n\r\n\r\n console.log(Object.values(courseOb))\r\n return list[middleIndex] \r\n\r\n}", "function intersection(a, b){\n return(\n // replace this line with your code\n );\n}", "analyze(input){ return null }", "compareDNA(specimen) {\n let matches = 0\n this.dna.forEach((element, currentIndex) => {\n if (element === specimen.dna[currentIndex]) {\n matches++\n console.log(`${this.dna[currentIndex]} matches ${specimen.dna[currentIndex]} at ${currentIndex}`)\n }\n })\n if (matches > 0) {\n console.log (`Specimens have ${Math.floor((matches / this.dna.length) * 100)}% DNA in common.`)\n } else {\n console.log(\"No matches were found.\")\n console.log (\"Specimens don't have DNA in common.\")\n }\n }", "function MatchData() {}", "function c(a,b){for(var c=0;c<a.lines.length;c++){var d=a.lines[c],f=d[0],g=d.substr(1);if(\" \"===f||\"-\"===f){\n// Context sanity check\nif(!j(b+1,e[b],f,g)&&(k++,k>l))return!1;b++}}return!0}", "static final private protected internal function m103() {}", "function challenge2() {\n\n}", "compareDNA(pAequor) {\n\t\t\tlet curr = this.dna;\n\t\t\tlet past = pAequor.dna;\n\t\t\tlet cnt = 0;\n\t\t\tfor(let i = 0; i < curr.length; i++) {\n\t\t\t\tif(curr[i] === past[i]) {\n\t\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet perc = (cnt/(curr.length) * 100).toFixed(2);\n\t\t\tconsole.log(`specimen #1 and specimen #2 have ${perc}% DNA in common`);\n\t\t}", "transient final private internal function m170() {}", "transient final protected internal function m174() {}", "function RelationshipAdvice(){\n \n \n \n\n var arrayEncoder;\n var initialSelections; \n var finalTruthTable;\n var ambiguousRelationships;\n var addedVals;\n var error = {broke:false, ErrorInfo:\"\"};\n var finalStage;\n\n var hijackNextQuestion = null;\n\n var status = \"Not Initialized\";\n \n this.initValues = function(allSelections){\n console.time('Time Test');\n\n truthTables = [];\n initialTruthTable = [];\n finalTruthTable = [];\n ambiguousRelationships = [];\n addedVals;\n error = {broke:false, ErrorInfo:\"\"};\n finalStage = new FinalStage();\n\n arrayEncoder = new ArrayEncoder(allSelections.CreateDetachedCopy());\n initialSelections = arrayEncoder.GetEncodedArray(allSelections).CreateDetachedCopy(); \n \n setTimeout(function() {\n // console.log(finalTruthTable); \n // console.log(ambiguousRelationships);\n }, 100);\n \n StageOneErrorResolver(initialSelections);\n \n \n finalTruthTable = initialSelections.CreateDetachedCopy();\n //console.log(\"finalTruthTable TEST\");\n //console.log(finalTruthTable.CreateDetachedCopy());\n try{ //breaks out of hijack array found\n RefineFinalTruth(); \n \n\n CreateAndRefineAmbiguousRelationships();\n \n var time = console.timeEnd('Time Test');\n }catch(err){\n console.error(err);\n }\n \n }\n\n this.AddValues = function(valuesToAdd){ \n addedVals = arrayEncoder.GetEncodedArray(valuesToAdd);\n\n StageOneErrorResolver(initialSelections, addedVals[0]);\n initialSelections = initialSelections.concat(addedVals);\n \n \n finalTruthTable = finalTruthTable.concat(addedVals.CreateDetachedCopy());\n \n try{\n RefineFinalTruth(); \n \n CreateAndRefineAmbiguousRelationships();\n }catch(err){\n console.error(err);\n }\n }\n\n this.RemoveValues = function(amountToRemove){\n\n //TODO\n }\n\n this.GetNextQuestions = function(amount=1){\n \n return arrayEncoder.Decode(finalStage.DetermineAmbiguityResolutionQuestions(ambiguousRelationships,amount,hijackNextQuestion));\n \n }\n\n this.GetPercentage = function(){\n return finalStage.GetProgressPercentage();\n }\n\n this.GetCompletionStatus = function(){\n return finalStage.GetCompletionStatus();\n }\n\n this.GetTruthTable = function(){\n return arrayEncoder.Decode(finalTruthTable);\n }\n this.GetStatus = function(){\n return status;\n }\n \n\n\n function RefineFinalTruth() { \n //Merge Truth tables\n //delete all truths that have been utilized\n\n var log = false;\n if(log){\n console.logd = console.log;\n }else{\n console.logd = function(a){\n\n }\n }\n \n var alreadyResolved = [], count = 0;\n\n do{\n FinalStageErrorResolver(finalTruthTable,initialSelections);\n\n var DetachedArray = finalTruthTable.CreateDetachedCopy(); \n var tempArray, numsSearched = [], restart = false;\n\n for (var i = 0; i < finalTruthTable.length - 1; i++) {\n for (var v = 0; v < finalTruthTable[i].length; v++) {\n var num = finalTruthTable[i][v];\n tempArray = finalTruthTable.slice(i + 1, finalTruthTable.length).FindNestledMatches(num);\n currentSelectionArray = finalTruthTable[i];\n\n numsSearched.push(num);\n\n for (var c = 0; c < tempArray[0].length; c++) { //Run for each match found\n if (tempArray != false) {\n console.logd(\"num \"+ num);\n console.logd(currentSelectionArray);\n console.logd(tempArray[0][c]);\n if(TestTheseConditions(num, currentSelectionArray, tempArray[0][c], DetachedArray, alreadyResolved)){\n restart = true;\n break;\n }\n \n \n }\n\n }\n if(restart){\n break;\n }\n\n \n }\n if(restart){\n break;\n }\n\n }\n if(count > 100){\n console.log(\"UH OH! IN REFINE INIITIAL TRUTH\");\n break;\n restart = false;\n }\n count++;\n \n finalTruthTable = DetachedArray.sort(function(a,b){\n return b.length-a.length;\n });\n \n\n var redundancyResolver = new ResolveRedundancy;\n redundancyResolver.Refresh(finalTruthTable); //Resolve redundancies\n alreadyResolved = alreadyResolved.concat(redundancyResolver.GetResolvedArrays());\n redundancyResolver.Reset();\n \n alreadyResolved = alreadyResolved.filter((item, index, arr)=>{ // removes duplicates in already resolved array\n var i = 0; \n for(i = 0; i<arr.length; i++){\n \n if(ArraysEqual(item,arr[i])){\n \n break;\n }\n }\n \n return i == index;\n });\n \n \n \n console.logd(\"FinalTruthTable\");\n console.logd(finalTruthTable);\n \n }while(restart);\n \n \n }\n\n function CreateAndRefineAmbiguousRelationships() {\n //Create Ambiguous List\n //Break ambiguous List down into basic form\n //Check if Ambigouity resolves from final truth table\n \n ambiguousRelationships = [];\n CreateAmbiguousRelationships(finalTruthTable,ambiguousRelationships);\n \n var ambiguousList = ambiguousRelationships.CreateDetachedCopy();\n\n for(var x = 0; x<2; x++){ //breaks all ambiguos relationships into most basic form\n \n var tempList = []; \n for(var i = 0; i<ambiguousList.length; i++){\n if(ambiguousList[i][0].length>1){\n for(var c = 0; c<ambiguousList[i][0].length; c++){\n tempList.push([ambiguousList[i][0][c],ambiguousList[i][1]]);\n }\n }else if(ambiguousList[i][1].length>1){\n for(var c = 0; c<ambiguousList[i][1].length; c++){\n tempList.push([ambiguousList[i][1][c],ambiguousList[i][0]]);\n \n }\n }\n }\n \n \n ambiguousList = ambiguousRelationships = tempList;\n \n } \n \n ambiguousRelationships = ambiguousRelationships.filter((item, index, arr) => { //filters self redundancys\n var i;\n if(item[0]==item[1]){\n return false;\n }\n for(i = 0; i<arr.length; i++){\n if((arr[i][0]==item[0]&&arr[i][1]==item[1])||(arr[i][1]==item[0]&&arr[i][0]==item[1])){\n break;\n }\n }\n return (i == index);\n });\n\n ambiguousRelationships = ambiguousRelationships.filter(item=>{\n var returnMe = true;\n for(i = 0; i<finalTruthTable.length; i++){\n if(finalTruthTable[i].includes(item[0])&&finalTruthTable[i].includes(item[1])){\n returnMe = false;\n }\n }\n return returnMe;\n });\n \n function CreateAmbiguousRelationships(truthTable,ambiguousList){//filters truth table redundancys\n for(var i = 0; i<truthTable.length-1; i++){\n for(var v = i+1; v<truthTable.length; v++){\n ambiguousList.push([truthTable[i],truthTable[v]]);\n }\n }\n }\n\n }\n \n function FinalStage() { // is in charge of when to end program\n //Find the answers that are included in refined ambigous relations the most and generate a question list\n //Once ambiuity questions are down to zero signal done\n var initialAmbiguityAmount = 0, firstTime = true, currentAmbiguityAmount;\n\n this.DetermineAmbiguityResolutionQuestions = function(ambigousList,amount=1,hijacked = null){ \n var returnMe = [], tempnum;\n if(hijacked == null){\n status = \"Resolving Based on Edge Optimized Algorithms\";\n var scores = ScoreAmbiguity(ambigousList,finalTruthTable);\n \n if(scores.length==0){\n status = \"Done\";\n console.log(\"Done, but for some reason still trying to get new questions\");\n returnMe = [-1,-1,-1];\n }else{\n\n if(firstTime){ //Allows for progress Percentage to be reached\n initialAmbiguityAmount = ambiguousRelationships.length;\n currentAmbiguityAmount = ambiguousRelationships.length;\n firstTime = false;\n }else{\n currentAmbiguityAmount = ambiguousRelationships.length;\n \n }\n\n var breakMe = false;\n var tempSortArray = [];\n var tempArrayIndex = 0, Largest = 0;\n var i = 0;\n \n while(!breakMe){ //sort all items based on given score\n \n if(scores.length == 0){ //if done\n breakMe = true;\n break;\n }\n \n if(scores[i]>Largest){\n Largest = scores[i];\n tempArrayIndex = i;\n }\n i++;\n if(i==scores.length){\n tempSortArray.push(ambigousList[tempArrayIndex]);\n ambigousList.splice(tempArrayIndex,1);\n scores.splice(tempArrayIndex,1);\n i = 0;\n Largest = 0;\n \n }\n\n \n \n\n }\n ambigousList = tempSortArray;\n breakMe = false;\n for(i = 0; i<ambigousList.length; i++){\n for(v = i+1; v<ambigousList.length; v++){\n \n if(ambigousList[i].includes(ambigousList[v][0])||ambigousList[i].includes(ambigousList[v][1])){\n \n breakMe=true;\n break;\n } \n }\n if(breakMe){\n break;\n }\n }\n \n if(breakMe){\n console.logc(\"ambigousList\");\n console.logc(ambigousList[6]);\n console.logc(\"i, v\");\n console.logc(\"i: \"+i+\" v: \"+v);\n if(ambigousList[i].includes(ambigousList[v][0])){\n \n returnMe = ambigousList[i].concat(ambigousList[v][1]);\n }else{\n \n returnMe = ambigousList[i].concat(ambigousList[v][0]);\n }\n }else{\n if(ambigousList.length>1){\n \n \n returnMe = ambigousList[0].concat(ambiguousList[1][0]);\n \n }else{\n do{\n i = finalTruthTable[0][Math.round(Math.random() * (finalTruthTable[0].length-1))];\n }while(ambigousList[0].includes(i));\n returnMe = ambigousList[0].concat(i);\n }\n }\n //console.log(ambigousList);\n ambiguousRelationships = ambigousList.CreateDetachedCopy();\n console.log(returnMe);\n }\n }else{ //if hijacked\n returnMe = hijacked;\n hijacked = null;\n }\n return returnMe;\n\n function ScoreAmbiguity(ambigousList,truthTable){ //values nearness to edges and repitition among truth tables\n var maxLength = 0,x,tempNum,tempScore = 0,tempLength,scoreArray = [],even = false;;\n truthTable.forEach(ele=>{ //figure out max length\n if(ele.length>maxLength){\n maxLength = ele.length;\n }\n });\n \n ambigousList.forEach(ele=>{\n tempScore = 0\n ele.forEach(num=>{\n for(x = 0; x<truthTable.length; x++){\n tempNum = truthTable[x].indexOf(num);\n tempLength = truthTable[x].length;\n if(tempNum!=-1){\n tempNum++;\n if((tempNum/tempLength)<.5){ //if found in first half of array\n tempScore+=(tempLength/maxLength)*(tempLength/tempNum)*10;\n }else{\n tempScore+=(tempLength/maxLength)*(tempLength/((tempLength+1)-tempNum))*10;\n }\n }\n }\n if(even){\n scoreArray.push(tempScore);\n even = false;\n }else{\n even = true;\n }\n });\n });\n return scoreArray;\n }\n \n }\n\n this.GetProgressPercentage = function(){ //Gets the percentage the program is at\n if(firstTime){\n console.log(\"Please run DetermineAmbiguityResolutionQuestions First\")\n }\n return Math.round(((initialAmbiguityAmount-currentAmbiguityAmount)/initialAmbiguityAmount)*100);\n }\n \n this.GetCompletionStatus = function(){\n if(ambiguousRelationships.length==0&&hijackNextQuestion==null){\n return true;\n }\n return false;\n\n }\n\n }\n //var TheeArray = [[1,2,3],[4,6,7],[3,7,1],[1,5,3],[1,7,4],[1,3,2]];\n \n // StageOneErrorResolver(TheeArray);\n //console.log(TheeArray);\n function StageOneErrorResolver(selection, addedArray = false) { //Resolves Errors in Initial User Selection Table\n\n //only searches the first array added\n \n \n var Counters = 0;\n var log = false; //Logs Events in Function\n if (log) {\n console.logc = console.log;\n } else {\n console.logc = function (nothing) {\n\n }\n }\n var selections = selection.CreateDetachedCopy();\n \n if (!addedArray) { //Search all\n \n } else { //search only first arrays\n \n selections.push(addedArray);\n console.logc(selections);\n\n }\n var selectionTotalLength = selections.length;\n \n var oneRun = false;\n do { //loop to regenerate values if error found\n console.logc(\"Selections\");\n console.logc(selections);\n \n restart = false;\n \n var tempArray;\n \n for (var i = selectionTotalLength - 1; i > 0; i--) {\n if(!addedArray){\n\n }else{\n\n if(oneRun){\n \n break;\n }\n oneRun=true;\n }\n \n \n for (var v = selections[i].length; v >= 0; v--) {\n \n var num = selections[i][v];\n \n \n \n console.logc(selections[i]);\n console.logc(\"i \" + i);\n console.logc(\"v \" + v);\n\n \n tempArray = selections.slice(0, i).FindNestledMatches(num);\n currentSelectionArray = selections[i];\n \n if(tempArray[0].length != 0){\n console.logc(\"Array Being Scanned: \");\n console.logc(tempArray[0]);\n console.logc(\"Slice: \")\n console.logc(selections.slice(0, i));\n console.logc(\"Num \" + num);\n }\n\n for (var c = 0; c < tempArray[0].length; c++) { //Run for each match found\n \n var tempError = TestForInternalConflict(num, currentSelectionArray, tempArray[0][c]);\n\n if (tempError[0]!=false) {\n console.logc(\"Selections: \");\n console.logc(currentSelectionArray);\n console.logc(tempArray[0][c]);\n var replacementValue = FlipArrayValues(tempArray[0][c], num, tempError[1][0]);\n \n console.logc(\"ErrorFound\");\n console.logc(selections[i]);\n console.logc(tempError[1][0] + \" \" + num);\n console.logc(\"replacementValue\");\n console.logc(replacementValue);\n \n selection[tempArray[1][c]] = replacementValue;\n\n console.logc(\"initialSelections Updated\");\n console.logc(initialSelections);\n restart = true;\n oneRun = false;\n initialTruthTable = [];\n ambiguousRelationships = [];\n break;\n }\n \n\n }\n if (restart) {\n selections = selection.CreateDetachedCopy();\n if (!addedArray) { //Search all\n \n } else { //search only first arrays\n \n selections.push(addedArray);\n \n }\n break;\n }\n \n }\n if (restart) { //Get out of all for loops and restart\n break;\n }\n }\n \n if(Counters>300){\n console.log(\"ERROR IN STAGE ONE ERROR RESOLVER OVER FLOW\");\n break;\n }\n Counters++;\n \n } while (restart);\n \n }\n \n \n function FinalStageErrorResolver(selection,resolvingSelection,log = false) { //Resolves Errors in any Selection Table\n\n //only searches the first array added\n var resolvingSelectionReversed = resolvingSelection.reverse();\n var Counter = 0;\n //var log = false; //Logs Events in Function\n if (log) {\n console.logc = console.log;\n } else {\n console.logc = function (nothing) {\n\n }\n }\n var MatchingArray, MatchingArrayMain = [], errorWasFound;\n console.logc(\"selection: \");\n console.logc(selection);\n var unresolvedErrors = [],truthTable = [] ,tempError, tempBool, tempTruthTable = [], unresolvedErrorsMainLoop = [];\n for(var i = 0; i<selection.length-1; i++){ //Iterate through all selection items but the last one\n unresolvedErrors = [];\n \n MatchingArray = FindCommonalities(selection[i],selection.slice(i+1),i+1,i); //returns [second array index in selections,\n //[[second array numbers],[second array indexes],[[first array numbers][first array indexes]]]\n \n errorWasFound = false;\n MatchingArray = MatchingArray.filter((ele)=>{\n tempBool = false;\n ele[1][0].forEach((ele1)=>{\n \n tempError = TestForInternalConflict(ele1,ele[1][0],ele[2][0])\n if(tempError[0]!=false){\n tempBool = errorWasFound = true;\n tempError[1].forEach(eles=>{\n unresolvedErrors.push([eles,ele1]);\n });\n }else{\n\n }\n \n });\n return tempBool;\n }); \n\n unresolvedErrors = unresolvedErrors.filter((item, index, arr) => { //filters self redundancies\n var i;\n if(item[0]==item[1]){\n return false;\n }\n for(i = 0; i<arr.length; i++){\n if((arr[i][0]==item[0]&&arr[i][1]==item[1])||(arr[i][1]==item[0]&&arr[i][0]==item[1])){\n break;\n }\n }\n return (i == index);\n });\n \n \n unresolvedErrors = unresolvedErrors.filter(ele=>{ //removes all Errors that are resolved\n tempBool = true;\n truthTable.forEach(eles=>{ //Check if redundant to truthtable\n if(eles.includes(ele[0])&&eles.includes(ele[1])){\n tempBool = false;\n }\n });\n \n if(tempBool){\n console.logc(resolvingSelectionReversed);\n resolvingSelectionReversed.forEach(ele1=>{ //resolves based on resolving selection array\n \n tempError = [ele1.indexOf(ele[0]), ele1.indexOf(ele[1])]; \n if(tempError[0]!=-1&&tempError[1]!=-1){\n console.logc(\"Resolved in Selection array\");\n tempBool = false;\n if(tempError[0]>tempError[1]){\n truthTable.push([ele[1],ele[0]]);\n }else{\n truthTable.push([ele[0],ele[1]]);\n }\n }\n \n });\n\n if(tempBool){ //if not already found\n \n tempTruthTable = [];\n selection.forEach(ele1=>{ //Resolves based on truth table \n tempError = [ele1.indexOf(ele[0]), ele1.indexOf(ele[1]),ele1.indexOf(ele[0])- ele1.indexOf(ele[1])]; \n \n if(tempError[0]!=-1&&tempError[1]!=-1){\n \n if(tempError[2]<=2&&tempError[2]>0){\n tempTruthTable.push([ele[1],ele[0],tempError[2]]);\n tempBool = false;\n }else if(tempError[2]>=-2&&tempError[2]<0){\n \n tempTruthTable.push([ele[0],ele[1],-tempError[2]]);\n tempBool = false;\n }\n }\n });\n \n \n tempError = [3,-1,true]; //[Distance,index, if last one was equal] \n tempTruthTable.forEach((ele,index)=>{ // Figures out the best match\n if(tempError[0]>ele[2]){ //if distance is less then prevous smallest\n tempError[0] = ele[2];\n tempError[1] = index;\n tempError[2] = false;\n }else if(tempError[0]==ele[2]){ // last value is of equal distance\n \n tempError[2] = true;\n }\n });\n if(!tempError[2]&&tempError[0]!=3){\n truthTable.push([tempTruthTable[tempError[1]][0],tempTruthTable[tempError[1]][1]]);\n }else{ //Tie or no existant\n \n tempBool=true;\n }\n\n }\n }\n console.logc(\"truthTable\");\n console.logc(truthTable.CreateDetachedCopy());\n\n return tempBool;\n });\n \n unresolvedErrorsMainLoop = unresolvedErrorsMainLoop.concat(unresolvedErrors);\n if(MatchingArray.length!=0&&unresolvedErrors.length==0){\n MatchingArrayMain.push(MatchingArray);\n }\n \n }\n \n if(unresolvedErrorsMainLoop.length!=0){ // IF errors left unresolved\n status = \"Resolving Errors\";\n \n tempTruthTable = [];\n \n for(var i = 0; i<unresolvedErrorsMainLoop.length-1; i++){\n unresolvedErrorsMainLoop.slice(i+1).forEach(ele=>{\n if(unresolvedErrorsMainLoop[i].includes(ele[0])){\n tempTruthTable = [unresolvedErrorsMainLoop[i][0],unresolvedErrorsMainLoop[i][1],ele[1]];\n }else if(unresolvedErrorsMainLoop[i].includes(ele[1])){\n tempTruthTable = [unresolvedErrorsMainLoop[i][0],unresolvedErrorsMainLoop[i][1],ele[0]];\n }\n });\n } \n \n if(tempTruthTable.length==0){\n do{\n tempTruthTable = finalTruthTable[0][Math.round(Math.random() * (finalTruthTable[0].length-1))];\n }while(unresolvedErrorsMainLoop[0].includes(tempTruthTable));\n tempTruthTable = unresolvedErrorsMainLoop[0].concat(tempTruthTable);\n }\n \n console.log(\"Hijack Array\");\n console.log(tempTruthTable);\n hijackNextQuestion = tempTruthTable.CreateDetachedCopy();\n throw new Error(\"Hijack Array Needed\");\n }else if(MatchingArrayMain.length!=0){ //if all Still need to make edit based on truth table\n MatchingArrayMain.forEach(ele=>{\n ele.forEach(ele=>{\n // console.log(\"ele[1]\");\n // console.log(ele[1]);\n \n ele[1][0].sort((a,b)=>{\n for(var i = 0; i<truthTable.length; i++){\n \n if(truthTable[i].indexOf(a)-truthTable.indexOf(b)>0){\n \n return 1;\n }else if(truthTable[i].indexOf(a)-truthTable.indexOf(b)<0){\n \n return -1;\n }\n }\n \n });\n console.logc(\"truthTable.CreateDetachedCopy()\");\n console.logc(truthTable.CreateDetachedCopy());\n // console.log(ele[1].CreateDetachedCopy());\n ele[2][0].sort((a,b)=>{\n for(var i = 0; i<truthTable.length; i++){\n \n if(truthTable[i].indexOf(a)-truthTable.indexOf(b)>0){\n \n return -1;\n }else if(truthTable[i].indexOf(a)-truthTable.indexOf(b)<0){\n \n return 1;\n }\n }\n });\n console.logc(\"selection.CreateDetachedCopy()\");\n console.logc(selection.CreateDetachedCopy());\n console.logc(\"ele\");\n console.logc(ele.CreateDetachedCopy());\n ele[1][1].forEach((eles1,index)=>{ //actually changes selection array\n selection[ele[0][0]][eles1] = ele[1][0][index];\n });\n ele[2][1].forEach((eles1,index)=>{ //actually changes selection array\n selection[ele[0][1]][eles1] = ele[2][0][index];\n });\n console.logc(selection.CreateDetachedCopy());\n \n });\n });\n console.logc(\"MatchingArrayMain\");\n console.logc(MatchingArrayMain);\n }\n \n \n \n \n\n \n\n\n }\n \n function FindCommonalities(array,wholeList,Offset,index1){ //returns common numbers between two arrays and their respective indexes\n var returnMe=[], tempArray=[],tempArray2=[],tempNum, eleTempArray=[], tempNumTempArray=[], indexTempArray=[];\n wholeList.forEach((mainEle,mainIndex)=>{\n tempArray=[];\n tempArray2=[];\n eleTempArray=[], tempNumTempArray=[], indexTempArray=[];\n\n array.forEach((ele,index)=>{\n tempNum = mainEle.indexOf(ele);\n if(tempNum!=-1){\n eleTempArray.push(ele);\n tempNumTempArray.push(tempNum);\n indexTempArray.push(index);\n }\n });\n \n \n \n var j,a,n = eleTempArray.length;\n if(n!=0){\n \n \n tempArray = [eleTempArray.CreateDetachedCopy(),tempNumTempArray];\n tempArray2= [eleTempArray,indexTempArray];\n for (var i = 0; i < n; ++i) //order array\n {\n for (j = i + 1; j < n; ++j)\n {\n if (tempArray[1][i] > tempArray[1][j]) \n {\n a = tempArray[1][i];\n tempArray[1][i] = tempArray[1][j];\n tempArray[1][j] = a;\n\n a = tempArray[0][i];\n tempArray[0][i] = tempArray[0][j];\n tempArray[0][j] = a;\n }\n }\n }\n\n returnMe.push([[mainIndex+Offset,index1],tempArray,tempArray2]);\n }\n });\n\n return returnMe;\n }\n\n function ResolveRedundancy(){\n if (false) {\n console.logh = console.log;\n } else {\n console.logh = function (nothing) {\n\n }\n }\n var resolvedArrays = [];\n var i = 0;\n this.Refresh = function(truthTable, truthTable1){\n while(this.ResolveRedundancy(truthTable,truthTable1)){ //Runs until all reduncies resolved\n \n if(i>500){ //if stuck in infinate loop\n console.log(\"BIG ERROR: \" + i);\n broke = true;\n errorName = \"Initial Truth Array Refinement Failed\";\n break; \n \n }\n i++;\n }\n }\n this.ResolveRedundancy = function(truthTableProtected, truthTable1 = false){\n\n var breakOut = false;\n var scanTruthTempArray;\n var truthTempArray, scanTruthTable, matchesInRow, matchingIndexesArray, v, i, Current, element,tempIndex,iOffset, returned;\n \n var truthTable = truthTableProtected.CreateDetachedCopy();\n var endOffset = 1;\n if(truthTable1!=false){\n truthTable= truthTable1.concat(truthTableProtected);\n endOffset = truthTable1.length;\n }\n for(i = truthTable.length-1; i>endOffset-1; i--){\n scanTruthTable = truthTable.slice(0,i);\n \n \n \n matchingIndexesArray = [];\n \n for(v = 0; v < scanTruthTable.length; v++){\n matchesInRow = 0;\n scanTruthTempArray = scanTruthTable[v];\n truthTempArray = truthTable[i];\n\n for(Current = 0; Current < truthTempArray.length; Current++){\n\n element = truthTempArray[Current];\n \n tempIndex = scanTruthTempArray.indexOf(element);\n if(tempIndex!=-1){\n console.logh(\"Update ME \"+ truthTempArray);\n console.logh(\"Keep ME \"+ scanTruthTempArray);\n \n matchesInRow++;\n console.logh(matchesInRow);\n matchingIndexesArray.push(Current);\n }else {\n matchesInRow=0;\n matchingIndexesArray=[];\n }\n\n if(truthTable1!=false){\n iOffset = i-(endOffset);\n }else{\n iOffset = i;\n }\n if(matchesInRow>=truthTempArray.length){\n console.logh(truthTableProtected.CreateDetachedCopy());\n resolvedArrays.push(truthTableProtected.splice(iOffset,1)[0]);\n console.logh(\"Resoltion\");\n console.logh(resolvedArrays.CreateDetachedCopy());\n breakOut=true;\n break;\n } \n\n };\n console.logh(truthTableProtected);\n if(breakOut){ //if Redundancy Detected and Resolved\n \n break;\n }\n }\n if(breakOut){\n break;\n }\n }\n\n return breakOut;\n }\n this.GetResolvedArrays = function(){\n return resolvedArrays.CreateDetachedCopy();\n }\n this.Reset = function(){\n resolvedArrays = [];\n }\n\n }\n \n \n \n function ArraysEqual(array1,array2, all = true){ //returns true if all are true in arrays, if all is a false then if the second one can be contained in the first\n var index, lastIndex,consecutives = 0,i=0, returnme=-1; \n if(all&&array2.length!=array1.length)\n return false;\n\n for(var z = 0; z<array1.length; z++){\n \n index = array2.indexOf(array1[z]);\n \n \n if(index!=-1){\n if(index==lastIndex+1){\n consecutives++;\n }else{\n consecutives = 0;\n }\n \n if(all&&i==0&&index!=0){\n \n returnme = false;\n break;\n }\n if(!all&&consecutives==array2.length-1){\n returnme = true;\n break;\n }\n\n }else if(all){\n \n returnme = false;\n break;\n \n }else{\n \n consecutives = 0;\n }\n lastIndex = index;\n i++;\n }\n if(returnme!=-1){\n return returnme;\n }\n if(all){\n return true;\n }\n return false;\n\n }\n\n function TestForInternalConflict(num, searchArray, matchArray) { //Tests to see if there is any values that are on opposite sides of an ancher in two arrays\n var errorFound = false;\n var searchArrayExterior = ExteriorValues(searchArray, num);\n var matchArrayExterior = ExteriorValues(matchArray, num);\n var erroredElements = [];\n \n if(matchArrayExterior[1]!=-1&&searchArrayExterior[0]!=-1){\n searchArrayExterior[0].forEach(element => {\n if (matchArrayExterior[1].includes(element)) {\n errorFound = true;\n erroredElements.push(element);\n }\n });\n }\n if(matchArrayExterior[0]!=-1&&searchArrayExterior[1]!=-1){\n searchArrayExterior[1].forEach(element => {\n\n if (matchArrayExterior[0].includes(element)) {\n errorFound = true;\n erroredElements.push(element);\n }\n });\n }\n\n return [errorFound, erroredElements];\n\n }\n\n function TestTheseConditions(num, searchArrayProtected, matchArrayProtected,truthTable, previouslyResolved = []) { //Adds Values to ambiguousRelationships and TruthTable from final search\n var searchArray = searchArrayProtected.slice();\n var matchArray = matchArrayProtected.slice();\n var searchArrayExteriors = ExteriorValues(searchArray,num);\n var matchArrayExteriors = ExteriorValues(matchArray,num);\n var tempMatchArray = matchArray.slice();\n var itemCorrected = false;\n var tempArray = [], tempMatchingArray;\n var PinchCondition = CheckForPinchCondition(tempMatchArray, searchArray)[0];\n if(false){ //log or naw\n console.logt = console.log;\n }else{\n console.logt = function(nothing){\n\n }\n }\n if (PinchCondition != false) { //Check for Pinch Conditions\n console.logt(\"Pinch\");\n truthTable.push(PinchCondition);\n\n } \n if(searchArrayExteriors[1]!=-1&&matchArrayExteriors[0]!=-1){\n \n tempArray = matchArrayExteriors[0].slice();\n tempArray.push(num);\n tempMatchingArray = tempArray.concat(searchArrayExteriors[1]);\n \n if(!ArrayContained(previouslyResolved,tempMatchingArray)){\n truthTable.push(tempMatchingArray);\n itemCorrected = true;\n }\n\n }else if(searchArrayExteriors[0]!=-1&&matchArrayExteriors[1]!=-1){\n tempArray = searchArrayExteriors[0].slice();\n tempArray.push(num);\n tempMatchingArray = tempArray.concat(matchArrayExteriors[1])\n \n if(!ArrayContained(previouslyResolved,tempMatchingArray)){\n truthTable.push(tempMatchingArray);\n itemCorrected = true;\n }\n\n }\n \n return itemCorrected;\n }\n\n function ArrayContained(array1,array2,all = true){ //returns true if found complete match in array one\n var returnMe = false; \n \n for(var i = 0; i<array1.length; i++){\n if(ArraysEqual(array1[i],array2,all)){\n returnMe = true;\n break;\n }\n }\n return returnMe;\n } \n\n function FlipArrayValues(array, num1, num2) { //Flips the location of the values num1 and num2 in the array\n var array1 = array.slice();\n var index1 = array1.indexOf(num1);\n \n array1[array1.indexOf(num2)] = num1;\n array1[index1] = num2;\n \n return array1;\n }\n\n function ExteriorValues(array, num) { // returns values on either side of value in array(doesn't include value)\n var returnNum = [[], []];\n var index = array.indexOf(num);\n if (index > 0) {\n returnNum[0] = array.slice(0, index);\n }else{\n returnNum[0] = -1;\n }\n if (index < array.length - 1) {\n returnNum[1] = array.slice(index + 1);\n }else{\n returnNum[1] = -1;\n }\n return returnNum;\n }\n\n function CheckForPinchCondition(array1, array2) {\n var arrayOfMatchingIndexes = [];\n var returnArray = false;\n var returnArrayNumber = false;\n\n array1.forEach(element => {\n var indexOf = array2.indexOf(element);\n\n if (indexOf != -1) {\n arrayOfMatchingIndexes.push(indexOf);\n }\n\n });\n arrayOfMatchingIndexes.sort((a, b) => a - b);\n if (arrayOfMatchingIndexes.length > 1) {\n var prevElement;\n //console.log(\"Array of Mathcing \");\n //console.log(arrayOfMatchingIndexes);\n arrayOfMatchingIndexes.forEach(element => {\n // console.log(element-prevElement);\n if (Math.abs(element - prevElement) == 1) {\n var endElement = array1.indexOf(array2[element]);\n var startElement = array1.indexOf(array2[prevElement]);\n //console.log(\"Array1 \"+(endElement-startElement));\n if (Math.abs(endElement - startElement) == 2) {\n //console.log(\"Slice 1 \"+ array2.slice(0,prevElement+1));\n //console.log(\"Slice 2 \" +array1[startElement+1]);\n returnArray = array2.slice(0, prevElement + 1).concat(array1[startElement + 1], array2.slice(element));\n returnArrayNumber = 1;\n }\n } else if (Math.abs(element - prevElement) == 2) {\n\n var endElement = array1.indexOf(array2[element]);\n var startElement = array1.indexOf(array2[prevElement]);\n // console.log(\"Array1 \"+(endElement-startElement));\n if (Math.abs(endElement - startElement) == 1) {\n // console.log(\"Slice 1 \"+ array1.slice(0,startElement+1));\n // console.log(\"Slice 2 \" +array2[prevElement+1]);\n returnArray = array1.slice(0, startElement + 1).concat(array2[prevElement + 1], array1.slice(endElement));\n\n returnArrayNumber = 0;\n }\n }\n prevElement = element;\n });\n }\n return [returnArray, returnArrayNumber]\n }\n\n function ArrayEncoder(array){ //Encodes Array into numerics amd decodes back into original format\n var valueMapDecoded = [];\n var valueMapEncoded = [];\n var currentMapValue = 0;\n var tempIndex;\n\n ArrayRecursionCreateEncodingMap(array);\n\n this.Decode = function(array1){\n return ArrayRecursionDecode(array1);\n }\n \n this.GetEncodedArray = function(array1 = false){\n \n return ArrayRecursionEncode(array1);\n \n }\n \n function ArrayRecursionCreateEncodingMap(array){ \n var returnMe = [];\n array.forEach(function(el){\n if(typeof el == 'object'){\n returnMe.push(ArrayRecursionCreateEncodingMap(el));\n }else{\n returnMe = array.map(ele=>{\n tempIndex = valueMapDecoded.indexOf(ele);\n if(tempIndex==-1){\n valueMapEncoded.push(currentMapValue);\n valueMapDecoded.push(ele);\n currentMapValue++;\n return currentMapValue-1;\n }else{\n return valueMapEncoded[tempIndex];\n }\n });\n \n }\n });\n \n return returnMe;\n }\n\n \n function ArrayRecursionEncode(array){ \n var returnMe = [];\n array.forEach(function(el){\n if(typeof el == 'object'){\n returnMe.push(ArrayRecursionEncode(el));\n }else{\n returnMe = array.map(ele=>{\n tempIndex = valueMapDecoded.indexOf(ele);\n if(tempIndex==-1){\n return -1;\n }else{\n return valueMapEncoded[tempIndex];\n }\n });\n \n }\n });\n \n return returnMe;\n }\n\n \n function ArrayRecursionDecode(array){ \n var returnMe = [];\n array.forEach(function(el){\n if(typeof el == 'object'){\n returnMe.push(ArrayRecursionDecode(el));\n }else{\n returnMe = array.map(ele=>{\n tempIndex = valueMapEncoded.indexOf(ele);\n if(tempIndex==-1){\n return -1;\n }else{\n return valueMapDecoded[tempIndex];\n }\n });\n \n }\n });\n \n return returnMe;\n }\n \n \n \n }\n\n}", "findSecondaryStructure () {\n let conhPartners = this.conhPartners\n let residueNormals = {}\n\n let nRes = this.getResidueCount()\n let residue0 = this.getResidueProxy()\n let residue1 = this.getResidueProxy()\n\n let atom0 = this.getAtomProxy()\n let atom1 = this.getAtomProxy()\n\n function isCONH (iRes0, iRes1) {\n if ((iRes1 < 0) || (iRes1 >= nRes) || (iRes0 < 0) || (iRes0 >= nRes)) {\n return false\n }\n return _.includes(conhPartners[iRes1], iRes0)\n }\n\n function vecBetweenResidues (iRes0, iRes1) {\n atom0.iAtom = residue0.load(iRes0).iAtom\n atom1.iAtom = residue1.load(iRes1).iAtom\n return v3.diff(atom0.pos, atom1.pos)\n }\n\n // Collect ca atoms\n let vertices = []\n let atomIndices = []\n let resIndices = []\n for (let iRes = 0; iRes < this.getResidueCount(); iRes += 1) {\n residue0.iRes = iRes\n if (residue0.isPolymer && !(residue0.ss === 'D')) {\n let iAtom = residue0.getIAtom('CA')\n if (iAtom !== null) {\n atom0.iAtom = iAtom\n vertices.push([atom0.pos.x, atom0.pos.y, atom0.pos.z])\n atomIndices.push(iAtom)\n resIndices.push(iRes)\n }\n }\n }\n\n for (let iRes0 = 0; iRes0 < nRes; iRes0 += 1) {\n residue0.iRes = iRes0\n\n if (!residue0.isPolymer) {\n continue\n }\n\n if (residue0.ss === 'D') {\n pushToListInDict(\n residueNormals, iRes0, residue0.getNucleotideNormal())\n continue\n }\n\n // alpha-helix\n if (isCONH(iRes0, iRes0 + 4) && isCONH(iRes0 + 1, iRes0 + 5)) {\n let normal0 = vecBetweenResidues(iRes0, iRes0 + 4)\n let normal1 = vecBetweenResidues(iRes0 + 1, iRes0 + 5)\n for (let iRes1 = iRes0 + 1; iRes1 < iRes0 + 5; iRes1 += 1) {\n residue0.load(iRes1).ss = 'H'\n pushToListInDict(residueNormals, iRes1, normal0)\n pushToListInDict(residueNormals, iRes1, normal1)\n }\n }\n\n // 3-10 helix\n if (isCONH(iRes0, iRes0 + 3) && isCONH(iRes0 + 1, iRes0 + 4)) {\n let normal1 = vecBetweenResidues(iRes0, iRes0 + 3)\n let normal2 = vecBetweenResidues(iRes0 + 1, iRes0 + 4)\n for (let iRes1 = iRes0 + 1; iRes1 < iRes0 + 4; iRes1 += 1) {\n residue0.load(iRes1).ss = 'H'\n pushToListInDict(residueNormals, iRes1, normal1)\n pushToListInDict(residueNormals, iRes1, normal2)\n }\n }\n }\n\n let betaResidues = []\n let spaceHash = new SpaceHash(vertices)\n for (let pair of spaceHash.getClosePairs()) {\n let [iVertex0, iVertex1] = pair\n let iRes0 = resIndices[iVertex0]\n let iRes1 = resIndices[iVertex1]\n if ((Math.abs(iRes0 - iRes1) <= 5)) {\n continue\n }\n // parallel beta sheet pairs\n if (isCONH(iRes0, iRes1 + 1) && isCONH(iRes1 - 1, iRes0)) {\n betaResidues = betaResidues.concat([iRes0, iRes1])\n }\n if (isCONH(iRes0 - 1, iRes1) && isCONH(iRes1, iRes0 + 1)) {\n betaResidues = betaResidues.concat([iRes0, iRes1])\n }\n\n // anti-parallel hbonded beta sheet pairs\n if (isCONH(iRes0, iRes1) && isCONH(iRes1, iRes0)) {\n betaResidues = betaResidues.concat([iRes0, iRes1])\n let normal = vecBetweenResidues(iRes0, iRes1)\n pushToListInDict(residueNormals, iRes0, normal)\n pushToListInDict(residueNormals, iRes1, v3.scaled(normal, -1))\n }\n\n // anti-parallel non-hbonded beta sheet pairs\n if (isCONH(iRes0 - 1, iRes1 + 1) && isCONH(iRes1 - 1, iRes0 + 1)) {\n betaResidues = betaResidues.concat([iRes0, iRes1])\n let normal = vecBetweenResidues(iRes0, iRes1)\n pushToListInDict(residueNormals, iRes0, v3.scaled(normal, -1))\n pushToListInDict(residueNormals, iRes1, normal)\n }\n }\n\n for (let iRes of betaResidues) {\n residue0.load(iRes).ss = 'E'\n }\n\n // average residueNormals to make a nice average\n for (let iRes = 0; iRes < nRes; iRes += 1) {\n if ((iRes in residueNormals) && (residueNormals[iRes].length > 0)) {\n let normalSum = v3.create(0, 0, 0)\n for (let normal of residueNormals[iRes]) {\n normalSum = v3.sum(normalSum, normal)\n }\n this.residueNormal[iRes] = v3.normalized(normalSum)\n }\n }\n\n // flip every second beta-strand normal so they are\n // consistently pointing in the same direction\n for (let iRes = 1; iRes < nRes; iRes += 1) {\n residue0.iRes = iRes - 1\n residue1.iRes = iRes\n if ((residue0.ss === 'E') && residue0.normal) {\n if ((residue1.ss === 'E') && residue1.normal) {\n if (residue1.normal.dot(residue0.normal) < 0) {\n this.residueNormal[iRes].negate()\n }\n }\n }\n }\n }", "areCousins(node1, node2) {}", "function Cv(a,b){this.F=[];this.ca=a;this.N=b||null;this.D=this.B=!1;this.A=void 0;this.V=this.R=this.I=!1;this.L=0;this.C=null;this.U=0}", "function testCirculations () {\n\tvar ds = currHds();\n\tfor (let hf of ds.allFaces()) {\n\t\tvar n = undefined;\n\t\tvar i = 0;\n\t\tfor (let h of ds.faceCirculator(hf)) {\n\t\t\tconsole.assert(n == undefined || h.n == n);\n\t\t\tn = h.n;\n\t\t\ti++;\n\t\t}\n\t\tconsole.assert(n == i);\n\t}\n}", "function Continuation() {}", "static transient final private internal function m43() {}", "function hc(){}", "function author245c(record1, record2) {\n\t\tvar fields1 = select(['245..c'], record1);\n\t\tvar fields2 = select(['245..c'], record2);\n\n\t\tvar norm245c = ['toSpace(\"-\")', 'delChars(\"\\':,.\")', 'trimEnd', 'upper', 'utf8norm', 'removediacs', 'removeEmpty'];\n\t\tvar normalized1 = normalize(select(['245..c'], record1), norm245c);\n\t\tvar normalized2 = normalize(select(['245..c'], record2), norm245c);\n\n\t\tvar set1 = normalized1;\n\t\tvar set2 = normalized2;\n\n\t\tfunction getData() {\n\t\t\treturn {\n\t\t\t\tfields: [fields1, fields2],\n\t\t\t\tnormalized: [normalized1, normalized2]\n\t\t\t};\n\t\t}\n\n\t\tfunction check() {\n\n\t\t\tif (set1.length === 0 || set2.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (!hasSubfield(set1, 'c') || !hasSubfield(set2, 'c')) {\n\t\t\t\treturn null;\n\t\t\t} \n\n\t\t\tfunction d(str) {\n\t\t\t\treturn;\n\t\t\t\tconsole.log(str);\n\t\t\t}\n\n\t\t\tif (compareFuncs.isIdentical(set1, set2)) {\n\t\t\t\treturn SURE;\n\t\t\t}\n\n\t\t\t// if one set has strings that are contained is the set of other strings\n\t\t\t// node sim.js author ../data/000926333.xml ../data/002407930.xml\n\t\t\tif (compareFuncs.isIdentical(set1, set2, compareFuncs.stringPartofComparator)) {\n\t\t\t\td(\"isIdentical stringPartofComparator\");\n\t\t\t\treturn SURE;\n\t\t\t}\t\t\t\n\n\t\t\t// Example: node sim.js author ../data/000040468.xml ../data/003099068.xml\n\t\t\tif (compareFuncs.isIdentical(set1, set2, compareFuncs.jaccardComparator(0.66))) {\n\t\t\t\td(\"isIdentical jaccardComparator0.66\");\n\t\t\t\treturn ALMOST_SURE;\n\t\t\t}\n\n\t\t\t// TODO: if sets are identical with lv-distance, we are almost sure\n\t\t\t// example: > node sim.js author ../data/000021724.xml ../data/001073242.xml\n\t\t\tif (compareFuncs.isIdentical(set1, set2, compareFuncs.lvComparator(0.75))) {\n\t\t\t\td(\"isIdentical lvComparator.75\");\n\t\t\t\treturn ALMOST_SURE;\n\t\t\t}\n\t\t\t\n\t\t\treturn SURELY_NOT;\n\t\t}\n\n\t\treturn {\n\t\t\tcheck: check,\n\t\t\tgetData: getData\n\t\t};\n\t}", "compareDNA(pAequor) {\n let similarBases = 0;\n for(let i = 0; i < 15; i++) {\n if(this.dna[i] === pAequor.dna[i]) {\n similarBases++;\n }\n }\n const percentOfSimilarity = (similarBases / 15) * 100;\n console.log(`specimen #${this.specimenNum} and specimen #${pAequor.specimenNum} have ${percentOfSimilarity.toFixed()}% DNA in common.`);\n }", "_convert(equipo, asistencia){\n let equipoResult = []\n let persona = {} //molde\n let asistenciaConvert= this._asistenciaConvert(asistencia); \n let equipoConvert = this._equipoConvert(equipo);\n let dias = ['lunes', 'martes', 'miercoles', 'jueves', 'viernes', 'sabado', 'domingo']\n \n if(equipoConvert==null || equipoConvert.length==0){ //viene vacio\n if(asistenciaConvert==null || asistenciaConvert.length==0){ // viene vacia\n equipoResult = equipoResult; //ambos vienen vacios\n }else{\n equipoResult = asistenciaConvert; // pasamos las asistencias pero sin nombres \n }\n }else if(asistenciaConvert==null || asistenciaConvert.length==0){ // equipo no viene vacio pero si asistencias\n equipoResult = equipoConvert; // asignamos todos los colaboradores con 0 asistencias\n }else{\n let len_ec = equipoConvert.length;\n let len_ac = asistenciaConvert.length;\n\n if(len_ec >= len_ac){\n //juntar ambos comparando codigos\n for(var i =0; i<len_ec; i++){\n let codigoeq = equipoConvert[i].num;\n let encontrado ='no'\n for(var k =0; k<len_ac; k++){\n let codigoac = asistenciaConvert[k].num;\n if(codigoeq==codigoac){\n encontrado=k\n }\n }\n\n if(encontrado!='no'){ //encontro la asistencia del colaborador \n equipoConvert[i].asistencia = asistenciaConvert[encontrado].asistencia //asigno las asistencias \n equipoConvert[i].retardos = asistenciaConvert[encontrado].retardos\n equipoResult.push(equipoConvert[i]);\n }else{\n equipoResult.push(equipoConvert[i]);\n }\n\n }\n }else{\n //juntar ambos comparando codigos\n for(var i =0; i<len_ac; i++){\n let codigoac = asistenciaConvert[i].num;\n let encontrado ='no'\n for(var k =0; k<len_ec; k++){\n let codigoec = equipoConvert[k].num;\n if(codigoac==codigoec){\n encontrado=k\n }\n }\n\n if(encontrado!='no'){ //encontro la asistencia del colaborador \n equipoConvert[encontrado].asistencia = asistenciaConvert[i].asistencia //asigno las asistencias \n equipoConvert[encontrado].retardos = asistenciaConvert[i].retardos\n equipoResult.push(equipoConvert[encontrado]);\n }else{\n equipoResult.push(asistenciaConvert[i]);\n }\n\n }\n }\n\n }\n\n return equipoResult\n }", "function Interfaz(){}", "compareDNA(otherPAequor) {\n let count = 0;\n for (let i = 0; i < this.dna.length; i++) {\n if (this.dna[i] === otherPAequor.dna[i]) {\n count++;\n }\n }\n const commonDNA = ((count / this.dna.length) * 100).toFixed(2);\n\n console.log(\n `Specimen #${this.specimenNum} and specimen #${otherPAequor.specimenNum} have ${commonDNA}% DNA in common.`\n );\n }", "function couleur()\n {\n\treturn 25000 * (0|pos_actuelle()/5 + 1);\n }", "function isCon(str){\n console.log(str, cons.includes(str)) \n return cons.includes(str);\n }", "function oi(){}", "function e(){cov_1myqaytex8.f[0]++;cov_1myqaytex8.s[6]++;if(true){cov_1myqaytex8.b[4][0]++;cov_1myqaytex8.s[7]++;console.info('hey');}else{cov_1myqaytex8.b[4][1]++;const f=(cov_1myqaytex8.s[8]++,99);}}", "UCB(c){\n //console.log(\"Victorias simulacion: \" + this.numVictoriasSimulacion + \"jugadas finales \" + this.numJugadasSimulacion + \"jugadas padre \" + this.padre.numJugadasSimulacion + \" jugadas simuladas \" + this.numJugadasSimulacion)\n return (this.numVictoriasSimulacion / this.numJugadasSimulacion) + c * Math.sqrt(Math.log(this.padre.numJugadasSimulacion) / this.numJugadasSimulacion)\n }", "function classmates (){\n\n\n\n\n}", "function\nXATS2JS_optn_cons(a1x1)\n{\nlet xtmp2;\n;\n{\nxtmp2 = [1, a1x1];\n}\n;\nreturn xtmp2;\n} // function // XATS2JS_optn_cons(84)", "function c(e,c,t,n){var o={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return c?o[t][0]:o[t][1]}", "function challenge3() {\n\n}", "function Carnivorus(){\n\n}", "static final private public function m104() {}", "static private protected internal function m118() {}", "function doExample() { \n\n // Ok, let's test on some sample data\n // Exercise to reader is to handle Wilm's library track format\n // instead of this sample data. \n // Ours is an array of x, y - each representing a unique person's position\n \n var sample_tracks = [ [0.5, 0.7], // Expected to be in \"apple\" region\n [1.0, 1.0], // Also in \"apple\" region\n [2.0, 2.0], // Not in any region\n [1.25, 1.25], // In \"carp\" region\n [0.4, 0.4], // In \"apple\" and \"banana\" region\n [0.1, 0.1] ] // In \"apple\" and \"banana\" region\n \n // But we're actually going to use random #'s to make this more interesting. \n // So, comment the following out if you want to see the results of the above: \n \n sample_tracks = []; \n N = Math.floor(Math.random()*10)+1; // Number of tracks from 1 to 10. \n for (var n=0; n<N; n++) \n sample_tracks.push( [ Math.random()*2, Math.random()*2 ] ); \n \n\n // We assume that the sample data are all received in the same processing \"cycle\"\n // So they all contribute to the occupancy counts. \n\n // In the data handling process, we would do something like the following\n // *each time* a new track list is received to update the counts in REGIONS\n\n clearCount(REGIONS); // We would do this in a real use case, though not needed here\n for (var i in sample_tracks) { \n track=sample_tracks[i];\n occupied = updateCount(track[0], track[1], REGIONS); \n updatePercentOccupancy(REGIONS, sample_tracks.length); \n if (occupied.length>0) \n mylog(sprintf(\"Point %0.2f, %0.2f is in %s.\", track[0], track[1], occupied));\n else\n mylog(sprintf(\"Point %0.2f, %0.2f is not in any regions.\", track[0], track[1]));\n } \n\n mylog (\"------------\")\n \n // After the above, we can now access the occupancy counts / percentages like this:\n //\n // REGIONS[\"banana\"].count or REGIONS[\"apple\"].pct_occupancy\n //\n \n // Here, we'll just print them all out. \n // \n // Note: sprintf() is just a helper function for formatting strings: \n // https://github.com/alexei/sprintf.js\n \n mylog(\"Total number of people: \" + sample_tracks.length); \n \n // Iterate through the regions. Here 'region' holds each key to the \n // associative array REGIONS.\n //\n for (var region in REGIONS) { \n mylog( \"Region \" + region + \" has \" + REGIONS[region].count + \" people, percent of total is \" \n + sprintf(\"%0.2f%%.\", REGIONS[region].pct_occupancy*100) ); \n } \n \n mylog (\"<br />Note: Percentage occupancies here do not sum to 100% <br />because we have overlapping regions, but do represent<br /> per-region occupancy.\");\n\n // Let's now look at what video triggering would look like, but we'll use images to keep things straightforward\n // Our objective here is to see if someone is occupying a region and if so, show an image for that region.\n // We'll set opacity based on percentage occupancy as a bonus!\n \n // Our files are organized like this:\n // images/ \n // region_name/ apple, banana, carp\n // 0.jpg\n // ...\n // N.jpg where N is available_images-1 \n \n target = document.getElementById(\"images\"); \n \n // Loop through each region \n // Note that \"region\" here is the name of the region, because we are \n // using that as the key for the associative array REGIONS.\n //\n for (var region in REGIONS) { \n \n // Only show images for regions having at least one person in them\n if (REGIONS[region].count < 1) continue; \n \n // Pick which image to use \n k = Math.floor( Math.random() * REGIONS[region].available_images); \n \n // Build the filename for the image\n filename = \"images/\" + region + \"/\" + k + \".jpg\";\n \n // Calculate the opacity; we'll vary from 25% to 100% based on occupancy\n opacity = 0.25 + REGIONS[region].pct_occupancy * 0.75;\n \n // Build the HTML with the above\n target.innerHTML += '<img src=\"'+ filename + '\" style=\"opacity:' + opacity + ';\" /><br clear=\"all\" />';\n \n }\n \n}", "_cbIntersetcion(entries) {\n\t\tconst [{ isIntersecting }] = entries;\n\t\tif (isIntersecting) {\n\t\t\tthis.intersecting = true;\n\t\t}\n\t}", "function coba1 () {\n\treturn [1,2];\n}", "function commonSub(x, y){\n\n //1. Create a table x axis is str1.length, y axis is str2.length. Initialize max variable.\n let table = new Array(x.length);\n\n for (var i=0; i<table.length; i++){\n table[i] = new Array(y.length);\n }\n\n let max = 0\n\n\n\n\n}", "static transient private protected internal function m55() {}", "compareDna (pAequor) {\n let identicalResults = 0;\n for (let i = 0; i < 15; i++) {\n if (this.dna[i] === pAequor.dna[i]) {\n identicalResults += 1;\n } \n }\n const percentage = identicalResults / this.dna.length * 100;\n console.log(`Specimen ${this.specimenNum} and specimen ${pAequor.specimenNum} have ${percentage.toFixed \n (2)}% in common.`);\n }", "function copiafyv(principal, copia) {\n try {\n /*Analizo primero el root principal */\n principal.lista_Nodo.forEach(function (element) {\n if (element.tipo == \"Clase\") {\n MYFPrincipal = [];\n MYFfCopia = [];\n /*por cada calse encontrada, la busco en el otro arbol*/\n copia.lista_Nodo.forEach(function (element2) {\n if (element2.tipo == \"Clase\") {\n /*Por cada clase que encuentro en el otro root compruebo si son los mismos*/\n if (element.descripcion == element2.descripcion) {\n /*recorro para encontrar los metodos y funciones de la clase principal*/\n element.lista_Nodo.forEach(function (element3) {\n if (element3.tipo == \"Funcion\") {\n MYFPrincipal.push(element3.descripcion);\n /*encontramos si tiene parametros la funcion*/\n element3.lista_Nodo.forEach(function (parametrosMF) {\n if (parametrosMF.tipo == \"Parametros\") {\n var parametroslst = returnLst(parametrosMF.lista_Nodo);\n element2.lista_Nodo.forEach(function (fmCopia) {\n if (fmCopia.tipo == \"Funcion\" && element3.tipodato == fmCopia.tipodato) {\n fmCopia.lista_Nodo.forEach(function (paramCopia) {\n if (paramCopia.tipo == \"Parametros\") {\n var parametroslstCopia = returnLst(paramCopia.lista_Nodo);\n if (parametroslst.toString() == parametroslstCopia.toString()) {\n console.log(\"las funciones \" + element3.descripcion + \" Son iguales en ambos archivos,por tener los mismos tipos de parametros en el mismo orden\" + \" de la calse \" + element.descripcion);\n MYFfCopia_Clase.push(element.descripcion);\n MYFfCopia.push(element3.descripcion);\n }\n }\n });\n }\n });\n }\n });\n }\n else if (element3.tipo == \"Metodo\") {\n MYFPrincipal.push(element3.descripcion);\n /*encontramos si tiene parametros la funcion*/\n element3.lista_Nodo.forEach(function (parametrosF) {\n if (parametrosF.tipo == \"Parametros\") {\n var parametroslstM = returnLst(parametrosF.lista_Nodo);\n element2.lista_Nodo.forEach(function (mCopia) {\n if (mCopia.tipo == \"Metodo\" && element3.descripcion == mCopia.descripcion) {\n mCopia.lista_Nodo.forEach(function (paramCopiaM) {\n if (paramCopiaM.tipo == \"Parametros\") {\n var parametroslstCopiaM = returnLst(paramCopiaM.lista_Nodo);\n if (parametroslstM.toString() == parametroslstCopiaM.toString()) {\n console.log(\"los metodos \" + element3.descripcion + \" Son iguales en ambos archivos,por tener los mismos tipos de parametros en el mismo orden\" + \" de la calse \" + element.descripcion);\n MYFfCopia.push(element3.descripcion);\n MYFfCopia.push(element3.descripcion);\n }\n }\n });\n }\n });\n }\n });\n }\n });\n if (MYFPrincipal.toString() == MYFfCopia.toString()) {\n console.log(\"las clases \" + element.descripcion + \" Son iguales en ambos archivos\");\n }\n }\n }\n });\n }\n });\n }\n catch (error) {\n }\n}", "function theImplementation(automata){\n\n}" ]
[ "0.5708856", "0.5492735", "0.54596746", "0.5415806", "0.5393721", "0.5372048", "0.5314331", "0.53106004", "0.5295508", "0.52575326", "0.5248906", "0.5234313", "0.5231627", "0.52228284", "0.5210417", "0.518919", "0.5155716", "0.51511574", "0.51445967", "0.5134951", "0.5123593", "0.50814664", "0.50717175", "0.50707716", "0.50680274", "0.50663275", "0.50584555", "0.504592", "0.50457305", "0.50413835", "0.5032984", "0.5030406", "0.5029969", "0.5023605", "0.5023605", "0.50202954", "0.501795", "0.49786267", "0.49786267", "0.49698976", "0.49687806", "0.49627393", "0.4957272", "0.49488643", "0.49442986", "0.4940643", "0.4935326", "0.49344468", "0.49313203", "0.49273562", "0.49242336", "0.49085218", "0.49076858", "0.49071196", "0.49049106", "0.49043342", "0.49037537", "0.49037057", "0.48992407", "0.48915377", "0.4891242", "0.48881844", "0.4878261", "0.48752147", "0.48727703", "0.48664027", "0.48629358", "0.48539892", "0.48506624", "0.48469916", "0.48331377", "0.48296377", "0.48192024", "0.48122063", "0.4810497", "0.4809511", "0.48083282", "0.47979066", "0.4797463", "0.47963998", "0.47934243", "0.47904244", "0.4777717", "0.47727004", "0.47726712", "0.47611693", "0.4760782", "0.4759467", "0.4759147", "0.47537208", "0.47520888", "0.47490078", "0.47468966", "0.47418493", "0.4740168", "0.4738044", "0.47364536", "0.47346655", "0.4725094", "0.47230446", "0.47208688" ]
0.0
-1
var quaternion = new THREE.Quaternion(); quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 ); var vector = new THREE.Vector3( 1, 0, 0 ); vector.applyQuaternion( quaternion );
function createTree(x , y, z){ //holds all of the below as a function //treeTrunk the brown trunk of the tree var g1 = new THREE.CylinderGeometry( 0.6, 0.6, 4.5, 20); ///(top, bottom, size, shapeish) var m1 = new THREE.MeshToonMaterial({color:0x603B14,transparent:false,flatShading:false}); m1.shininess = 7; // var m1 = new THREE.MeshBasicMaterial( {color: 0x603B14} ); var treeTrunk = new THREE.Mesh( g1, m1 ); //treeTrunk.rotation.y = globeBox.getCenter[2]; //treeLower- the green part of the tree creation var g2 = new THREE.CylinderGeometry(0.1, 2.9, 7, 20); // You had the sizes the wrong way around, didn't need to -7 the scale. var m2 = new THREE.MeshToonMaterial({color:0x358C47,transparent:false,flatShading:false}); m2.shininess = 5; var treeLower = new THREE.Mesh( g2, m2 ); // Set position of tree parts. treeLower.position.x=0; treeLower.position.y=6.0; //-920 for big view //6.0 works with ghetto set up treeLower.position.z=0; //250 //0 works with my ghetto set up //add tree meshes scene.add( treeTrunk ); scene.add(treeLower); //scales the trees up to be seen better. treeTrunk.scale.x = 6; treeTrunk.scale.y = 6; treeTrunk.scale.z = 6; // define parent-child relationships treeLower.parent = treeTrunk; treeTrunk.position.x = x; treeTrunk.position.y = y; treeTrunk.position.z = z; treeTrunk.parent = globe; var rotation = new THREE.Quaternion(); rotation.setFromUnitVectors(globe.up, treeTrunk.position.clone().normalize()); treeTrunk.quaternion.copy(rotation); // Enable shadows. treeTrunk.castShadow = true; treeLower.castShadow = true; // Sets the name so the raycast can query against it. treeLower.name = "tree"; treeTrunk.name = "tree"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get quaternion() {\n return new Quaternion({ scalar: 0, vector: this });\n }", "function render() {\n\n var rotation = new THREE.Euler( 0, 0, 0, 'YXZ' );\n \n var qR = computeQuaternion();\n var tmpQuat = new THREE.Quaternion(qR[0],qR[1],+qR[2],qR[3]);\n\n var xRot = rotation.setFromQuaternion( tmpQuat, 'XYZ' ).x;\n var yRot = rotation.setFromQuaternion( tmpQuat, 'XYZ' ).y;\n var zRot = rotation.setFromQuaternion( tmpQuat, 'XYZ' ).z;\n\n $(\".rotation-quat\").html(\"x:\" +xRot+\", y:\" +yRot+\", z:\" +zRot );\n \n // camera.rotation.x = xRot;\n // camera.rotation.y = yRot;\n // camera.rotation.z = zRot;\n\n renderer.render(scene, camera);\n\n requestAnimationFrame(render);\n}", "setObjectQuaternion(quaternion, alpha, beta, gamma, orient) {\n\n var zee = new Vector3(0, 0, 1);\n\n var euler = new Euler();\n\n var q0 = new Quaternion();\n\n var q1 = new Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); // - PI/2 around the x-axis\n\n euler.set(beta, alpha, -gamma, 'YXZ'); // 'ZXY' for the device, but 'YXZ' for us\n\n quaternion.setFromEuler(euler); // orient the device\n\n quaternion.multiply(q1); // camera looks out the back of the device, not the top\n\n quaternion.multiply(q0.setFromAxisAngle(zee, -orient)); // adjust for screen orientation\n\n }", "function Quaternion(x,y,z,w){if(x===void 0){x=0.0;}if(y===void 0){y=0.0;}if(z===void 0){z=0.0;}if(w===void 0){w=1.0;}this.x=x;this.y=y;this.z=z;this.w=w;}", "function quaternion(v0, v1) {\n\n\tif (v0 && v1) {\n\t\t\n\t var w = cross(v0, v1), // vector pendicular to v0 & v1\n\t w_len = Math.sqrt(dot(w, w)); // length of w \n\n if (w_len == 0)\n \treturn;\n\n var theta = .5 * Math.acos(Math.max(-1, Math.min(1, dot(v0, v1)))),\n\n\t qi = w[2] * Math.sin(theta) / w_len; \n\t qj = - w[1] * Math.sin(theta) / w_len; \n\t qk = w[0]* Math.sin(theta) / w_len;\n\t qr = Math.cos(theta);\n\n\t return theta && [qr, qi, qj, qk];\n\t}\n}", "static fromQuaternion(q)\n\t{\n\t\t//TODO: done\n\t\treturn new Vector(q.x, q.y, q.z);\n\t}", "function quat_rotate(out, q, v) {\n let p = vec4.fromValues(\n q[3] * v[0] + q[1] * v[2] - q[2] * v[1], // x\n q[3] * v[1] + q[2] * v[0] - q[0] * v[2], // y\n q[3] * v[2] + q[0] * v[1] - q[1] * v[0], // z\n -q[0] * v[0] - q[1] * v[1] - q[2] * v[2] // w\n );\n return vec3.set(\n out,\n p[0] * q[3] - p[3] * q[0] + p[2] * q[1] - p[1] * q[2], // x\n p[1] * q[3] - p[3] * q[1] + p[0] * q[2] - p[2] * q[0], // y\n p[2] * q[3] - p[3] * q[2] + p[1] * q[0] - p[0] * q[1] // z\n );\n }", "function rotateVecByQuat(v, q) {\n qVec = new vec3(q.x, q.y, q.z);\n qS = q.w;\n // 2*(qVec . v)*qVec + (qS^2 - qVec . qVec)*v + 2*qS*(qVec x v)\n return qVec.uniformScale(2*qVec.dot(v))\n .add(v.uniformScale(qS*qS - qVec.dot(qVec)))\n .add(qVec.cross(v).uniformScale(2*qS));\n}", "static setAxisAngleQV(qv, xyz, angle) {\nvar halfA, sinHA, ux, uy, uz;\n//--------------\n// The quaternion representing the rotation is\n// q = cos(A/2) + sin(A/2)*(x*i + y*j + z*k)\n// ASSERT: xyz.length() == 1;\n[ux, uy, uz] = xyz;\nhalfA = 0.5 * angle;\nsinHA = Math.sin(halfA);\nreturn this.setQV_xyzw(qv, sinHA * ux, sinHA * uy, sinHA * uz, Math.cos(halfA));\n}", "function v(x,y,z){\n return new THREE.Vector3(x,y,z); \n }", "function rotateZ() {\n console.log('rotate about z triggered');\n var cosA = Math.cos(0.05);\n var sinA = Math.sin(0.05);\n var m = new THREE.Matrix4();\n m.set( cosA, sinA, 0, 0,\n -sinA, cosA, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n // render\n render();\n}", "invert ()\n\t{\n\t\tvar fMagnitude = this._w * this._w + this._x * this._x + this._y * this._y + this._z * this._z;\n\t\tvar fInv_Magnitude = 1.0 / fMagnitude;\n\n\t\treturn new Quaternion (this._w * fInv_Magnitude,-this._x * fInv_Magnitude,-this._y * fInv_Magnitude,-this._z * fInv_Magnitude);\n\t}", "function quaternion_from_axisangle(origAxis, angle){\n\taxis = vector_normalize(origAxis);\n\tvar myQuat = [Math.cos(angle/2), axis[0]*Math.sin(angle/2), axis[1]*Math.sin(angle/2), axis[2]*Math.sin(angle/2)];\n\treturn myQuat\n}", "function Quaternion(\n /** defines the first component (0 by default) */\n x, \n /** defines the second component (0 by default) */\n y, \n /** defines the third component (0 by default) */\n z, \n /** defines the fourth component (1.0 by default) */\n w) {\n if (x === void 0) { x = 0.0; }\n if (y === void 0) { y = 0.0; }\n if (z === void 0) { z = 0.0; }\n if (w === void 0) { w = 1.0; }\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n }", "static fromRot(axis, angle) {\nvar q;\n//-------\nq = new RQ();\nq.setFromAxisAngle(axis, angle);\nreturn q;\n}", "rotate({ angle, direction }) {\n\n // Throw an error if the angle is not an Angle\n validate({ angle }, 'Angle');\n\n // Throw an error if the direction is not a Direction\n validate({ direction }, 'Direction');\n\n // Create a Quaternion from the angle and direction\n const rotationQuaterion = Quaternion.fromAngleAndDirection({ angle, direction });\n\n // Rotate the vector\n const { vector } = this.quaternion.rotate(rotationQuaterion);\n\n // Return the rotated vector\n return new Vector(vector);\n }", "set quaternionValue(value) {}", "static rotateAroundQuaternion( obj, q, p ) {\n\n\t\tlet pos = p || obj.position.clone();\n\t\tobj.position.sub( pos );\n\n\t\t// do we want to premultiply here instead?\n\t\tobj.setRotationFromQuaternion( q );\n\t\t//obj.quaternion.multiply(q);\n\t\tobj.position.add( pos );\n\n\t}", "function v(x,y,z){ \n\t return new THREE.Vertex(new THREE.Vector3(x,y,z)); \n\t }", "function rotateLocal(obj3D,axis,degree){\n\n var rotateMatrix = new THREE.Matrix4();\n\n rotateMatrix.makeRotationAxis(axis.normalize(),degree*Math.PI/180);\n\n obj3D.matrix.multiply(rotateMatrix);\n\n obj3D.rotation.setFromRotationMatrix(obj3D.matrix);\n\n\n}", "function quat_rotation_to(out, q, dir, fwd=[0,0,-1]) {\n\tlet v = vec3.create()\n\tlet axis = vec3.create()\n\t// viewer's look direction in world space\n\tvec3.transformQuat(v, fwd, q); \n\t// axis of rotation (not normalized)\n\tvec3.cross(axis, v, dir);\n\tlet la = vec3.length(axis);\n\tlet ld = vec3.length(dir); \n\t// skips rotation if a) we are too close, \n\t// or b) we are pointing in opposite directions\n\tif (ld > 0.000001 && la > 0.000001) {\n\t\tlet sin_a = la / ld;\n\t\tlet cos_a = vec3.dot(v, dir) / ld;\n\t\tlet a = Math.atan2(sin_a, cos_a)\n\t\t// n becomes axis, but must first be normalized:\n\t\tvec3.scale(axis, axis, 1/la)\n\t\tquat.setAxisAngle(out, axis, a);\n\t} else {\n\t\tquat.identity(out);\n\t}\n\treturn out\n}", "function quaternion_from_axisangle(axis, angle){\n return [Math.cos(angle/2), axis[0]*Math.sin(angle/2), axis[1]*Math.sin(angle/2), axis[2]*Math.sin(angle/2)];\n}", "function v(x,y,z){\n\t\t\treturn new THREE.Vector3(x,y,z);\n\t}", "function arcballVector(vector) {\n P = new THREE.Vector3;\n\n P.set( vector.x,vector.y, 0 ); \n\n OP_length = P.length();\n\n if (OP_length <= 1 ){\n P.z = Math.sqrt(1 - OP_length * OP_length);\n } else {\n P = P.normalize();\n }\n\n return P;\n}", "static get identity() {\n return new Quaternion(0, 0, 0, 1);\n }", "toRotMat3x3(m) {\nreturn RQ.setRotMat3x3FromQV(m, this.xyzw, true, true);\n}", "stringifyQuaternion(quat) {\n return '{\"x\":'+quat.x+',\"y\":'+quat.y+',\"z\":'+quat.z+',\"w\":'+quat.w+'}';\n }", "function Update()\n{\n//transform.rotation = Quaternion.Euler(lockPos, lockPos, transform.rotation.eulerAngles.z);\ntransform.localRotation.z = 0;\n}", "function v(x,y,z){\n return new THREE.Vector3(x,y,z);\n }", "get quaternionValue() {}", "function Quaternion() {\n var _this;\n\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var w = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n\n _classCallCheck(this, Quaternion);\n\n _this = _possibleConstructorReturn(this, (Quaternion.__proto__ || Object.getPrototypeOf(Quaternion)).call(this));\n\n if (Array.isArray(x) && arguments.length === 1) {\n _this.copy(x);\n } else {\n _this.set(x, y, z, w);\n }\n\n return _this;\n } // Creates a quaternion from the given 3x3 rotation matrix.", "function quatToRot(q) {\n let norm = math.norm(q, 'fro');\n q = math.multiply(q, 1/norm);\n q = math.flatten(q.toArray());\n\n let data = [[0,0,0],[0,0,0],[0,0,0]];\n data[0][1] = -q[3];\n data[0][2] = q[2];\n data[1][2] = -q[1];\n data[1][0] = q[3];\n data[2][0] = -q[2];\n data[2][1] = q[1];\n\n let qahat = math.matrix(data);\n let tmp1 = math.multiply(qahat, qahat);\n let tmp2 = math.multiply(q[0], qahat);\n qahat = math.add(tmp1, tmp2);\n qahat = math.multiply(2, qahat);\n let R = math.add(math.eye(3), qahat);\n\n return R;\n}", "function Quaternion() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var w = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n\n _classCallCheck(this, Quaternion);\n\n var _this = _possibleConstructorReturn(this, (Quaternion.__proto__ || Object.getPrototypeOf(Quaternion)).call(this));\n\n if (Array.isArray(x) && arguments.length === 1) {\n _this.copy(x);\n } else {\n _this.set(x, y, z, w);\n }\n return _this;\n }", "function Quaternion() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var w = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n\n _classCallCheck(this, Quaternion);\n\n var _this = _possibleConstructorReturn(this, (Quaternion.__proto__ || Object.getPrototypeOf(Quaternion)).call(this));\n\n if (Array.isArray(x) && arguments.length === 1) {\n _this.copy(x);\n } else {\n _this.set(x, y, z, w);\n }\n return _this;\n }", "function get_axis(r1, r2, r3) {\n rnorm = Math.sqrt(r1 * r1 + r2 * r2 + r3 * r3)\n k1 = r1 / rnorm\n k2 = r2 / rnorm\n k3 = r3 / rnorm\n return new THREE.Vector3(k1, k2, k3)\n}", "function\nnormalize_quat(q)\n{\n var v = [];\n var i, mag;\n \n mag = Math.sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);\n for (i = 0; i < 4; i++) q[i] /= mag;\n v[0] = q[0];\n v[1] = q[1];\n v[2] = q[2];\n v[3] = q[3];\n return v;\n}", "function start() {\n document.body.appendChild( renderer.domElement );\n\n\n mesh.rotation.set(-Math.PI/2, 0, 0);\n}", "function v(x,y,z){\n return new THREE.Vertex(new THREE.Vector3(x,y,z));\n }", "rotate(model, axis, degree) {\r\n let axes = [\r\n new Float32Array([1, 0, 0]),\r\n new Float32Array([0, 1, 0]),\r\n new Float32Array([0, 0, 1])\r\n ];\r\n axis = Number(axis);\r\n const d = xeogl.math.transformPoint3(xeogl.math.transposeMat4(model.worldMatrix), axes[axis]);\r\n\r\n model.rotate(d, degree);\r\n\r\n let euler\r\n\r\n\r\n console.log(model.rotation, xeogl.math.quaternionToEuler(model.quaternion, \"XYZ\"));\r\n }", "function quat_unrotate(out, q, v) {\n // return quat_mul(quat_mul(quat_conj(q), vec4(v, 0)), q)[0]yz;\n // reduced:\n let p = vec4.fromValues(\n q[3] * v[0] - q[1] * v[2] + q[2] * v[1], // x\n q[3] * v[1] - q[2] * v[0] + q[0] * v[2], // y\n q[3] * v[2] - q[0] * v[1] + q[1] * v[0], // z\n q[0] * v[0] + q[1] * v[1] + q[2] * v[2] // w\n );\n return vec3.set(\n out,\n p[3] * q[0] + p[0] * q[3] + p[1] * q[2] - p[2] * q[1], // x\n p[3] * q[1] + p[1] * q[3] + p[2] * q[0] - p[0] * q[2], // y\n p[3] * q[2] + p[2] * q[3] + p[0] * q[1] - p[1] * q[0] // z\n );\n }", "function setOrientation(orientation){\n if(orientation)\n camera.rotation.z=Math.PI/2; ///=+\n else\n camera.rotation.z=0;\n}", "function rotateX() {\n console.log('rotate about x triggered');\n var cosA = Math.cos(0.05);\n var sinA = Math.sin(0.05);\n var m = new THREE.Matrix4();\n m.set( 1, 0, 0, 0,\n 0, cosA, sinA, 0,\n 0, -sinA, cosA, 0,\n 0, 0, 0, 1 );\n geometry.applyMatrix(m);\n // render\n render();\n}", "function log(quat, translation) {\n // XYZ is imaginary vector part and W is real scalar part\n var quatVector = new THREE.Vector3(quat.x, quat.y, quat.z);\n var quatVectorMag = quatVector.length();\n\n var theta, A, B, C, D, axisAngle;\n if (quatVectorMag < 0.0001)\n {\n theta = 0;\n A = 1.0;\n B = 0.5;\n C = -0.5;\n // https://www.ethaneade.com/lie.pdf equation 85 has third term of (1-A/2B)/(theta*theta)\n // That is approximated by the Taylor series from\n // https://www.wolframalpha.com/input?i=series+%281+-+%28sin%28theta%29%2Ftheta%29%2F%282*%281-cos%28theta%29%29%2F%28theta*theta%29%29+%29+%2F+%28theta+*+theta%29\n D = 1/12.0;\n axisAngle = new THREE.Vector3(0,0,0);\n }\n else\n {\n theta = 2 * Math.atan2(quatVectorMag, quat.w);\n A = Math.sin(theta)/theta;\n B = (1-Math.cos(theta)) / (theta*theta);\n C = -0.5;\n D = (1-A/(2*B)) / (theta*theta);\n var quatVectorNormalized = quatVector.divideScalar(quatVectorMag);\n axisAngle = quatVectorNormalized.multiplyScalar(theta);\n }\n\n // hat operator (converts axis-angle vector to matrix form)\n var omegaHat = new THREE.Matrix3();\n omegaHat.set(0.0, -axisAngle.z, axisAngle.y,\n axisAngle.z, 0.0, -axisAngle.x,\n -axisAngle.y, axisAngle.x, 0.0);\n\n var logR = omegaHat.clone();\n \n // Vinv is I + omegaHat*C + omegaHat*omegaHat*D\n // from https://www.ethaneade.com/lie.pdf equation 85\n var Vinv_term0 = MatrixIdentity.clone();\n var Vinv_term1 = omegaHat.clone().multiplyScalar(C);\n var Vinv_term2 = (new THREE.Matrix3()).multiplyMatrices(omegaHat, omegaHat).multiplyScalar(D);\n var Vinv = addMatrix3(Vinv_term0, Vinv_term1, Vinv_term2);\n\n var u = translation.clone().applyMatrix3(Vinv);\n\n var logMatrix = new THREE.Matrix4();\n logMatrix.set(logR.elements[0], logR.elements[3], logR.elements[6], u.x,\n logR.elements[1], logR.elements[4], logR.elements[7], u.y,\n logR.elements[2], logR.elements[5], logR.elements[8], u.z,\n 0.0, 0.0, 0.0, 0.0);\n\n return logMatrix;\n}", "static rotation(quat)\n\t{\n\t\t//TODO: this\n\t}", "function v(x, y, z) {\n return new THREE.Vector3(x, y, z);\n }", "function vertex(point) {\n var lambda = (point[0] * Math.PI) / 180,\n phi = (point[1] * Math.PI) / 180,\n cosPhi = Math.cos(phi);\n return new THREE.Vector3(\n radius * cosPhi * Math.cos(lambda),\n radius * cosPhi * Math.sin(lambda),\n radius * Math.sin(phi)\n );\n }", "function rotateBot(object, axis, degree) { \n\tvar angle = degree * Math.PI / 180;\n\t var quaternion = new THREE.Quaternion();\n\t quaternion.setFromAxisAngle(axis, angle);\n\t object.quaternion.multiply(quaternion);\n}", "function Quad() { return [-1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0] }", "function Quad() { return [-1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0] }", "pmulQuat(q) {\n const qx = q[0], qy = q[1], qz = q[2], qw = q[3];\n let bx = this[0], by = this[1], bz = this[2], bw = this[3];\n this[0] = qx * bw + qw * bx + qy * bz - qz * by;\n this[1] = qy * bw + qw * by + qz * bx - qx * bz;\n this[2] = qz * bw + qw * bz + qx * by - qy * bx;\n this[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = this[4];\n by = this[5];\n bz = this[6];\n bw = this[7];\n this[4] = qx * bw + qw * bx + qy * bz - qz * by;\n this[5] = qy * bw + qw * by + qz * bx - qx * bz;\n this[6] = qz * bw + qw * bz + qx * by - qy * bx;\n this[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return this;\n }", "rotationMat4v(anglerad, axis, m) {\n const ax = math.normalizeVec4([axis[0], axis[1], axis[2], 0.0], []);\n const s = Math.sin(anglerad);\n const c = Math.cos(anglerad);\n const q = 1.0 - c;\n\n const x = ax[0];\n const y = ax[1];\n const z = ax[2];\n\n let xy;\n let yz;\n let zx;\n let xs;\n let ys;\n let zs;\n\n //xx = x * x; used once\n //yy = y * y; used once\n //zz = z * z; used once\n xy = x * y;\n yz = y * z;\n zx = z * x;\n xs = x * s;\n ys = y * s;\n zs = z * s;\n\n m = m || math.mat4();\n\n m[0] = (q * x * x) + c;\n m[1] = (q * xy) + zs;\n m[2] = (q * zx) - ys;\n m[3] = 0.0;\n\n m[4] = (q * xy) - zs;\n m[5] = (q * y * y) + c;\n m[6] = (q * yz) + xs;\n m[7] = 0.0;\n\n m[8] = (q * zx) + ys;\n m[9] = (q * yz) - xs;\n m[10] = (q * z * z) + c;\n m[11] = 0.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = 0.0;\n m[15] = 1.0;\n\n return m;\n }", "function Vector3() {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n}", "function toThreeVec(v) {\n return new THREE.Vector3(v.x, v.y, v.z);\n}", "add(RHO)\n\t{\n\t\treturn new Quaternion(this._w + RHO._w, this._x + RHO._x, this._y + RHO._y, this._z + RHO._z);\n\t}", "static fromAxisAngle(axis, angle) {\n if (axis.lengthSq() === 0) {\n return Quaternion.identity;\n }\n\n let result = Quaternion.identity;\n\n angle *= 0.5;\n axis.normalize();\n result.xyz = axis.clone().multiplyScalar( Math.sin(angle) );\n result.w = Math.cos(angle);\n\n return result.normalize();\n }", "static rotation(q)\n\t{\n\t\t// TODO construct a 4x4 rotation matrix for a rotation by the\n\t\t// qernion q\n\n\t\tvar xGlobal = new Vector(1,0,0);\n\t\tvar yGlobal = new Vector(0,1,0);\n\t\tvar zGlobal = new Vector(0,0,1);\n\n\t\txGlobal.rotate(q);\n\t\tyGlobal.rotate(q);\n\t\tzGlobal.rotate(q);\n\n\t\treturn new Float32Array([\n\t\t\txGlobal.x, xGlobal.y, xGlobal.z, 0,\n\t\t\tyGlobal.x, yGlobal.y, yGlobal.z, 0,\n\t\t\tzGlobal.x, zGlobal.y, zGlobal.z, 0,\n\t\t\t0, 0, 0, 1]);\n\t\t\n\t}", "mulQuat(q) {\n const qx = q[0], qy = q[1], qz = q[2], qw = q[3];\n let ax = this[0], ay = this[1], az = this[2], aw = this[3];\n this[0] = ax * qw + aw * qx + ay * qz - az * qy;\n this[1] = ay * qw + aw * qy + az * qx - ax * qz;\n this[2] = az * qw + aw * qz + ax * qy - ay * qx;\n this[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = this[4];\n ay = this[5];\n az = this[6];\n aw = this[7];\n this[4] = ax * qw + aw * qx + ay * qz - az * qy;\n this[5] = ay * qw + aw * qy + az * qx - ax * qz;\n this[6] = az * qw + aw * qz + ax * qy - ay * qx;\n this[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return this;\n }", "function v(x, y, z) {\n return new THREE.Vector3(x, y, z);\n }", "static createRotation(axis, angle) {\n//--------------\nreturn RQ.setAxisAngleQV(RQ.makeQV(0, 0, 0, 0), axis, angle);\n}", "function Update (){\n\ttransform.Rotate(Vector3(0,rotationSpeed * 10,0) * Time.deltaTime);\n}", "toRotMat4x4(m) {\nreturn RQ.setRotMat4x4FromQV(m, this.xyzw, true, false, false);\n}", "static euler(x, y, z) {\n\t\t return Quaternion.fromEulerRad( new Vector3(x, y, z).multiplyScalar(degToRad) );\n\t }", "rotate() {\n\t\tthis.scene.rotate(-Math.PI / 2, 1, 0, 0);\n\t}", "function quatAxisAngle(axis, angle) {\n var halfAngle = angle / 2.0;\n var sinHalfAngle = sin(halfAngle);\n return [cos(halfAngle),\n \t\t-axis[0] * sinHalfAngle,\n \t\t-axis[1] * sinHalfAngle,\n \t\t-axis[2] * sinHalfAngle];\n }", "setFromRotMat3x3(m) {\nvar DIV_4W, EPS, SQRT_T, T, dorotx, doroty, dorotz, tx, ty, tz;\n//---------------\n// The given matrix is :\n// m[0] m[3] m[6] m00 m01 m02\n// m[1] m[4] m[7] == m10 m11 m12\n// m[2] m[5] m[8] m20 m21 m22\nEPS = 1e-4;\n[tx, ty, tz] = [m[0], m[4], m[8]];\nT = tx + ty + tz + 1;\nif (1 <= T + EPS) {\n// Normal case: 1 <= T\nSQRT_T = Math.sqrt(T);\nDIV_4W = 0.5 / SQRT_T;\nthis.set_xyzw((m[5] - m[7]) * DIV_4W, (m[6] - m[2]) * DIV_4W, (m[1] - m[3]) * DIV_4W, 0.5 * SQRT_T); // m21 - m12 // m02 - m20 // m10 - m01\n} else {\n// To avoid instability, we need to adjust both the matrix\n// m and the quaternion (this) by introducing a prior\n// rotation by PI about one of the three axes (X, Y or Z).\n// First, decide which axis by finding the one with the\n// largest t-value:\ndorotx = doroty = dorotz = false;\nif (tz <= ty) {\nif (ty <= tx) {\ndorotx = true;\n} else {\ndoroty = true;\n}\n} else {\nif (tz <= tx) {\ndorotx = true;\n} else {\ndorotz = true;\n}\n}\nif (dorotx) {\nthis._setFromMatWithXRot(m);\n} else if (doroty) {\nthis._setFromMatWithYRot(m);\n} else if (dorotz) {\nthis._setFromMatWithZRot(m);\n}\n}\nreturn this;\n}", "function euler2quat(e) {\n\n\tif(!e) return;\n \n var roll = .5 * e[0] * to_radians,\n pitch = .5 * e[1] * to_radians,\n yaw = .5 * e[2] * to_radians,\n\n sr = Math.sin(roll),\n cr = Math.cos(roll),\n sp = Math.sin(pitch),\n cp = Math.cos(pitch),\n sy = Math.sin(yaw),\n cy = Math.cos(yaw),\n\n qi = sr*cp*cy - cr*sp*sy,\n qj = cr*sp*cy + sr*cp*sy,\n qk = cr*cp*sy - sr*sp*cy,\n qr = cr*cp*cy + sr*sp*sy;\n\n return [qr, qi, qj, qk];\n}", "function rotateVectorAroundAxis(vec, axis, angle){\n var u = axis.clone().normalize();\n var cosa = Math.cos(angle), sina = Math.sin(angle);\n // https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle\n var R = new THREE.Matrix3();\n R.set(\n cosa+u.x*u.x*(1-cosa), u.x*u.y*(1-cosa)-u.z*sina, u.x*u.z*(1-cosa)+u.y*sina,\n u.y*u.x*(1-cosa)+u.z*sina, cosa+u.y*u.y*(1-cosa), u.y*u.z*(1-cosa)-u.x*sina,\n u.z*u.x*(1-cosa)-u.y*sina, u.z*u.y*(1-cosa)+u.x*sina, cosa+u.z*u.z*(1-cosa)\n );\n return vec.clone().applyMatrix3(R);\n}", "processSurface(v,j) {\n\n let c = v.position;\n let vtemp, vtemp1;\n // console.log(c);\n // c = new THREE.Vector3(0,0,0);\n // geometry changes\n vtemp = v.children[0].geometry.clone();\n // vtemp = vtemp.applyMatrix( new THREE.Matrix4().makeRotationY(Math.PI/2) );\n vtemp = vtemp.applyMatrix( new THREE.Matrix4().makeTranslation(c.x, c.y, c.z ));\n // let vtemp = v.children[0].geometry;\n vtemp1 = v.children[1].geometry;\n // vtemp1 = vtemp1.applyMatrix( new THREE.Matrix4().makeRotationY(Math.PI/2) );\n vtemp1 = vtemp1.clone().applyMatrix( new THREE.Matrix4().makeTranslation(c.x, c.y, c.z ));\n // debug\n // let mesh = new THREE.Mesh(vtemp1, new THREE.MeshBasicMaterial( {color:0xff0000,side: THREE.DoubleSide, wireframe: true}));\n // v.children[0].material = new THREE.MeshBasicMaterial( {wireframe:true,color:0xff0000,side: THREE.DoubleSide});\n // v.children[1].material = new THREE.MeshBasicMaterial( {wireframe:true,color:0x00ff00,side: THREE.DoubleSide});\n // console.log({v});\n // let test = v.clone();\n // let nn = v.children[1].clone();\n // nn.geometry = v.children[1].geometry.clone();\n // nn.material = new THREE.MeshBasicMaterial( {color:0x00ff00,side: THREE.DoubleSide, wireframe: true});\n // nn.position.copy(v.position);\n \n // nn.rotation.copy(v.rotation);\n // nn.rotateX(Math.PI);\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeRotationX(Math.PI) );\n\n // console.log(v.rotation,'rot');\n // nn.position.copy(v.position);\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeTranslation(v.position.x, v.position.y, v.position.z ) );\n\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeTranslation(-v.position.x, -v.position.y, -v.position.z ) );\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeRotationX(Math.PI) );\n // nn.geometry.applyMatrix( new THREE.Matrix4().makeTranslation(v.position.x, v.position.y, v.position.z ) );\n\n // console.log({v},{nn},{test});\n // this.scene.add(test);\n // if(j===1) {\n // this.scene.add(test);\n // this.scene.add(nn);\n // this.scene.add( new THREE.AxesHelper( 20 ) );\n // }\n \n // \n // console.log({nn});\n \n\n\n let len = v.children[0].geometry.attributes.position.array.length/3;\n let len1 = v.children[1].geometry.attributes.position.array.length/3;\n // console.log(len,len1);\n // fragment id\n let offset = new Array(len).fill(j/100);\n vtemp.addAttribute( 'offset', new THREE.BufferAttribute( new Float32Array(offset), 1 ) );\n\n let offset1 = new Array(len1).fill(j/100);\n vtemp1.addAttribute( 'offset', new THREE.BufferAttribute( new Float32Array(offset1), 1 ) );\n\n // axis\n let axis = getRandomAxis();\n let axes = new Array(len*3).fill(0);\n let axes1 = new Array(len1*3).fill(0);\n for (let i = 0; i < len*3; i=i+3) {\n axes[i] = axis.x;\n axes[i+1] = axis.y;\n axes[i+2] = axis.z;\n }\n vtemp.addAttribute( 'axis', new THREE.BufferAttribute( new Float32Array(axes), 3 ) );\n // volume axes\n for (let i = 0; i < len1*3; i=i+3) {\n axes1[i] = axis.x;\n axes1[i+1] = axis.y;\n axes1[i+2] = axis.z;\n }\n vtemp1.addAttribute( 'axis', new THREE.BufferAttribute( new Float32Array(axes1), 3 ) );\n\n\n // centroid\n let centroidVector = getCentroid(vtemp);\n let centroid = new Array(len*3).fill(0);\n let centroid1 = new Array(len1*3).fill(0);\n for (let i = 0; i < len*3; i=i+3) {\n centroid[i] = centroidVector.x;\n centroid[i+1] = centroidVector.y;\n centroid[i+2] = centroidVector.z;\n }\n for (let i = 0; i < len1*3; i=i+3) {\n centroid1[i] = centroidVector.x;\n centroid1[i+1] = centroidVector.y;\n centroid1[i+2] = centroidVector.z;\n }\n vtemp.addAttribute( 'centroid', new THREE.BufferAttribute( new Float32Array(centroid), 3 ) );\n vtemp1.addAttribute( 'centroid', new THREE.BufferAttribute( new Float32Array(centroid1), 3 ) );\n \n\n return {surface: vtemp, volume: vtemp1};\n }", "function createScene() {\r\n scene = new THREE.Scene();\r\n aspect = window.innerWidth / window.innerHeight;\r\n fov = 60;\r\n nearVal = 1;\r\n farVal = 950;\r\n\r\n scene.fog = new THREE.Fog(0xff5566, 120, 800);\r\n camera = new THREE.PerspectiveCamera(fov,aspect,nearVal,farVal);\r\n camera.position.x = 0;\r\n camera.position.z = 500;\r\n camera.position.y = 100;\r\n\r\n renderer = new THREE.WebGLRenderer({alpha: true,antialias: true});\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n renderer.shadowMap.enabled = true;\r\n\r\n\r\n\r\n container = document.getElementById('bg');\r\n container.appendChild(renderer.domElement);\r\n\r\n controls = new THREE.DeviceOrientationControls( camera );// <------------ //for the phone (also a variable in)\r\n\r\n pivPoint = new THREE.Object3D();\r\n\r\n}", "function createHemisphereGeometry(radius,dir,cu,cv) {\n let r = radius;\n\n var geom = new THREE.Geometry(); \n\n let points = [];\n\n let num_z_segments = 16;\n let num_xy_segments = 32;\n\n let uvs = [];\n let margin = 0.05;\n let ru = 0.25 * (1.0 - margin);\n let rv = 0.5 * (1.0 - margin);;\n\n let half_pi = Math.PI / 2.0;\n for(let s=0; s<num_z_segments; s++) {\n let zc = (s / num_z_segments) * half_pi;\n\n for(let t=0; t<num_xy_segments; t++) {\n\n // angle of rotation on xy plane in radians\n let xyc = (t / num_xy_segments) * (Math.PI * 2.0) * dir;\n\n let x = Math.cos(xyc) * Math.cos(zc) * r;\n let y = Math.sin(xyc) * Math.cos(zc) * r;\n let z = Math.sin(zc) * r * dir * (-1.0);\n\n geom.vertices.push(new THREE.Vector3(x,y,z));\n\n let u = cu + (Math.cos(xyc) * ru * (num_z_segments - s) / num_z_segments) * dir;\n let v = cv + Math.sin(xyc) * rv * (num_z_segments - s) / num_z_segments;\n uvs.push( new THREE.Vector2(u,v) );\n }\n }\n\n // Add the last one vertex to close the top of the dome\n geom.vertices.push(new THREE.Vector3(0,0,r * dir * (-1.0)));\n uvs.push( new THREE.Vector2(cu,cv) );\n\n // Faces (polygon indices)\n\n for(let s=0; s<num_z_segments-1; s++) {\n for(let t=0; t<num_xy_segments; t++) {\n //let i = ;\n let i0 = s * num_xy_segments + t;\n let i1 = s * num_xy_segments + (t+1) % num_xy_segments;\n let i2 = (s+1) * num_xy_segments + (t+1) % num_xy_segments;\n let i3 = (s+1) * num_xy_segments + t;\n geom.faces.push( new THREE.Face3(i0,i1,i2) );\n geom.faces.push( new THREE.Face3(i0,i2,i3) );\n\n geom.faceVertexUvs[0].push([ uvs[i0], uvs[i1], uvs[i2] ]);\n geom.faceVertexUvs[0].push([ uvs[i0], uvs[i2], uvs[i3] ]);\n }\n }\n\n // Close the hole\n let i2 = num_z_segments * num_xy_segments;\n for(let t=0; t<num_xy_segments; t++) {\n let i0 = (num_z_segments-1) * num_xy_segments + t;\n let i1 = (num_z_segments-1) * num_xy_segments + (t+1) % num_xy_segments;\n geom.faces.push( new THREE.Face3(i0,i1,i2) );\n geom.faceVertexUvs[0].push([ uvs[i0], uvs[i1], uvs[i2] ]);\n }\n\n return geom;\n}", "function Start() {\n\t// transform.Rotate(-90,0,0);\n}", "createGizmo (center, euler, size, radius, color, range, axis) {\n\n var material = new GizmoMaterial({\n color: color\n })\n\n var subMaterial = new GizmoMaterial({\n color: color\n })\n\n var torusGizmo = new THREE.Mesh(\n new THREE.TorusGeometry(\n radius, size, 64, 64, range),\n material)\n\n var subTorus = new THREE.Mesh(\n new THREE.TorusGeometry(\n radius, size, 64, 64, 2 * Math.PI),\n subMaterial)\n\n subTorus.material.highlight(true)\n\n var transform = new THREE.Matrix4()\n\n var q = new THREE.Quaternion()\n\n q.setFromEuler(euler)\n\n var s = new THREE.Vector3(1, 1, 1)\n\n transform.compose(center, q, s)\n\n torusGizmo.applyMatrix(transform)\n\n subTorus.applyMatrix(transform)\n\n var plane = this.createBox(\n this.size * 100,\n this.size * 100,\n 0.01)\n\n plane.applyMatrix(transform)\n\n subTorus.visible = false\n\n this.viewer.impl.addOverlay(\n this.overlayScene, torusGizmo)\n\n this.viewer.impl.addOverlay(\n this.overlayScene, subTorus)\n\n torusGizmo.subGizmo = subTorus\n torusGizmo.plane = plane\n torusGizmo.axis = axis\n\n return torusGizmo\n }", "function getRotMatrix(p, str){\n switch(str)\n {case \"x\":\n var obj = new THREE.Matrix4().set(1, 0, 0, 0, \n 0, Math.cos(p),-Math.sin(p), 0, \n 0, Math.sin(p), Math.cos(p), 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n case \"y\":\n var obj = new THREE.Matrix4().set(Math.cos(p), 0, -Math.sin(p), 0, \n 0, 1, 0, 0, \n Math.sin(p), 0, Math.cos(p), 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n case \"z\":\n var obj = new THREE.Matrix4().set(Math.cos(p), -Math.sin(p), 0, 0, \n Math.sin(p), Math.cos(p), 0, 0, \n 0, 0, 1, 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n\n default:\n break;\n\n }\n\n}", "static makeRotationMatrix(vector, angle){\n if(vector.length == null || vector.length != 3){\n return null;\n }\n let c = Math.cos(angle);\n let s = Math.sin(angle);\n let omc = 1 - c; //One Minus C\n \n let l = Math.sqrt(vector[0]*vector[0] + vector[1]*vector[1] + vector[2]*vector[2]);\n let x = vector[0]/l, y = vector[1]/l, z = vector[2]/l;\n \n let M = Matrix.make(\n [\n [x*x*omc+c, y*x*omc-z*s, z*x*omc+y*s, 0],\n [x*y*omc+z*s, y*y*omc+c, z*y*omc-x*s, 0],\n [x*z*omc-y*s, y*z*omc+x*s, z*z*omc+c , 0],\n [ 0, 0, 0, 1]\n ]\n );\n return M;\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\tInterpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n}", "function v3tov(v)\n{//vector to THREE vector\n\treturn vector(v.x, v.y, v.z)\n}", "function turnVectorRight(vector) {\n var axis = new THREE.Vector3(0, -1, 0);\n var angle = 90 * (Math.PI / 180);\n let newVec = vector.clone();\n newVec.applyAxisAngle(axis, angle);\n return newVec;\n}", "function randomUnitVector() {\r\n var theta = randomRange(0, 2 * Math.PI);\r\n var z = randomRange(-1, 1);\r\n return new components_1.Vector(Math.sqrt(1 - z * z) * Math.cos(theta), Math.sqrt(1 - z * z) * Math.sin(theta), z);\r\n}", "setRotation(trs) {\n//----------\nreturn this.rotation = RQ.copyOfQV(trs.getRotation());\n}", "function drawQuarterSphere(radius, widthSegments, heightSegments, opacity, color, position, rotation){\n\tvar sphere = new THREE.SphereGeometry(radius, widthSegments, heightSegments, 0, Math.PI/2., 0, Math.PI/2.)\n\tvar circle1 = new THREE.CircleGeometry(radius, widthSegments, 0., Math.PI/2.)\n\tvar circle2 = new THREE.CircleGeometry(radius, widthSegments, 0., Math.PI/2.)\n\tvar circle3 = new THREE.CircleGeometry(radius, widthSegments, 0., Math.PI/2.)\n\n\tvar sphereMesh = new THREE.Mesh(sphere);\n\n\tvar circle1Mesh = new THREE.Mesh(circle1);\n\tcircle1Mesh.rotation.set(0, 0, Math.PI/2.);\n\n\tvar circle2Mesh = new THREE.Mesh(circle2);\n\tcircle2Mesh.rotation.set(Math.PI/2., 0, Math.PI/2.);\n\n\tvar circle3Mesh = new THREE.Mesh(circle3);\n\tcircle3Mesh.rotation.set(Math.PI/2., Math.PI/2., 0);\n\n\tvar singleGeometry = new THREE.Geometry();\n\n\tsphereMesh.updateMatrix(); // as needed\n\tsingleGeometry.merge(sphereMesh.geometry, sphereMesh.matrix);\n\n\tcircle1Mesh.updateMatrix(); // as needed\n\tsingleGeometry.merge(circle1Mesh.geometry, circle1Mesh.matrix);\n\n\tcircle2Mesh.updateMatrix(); // as needed\n\tsingleGeometry.merge(circle2Mesh.geometry, circle2Mesh.matrix);\n\n\tcircle3Mesh.updateMatrix(); // as needed\n\tsingleGeometry.merge(circle3Mesh.geometry, circle3Mesh.matrix);\n\n\tvar material = new THREE.MeshPhongMaterial( { \n\t\tcolor: color, \n\t\tflatShading: false, \n\t\ttransparent:true,\n\t\t//shininess:50,\n\t\topacity:opacity, \n\t\tside:THREE.DoubleSide,\n\t});\n\n\tvar mesh = new THREE.Mesh(singleGeometry, material);\n\tmesh.position.set(position.x, position.y, position.z);\n\tmesh.rotation.set(rotation.x, rotation.y, rotation.z);\n\tmesh.renderOrder = -1;\n\tparams.scene.add(mesh);\n\treturn mesh;\n\n}", "function QuaternionKeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrack.call( this, name, times, values, interpolation );\n\n}", "function QuaternionKeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrack.call( this, name, times, values, interpolation );\n\n}", "function QuaternionKeyframeTrack( name, times, values, interpolation ) {\n\n\tKeyframeTrack.call( this, name, times, values, interpolation );\n\n}", "setRotation(r) {\n // console.log('setrotation', r)\n this.a = Math.cos(r)\n this.b = -Math.sin(r)\n this.d = Math.sin(r)\n this.e = Math.cos(r)\n // console.log(this)\n }", "setFromAxisAngle(xyz, angle) {\n//---------------\nRQ.setAxisAngleQV(this.xyzw, xyz, angle);\nreturn this;\n}", "rotateTurtle(x, y, z) {\n x = x * this.angle;\n y = 45;\n z = z * this.angle ;\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 }", "function QuaternionLinearInterpolant(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n Interpolant.call(this, parameterPositions, sampleValues, sampleSize, resultBuffer);\n}", "function QuaternionLinearInterpolant(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n Interpolant.call(this, parameterPositions, sampleValues, sampleSize, resultBuffer);\n}", "function orient( p, q, r ) {\n\treturn p.x*q.y + q.x*r.y + r.x*p.y - (p.y*q.x + q.y*r.x + r.y*p.x) ;\n}", "function rotation (x, y, z) {\n let so = [[0, -z, y],\n [z, 0, -x],\n [-y, x, 0]]\n return expm3(so)\n}", "setRotate(rq) {\nE3Vec.setRotateV3(this.xyz, rq.xyzw);\nreturn this;\n}" ]
[ "0.73095", "0.72610736", "0.71722066", "0.7123993", "0.7013817", "0.6782107", "0.669506", "0.6635915", "0.66320837", "0.66166276", "0.65798146", "0.6509466", "0.6507568", "0.6503738", "0.64911366", "0.6457765", "0.64351106", "0.6410655", "0.64008915", "0.6383862", "0.6377777", "0.6374296", "0.6278928", "0.6277352", "0.6255316", "0.62041926", "0.6202482", "0.61968285", "0.6192675", "0.61787564", "0.6168581", "0.61520815", "0.612969", "0.612969", "0.6128373", "0.61152077", "0.61096406", "0.6108806", "0.6108531", "0.60738117", "0.6041905", "0.60311794", "0.6022731", "0.6013452", "0.6010046", "0.60046583", "0.600041", "0.5976484", "0.5976484", "0.59612525", "0.5941124", "0.5937096", "0.5927188", "0.5909461", "0.58980614", "0.5885074", "0.5863929", "0.58559006", "0.58525264", "0.5844183", "0.583827", "0.58300626", "0.5823862", "0.5822141", "0.58050287", "0.57992613", "0.5772814", "0.57525444", "0.5751631", "0.5743895", "0.57312626", "0.5730603", "0.571233", "0.5707297", "0.5698072", "0.5698072", "0.5698072", "0.5698072", "0.5698072", "0.5698072", "0.5698072", "0.5698072", "0.5698072", "0.5698072", "0.5698072", "0.5697002", "0.56920254", "0.56832963", "0.56806356", "0.5676502", "0.5671094", "0.5671094", "0.5671094", "0.5669526", "0.5666069", "0.566297", "0.56525135", "0.56525135", "0.5649629", "0.56345344", "0.5633543" ]
0.0
-1
The actual function that gets called whenever the event listener is triggered.
function eventFuncTouchStart( event ) { // Not needed because the event target holder is passive. Uncommenting will prompt errors about this. // event.preventDefault(); // Variable to hold the x and y input coordinates. // The mathematical operations normalise the input; so that the value is between -1 and 1 in a float format. // Both x and y are " *-1" to invert them, seems like a bug. touchInputPos.x = ( (event.touches[0].clientX / window.innerWidth ) * 2 - 1); if(invertTouchInputY){ touchInputPos.y = ( (event.touches[0].clientY / window.innerHeight ) * 2 - 1) *-1; }else{ touchInputPos.y = ( (event.touches[0].clientY / window.innerHeight ) * 2 - 1); } // Debug logging to show the raw & normalised positions of input, incase there's bugs with desktop testing (seems to be!). // event.touches[0] gets the FIRST finger touch, since devices are capable of multi-touch input. console.log("NormX | RawX: " + touchInputPos.x + " | " + event.touches[0].clientX + "\n" + "NormY | RawY: " + touchInputPos.y + " | " + event.touches[0].clientY ); // Sets the ray to use the scene camera & input position touchInputRay.setFromCamera(touchInputPos, camera); // Gets all the objects that the ray intersects. var intersectedObjects = touchInputRay.intersectObjects(scene.children); // Debug log how many objects were hit. console.log("Objects hit: " + intersectedObjects.length); // Iterate over the intersected objects. for (var index = 0; index < intersectedObjects.length; index++){ console.log("Object #" + index); // intersectedObjects[index].object.material.color.set( 0xff0000 ); if(intersectedObjects[index].object.name == "tree"){ // Convenience variable to shorten typing within the loop. var hitObject = intersectedObjects[index].object; console.log("ITS A TREE! :D "); // In order to completely remove the tree, the parent and children have to be checked. // If there is a child, and its name is tree, the hit object was the treetop. if( hitObject.children.length == 1 && hitObject.children[0].name == "tree" ){ cleanup3DObject(hitObject.children[0]); } // END if child name is tree. // If there is a parent, and its name is tree, the hit object was the trunk. if( (typeof hitObject.parent !== 'undefined') && hitObject.parent.name == "tree"){ cleanup3DObject(hitObject.parent); } // END - if parent object is tree. // Remove the hit object. cleanup3DObject(hitObject); } // END - if intersected object is a tree. } // END - Iteration loop. } // END - eventFuncTouchStart
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onEvent() {\n \n }", "handleEvent() {}", "handleEvent() {}", "function Listener() { }", "function initEventListener() {\n \n }", "function Listener() {}", "function Listener() {}", "handleEvents() {\n }", "listener() {}", "handleEventChange() {\n }", "_evtChange(event) { }", "_addEventsListeners ()\n {\n this._onChange();\n }", "on(event, listener) {\n return super.on(event, listener);\n }", "function initEventListener() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "bindEvents() {\n }", "function InternalEvent() {}", "function addEventListeners() {\n\n}", "onChanged(e){}", "function registerEvents() {\n}", "function setup_event (params) {\n return true;\n}", "function handler() {\n fired = true;\n }", "aListener(val) {}", "function dumbListener2(event) {}", "function dumbListener2(event) {}", "initializeEvents () {\n }", "callEvent(event) {\n trackEvent('Elections', 'clicked ' + event.currentTarget.id)\n }", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function clickHandler(){\n console.log('I am clicked');\n}", "function eventListener(ev) {\n if (testKeyCode > 0 && ev.keyCode !== testKeyCode) {\n // we're looking for a specific keycode\n // but the one we were given wasn't the right keycode\n return;\n }\n // fire the user's component event listener callback\n // if the instance isn't ready yet, this listener is already\n // set to handle that and re-queue the update when it is ready\n listenerCallback(ev);\n if (elm.$instance) {\n // only queue an update if this element itself is a host element\n // and only queue an update if host element's instance is ready\n // once its instance has been created, it'll then queue the update again\n // queue it up for an update which then runs a re-render\n elm._queueUpdate();\n // test if this is the user's interaction\n if (isUserInteraction(eventName)) {\n // so turns out that it's very important to flush the queue NOW\n // this way the app immediately reflects whatever the user just did\n plt.queue.flush();\n }\n }\n }", "get onEvent() {\n return this._onEvent;\n }", "function main() {\n addEventListeners();\n}", "function onevent(args) {\n console.log(\"Event:\", args[0]);\n }", "function listening(){console.log(\"listening. . .\");}", "addEventListeners() {\n // Empty in base class.\n }", "#setupTriggerEventListener() {\n this.#teardownTriggerEventListener = createListener(\n window,\n this.triggerEventName,\n this.#handleTiggerEvent.bind(this),\n );\n }", "function onevent(args) {\n console.log(\"Event:\", args[0]);\n }", "listener() {\n console.warn(\"no update listener set!\");\n }", "function Event() { }", "function Event() { }", "function FsEventsHandler() {}", "onEvent(event) {\r\n this.resolveInialized();\r\n this.passiveListeners.forEach(cb => cb(event));\r\n return super.onEvent(event);\r\n }", "function click_on() {\n console.log('called click function');\n}", "function handleEvent(event) {\n\n }", "_bindEventListenerCallbacks() {\n this._onInputBound = this._onInput.bind(this);\n }", "function evtListener() {\n debug(\"evtListener\");\n cards().forEach(function(node) {\n node.addEventListener('click', cardMagic);\n })\n }", "attachedCallback() {}", "attachedCallback() {}", "function eventFunction(e){\n\t getSlot([q.id], allEvents).push(e);\n\t eventDurForeach(e, drawfn);\n\t}", "allCustomEvents() {\n // add custom events here\n }", "function handleEvent(event) {\n console.log(event);\n // and whatever else\n}", "_onChange() {\n void this._debouncer.invoke();\n }", "onMessage() {}", "onMessage() {}", "function myCallback(event) {\n console.log(\"The button was clicked\", event);\n}", "connected() {\n event();\n }", "on(handler) {\n this.addEventListener(handler);\n }", "handlerWillAdd (event, when, handler) {\n\n }", "function EventDispatcher() {}", "function EventDispatcher() {}", "startEventListener() {\n Utils.contract.MessagePosted().watch((err, { result }) => {\n if(err)\n return console.error('Failed to bind event listener:', err);\n\n console.log('Detected new message:', result.id);\n this.fetchMessage(+result.id);\n });\n }", "static get listeners() {\n return {\n 'resize': '_resizeHandler'\n };\n }", "static _onListenDone () {\n }", "_addMessageListener({\n eventHandler,\n eventName,\n frameId\n }) {\n\n if (typeof eventHandler === 'function') {\n\n handlers.add({\n componentId: this.componentId,\n eventName: eventName,\n eventHandler: eventHandler,\n frameId,\n });\n\n }\n\n }", "handleReRunEvent() {\n console.log(' in handleReRunEvent method');\n }", "function eventHandler(event)\n{\n if (event_listeners.length > 0)\n {\n for(var i=0;i<event_listeners.length;++i)\n {\n var obj = event_listeners[i].object;\n event_listeners[i].callback.call(obj,event);\n //event_listeners[i].callback(event);\n }\n }\n}", "addChangeListener(callback) {\n Bullet.on(LOCAL_EVENT_NAME, callback)\n }", "static get EVENT() {\n // Get the original event to call\n return overtakenAdaptEvent = overtakenAdaptEvent || function(name, description, event) {\n console.log( 'AdaptEvent: ', {\n name,\n description,\n event,\n } );\n };\n }", "function Eventable()\n{\n\n}", "function trigger_event_listeners() {\n\n // Handles/Triggers the Function for\n // changes in the Motions' Radio\n on_change_motions();\n\n // Handles/Triggers the Function for\n // changes in the Camera View's Radio\n on_change_camera_view();\n\n // Handles/Triggers the Function for\n // changes in the XZ Grid's Checkbox\n on_check_xz_grid();\n\n // Handles/Triggers the Function for\n // changes in the Atomic Orbit's Checkbox\n on_check_atomic_orbits();\n \n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #1 Checkbox\n on_check_atom_particle_state_1();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #2 Checkbox\n on_check_atom_particle_state_2();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #3 Checkbox\n on_check_atom_particle_state_3();\n \n // Handles/Triggers the Function for\n // changes in the Atom's Particle's State #4 Checkbox\n on_check_atom_particle_state_4();\n \n}", "listen() {\n window.addEventListener(\"keydown\", this.callbackFunc.bind());\n }", "function onloevha() {\n}", "static _onListen () {\n debug('_onListen');\n\n TalkieActions.setActiveAnimation('receiving');\n }", "function myEventListenerFunction(event) {\n console.log(\"Named function for our event listener\", event);\n}", "on(listener, thisArgs, disposables) {\n return this.event(listener, thisArgs, disposables);\n }", "formChanged() {}", "firstUpdated(e){}", "function onevent(args) {\n console.log('connected')\n console.log(\"Event:\", args[0]);\n }", "listener(event) {\n\t\tevent.stopPropagation();\n\t\tlet values = [event].concat(this.events[event.type].values);\n\t\tthis.events[event.type].method.apply(this.model, values);\n\t}" ]
[ "0.72889096", "0.6764487", "0.6764487", "0.6724855", "0.6703935", "0.6674106", "0.6674106", "0.6670336", "0.66314", "0.6589077", "0.65570176", "0.65224195", "0.6443552", "0.6429053", "0.6386561", "0.6386561", "0.6386561", "0.6386561", "0.6386561", "0.6341344", "0.63266826", "0.62639475", "0.6241291", "0.62316155", "0.6214334", "0.6183276", "0.6173824", "0.6173814", "0.6173814", "0.6169609", "0.6168659", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6159178", "0.6147572", "0.61458415", "0.6136192", "0.6126951", "0.6117501", "0.6111328", "0.60920763", "0.6086404", "0.60737157", "0.6064411", "0.6056769", "0.6056769", "0.60556763", "0.6050753", "0.60429597", "0.6041519", "0.6038877", "0.6029015", "0.60229814", "0.60229814", "0.6016878", "0.6013413", "0.60125095", "0.60124093", "0.59814733", "0.59814733", "0.5980024", "0.59688723", "0.59674627", "0.59627414", "0.5955519", "0.5955519", "0.59492356", "0.59382", "0.5936629", "0.592945", "0.5917562", "0.59166366", "0.5906814", "0.5889414", "0.58768237", "0.5870806", "0.58666044", "0.5863673", "0.58585286", "0.5850719", "0.58499837", "0.5844753", "0.58420813", "0.58404434", "0.5838456" ]
0.0
-1
Kept in function to keep animate clean.
function updateGlobalLerpValue(){ // Perform clamping or bouncing of lerp value. // If lerp value is LESS than 0... if(globalLerpValue < 0){ // Snap value back to 0, and set reversing value to false. globalLerpReversing = false; globalLerpValue = 0; } // END - if global lerp is reversing. // Else, if the value is GREATER than 1... else if ( globalLerpValue > 1 ){ if(globalLerpBounce){ // Snap back to 1 and enable reversing. globalLerpReversing = true; globalLerpValue = 1; } // END - reverse enabled // Else, lerp bounce is disabled, so just snap the value that's greater than 1 back to 0. else{ // LERP BOUNCE DISABLED. // Snap value back to 0. globalLerpValue = 0; } // END - If lerp bounce is DISABLED } // END - if else. // Inc/Decrement the lerp value depending on if lerp Reverse is true or false. if(globalLerpReversing){ // bounce is enabled, so count DOWN using speed. globalLerpValue -= globalLerpSpeed; } else{ // Counting up normally using speed. globalLerpValue += globalLerpSpeed; } // END - if/else lerp reversing. // console.log("LERP: " + globalLerpValue); } // END - update lerp value.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reAnimate(){\n\t\tthis.keyFrameStyle.parentNode.removeChild(this.keyFrameStyle);\n\t\tthis.keyFrameStyle = null;\n\t\tthis.keyFrameAnimate();\n\t}", "function stop() {\r\n animating = false;\r\n }", "animate_stop() {\r\n this.sprite.animate = false;\r\n }", "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }", "function stopanimate() {\r\n window.cancelAnimationFrame(request)\r\n }", "updateAnimation() {\n return;\n }", "function animateRemoval() {\n return $animateCss(element, {addClass: '_md-leave'}).start();\n }", "function stopAnimate() {\n clearInterval(tID);\n} //end of stopAnimate()", "re_animate_ghost() {\r\n\r\n this.sprite.status = this.statusEnum.ALIVE;\r\n this.set_animation_frame(0, 0);\r\n this.animate_start();\r\n \r\n }", "function removeAnimation(){\n\t\tsetTimeout(function() {\n\t\t\t$('.bubble').removeClass('animating')\n\t\t}, 1000);\t\t\t\n\t}", "function stopAnimate() {\r\n clearInterval(tID);\r\n} //end of stopAnimate()", "function clear() {\n lastPos = null;\n delta = 0;\n\n // $('.cine').css('-webkit-transition','.5s');\n // $('.cine').css('-webkit-transform','skewY(0deg)');\n // $('.cine pre').css('-webkit-transform','skewY(0deg)');\n // $('.cine span').css('-webkit-transform','skewY(0deg)');\n //\n // timer = setTimeout(function(){\n // $('.cine').css('-webkit-transition','0s');\n // console.log(\"!@#\");\n // }, 500);\n }", "function resetAnimation() {\n $(\"#win-display\").removeClass('animated bounceInDown');\n $(\"#lose-display\").removeClass('animated bounceInDown');\n $(\".gameBanner\").removeClass('animated bounceInDown');\n $(\".target-number\").removeClass('animated rotateInDownRight');\n $(\".total-number\").removeClass('animated rotateInDownLeft');\n}", "stop(){this.__stopped=!1;this.toggleAnimation()}", "function animateRemoval() {\n return $animateCss(element, {addClass: '_md-leave'}).start();\n }", "function animateRemoval() {\n return $animateCss(element, {addClass: '_md-leave'}).start();\n }", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "function resetRuning(){\r\n Joey.changeAnimation(\"running\",Running_Joey);\r\n \r\n}", "stop() {\n this._enableAnimation = false;\n }", "function animateRemoval(){return $animateCss(element,{addClass:'md-leave'}).start();}", "function animateRemoval(){return $animateCss(element,{addClass:'md-leave'}).start();}", "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }", "function OwlCarouselresetAnimation(anim) {\n\t\t$(anim).css({\n\t\t\t'opacity':'0',\n\t\t\t'transform':'none',\n\t\t\t'left':'auto',\n\t\t\t'right':'auto'\n\t\t}).removeClass('animated-in');\t\n\t\t\n\t\t$(anim).each(function(i) {\n\t\t\tclearTimeout($standAnimatedColTimeout[i]); \n\t\t});\n\t}", "function stop_animation(mark) {\r\n win.mark.setIcon(null);\r\n win.mark.setAnimation(null);\r\n}", "function animateRemoval() {\n animationRunner = $animateCss(element, {addClass: 'md-leave'});\n return animationRunner.start();\n }", "if (m_bInitialAnim) { return; }", "removeMarkerAnimation() {\n\t\tif(this.currentMarker) {\n\t\t\tthis.MAPMarker.RemoveAnimation(this.currentMarker);\n\t\t}\n\t}", "idle() {\n this._idle = true;\n this._animation.stop();\n this.emit('clear');\n this.emit('idle');\n }", "reset() {\n if(!this.finishedAnimating) {\n return false;\n }\n\n const svg = this.shadowRoot.querySelector(\"svg\");\n\n svg.classList.remove(\"animate\");\n\n this.finishedAnimating = false;\n return true;\n }", "static clearAnimations() {\n this.clearItems('cycleAnimation');\n }", "stopDrawing() {\n this.updateAnimation = false;\n }", "function reset() {\n\t element[0].style.transitionDuration = 0;\n\t element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n\t }", "stop() {\n clearInterval(this.animation);\n this.canvas.clear();\n }", "animateNoFire1() {\r\n this.p1StreakLvl = 0;\r\n }", "function restoreAnimation() {\n MyAvatar.restoreAnimation();\n \n // Make sure the input is disconnected after animations are restored so it doesn't affect any emotes other than sit\n Controller.keyPressEvent.disconnect(restoreAnimation);\n Controller.disableMapping(eventMappingName);\n}", "function animationCleanPlayerData(selector) {\n\t$(selector).animate({'opacity': '0'}, 500, 'linear');\n}", "function reset(){\n animate = false;\n if ((cur === 0 || cur === n - beforeN)) {\n cur = beforeN;\n $(element).css({\"margin-left\": -cur * w});\n }\n o.endChange(log);\n }", "function expClean(){\r\n\tcurrId = -1;\r\n\tkillTweens([],1)\r\n\tkillTweens([],0); // items\r\n\tkillArrTweens(); \r\n\tclickLegalClose();\r\n\r\n}", "function restart(){\n animate_ca();\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function animateOut() {\n\n chartRing.selectAll('.chart-ring')\n .style('opacity', 1)\n .transition()\n .duration(DURATION)\n .delay(function (d, i) {\n return (DELAY + (i * 100));\n })\n .style('opacity', 0);\n }", "function button_kagawa_animationRemove(){\n\t\t\tthat.button_kagawa_i1.alpha = 1;\n\t\t\tthat.button_kagawa_i2.alpha = 1;\n\t\t\tthat.button_kagawa_i3.alpha = 1;\n\t\t\tthat.button_kagawa_i4.alpha = 1;\n\t\t\t//that.button_kagawa_i5.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_kagawa_i6.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_kagawa_i7.alpha = 1;\t\t// notAvailable\n\t\t}", "function stopAnimation () {\r\n on = false; // Animation abgeschaltet\r\n clearInterval(timer); // Timer deaktivieren\r\n }", "function resetAnimations() {\n animationEls = document.querySelectorAll('.js-animate.shown');\n for (var i = 0; i < animationEls.length; i++) {\n animationEls[i].classList.remove('shown');\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function circle_animated() {\n // console.log(\"Worked\");\n circle.removeAttribute('class');\n path.removeAttribute('class');\n }", "function clean_slate() {\n clear_gifts();\n hit = false;\n game_level_score = 0;\n game_level_timer = 45;\n clearInterval(timer_id);\n gift_timeouts = [];\n keys = {};\n unblast_balloon();\n //$(\"#balloon\").removeClass('blink');\n $(\"#balloon\").css('top', '70%');\n $(\"#balloon\").css('left', '50%');\n}", "function animationManager () {\n for (var i = tasks.length; i--;) {\n if (tasks[i].step() == false) {\n // remove animation tasks\n logToScreen(\"remove animation\");\n tasks.splice(i, 1);\n }\n }\n }", "function reset_animations(){\n if(active != \"idee\"){tl_idee.restart();\n tl_idee.pause();}\n if(active != \"reunion\"){tl_reunion.restart();\n tl_reunion.pause();}\n if(active != \"travail\"){tl_travail.restart();\n tl_travail.pause();}\n if(active != \"deploiement\"){tl_depl.restart();\n tl_depl.pause();}\n }", "function handleInteruption() {\n // Remove animate in instance\n anime.remove(scrollToObject);\n\n // Remove the events\n dettachEvents();\n}", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function stopAnimateButton(obj){\r\n\tobj.alpha=0;\r\n\t$(obj)\r\n\t.clearQueue()\r\n\t.stop(true,true);\r\n}", "function animate() {\r\n if (!doAnim) {\r\n river.context=null; \r\n return;\r\n }\r\n\trequestAnimFrame( animate );\r\n river.background.draw();\r\n}", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "stop() {\n this.renderer.setAnimationLoop(null);\n }", "restartAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n this.animations[key].reset();\n }\n }\n }", "function onEnd() {\n\t\t\t\t\t\t\telement.off(css3AnimationEvents, onAnimationProgress);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, activeClassName);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, pendingClassName);\n\t\t\t\t\t\t\tif (staggerTimeout) {\n\t\t\t\t\t\t\t\t$timeout.cancel(staggerTimeout);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimateClose(element, className);\n\t\t\t\t\t\t\tvar node = extractElementNode(element);\n\t\t\t\t\t\t\tfor (var i in appliedStyles) {\n\t\t\t\t\t\t\t\tnode.style.removeProperty(appliedStyles[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "function stopAnimation(){\r\n for(var i=0; i<self.markerArray().length; i++){\r\n self.markerArray()[i][1].setAnimation(null);\r\n\tself.markerArray()[i][1].setIcon(defaultIcon);\r\n }\r\n}", "function animcompleted() {\n\t\t\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\t\t\tnextcaption.css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\t\t\t\t\t\t\t\t\t\t},100)\n\t\t\t\t\t\t\t\t\t}", "function animcompleted() {\n\t\t\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\t\t\tnextcaption.css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\t\t\t\t\t\t\t\t\t\t},100)\n\t\t\t\t\t\t\t\t\t}", "clearAnimStyle(id) {\n setTimeout(function () {\n this.item.removeAttribute('style')\n this.options.event()\n }.bind(this), this.options.delay * 1000)\n clearInterval(id);\n }", "setAnimTimeout(){\n\n if( this.animTimeout)\n window.clearTimeout( this.animTimeout);\n\n this.animTimeout = window.setTimeout(this.clearAnims,1000);\n }", "function disappearAnimation(){\n $(this).addClass(\"imgAnimate\");\n $(this).one(\"webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend\", function(){\n toSearchBox();\n $(this).remove();\n addSearchBox()\n //$(\"#searchBarSeven\").toggleClass(\"searchBarSevenExtend\");\n\n\n })\n}", "function setAnimationToNull() {\n\n for (var i = 0; i < myMarkers.length; i++) {\n myMarkers[i].setAnimation(null);\n }\n }", "function anim(){\n\tarray.forEach(function(a){\n\t\ta.style.animation = ''\n\t})\t\n\t// Wykonaj funckja czysczesnia divow po 3995 sekundy\n\tsetTimeout(anim, 3995)\n}", "function reset()\n\t\t{\n\t\t\tif(sw != 0)\n\t\t\t{\n\t\t\t\tsw = 0;\n\t\t\t\tmouse = 0;\n\t\t\t\tmotionDialog('total', sw);\n\t\t\t}\n\n\t\t\ti = 0;\n\t\t\tclearInterval(timer);\n\t\t\t$(\"#dadmin\").animate({\"left\":\"48px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dprogram\").animate({\"left\":\"161px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#ddesign\").animate({\"left\":\"286px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dmedia\").animate({\"left\":\"406px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dproject\").animate({\"left\":\"513px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dphoto\").animate({\"left\":\"633px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#ddeload\").animate({\"left\":\"766px\", \"top\":\"530px\"}, \"slow\");\n\t\t\t$(\".match\").css(\"z-index\", \"2\");\n\t\t}", "stopAnimation() {\r\n this.anims.stop();\r\n\r\n //Stop walk sound\r\n this.walk.stop();\r\n }", "function checkIfStillAnimating(e){\n if(isAnimating == false){\n e.target.classList.add('animate-border');\n prevWord = e.target.innerHTML;\n eventInfo = e;\n eraseWord(e, e.target.innerHTML, e.target.id);\n }\n }", "function ani_clear() {\n while(ani_stack.length > 0) {\n ani_stack.pop();\n }\n}", "function stop_dog_poop() {\n cancelAnimationFrame(anim_id);\n $('#restart').slideDown();\n }", "_reset() {\n this._looped = 0;\n this._finished = 0;\n this._started = true;\n this._createAnimatables();\n }", "function animcompleted() {\n\t\t\t\t\t\t}", "function button_tokushima_animationRemove(){\n\t\t\tthat.button_tokushima_i1.alpha = 1;\n\t\t\t//that.button_tokushima_i2.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i3.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i4.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i5.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i6.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i7.alpha = 1;\t\t// notAvailable\n\t\t}", "function removeAllMarkerBounce() {\n logger('function removeAllMarkerBounce is called');\n gmarkers.forEach(function (gmarker) {\n gmarker.setAnimation(null);\n });\n logger('function removeAllMarkerBounce is ended');\n }", "function button_kochi_animationRemove(){\n\t\t\tthat.button_kochi_i1.alpha = 1;\n\t\t\tthat.button_kochi_i2.alpha = 1;\n\t\t\tthat.button_kochi_i3.alpha = 1;\n\t\t\tthat.button_kochi_i4.alpha = 1;\n\t\t\t//that.button_kochi_i5.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_kochi_i6.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_kochi_i7.alpha = 1;\t\t// notAvailable\n\t\t}", "function clearBackground() {\n $('#sprout-animate').css({\n \"background-size\": \"130px 0px\", \"animation-name\": \"popout\",\n \"animation-duration\": \"0.8s\"\n });\n}", "stopAnimation() {\n setStyle(this.slider, 'transition', '', true);\n setStyle(this.slider, 'transform', 'translateX(0%)', true);\n }", "function stopAnimation() {\n cancelAnimationFrame(animationID)\n}", "function stopAnimation(){\n\t\ttile = toTile;\n\t\tPos = toPos;\n\t\tvelocity = 0;\n\t\tAnimation.moving = false;\n\t}", "function hackRemoveAnimations(){\n if (user.hackAnimations!='')\n $jQ('.'+user.hackAnimations).removeClass(user.hackAnimations);\n}", "dropAnimation() {\n if (typeof (this.timer) != 'undefined') clearTimeout(this.timer);\n this.timer = setTimeout(this.stopAnimation.bind(this), 350);\n }", "function stopAnimation() {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }", "function stopAnimation() {\n for (var i = 0; i < self.markerArray().length; i++) {\n self.markerArray()[i][1].setAnimation(null);\n }\n}", "function removeCrashAnimation(e) {\n if (e.propertyName !== 'transform') return;\n e.target.style.transform = 'rotate(-7.2deg) scale(1.5)'; \n}", "killAnimations() {\n this.timelines.forEach((timeline) => {\n this.killTimeline(timeline);\n });\n\n this.tweens.forEach((tween) => {\n this.killTween(tween);\n });\n\n this.timelines = [];\n this.tweens = [];\n }", "afterAnimate() {\n UX.setAnimation(\"vx-layout-standard\", null)\n }", "function clearInte(){\n clearInterval(aniMay);\n clearInterval(aniMay2);\n clearInterval(aniMay3);\n clearInterval(aniMay4);\n clearInterval(aniMay5);\n clearInterval(aniMay6);\n clearInterval(aniMay7);\n}" ]
[ "0.7263442", "0.7121229", "0.6833765", "0.680324", "0.6783706", "0.67652506", "0.67481035", "0.67373985", "0.67343944", "0.6732134", "0.6715589", "0.6645241", "0.664387", "0.6628045", "0.6626414", "0.6626414", "0.662126", "0.6596393", "0.6592641", "0.658388", "0.658388", "0.6565162", "0.6565162", "0.6565162", "0.6565162", "0.6565162", "0.6565162", "0.6553338", "0.64971375", "0.6484686", "0.6454342", "0.64429617", "0.64260906", "0.6407674", "0.64027727", "0.6400433", "0.63991565", "0.638437", "0.6383292", "0.6376207", "0.6362265", "0.6359106", "0.63581425", "0.6355627", "0.6353576", "0.63482183", "0.6337273", "0.63172424", "0.6313753", "0.63136005", "0.63136005", "0.63136005", "0.6308318", "0.6307142", "0.6305294", "0.63037235", "0.6303238", "0.6300516", "0.62999624", "0.6296591", "0.62904847", "0.62904847", "0.62904847", "0.62904847", "0.62717724", "0.626844", "0.6258446", "0.6256062", "0.6244855", "0.6244855", "0.6244855", "0.624116", "0.62403554", "0.62403554", "0.6233319", "0.6233159", "0.6228842", "0.6220393", "0.62168187", "0.62153125", "0.62102276", "0.6208883", "0.6208629", "0.6205491", "0.6192743", "0.6189175", "0.61789846", "0.6178092", "0.61659914", "0.6160723", "0.6159635", "0.6151666", "0.61465156", "0.6144792", "0.61336285", "0.6132337", "0.6100466", "0.6096539", "0.60919136", "0.6090539", "0.6077334" ]
0.0
-1
A modified updateGlobalLerpValue to take an object which contains compatable object subtypes (lerp/animatable).
function updateObjectLerp( objectToModify ){ // Perform clamping or bouncing of lerp value. if(objectToModify.animationFloat < 0){ // Snap value back to 0, and set reversing value to false. objectToModify.animationReversing = false; objectToModify.animationFloat = 0; } // END - if global lerp is reversing. // If value is greater than 1. else if ( objectToModify.animationFloat > 1 ){ // Check to see if global bouncing is enabled. if(objectToModify.animationBounces){ // Snap back to 1 and enable reversing. objectToModify.animationReversing = true; objectToModify.animationFloat = 1; } // END - reverse enabled else{ // LERP BOUNCE DISABLED. // Snap value back to 0. objectToModify.animationFloat = 0; } // END - If lerp bounce is DISABLED } // END - if else. if(objectToModify.animationReversing){ // bounce is enabled, so count DOWN using speed. objectToModify.animationFloat -= globalLerpSpeed; } else{ // Counting up normally. objectToModify.animationFloat += globalLerpSpeed; } // END - if/else lerp reversing. } // END - update lerp value.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateGlobalLerpValue(){\r\n\t// Perform clamping or bouncing of lerp value.\r\n\t// If lerp value is LESS than 0...\r\n\tif(globalLerpValue < 0){\r\n\t\t// Snap value back to 0, and set reversing value to false.\r\n\t\tglobalLerpReversing = false;\r\n\t\tglobalLerpValue = 0;\r\n\t} // END - if global lerp is reversing.\r\n\t// Else, if the value is GREATER than 1...\r\n\telse if ( globalLerpValue > 1 ){\r\n\t\tif(globalLerpBounce){\r\n\t\t\t// Snap back to 1 and enable reversing.\r\n\t\t\tglobalLerpReversing = true;\r\n\t\t\tglobalLerpValue = 1;\r\n\t\t} // END - reverse enabled\r\n\t\t// Else, lerp bounce is disabled, so just snap the value that's greater than 1 back to 0.\r\n\t\telse{ // LERP BOUNCE DISABLED.\r\n\t\t\t// Snap value back to 0.\r\n\t\t\tglobalLerpValue = 0;\r\n\t\t} // END - If lerp bounce is DISABLED\r\n\t} // END - if else.\r\n\t\r\n\t// Inc/Decrement the lerp value depending on if lerp Reverse is true or false.\r\n\tif(globalLerpReversing){\r\n\t\t// bounce is enabled, so count DOWN using speed.\r\n\t\tglobalLerpValue -= globalLerpSpeed;\r\n\t} else{\r\n\t\t// Counting up normally using speed.\r\n\t\tglobalLerpValue += globalLerpSpeed;\r\n\t} // END - if/else lerp reversing.\r\n\t\r\n//\tconsole.log(\"LERP: \" + globalLerpValue);\r\n} // END - update lerp value.", "interpolateOneObject(prevObj, nextObj, objId, playPercentage) {\n\n // if the object is new, add it\n // TODO: this code should no longer be necessary\n let world = this.gameEngine.world;\n if (!world.objects.hasOwnProperty(objId)) {\n this.addNewObject(objId, nextObj);\n }\n\n // handle step for this object\n let curObj = world.objects[objId];\n if (curObj.isPlayerControlled && curObj.physicalObject) {\n\n // if the object is the self, update render position/rotation from physics\n curObj.updateRenderObject();\n\n } else if (typeof curObj.interpolate === 'function') {\n\n // update positions with interpolation\n curObj.interpolate(prevObj, nextObj, playPercentage);\n\n // if this object has a physics sub-object, it must inherit\n // the position now.\n if (curObj.physicalObject && typeof curObj.updatePhysicsObject === 'function') {\n curObj.updatePhysicsObject();\n }\n }\n }", "bendToCurrent(original, percent, worldSettings, isLocal, increments) {\n\n let bending = { increments, percent };\n // if the object has defined a bending multiples for this object, use them\n let positionBending = Object.assign({}, bending, this.bending.position);\n let velocityBending = Object.assign({}, bending, this.bending.velocity);\n let angleBending = Object.assign({}, bending, this.bending.angle);\n let avBending = Object.assign({}, bending, this.bending.angularVelocity);\n\n // check for local object overrides to bendingTarget\n if (isLocal) {\n Object.assign(positionBending, this.bending.positionLocal);\n Object.assign(velocityBending, this.bending.velocityLocal);\n Object.assign(angleBending, this.bending.angleLocal);\n Object.assign(avBending, this.bending.angularVelocityLocal);\n }\n\n // get the incremental delta position & velocity\n this.incrementScale = percent / increments;\n this.bendingPositionDelta = original.position.getBendingDelta(this.position, positionBending);\n this.bendingVelocityDelta = original.velocity.getBendingDelta(this.velocity, velocityBending);\n\n // get the incremental angular-velocity\n this.bendingAVDelta = (this.angularVelocity - original.angularVelocity) * this.incrementScale * avBending.percent;\n\n // get the incremental angle correction\n this.bendingAngleDelta = MathUtils.interpolateDeltaWithWrapping(original.angle, this.angle, angleBending.percent, 0, 2 * Math.PI) / increments;\n\n this.bendingTarget = (new this.constructor());\n this.bendingTarget.syncTo(this);\n\n // revert to original\n this.position.copy(original.position);\n this.angle = original.angle;\n this.angularVelocity = original.angularVelocity;\n this.velocity.copy(original.velocity);\n\n this.bendingIncrements = increments;\n this.bendingOptions = bending;\n\n this.refreshToPhysics();\n }", "bendToCurrent(original, percent, worldSettings, isLocal, increments) {\n\n let bending = { increments, percent };\n // if the object has defined a bending multiples for this object, use them\n let positionBending = Object.assign({}, bending, this.bending.position);\n let velocityBending = Object.assign({}, bending, this.bending.velocity);\n\n // check for local object overrides to bendingTarget\n if (isLocal) {\n Object.assign(positionBending, this.bending.positionLocal);\n Object.assign(velocityBending, this.bending.velocityLocal);\n }\n\n // get the incremental delta position & velocity\n this.incrementScale = percent / increments;\n this.bendingPositionDelta = original.position.getBendingDelta(this.position, positionBending);\n this.bendingVelocityDelta = original.velocity.getBendingDelta(this.velocity, velocityBending);\n this.bendingAVDelta = new ThreeVector(0, 0, 0);\n\n // get the incremental quaternion rotation\n this.bendingQuaternionDelta = (new Quaternion()).copy(original.quaternion).conjugate();\n this.bendingQuaternionDelta.multiply(this.quaternion);\n\n let axisAngle = this.bendingQuaternionDelta.toAxisAngle();\n axisAngle.angle *= this.incrementScale;\n this.bendingQuaternionDelta.setFromAxisAngle(axisAngle.axis, axisAngle.angle);\n\n this.bendingTarget = (new this.constructor());\n this.bendingTarget.syncTo(this);\n\n this.position.copy(original.position);\n this.quaternion.copy(original.quaternion);\n this.angularVelocity.copy(original.angularVelocity);\n\n this.bendingIncrements = increments;\n this.bendingOptions = bending;\n\n this.refreshToPhysics();\n }", "function updateObject(object, updates, tweenId) {\n var attr = updates.attr;\n var tnt = updates.tnt;\n var cst = updates.cst;\n var sat = updates.sat;\n var brt = updates.brt;\n var o = updates.o;\n\n if (attr) {\n if (attr.pickable !== undefined) {\n object.setPickable(attr.pickable);\n }\n\n if (attr.opacity !== undefined) {\n object.setOpacity(attr.opacity);\n }\n\n if (attr.shown !== undefined) {\n Human.timeline.objectVisibilityUpdates[object.objectId] = attr.shown;\n }\n }\n\n if (o && o.val !== undefined) {\n tmpOpacityModifier.value = o.val;\n if (o.x !== undefined) {\n tmpOpacityModifier.range = {\n center: [o.x, o.y, o.z],\n minRadius: o.rmin,\n maxRadius: o.rmax\n };\n }\n object.setOpacityModifier(\"__OPACITY_TWEEN_\" + tweenId, tmpOpacityModifier);\n }\n\n if (tnt && tnt.r !== undefined) {\n tmpColorModifier.applyTo = \"tintColor\";\n tmpColorModifier.value = [tnt.r, tnt.g, tnt.b];\n if (tnt.x !== undefined) {\n tmpColorModifier.range = {\n center: [tnt.x, tnt.y, tnt.z],\n minRadius: tnt.rmin,\n maxRadius: tnt.rmax\n };\n }\n object.setColorModifier(\"__TINT_COLOR_TWEEN_\" + tweenId, tmpColorModifier);\n }\n\n if (cst && cst.val !== undefined) {\n tmpColorModifier.applyTo = \"contrast\";\n tmpColorModifier.value = cst.val;\n if (cst.x !== undefined) {\n tmpColorModifier.range = {\n center: [cst.x, cst.y, cst.z],\n minRadius: cst.rmin,\n maxRadius: cst.rmax\n };\n }\n object.setColorModifier(\"_CONTRAST_TWEEN_\" + tweenId, tmpColorModifier);\n }\n\n if (sat && sat.val !== undefined) {\n tmpColorModifier.applyTo = \"saturation\";\n tmpColorModifier.value = sat.val;\n if (sat.x !== undefined) {\n tmpColorModifier.range = {\n center: [sat.x, sat.y, sat.z],\n minRadius: sat.rmin,\n maxRadius: sat.rmax\n };\n }\n object.setColorModifier(\"__SATURATION_TWEEN_\" + tweenId, tmpColorModifier);\n }\n\n if (brt && brt.val !== undefined) {\n tmpColorModifier.applyTo = \"brightness\";\n tmpColorModifier.value = brt.val;\n if (brt.x !== undefined) {\n tmpColorModifier.range = {\n center: [brt.x, brt.y, brt.z],\n minRadius: brt.rmin,\n maxRadius: brt.rmax\n };\n }\n object.setColorModifier(\"__BRIGHTNESS_TWEEN_\" + tweenId, tmpColorModifier);\n }\n\n if (object.objects.length > 0) {\n var objects = object.objects;\n for (var i = 0, len = objects.length; i < len; i++) {\n updateObject(objects[i], updates, tweenId);\n }\n }\n }", "static LerpUnclamped() {}", "interpolate(interpolateType) {\n let thisTween = Tween.get(this._tweenObject)\n .to(this._target, ...threeConfig.tween[interpolateType])\n .call(() => {\n console.log(\"interpolation done\");\n });\n thisTween.start();\n return thisTween; // if we apply further changes on this active tween\n }", "updateColor() {\n if (this.colorToLerpTo == 0) {\n if (this.r != 255) {\n this.r++;\n if (this.g != 20) this.g--;\n if (this.b != 147) this.b--;\n this.color = makeColor(this.r, this.g, this.b);\n } else {\n this.g = 20;\n this.b = 147;\n this.colorToLerpTo = 1;\n this.color = makeColor(this.r, this.g, this.b);\n }\n } else if (this.colorToLerpTo == 1) {\n if (this.g != 255) {\n this.g++;\n if (this.b != 20) this.b--;\n if (this.r != 147) this.r--;\n this.color = makeColor(this.r, this.g, this.b);\n } else {\n this.r = 147;\n this.b = 20;\n this.colorToLerpTo = 2;\n this.color = makeColor(this.r, this.g, this.b);\n }\n } else if (this.colorToLerpTo == 2) {\n if (this.b != 255) {\n this.b++;\n if (this.r != 20) this.r--;\n if (this.g != 147) this.g--;\n this.color = makeColor(this.r, this.g, this.b);\n } else {\n this.g = 147;\n this.r = 20;\n this.colorToLerpTo = 0;\n this.color = makeColor(this.r, this.g, this.b);\n }\n }\n }", "static Lerp(a, b, t) {\n return a * (1.0 - t) + b * t;\n }", "static lerp(v1, v2, amt, target) \r\n {\r\n if (!target) \r\n target = v1.copy();\r\n else \r\n target.set(v1);\r\n \r\n target.lerp(v2, amt);\r\n \r\n return target;\r\n }", "static Lerp() {}", "calculateLerpFunction ()\n {\n\n // Get the styles we are interested in using\n let transition = Transition[this.transition];\n let style = Style[this.style];\n\n // Build up the function name and get our function\n let functionName = 'lerpStyle' + transition + style;\n let functionToCall = this.lerpFunctions[functionName];\n\n // Send back our function\n return functionToCall;\n }", "function lerp( a, b, alpha ) {\n return (a+alpha*(b-a));\n}", "function lerp( from, to, alpha ) {\n\treturn from * ( 1 - alpha ) + to * alpha;\n}", "function lerp(value, targetValue, stepPercentage) {\n return value * (1 - stepPercentage) + targetValue * stepPercentage;\n }", "function lerp(a, b, t) {\n return a * (1.0 - t) + b * t;\n}", "function lerp(v0, v1, t) {\n return (1 - t) * v0 + t * v1;\n}", "function LayerLerpBlender() {\n\tthis._blendWeight = null;\n\tthis._layerA = null;\n\tthis._layerB = null;\n}", "function getNewTween(obj, props, duration, easingFn, onProgress, onComplete) {\n\t var starts = {};\n\t var changes = {};\n\t var startTime = new Date();\n\t\n\t var prop;\n\t\n\t for (prop in props) {\n\t starts[prop] = obj[prop];\n\t changes[prop] = props[prop] - starts[prop];\n\t }\n\t\n\t var currentTime = void 0;\n\t\n\t return function () {\n\t currentTime = new Date() - startTime;\n\t\n\t if (currentTime < duration) {\n\t\n\t for (prop in props) {\n\t obj[prop] = easingFn(currentTime, starts[prop], changes[prop], duration);\n\t }\n\t\n\t // pass in arguments in case you need to reference\n\t // something when calling returned function in callback\n\t if (onProgress) onProgress(arguments);\n\t } else {\n\t\n\t currentTime = duration;\n\t for (var prop in props) {\n\t obj[prop] = easingFn(currentTime, starts[prop], changes[prop], duration);\n\t }\n\t\n\t // pass in arguments in case you need to reference\n\t // something when calling returned function in callback\n\t if (onComplete) onComplete(arguments);\n\t }\n\t };\n\t}", "function updateToEnd()\n{\n for ( var i = 0; i < script.api.tweenObjects.length; i++)\n {\n var tweenObject = script.api.tweenObjects[i];\n\n var copiedValue = {\n \"r\": (script.loopType == 3) ? tweenObject.startValue.r : tweenObject.endValue.r,\n \"g\": (script.loopType == 3) ? tweenObject.startValue.g : tweenObject.endValue.g,\n \"b\": (script.loopType == 3) ? tweenObject.startValue.b : tweenObject.endValue.b,\n \"a\": (script.loopType == 3) ? tweenObject.startValue.a : tweenObject.endValue.a\n };\n\n updateColorComponent( tweenObject.component, copiedValue );\n }\n}", "resolveLlamaItemsWithDepositSpacesCollision(object) {\n\n if (!(object instanceof _special_items_weapon_items_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])) {\n object.status = \"inactive\";\n }\n // else if (object instanceof WeaponItem) {\n // object.status = \"unequipped\";\n // }\n\n let destination = {};\n\n if (object instanceof _other_objects_coin_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]) {\n destination.x = _constants_js__WEBPACK_IMPORTED_MODULE_16__[\"COINDEPOSITCOORD\"].x;\n destination.y = _constants_js__WEBPACK_IMPORTED_MODULE_16__[\"COINDEPOSITCOORD\"].y;\n } else if (object instanceof _other_objects_heart_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n destination.x = _constants_js__WEBPACK_IMPORTED_MODULE_16__[\"HEARTDEPOSITCOORD\"].x;\n destination.y = _constants_js__WEBPACK_IMPORTED_MODULE_16__[\"HEARTDEPOSITCOORD\"].y;\n } else if (object instanceof _other_objects_bacon_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]) {\n destination.x = _constants_js__WEBPACK_IMPORTED_MODULE_16__[\"BACONDEPOSITCOORD\"].x;\n destination.y = _constants_js__WEBPACK_IMPORTED_MODULE_16__[\"BACONDEPOSITCOORD\"].y;\n }\n // else if (object instanceof WeaponItem) {\n // let emptyWeaponSlot = this.returnEmptyWeaponSlot();\n // object.assignedWeaponContainerCoord = {x: emptyWeaponSlot.x, y: emptyWeaponSlot.y};\n // object.x = emptyWeaponSlot.x;\n // object.y = emptyWeaponSlot.y;\n // object.x_velocity = 0;\n // object.y_velocity = 0;\n // return;\n // }\n\n let collisionCoord = {x: object.x, y: object.y};\n\n let xDistance = destination.x - collisionCoord.x;\n let yDistance = destination.y - collisionCoord.y;\n\n let distance = Math.sqrt(xDistance * xDistance + yDistance * yDistance);\n let desiredVelocity = 7; //4 px per frame = 180px per second (4x60)\n let offset = desiredVelocity/distance;\n let newXVelocity = xDistance * offset;\n let newYVelocity = yDistance * offset;\n\n object.x_velocity = newXVelocity;\n object.y_velocity = newYVelocity;\n }", "render () {\n if (this._rendered) {\n return this\n }\n let { _valuesStart, _valuesEnd, object, node, InitialValues } = this;\n\n SET_NESTED(object);\n SET_NESTED(_valuesEnd);\n\n if (node && node.queueID && Store[node.queueID]) {\n const prevTweenByNode = Store[node.queueID];\n if (prevTweenByNode.propNormaliseRequired && prevTweenByNode.tween !== this) {\n for (const property in _valuesEnd) {\n if (prevTweenByNode.tween._valuesEnd[property] !== undefined) ;\n }\n prevTweenByNode.normalisedProp = true;\n prevTweenByNode.propNormaliseRequired = false;\n }\n }\n\n if (node && InitialValues) {\n if (!object || Object.keys(object).length === 0) {\n object = this.object = NodeCache(node, InitialValues(node, _valuesEnd), this);\n } else if (!_valuesEnd || Object.keys(_valuesEnd).length === 0) {\n _valuesEnd = this._valuesEnd = InitialValues(node, object);\n }\n }\n if (!_valuesStart.processed) {\n for (const property in _valuesEnd) {\n let start = object && object[property] && deepCopy(object[property]);\n let end = _valuesEnd[property];\n if (Plugins[property] && Plugins[property].init) {\n Plugins[property].init.call(this, start, end, property, object);\n if (start === undefined && _valuesStart[property]) {\n start = _valuesStart[property];\n }\n if (Plugins[property].skipProcess) {\n continue\n }\n }\n if (\n (typeof start === 'number' && isNaN(start)) ||\n start === null ||\n end === null ||\n start === false ||\n end === false ||\n start === undefined ||\n end === undefined ||\n start === end\n ) {\n continue\n }\n _valuesStart[property] = start;\n if (Array.isArray(end)) {\n if (!Array.isArray(start)) {\n end.unshift(start);\n for (let i = 0, len = end.length; i < len; i++) {\n if (typeof end[i] === 'string') {\n end[i] = decomposeString(end[i]);\n }\n }\n } else {\n if (end.isString && object[property].isString && !start.isString) {\n start.isString = true;\n } else {\n decompose(property, object, _valuesStart, _valuesEnd);\n }\n }\n } else {\n decompose(property, object, _valuesStart, _valuesEnd);\n }\n if (typeof start === 'number' && typeof end === 'string' && end[1] === '=') {\n continue\n }\n }\n _valuesStart.processed = true;\n }\n\n if (Tween.Renderer && this.node && Tween.Renderer.init) {\n Tween.Renderer.init.call(this, object, _valuesStart, _valuesEnd);\n this.__render = true;\n }\n\n this._rendered = true;\n\n return this\n }", "function lerp(a, b, t) {\n return a + t * (b - a);\n}", "function lerp(a, b, t) {\n return a + (b - a) * t\n}", "objectStep(o, dt) {\n\n // calculate factor\n if (dt === 0)\n return;\n\n if (dt)\n dt /= (1 / 60);\n else\n dt = 1;\n\n // TODO: worldsettings is a hack. Find all places which use it in all games\n // and come up with a better solution. for example an option sent to the physics Engine\n // with a \"worldWrap:true\" options\n // replace with a \"worldBounds\" parameter to the PhysicsEngine constructor\n\n let worldSettings = this.gameEngine.worldSettings;\n\n // TODO: remove this code in version 4: these attributes are deprecated\n if (o.isRotatingRight) { o.angle += o.rotationSpeed; }\n if (o.isRotatingLeft) { o.angle -= o.rotationSpeed; }\n\n // TODO: remove this code in version 4: these attributes are deprecated\n if (o.angle >= 360) { o.angle -= 360; }\n if (o.angle < 0) { o.angle += 360; }\n\n // TODO: remove this code in version 4: these attributes are deprecated\n if (o.isAccelerating) {\n let rad = o.angle * (Math.PI / 180);\n dv.set(Math.cos(rad), Math.sin(rad)).multiplyScalar(o.acceleration).multiplyScalar(dt);\n o.velocity.add(dv);\n }\n\n // apply gravity\n if (!o.isStatic) o.velocity.add(this.gravity);\n\n let velMagnitude = o.velocity.length();\n if ((o.maxSpeed !== null) && (velMagnitude > o.maxSpeed)) {\n o.velocity.multiplyScalar(o.maxSpeed / velMagnitude);\n }\n\n o.isAccelerating = false;\n o.isRotatingLeft = false;\n o.isRotatingRight = false;\n\n dx.copy(o.velocity).multiplyScalar(dt);\n o.position.add(dx);\n\n o.velocity.multiply(o.friction);\n\n // wrap around the world edges\n if (worldSettings.worldWrap) {\n if (o.position.x >= worldSettings.width) { o.position.x -= worldSettings.width; }\n if (o.position.y >= worldSettings.height) { o.position.y -= worldSettings.height; }\n if (o.position.x < 0) { o.position.x += worldSettings.width; }\n if (o.position.y < 0) { o.position.y += worldSettings.height; }\n }\n }", "update(scene, elapsed) {\n if(!elapsed || elapsed<0){\n elapsed = 1\n }\n var objects = scene.objects\n // Add all World forces\n var w = {\n x: 0,\n y: 0\n }\n this.properties.forces.forEach(f=>{\n w.x += f.x\n w.y += f.y\n }\n )\n objects.forEach(o=>{\n // If object active, update physic for it\n if (o.active) {\n if (o.properties.physicType == \"DYNAMIC\") {\n var r = (o.contact ? o.properties.friction : 1.0)\n\n //reset all acceleration for the current GameObject\n o.acceleration = w\n\n // add All object applied forces\n o.forces.forEach(f=>{\n o.acceleration.x += f.x\n o.acceleration.y += f.y\n }\n )\n o.forces = []\n\n // Add gravity\n o.acceleration.x += (this.properties.gravity.x)\n o.acceleration.y += -(this.properties.gravity.y * o.properties.mass)\n\n // limit acceleration vector to maxAcc\n if (o.properties.maxAcc && o.properties.maxAcc.x > 0 && o.properties.maxAcc.y > 0) {\n o.acceleration = this.threshold(o.acceleration, o.properties.maxAcc)\n }\n\n // compute object velocity\n o.velocity.x = (o.velocity.x + o.acceleration.x) * r\n o.velocity.y = (o.velocity.y + o.acceleration.y) * r\n\n // Limit object velocity vector to maxSpd\n o.velocity = this.threshold(o.velocity, (o.properties.maxSpeed ? o.properties.maxSpeed : this.properties.maxSpd))\n\n // compute object position\n o.position.x += o.velocity.x\n o.position.y += o.velocity.y\n\n // update object with its own update method.\n o.update(elapsed)\n\n // constrains Object position to current viewport\n this.constrained(o)\n\n if (o.duration != -1 && o.duration > 0) {\n o.duration -= elapsed;\n if (o.duration < 0) {\n o.duration = -1\n o.active = false\n }\n }\n } else {\n o.update(elapsed)\n }\n }\n }\n );\n // call the specific scene update mechanism\n scene.update(elapsed)\n }", "function update(obj/*, …*/) {\n for (var i=1; i<arguments.length; i++) {\n for (var prop in arguments[i]) {\n var val = arguments[i][prop];\n if (typeof val == \"object\") // this also applies to arrays or null!\n update(obj[prop], val);\n else\n obj[prop] = val;\n }\n }\n return obj;\n }", "function updateSlider(obj, that) {\n var currMinPixel, \n currMaxPixel, \n leftCss, \n labelsVal;\n\n //check if our object is an object\n if (typeof obj !== 'undefined') {\n if (!obj.state) {\n \n //call disabled sliders\n that.options.isDisabled = true;\n //\n disableSlider(that);\n \n } else {\n \n //switch the flag for dsiabled slider\n that.options.isDisabled = false;\n \n //remove disabled class\n $(that.element).removeClass('disabled');\n \n //setup all the local variables \n that._prvt.currentMin = obj.min;\n that._prvt.currentMax = obj.max;\n \n //setup the Limit Values\n that.options.minLimit = obj.min;\n that.options.maxLimit = obj.max;\n \n //add values\n currMinPixel = unitsToPixels(that, that._prvt.currentMin);\n currMaxPixel = unitsToPixels(that, that._prvt.currentMax);\n \n //get the CSS property value\n leftCss = parseInt(that._prvt.sliderBarBack.css('left'), 10);\n \n //adjust current offset value\n that._prvt.innerOffset = currMinPixel;\n \n //this will reset the intenal values to what they need to be\n that._prvt.sliderBar.animate({ \n //setup the width and position of this based on the values that are passed in\n 'left': currMinPixel + leftCss,\n 'width': currMaxPixel - currMinPixel + that._prvt.handleWidth + 'px'\n }, 500);\n \n //animate slider range color\n that._prvt.sliderRange.animate({ \n //setup the width and position of this based on the values that are passed in\n 'left': 0,\n 'width': (currMaxPixel - currMinPixel) + (that._prvt.handleWidth / 2) + 'px'\n }, 500);\n \n //adjust values and slider position\n that._prvt.handleMax.animate({\n 'left': currMaxPixel - currMinPixel\n }, 400);\n \n //update min\n that._prvt.handleMin.animate({\n 'left': currMinPixel - currMinPixel\n }, 400);\n \n //update labels\n labelsVal = formatLabels(that);\n that._prvt.maxLabel.html(labelsVal.maxVal);\n that._prvt.minLabel.html(labelsVal.minVal);\n \n //run a funciton that checks for values and makes items hidden if they need to be\n checkMinMaxValues(that);\n }\n }\n }", "function lerp(t,A,B) { return A + t*(B-A) }", "if(!m_bStopLerp)\n\t\t\t{\n en_plLastPlacement = en_plPlacement; \n }", "constructLerpFunctions ()\n {\n\n // Quadratic\n\n // lerpStyleEaseOutQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // Linear\n\n // lerpStyleLinear\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n\n // Sine\n\n // lerpStyleEaseOutSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutSine(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInSine(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutSine(initial, lerpDistance, duration, currentTime);\n };\n\n // Exponential\n\n // lerpStyleEaseOutExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // Cubic\n\n // lerpStyleEaseOutCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutCubic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInCubic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutCubic(initial, lerpDistance, duration, currentTime);\n };\n }", "static lerp(v1, v2, t) {\n t = t < 0 ? 0 : t\n t = t > 1 ? 1 : t\n let out = []\n out[0] = v1.x + (v2.x - v1.x) * t\n out[1] = v1.y + (v2.y - v1.y) * t\n\n return new Vector2(out[0], out[1])\n }", "objectStep(o, dt) {\n\n // calculate factor\n if (dt === 0)\n return;\n\n if (dt)\n dt /= (1 / 60);\n else\n dt = 1;\n\n // TODO: worldsettings is a hack. Find all places which use it in all games\n // and come up with a better solution. for example an option sent to the physics Engine\n // with a \"worldWrap:true\" options\n // replace with a \"worldBounds\" parameter to the PhysicsEngine constructor\n\n let worldSettings = this.gameEngine.worldSettings;\n\n // TODO: remove this code in version 4: these attributes are deprecated\n if (o.isRotatingRight) { o.angle += o.rotationSpeed; }\n if (o.isRotatingLeft) { o.angle -= o.rotationSpeed; }\n\n // TODO: remove this code in version 4: these attributes are deprecated\n if (o.angle >= 360) { o.angle -= 360; }\n if (o.angle < 0) { o.angle += 360; }\n\n // TODO: remove this code in version 4: these attributes are deprecated\n if (o.isAccelerating) {\n let rad = o.angle * (Math.PI / 180);\n dv.set(Math.cos(rad), Math.sin(rad)).multiplyScalar(o.acceleration).multiplyScalar(dt);\n o.velocity.add(dv);\n }\n\n // apply gravity\n if (!o.isStatic) o.velocity.add(this.gravity);\n\n let velMagnitude = o.velocity.length();\n if ((o.maxSpeed !== null) && (velMagnitude > o.maxSpeed)) {\n o.velocity.multiplyScalar(o.maxSpeed / velMagnitude);\n }\n\n o.isAccelerating = false;\n o.isRotatingLeft = false;\n o.isRotatingRight = false;\n\n dx.copy(o.velocity).multiplyScalar(dt);\n o.position.add(dx);\n\n o.velocity.multiply(o.friction);\n\n // wrap around the world edges\n if (worldSettings.worldWrap) {\n if (o.position.x >= worldSettings.width) { o.position.x -= worldSettings.width; }\n if (o.position.y >= worldSettings.height) { o.position.y -= worldSettings.height; }\n if (o.position.x < 0) { o.position.x += worldSettings.width; }\n if (o.position.y < 0) { o.position.y += worldSettings.height; }\n }\n }", "update(t) {\n this.current.interpolate(this.start, this.end, t);\n }", "lerp() {\n for (let i = 0; i < this.vertices.length; i++) {\n // each vertex object contains a 'finished' boolean\n if (!this.vertices[i].finished) {\n // if the vertex has reached its destination\n // set its 'finished' boolean to true\n // and increment the finishedVerticesCount\n if (\n Math.abs(this.endPositions[i].x - this.positions[i].x) <=\n this.vertexIsCloseEnoughDistance\n ) {\n this.vertices[i].finished = true;\n this.finishedVerticesCount++;\n }\n }\n this.vertices[i].x = this.p.lerp(\n this.startPositions[i].x,\n this.endPositions[i].x,\n this.lerpSpeed\n );\n this.vertices[i].y = this.p.lerp(\n this.startPositions[i].y,\n this.endPositions[i].y,\n this.lerpSpeed\n );\n }\n }", "function updateFunction(object) {\n for (var propertyName in propertyUpdates) {\n if (propertyUpdates.hasOwnProperty(propertyName)) {\n object[propertyName] = propertyUpdates[propertyName];\n }\n }\n }", "function update(a){a.vglUpdate&&a.vglUpdate()}", "update(_time, delta) {\n const deltaTheta = this[$targetSpherical].theta - this[$spherical].theta;\n const deltaPhi = this[$targetSpherical].phi - this[$spherical].phi;\n const deltaRadius = this[$targetSpherical].radius - this[$spherical].radius;\n const distance = magnitude(deltaTheta, deltaPhi, deltaRadius);\n const frames = delta / FRAME_MILLISECONDS;\n // Velocity represents a scale along [0, 1] that changes based on the\n // acceleration constraint. We only \"apply\" velocity when accelerating.\n // When decelerating, we apply dampening exclusively.\n const applyVelocity = distance > this[$options].decelerationMargin;\n const nextVelocity = Math.min(this[$velocity] + this[$options].acceleration * frames, 1.0);\n if (applyVelocity) {\n this[$velocity] = nextVelocity;\n }\n else if (this[$velocity] > 0) {\n this[$velocity] = Math.max(nextVelocity, 0.0);\n }\n const scale = this[$dampeningFactor] *\n (applyVelocity ? this[$velocity] * frames : frames);\n const scaledDeltaTheta = deltaTheta * scale;\n const scaledDeltaPhi = deltaPhi * scale;\n const scaledDeltaRadius = deltaRadius * scale;\n let incrementTheta = step(ORBIT_STEP_EDGE, Math.abs(scaledDeltaTheta)) * scaledDeltaTheta;\n let incrementPhi = step(ORBIT_STEP_EDGE, Math.abs(scaledDeltaPhi)) * scaledDeltaPhi;\n let incrementRadius = step(ORBIT_STEP_EDGE, Math.abs(scaledDeltaRadius)) * scaledDeltaRadius;\n // NOTE(cdata): If we evaluate enough frames at once, then there is the\n // possibility that the next incremental step will overshoot the target.\n // If that is the case, we just jump straight to the target:\n if (magnitude(incrementTheta, incrementPhi, incrementRadius) > distance) {\n incrementTheta = deltaTheta;\n incrementPhi = deltaPhi;\n incrementRadius = deltaRadius;\n }\n this[$spherical].theta += incrementTheta;\n this[$spherical].phi += incrementPhi;\n this[$spherical].radius += incrementRadius;\n // Derive the new camera position from the updated spherical:\n this[$spherical].makeSafe();\n this[$sphericalToPosition](this[$spherical], this.camera.position);\n this.camera.lookAt(this.target);\n // Dispatch change events only when the camera position changes due to\n // the spherical->position derivation:\n if (!this[$previousPosition].equals(this.camera.position)) {\n this[$previousPosition].copy(this.camera.position);\n this.dispatchEvent({ type: 'change' });\n }\n else {\n this[$targetSpherical].copy(this[$spherical]);\n }\n }", "speedFollow(conLerp, scene)\r\n {\r\n\r\n this.distanceFmCam = Phaser.Math.Distance.Between(scene.cameras.main.midPoint.x, scene.cameras.main.midPoint.y, this.player.x, this.player.y);\r\n\r\n\r\n\r\n if(this.distanceFmCam < 150 && conLerp <= 0.05)\r\n {\r\n conLerp -= 0.000000000001;\r\n scene.cameras.main.setLerp(conLerp);\r\n }else if( this.distanceFmCam > 150 && conLerp < 0.3){\r\n //set to 0.05 for glorious motion sickness\r\n conLerp += 0.06;\r\n scene.cameras.main.setLerp(conLerp);\r\n }else if (this.distanceFmCam > 400 && conLerp < 0.75){\r\n conLerp += -0.002;\r\n scene.cameras.main.setLerp(conLerp);\r\n this.playerCamera.shake(3000);\r\n }\r\n\r\n }", "function updateObjects(now) {\n // if in world space, calculate speed based on parent rotation\n var posFunction = (script.api.type == 1) ? \n function(obj) { return rotateVecByQuat(obj.speed, obj.rotOffset); } :\n function(obj) { return obj.speed; }\n\n // traverse the object array in reverse order so we can remove items as we go\n for (var i = script.api.objects.length - 1; i >= 0; i--) {\n var o = script.api.objects[i];\n var timeAlive = now - o.startTime;\n // if old, remove from scene and array\n if (timeAlive >= o.lifetime) {\n o.obj.destroy();\n script.api.objects.splice(i, 1);\n continue;\n }\n \n var oT = o.obj.getTransform();\n // position based on current position, speed, acceleration, and friction\n var f = Math.max(1 - script.api.frictionFactor*o.friction, 0);\n var speedOffset = posFunction(o).add(script.api.acceleration.uniformScale(timeAlive/1000)).uniformScale(f);\n var nPos = oT.getLocalPosition().add(speedOffset.uniformScale(script.api.timeSinceLastUpdate));\n if (script.api.type == 1 && script.api.collisionEnabled) {\n nPos.y = Math.max(nPos.y, 0);\n if (nPos.y == 0) o.friction++;\n }\n oT.setLocalPosition(nPos);\n\n // rotation based on current rotation, rotational speed, and friction\n oT.setLocalRotation(oT.getLocalRotation().multiply(\n quat.fromEulerVec(o.rotSpeed.uniformScale(f).uniformScale(script.api.timeSinceLastUpdate))\n ));\n\n // scale based on start and end values\n oT.setLocalScale(vec3.one().uniformScale((o.scale[1] - o.scale[0])*(timeAlive / o.lifetime) + o.scale[0]));\n\n // fade in\n if (timeAlive < script.api.fade.x) {\n var alpha = timeAlive / script.api.fade.x;\n o.materials.forEach(function(mat) {\n var color = mat.mainPass.baseColor;\n color.w = alpha;\n mat.mainPass.baseColor = color;\n });\n }\n // fade out\n else if (o.lifetime - timeAlive < script.api.fade.y) {\n var alpha = (o.lifetime - timeAlive) / script.api.fade.y;\n o.materials.forEach(function(mat) {\n var color = mat.mainPass.baseColor;\n color.w = alpha;\n mat.mainPass.baseColor = color;\n });\n }\n }\n}", "static LerpColor(a, b, t) {\n return new b2.Color(Fracker.Lerp(a.r, b.r, t), Fracker.Lerp(a.g, b.g, t), Fracker.Lerp(a.b, b.b, t));\n }", "update() {\n if (state.current.moving) {\n updateOnMove.map((object) => object.update());\n }\n }", "static LerpToRef(left, right, amount, result) {\n result.r = left.r + (right.r - left.r) * amount;\n result.g = left.g + (right.g - left.g) * amount;\n result.b = left.b + (right.b - left.b) * amount;\n result.a = left.a + (right.a - left.a) * amount;\n }", "function rigidLerp (T1, T2, lambda) {\n lambda = clamp(lambda, 0, 1);\n let t1 = new J3DIVector3(T1.$matrix.m41, T1.$matrix.m42, T1.$matrix.m43);\n let R1 = new J3DIMatrix4(T1);\n R1.$matrix.m41 = 0;\n R1.$matrix.m42 = 0;\n R1.$matrix.m43 = 0;\n let t2 = new J3DIVector3(T2.$matrix.m41, T2.$matrix.m42, T2.$matrix.m43);\n let R2 = new J3DIMatrix4(T2);\n R2.$matrix.m41 = 0;\n R2.$matrix.m42 = 0;\n R2.$matrix.m43 = 0;\n let invR1 = new J3DIMatrix4(R1).transpose();\n let invR2 = new J3DIMatrix4(R2).transpose();\n t1.multVecMatrix(invR1).multiply(1 - lambda);\n t2.multVecMatrix(invR2).multiply(lambda);\n let t = new J3DIVector3(t1);\n t.add(t2);\n let a = invR1.multiply(R2).loghat().multiply(lambda);\n let lerp = new J3DIMatrix4(R1);\n lerp.multiply(a.exphat());\n t.multVecMatrix(lerp);\n lerp.$matrix.m41 = t[0];\n lerp.$matrix.m42 = t[1];\n lerp.$matrix.m43 = t[2];\n return lerp;\n}", "function UpdateMotion(t)\n{\n var i, obj;\n\n for (i in ph_objects)\n {\n obj = ph_objects[i];\n // Update position\n vec2.scaleAndAdd(obj.pos, obj.pos, obj.vel, t);\n // Update rotation\n obj.rot += obj.rot_vel * t;\n }\n\n // TODO: Check if this works with splice below\n for (i in ph_particles)\n {\n obj = ph_particles[i];\n\n // Check 'dead' status\n if (obj.dead)\n {\n ph_particles.splice(i, 1);\n }\n else\n {\n // Update position\n vec2.scaleAndAdd(obj.pos, obj.pos, obj.vel, t);\n }\n }\n}", "function lerp(a, b, x) {\n return (a + x * (b - a));\n}", "function lerp(t, minval, maxval) {\n return minval + t* (maxval - minval);\n}", "update(t){\r\n this.movingObject.update();\r\n this.fish.update(t);\r\n this.waterSurface.update(t);\r\n this.algaeSet.update(t);\r\n this.checkKeys();\r\n }", "on_tick(args) {\n\n\t\t// Find a destination to go to if any\n\n\t\tlet destiny = 0\n\n\t\tif(this.destination === \"string\") {\n\t\t\tlet mesh = blox.query({name:this.destination,property:isObject3D})\n\t\t\tif(mesh) {\n\t\t\t\tdestiny = mesh.position.clone()\n\t\t\t}\n\t\t} else {\n\t\t\tthis.destination = new THREE.Vector3(props.destination.x,props.destination.y,props.destination.z)\n\t\t}\n\n\t\t// TODO - modulate that destination by any high level rules, such as be on ground\n\n\t\t// TODO - figure out forces to go from current position to destination at current rate of movement\n\n\t\t// OLD:\n\n\t\t// dampen linear movement by friction\n\t\tthis.linear.x = this.linear.x * this.friction\n\t\tthis.linear.y = this.linear.y * this.friction\n\t\tthis.linear.z = this.linear.z * this.friction\n\n\t\t// add force to object\n\t\tthis.position.add(this.linear)\n\n\t\tif(this.mesh) {\n\t\t\tthis.mesh.position.set(this.position.x,this.position.y,this.position.z)\n\t\t}\n\t}", "function lerp(x, y, a) {\n //x×(1−a)+y×a\n var b = a / 0.50;\n return y * (1.0 - b) + x * b;\n}", "updateObjectDirections() {\n for (let aniObj of this.state.animatedObjects) {\n aniObj.updateDirection();\n }\n }", "function lerp(a, b, proportion) { return a + (b-a)*proportion; }", "updateSteeringTargetOfPlayers() {\n\n\t\tconst players = this.children;\n\n\t\tfor ( let i = 0, l = players.length; i < l; i ++ ) {\n\n\t\t\tconst player = players[ i ];\n\n\t\t\tif ( player.role !== ROLE.GOALKEEPER ) {\n\n\t\t\t\tif ( player.stateMachine.in( FIELDPLAYER_STATES.WAIT ) || player.stateMachine.in( FIELDPLAYER_STATES.RETURN_HOME ) ) {\n\n\t\t\t\t\tplayer.steeringTarget.copy( player.getHomeRegion().center );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function resolvePropertiesInKeyframes(source, target, ctx) {\n var len = source.length;\n for (var i = 0; i < len; i++) {\n var sourceKeyframe = source[i];\n var targetKeyframe = {};\n for (var propertyName in sourceKeyframe) {\n if (!sourceKeyframe.hasOwnProperty(propertyName)) {\n continue;\n }\n var sourceValue = sourceKeyframe[propertyName];\n if (!type_8.isDefined(sourceValue)) {\n continue;\n }\n targetKeyframe[propertyName] = objects_2.resolve(sourceValue, ctx);\n }\n normalizeProperties(targetKeyframe);\n target.push(targetKeyframe);\n }\n }", "updateR() {\n if (this.lastRUpdate==0 || globalUpdateCount - this.lastRUpdate >= DAY_LENGTH) {\n let pts = this.fields.map(f => f.pts).reduce((acc, pts) => acc.concat(pts), [])\n pts.push(...this.sender.objs.map(o => o.point))\n \n let nInfectious = 0\n const val = pts\n .map(pt => {\n if (pt.isInfectious()) {\n nInfectious += 1\n const timeInfectious = globalUpdateCount - pt.lastStatusUpdate + (pt.status == Point.INFECTIOUS2) ? Point.infectious1Interval : 0\n if (timeInfectious>0) {\n const timeRemaining = Point.infectious2Interval + Point.infectious1Interval - timeInfectious\n return pt.nInfected/timeInfectious*timeRemaining // estimated infections over duration of illness\n } else return 0\n } else return 0\n })\n .reduce((sum, ei) => sum + ei)\n \n if (nInfectious>0) {\n this.rVal = val/nInfectious\n this.rMax = this.rMax < this.rVal ? this.rVal : this.rMax\n } else this.rVal = 0\n this.lastRUpdate = globalUpdateCount\n }\n }", "function lerp(x, x1, x2, v1, v2) {\n return ((x2 - x) / (x2 - x1)) * v1 + ((x - x1) / (x2 - x1)) * v2;\n}", "function update() {\n //Update gameObjects\n for (const goID in sp.gameObjects) {\n let obj = sp.gameObjects[goID];\n\n //Update the object\n obj.update();\n //Apply collisions and all things that might keep the player in the air\n obj.applyPlatformCollision(sp.platforms);\n //If the player shoud get gravity, apply it. Collisions can disable gravity for a frame\n if (obj.shouldGetGravity) {\n obj.applyGravity(sp.gravity);\n }\n }\n }", "function lerp(a,b,t) {\n\n\t\t//x axis\n\t\tvar x = a.x + t * (b.x - a.x);\n\n\t\t//y axis\n\t\tvar y = a.y + t * (b.y - a.y);\n\n\t\tvar ret = new Vector2();\n\t\tret.x = x;\n\t\tret.y = y;\n\n\t\treturn ret;\n\n\t}", "function updateFromLps() {\n\tstate.larvae += state.lps*0.05;\n}", "function lerp(a, b, x) {\n\treturn a+x*(b-a);\n}", "function lerp(a0, a1, w) {\n return (1.0 - w)*a0 + w*a1;\n }", "travelTo(gameObjectTravelling, finalPosition, time, parameters) {\n const _from = {\n x: gameObjectTravelling.position.x,\n y: gameObjectTravelling.position.y,\n z: gameObjectTravelling.position.z\n };\n\n const _to = {\n x: finalPosition.x,\n y: finalPosition.y,\n z: finalPosition.z\n };\n\n const _easing =\n parameters && parameters.easing\n ? parameters.easing\n : TWEEN.Easing.Linear.None;\n const _target = parameters && parameters.target ? parameters.target : false;\n\n const tween = new TWEEN.Tween(_from)\n .to(_to, time)\n .easing(_easing)\n .onUpdate(function() {\n gameObjectTravelling.position.set(_from.x, _from.y, _from.z);\n if (_target) {\n gameObjectTravelling.lookAt(_target);\n }\n })\n .onComplete(function() {\n // TODO: emit event or dispatch to redux\n })\n .start();\n }", "function biLerpParam (param, wthrIdx, lng, lat, pressure, lowLng, highLng, lowLat, highLat) {\n\n var corners_ll = weatherData[wthrIdx].getValue(lowLat, lowLng, pressure, param);\t\n var corners_lr = weatherData[wthrIdx].getValue(lowLat, highLng, pressure, param);\t\n var corners_ul = weatherData[wthrIdx].getValue(highLat, lowLng, pressure, param);\t\n var corners_ur = weatherData[wthrIdx].getValue(highLat, highLng, pressure, param);\t\n\t\t\t\t\t\t //biLerp(x, y, v11, v12, v21, v22, x1, x2, y1, y2) \n return biLerp(lng, lat, corners_ll, corners_lr, corners_ul, corners_ur, lowLng, highLng, lowLat, highLat);\n}", "reassignValues (time) {\n const { _valuesStart, object, _delayTime } = this;\n\n this._isPlaying = true;\n this._startTime = time !== undefined ? time : now();\n this._startTime += _delayTime;\n this._reversed = false;\n add(this);\n\n for (const property in _valuesStart) {\n const start = _valuesStart[property];\n\n object[property] = start;\n }\n\n return this\n }", "function handleRotorSpeed(newValue)\n{\n rot = newValue;\n r = rot * 0.8;\t\n PIErender();\n}", "function Update (obj) {\n return function update (state, ev) {\n var fn = obj[Ev.type(ev)];\n return fn(state[Ev.type(ev)], Ev.data(ev));\n };\n}", "calculate_g(objects, delta) {\n let gSum = new THREE.Vector3();\n let sumedVelocityFromAccelaration = new THREE.Vector3();\n //summ all gs\n for (let i = 0; i < objects.length; i++) {\n if (objects[i] != this) {\n let distance = this.distance(objects[i]) * 1000000000; // convert units to meters\n let g = G * objects[i].mass / Math.pow(distance, 2);\n let accelarationVector = this.directionVectorToOther(objects[i]); //normal vector to the object\n accelarationVector.multiplyScalar(g);\n gSum.add(accelarationVector);\n }\n }\n if (params.showArrows) {\n this.gravityArrow = new THREE.ArrowHelper(gSum.clone().normalize(), this.mesh.position, gSum.length() + this.r + 50, 0x00ff00);\n scene.add(this.gravityArrow);\n }\n sumedVelocityFromAccelaration = gSum.clone();\n sumedVelocityFromAccelaration.multiplyScalar(delta); // sec\n let newGravVel = new THREE.Vector3();\n newGravVel = newGravVel.addVectors(this.gravityVelocityVector.clone(), sumedVelocityFromAccelaration);\n if (params.showArrows) {\n this.gVelArrow = new THREE.ArrowHelper(newGravVel.clone().normalize(), this.mesh.position, newGravVel.length() / 100 + this.r * 2, 0x00ffff);\n scene.add(this.gVelArrow);\n }\n let test = this.directionVectorToOther(objects[0]);\n test.multiplyScalar(100);\n newGravVel.divideScalar(1);\n this.gravityVelocityVector = newGravVel;\n return gSum;\n }", "bounceOffSurface(o, s) {\n //Add collision properties\n if (!o._bumpPropertiesAdded)\n this.addCollisionProperties(o);\n let dp1, dp2, p1 = { vx: undefined, vy: undefined }, p2 = { vx: undefined, vy: undefined }, bounce = { x: undefined, y: undefined }, mass = o.mass || 1;\n //1. Calculate the collision surface's properties\n //Find the surface vector's left normal\n s.lx = s.y;\n s.ly = -s.x;\n //Find its magnitude\n s.magnitude = Math.sqrt(s.x * s.x + s.y * s.y);\n //Find its normalized values\n s.dx = s.x / s.magnitude;\n s.dy = s.y / s.magnitude;\n //2. Bounce the object (o) off the surface (s)\n //Find the dot product between the object and the surface\n dp1 = o.vx * s.dx + o.vy * s.dy;\n //Project the object's velocity onto the collision surface\n p1.vx = dp1 * s.dx;\n p1.vy = dp1 * s.dy;\n //Find the dot product of the object and the surface's left normal (s.lx and s.ly)\n dp2 = o.vx * (s.lx / s.magnitude) + o.vy * (s.ly / s.magnitude);\n //Project the object's velocity onto the surface's left normal\n p2.vx = dp2 * (s.lx / s.magnitude);\n p2.vy = dp2 * (s.ly / s.magnitude);\n //Reverse the projection on the surface's left normal\n p2.vx *= -1;\n p2.vy *= -1;\n //Add up the projections to create a new bounce vector\n bounce.x = p1.vx + p2.vx;\n bounce.y = p1.vy + p2.vy;\n //Assign the bounce vector to the object's velocity\n //with optional mass to dampen the effect\n o.vx = bounce.x / mass;\n o.vy = bounce.y / mass;\n }", "function setupTweenBackwards()\n{\n var tempTweenObjectsArray = [];\n\n var tempTweenArray = [];\n\n // Change easing type\n var easingType = global.tweenManager.getSwitchedEasingType( script.easingType );\n\n for ( var i = 0; i < script.api.tween.length; i++)\n {\n var tween = script.api.tweenObjects[i];\n\n var newTween = new TWEEN.Tween((script.loopType == 3) ? tween.startValue : tween.endValue)\n .to( (script.loopType == 3) ? tween.endValue : tween.startValue, script.api.time * 1000.0 )\n .delay( script.delay * 1000.0 )\n .easing( global.tweenManager.getTweenEasingType( script.easingFunction, easingType ) )\n .onUpdate( updateColorComponent(tween.component) );\n\n var newTweenObject = null;\n\n if ( newTween )\n {\n // Configure the type of looping based on the inputted parameters\n global.tweenManager.setTweenLoopType( newTween, script.api.loopType );\n\n newTweenObject = {\n \"tween\": newTween,\n \"startValue\": {\n \"r\": (script.loopType == 3) ? tween.startValue.r : tween.endValue.r,\n \"g\": (script.loopType == 3) ? tween.startValue.g : tween.endValue.g,\n \"b\": (script.loopType == 3) ? tween.startValue.b : tween.endValue.b,\n \"a\": (script.loopType == 3) ? tween.startValue.a : tween.endValue.a\n },\n \"endValue\": {\n \"r\": (script.loopType == 3) ? tween.endValue.r : tween.startValue.r,\n \"g\": (script.loopType == 3) ? tween.endValue.g : tween.startValue.g,\n \"b\": (script.loopType == 3) ? tween.endValue.b : tween.startValue.b,\n \"a\": (script.loopType == 3) ? tween.endValue.a : tween.startValue.a\n },\n \"component\": tween.component\n };\n\n // Save reference to tween\n tempTweenObjectsArray.push(newTweenObject);\n\n tempTweenArray.push(newTween);\n\n }\n else\n {\n print( \"Tween Color: Tween Manager not initialized. Try moving the TweenManager script to the top of the Objects Panel or changing the event on this TweenType to \\\"Lens Turned On\\\".\" );\n return;\n }\n }\n\n return tempTweenArray;\n\n}", "define (lerpValues, duration, transition = Transition.EaseOut, style = Style.Quadratic)\n {\n this.lerpValues = lerpValues;\n\n this.duration = duration;\n this.currentTime = 0;\n\n this.transition = transition;\n this.style = style;\n\n this.clientCallback = null;\n }", "function updateFortification(obj) {\n if(simType == 2 || simType == 3) {\n return;\n }\n if(typeof obj == \"object\") {\n var castleLevel = $(obj).attr(\"rel\");\n } else {\n var castleLevel = obj;\n }\n if ($(\"#simulator-parameters-bottom\").find(\".FORT\").val() < fortification[castleLevel]) {\n $(\"#simulator-parameters-bottom\").find(\".FORT\").val(fortification[castleLevel]);\n $(\"#simulator-parameters-bottom\").find(\".FORT\").mouseenter(function() {\n Tip3(paramsAutoCalcTip);\n });\n }\n}", "function updateT(color, t) {\n var a = _consts__WEBPACK_IMPORTED_MODULE_0__.MAX_COLOR_ALPHA - t;\n return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, color), { t: t,\n a: a, str: (0,_rgbaOrHexString__WEBPACK_IMPORTED_MODULE_2__._rgbaOrHexString)(color.r, color.g, color.b, a, color.hex) });\n}", "function resolveMotionValue(value) {\n var unwrappedValue = value instanceof MotionValue ? value.get() : value;\n return isCustomValue(unwrappedValue)\n ? unwrappedValue.toValue()\n : unwrappedValue;\n}", "function invLerp(v1, v2, v) {\n return (v - v1) / (v2 - v1);\n}", "function lerpVector3( v0, v1, progress ) {\n\treturn new THREE.Vector3( v0.x+(v1.x-v0.x)*progress, v0.y+(v1.y-v0.y)*progress, v0.z+(v1.z-v0.z)*progress );\n}", "update() {\n let alpha = -gravity * (2 * this.p.mass + this.childPendulum.mass) * sin(this.p.angle) - this.childPendulum.mass * gravity * sin(this.p.angle - 2 * this.childPendulum.angle) - 2 * sin(this.p.angle - this.childPendulum.angle) * this.childPendulum.mass * (this.childPendulum.aVelocity * this.childPendulum.aVelocity * this.childPendulum.r + this.p.aVelocity * this.p.aVelocity * this.p.r * cos(this.p.angle - this.childPendulum.angle));\n\n let beta = this.p.r * (2 * this.p.mass + this.childPendulum.mass - this.childPendulum.mass * cos(2 * this.p.angle - 2 * this.childPendulum.angle));\n\n this.p.aAcceleration = alpha / beta;\n\n super.update();\n }", "function updateFillProps() {\n var _this2 = this;\n\n if (!props.fill || !props.animatedValue) return;\n\n props.animatedValue.addListener(function () {\n _this2.path.setNativeProps({\n fill: extractBrush(props.fill.__getAnimatedValue())\n });\n });\n }", "lerp(p, t) {\n const ref = Point.create(p);\n return new Point((1 - t) * this.x + t * ref.x, (1 - t) * this.y + t * ref.y);\n }", "updateRendererStateObject()\r\n {\r\n // copy keys and values of both subscription returned data into the renderer state so the renderer \r\n // state will fill up with the gathered and always upToDate values\r\n for(var key in this.lastChangedAvTransportData)\r\n {\r\n // check if value has changed or if new key is not existent, if so then we do emit an event with the key and value\r\n if(this.rendererState[key] != this.lastChangedAvTransportData[key])\r\n {\r\n this.logVerbose(key + \" has changed from '\" + this.rendererState[key] + \"' to '\" + this.lastChangedAvTransportData[key] + \"'\");\r\n this.emit(\"rendererStateKeyValueChanged\", this, key, this.rendererState[key], this.lastChangedAvTransportData[key], \"\");\r\n }\r\n this.rendererState[key]=this.lastChangedAvTransportData[key];\r\n }\r\n for(var key in this.lastChangedRenderingControlData)\r\n {\r\n // check if value has changed or if new key is not existent, if so then we do emit an event with the key and value\r\n if(this.rendererState[key] != this.lastChangedRenderingControlData[key])\r\n {\r\n this.logVerbose(key + \" has changed from '\" + this.rendererState[key] + \"' to '\" + this.lastChangedRenderingControlData[key] + \"'\");\r\n this.emit(\"rendererStateKeyValueChanged\", this, key, this.rendererState[key], this.lastChangedRenderingControlData[key], \"\");\r\n }\r\n this.rendererState[key]=this.lastChangedRenderingControlData[key];\r\n }\r\n }", "function revolve(body){\n if (body.pivot == null){\n return;\n }\n else{\n var x = Math.cos(TAU * getDayCompletion() * body.yearLength * speedMultiplier) * body.distanceFromParent;\n var z = Math.sin(TAU * getDayCompletion() * body.yearLength * speedMultiplier) * body.distanceFromParent;\n body.pivot.position.set(x, 0, z);\n for (var i = 0; i < body.children.length; i++){\n revolve(body.children[i]);\n }\n }\n}", "updateAmbientLightColor() {\n // Calculate the position on the gradient by looking at the time (0..1, 0.5 = 12:00)\n var h = (this.time.getHours() / 24) * 24;\n var m = this.time.getMinutes();\n\n // Calculate the time step taking minutes into accout aswell\n var hour = (0.5 * (h * 60 + m)) / 360;\n\n // Calculate a position on the gradient (the gradient goes from 0..24)\n var gradientPos = hour * 12;\n\n // Holds two gradient stops, a left one and a right one, encapsulating the gradient slice we're looking at\n var leftStop = -1;\n var rightStop = -1;\n\n // Find the stops by looking at the gradient's keys\n var gradientStops = Object.keys(AMBIENT_COLOR_GRADIENT);\n\n gradientStops.forEach(function(stopValue, stopIndex) {\n // Get the stop\n var stop = parseInt(stopValue);\n\n // Check if a next stop after this exists\n if ((stopIndex + 1) < gradientStops.length) {\n // Parse the next stop\n var nextStop = parseInt(gradientStops[stopIndex+1]);\n \n // Check if the gradient position is inside these boundaries\n if (gradientPos >= stop && gradientPos < nextStop) {\n leftStop = stop;\n rightStop = nextStop;\n }\n } \n // If no next stop exists, we arrived at the end of the gradient\n else {\n // We can loop back to the first gradient stop\n if (gradientPos >= stop) {\n leftStop = stop;\n rightStop = gradientStops[0];\n }\n }\n });\n\n // Get the colors from the two gradient stops\n var color1 = Phaser.Display.Color.ColorToRGBA(AMBIENT_COLOR_GRADIENT[leftStop]);\n var color2 = Phaser.Display.Color.ColorToRGBA(AMBIENT_COLOR_GRADIENT[rightStop]);\n\n // Calculate the interpolation factor which goes from 0..100 because we've taken 100 interpolation steps\n var interp = ((gradientPos - leftStop) / (rightStop - leftStop)) * 100;\n\n // Now interpolate and get the new color\n var newAmbientColor = Phaser.Display.Color.Interpolate.RGBWithRGB(color1.r, color1.g, color1.b, color2.r, color2.g, color2.b, 100, interp);\n\n // Apply the color to the scene's ambient light\n window.game.scene.lights.setAmbientColor(Phaser.Display.Color.GetColor(newAmbientColor.r, newAmbientColor.g, newAmbientColor.b));\n }", "animateFloat(object, property, from, to) {\n const keys = [{\n frame: 0,\n value: from,\n }, {\n frame: 100,\n value: to,\n }]\n\n const animation = new BABYLON.Animation(\n 'animation',\n property,\n 100,\n BABYLON.Animation.ANIMATIONTYPE_FLOAT,\n BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT,\n )\n animation.setKeys(keys)\n\n this.currentSceneObject.stopAnimation(object)\n object.animations.push(animation)\n object._scene.beginAnimation(object, 0, 100, false, 1, () => {})\n }", "updatePlanetSceneObj(planet) {\n\t\t//TODO what if planet.tex === undefined?\n\t\tplanet.sceneObj.shader = this.planetHeatMapAttrShader;\n\t\tplanet.sceneObj.texs.length = 2;\n\t\tplanet.sceneObj.texs[0] = planet.tex;\n\t\tplanet.sceneObj.texs[1] = this.hsvTex;\n\t\t\t\n\t\t//and update calculated variable if it is out of date ...\n\t\tif (planet.lastMeasureCalcDate !== cfg.julianDate) {\n\t\t\tplanet.lastMeasureCalcDate = cfg.julianDate;\n\n\t\t\tlet measureMin = undefined;\n\t\t\tlet measureMax = undefined;\n\t\t\tlet vertexIndex = 0;\n\t\t\tfor (let tideIndex = 0; tideIndex < planet.tideBuffer.data.length; ++tideIndex) {\n\t\t\t\tlet lat = planet.sceneObj.attrs.vertex.data[vertexIndex++];\n\t\t\t\tlet lon = planet.sceneObj.attrs.vertex.data[vertexIndex++];\nlet x = [];\n\t\t\t\tplanetGeodeticToSolarSystemBarycentric(x, planet, lat, lon, 0);\n\n\t\t\t\tlet t = cfg.calcMetricForce(x, planet);\n\n\t\t\t\tif (measureMin === undefined || t < measureMin) measureMin = t;\n\t\t\t\tif (measureMax === undefined || t > measureMax) measureMax = t;\n\t\t\t\tplanet.tideBuffer.data[tideIndex] = t;\n\t\t\t}\n\t\t\tplanet.measureMin = measureMin;\n\t\t\tplanet.measureMax = measureMax;\n\t\t\tfor (let i = 0; i < planet.tideBuffer.data.length; ++i) {\n\t\t\t\tplanet.tideBuffer.data[i] =\n\t\t\t\t\t(255/256 - (planet.tideBuffer.data[i] - measureMin)\n\t\t\t\t\t\t/ (measureMax - measureMin) * 254/256) * colorBarHSVRange;\n\t\t\t}\n\t\t\tplanet.tideBuffer.updateData();\n\t\t\t//if it updated...\n\t\t\tif (planet == cfg.orbitTarget) {\n\t\t\t\tcfg.refreshMeasureText();\n\t\t\t}\n\t\t}\n\t}", "function lerp_element(a, b, t) {\n\treturn a+t*(b-a);\n}", "function lerp(x1,y1,x2,y2,y3) {\n\t\tif(y2==y1) {\n\t\t\treturn false; //division by zero avoidance\n\t\t} else {\n\t\t\treturn ((y2-y3) * x1 + (y3-y1) * x2)/(y2-y1);\n\t\t}\n\t}", "lerp(value1, value2, amount) {\n amount = amount < 0 ? 0 : amount;\n amount = amount > 1 ? 1 : amount;\n return (1 - amount) * value1 + amount * value2;\n }", "function GameLoop(){\n player.update();\n // Move camera with player \n var camera_x = player.sprite.x - WINDOW_WIDTH/2;\n var camera_y = player.sprite.y - WINDOW_HEIGHT/2;\n game.camera.x += (camera_x - game.camera.x) * 0.08;\n game.camera.y += (camera_y - game.camera.y) * 0.08;\n \n // Each player is responsible for bringing their alpha back up on their own client \n // Make sure other players flash back to alpha = 1 when they're hit \n for(var id in other_players){\n if(other_players[id].alpha < 1){\n other_players[id].alpha += (1 - other_players[id].alpha) * 0.16;\n } else {\n other_players[id].alpha = 1;\n }\n }\n \n // Interpolate all players to where they should be \n for(var id in other_players){\n var p = other_players[id];\n if(p.target_x != undefined){\n p.x += (p.target_x - p.x) * 0.16;\n p.y += (p.target_y - p.y) * 0.16;\n // Intepolate angle while avoiding the positive/negative issue \n var angle = p.target_rotation;\n var dir = (angle - p.rotation) / (Math.PI * 2);\n dir -= Math.round(dir);\n dir = dir * Math.PI * 2;\n p.rotation += dir * 0.16;\n }\n }\n\n}", "function lerp(start, end, t){\n return start * (1-t) + end * t;\n}", "function update(obj) {\n obj.x += obj.vx;\n obj.y += obj.vy;\n if (obj.x > canvas.width + (maxDist / 2)) {\n obj.x = -(maxDist / 2);\n }\n else if (obj.xpos < -(maxDist / 2)) {\n obj.x = canvas.width + (maxDist / 2);\n }\n if (obj.y > canvas.height + (maxDist / 2)) {\n obj.y = -(maxDist / 2);\n }\n else if (obj.y < -(maxDist / 2)) {\n obj.y = canvas.height + (maxDist / 2);\n }\n }", "static Lerp(left, right, amount) {\n const result = new Color4(0.0, 0.0, 0.0, 0.0);\n Color4.LerpToRef(left, right, amount, result);\n return result;\n }", "function apply_gravity(){\r\n for (let b = 0; b < balls.length; b++){\r\n balls[b].vy += gravity * time_delta_s;\r\n }\r\n}", "function update() {\n maxspeed = defaultSpeed * deltaTime * globalSpeed;\n maxforce = defaultForce * deltaTime * globalSpeed;\n // Update velocity\n velocity.add(acceleration);\n // Limit speed\n velocity.clampLength(0, maxspeed);\n obj.position.add(velocity);\n // Reset accelertion to 0 each cycle\n acceleration.multiplyScalar(0);\n }", "update(t) {\r\n this.vehicle.v = this.vehicleSpeed * this.speedFactor;\r\n this.vehicle.update(t, this.freezeVehiclePos);\r\n }", "function tween() {\n if (player['newx'] !== player['x']) {\n var diffx = Math.abs(player['x'] - player['newx']);\n\n if (player['newx'] > player['x']) {\n player['tweenx'] += TWEENSPEED;\n if (Math.abs(player['tweenx']) > TILESIZE * diffx) {\n player['x'] = player['newx'];\n player['tweenx'] = 0;\n }\n }\n else if (player['newx'] < player['x']) {\n player['tweenx'] -= TWEENSPEED;\n if (Math.abs(player['tweenx']) > TILESIZE * diffx) {\n player['x'] = player['newx'];\n player['tweenx'] = 0;\n }\n }\n }\n if (player['newy'] !== player['y']) {\n var diffy = Math.abs(player['y'] - player['newy']);\n\n if (player['newy'] > player['y']) {\n player['tweeny'] += TWEENSPEED;\n if (Math.abs(player['tweeny']) > TILESIZE * diffy) {\n player['y'] = player['newy'];\n player['tweeny'] = 0;\n }\n }\n else if (player['newy'] < player['y']) {\n player['tweeny'] -= TWEENSPEED;\n if (Math.abs(player['tweeny']) > TILESIZE * diffy) {\n player['y'] = player['newy'];\n player['tweeny'] = 0;\n }\n }\n }\n}", "@autobind\n updateColorTime (event, opacity=true) {\n var r = 0;\n var g = 0;\n var b = 0;\n\n for (var i=0, i3=0, l=this.particleCount; i<l; i++, i3 += 3) {\n if (opacity) {\n if (this.opacityArray[i] < 1) {\n this.opacityArray[i] += 0.01;\n if (this.opacityArray[i] > 1) {\n this.opacityArray[i] = 1;\n }\n }\n }\n\n r = this.colorsTargetArray[i3 + 0] - this.colorsArray[i3 + 0];\n g = this.colorsTargetArray[i3 + 1] - this.colorsArray[i3 + 1];\n b = this.colorsTargetArray[i3 + 2] - this.colorsArray[i3 + 2];\n\n this.colorsArray[i3 + 0] += r * this.tweenContainer.colorTime;\n this.colorsArray[i3 + 1] += g * this.tweenContainer.colorTime;\n this.colorsArray[i3 + 2] += b * this.tweenContainer.colorTime;\n }\n\n this.material.uniforms[ 'colortime' ].value = this.tweenContainer.colorTime;\n this.material2.uniforms[ 'colortime' ].value = this.tweenContainer.colorTime;\n }", "updateDelta() {\n this.uniforms.delta.x = 0.1\n this.uniforms.delta.y = 0\n }", "animate() {\n // interpolate values\n var translation = this.lerp(this.translation, this.currentPosition, this.options.easing);\n\n // apply our translation\n this.translateSlider(translation);\n\n this.animationFrame = requestAnimationFrame(this.animate.bind(this));\n }", "lerpAngle (a, b, t) {\n\n let difference = Math.abs(b - a);\n\n if (difference > Math.PI) {\n // We need to add on to one of the values.\n if (b > a) {\n // We'll add it on to start...\n a += 2*Math.PI;\n } else {\n // Add it on to end.\n b += 2*Math.PI;\n }\n }\n\n // Interpolate it.\n let value = this.lerp(a, b, t);\n\n // Wrap it..\n let rangeZero = 2*Math.PI;\n\n if (value >= 0 && value <= 2*Math.PI)\n return value;\n\n return (value % rangeZero);\n\n }", "updateShaders(time, obj) {\r\n\r\n let shader, x;\r\n\r\n obj = obj || {};\r\n\r\n for (x = 0; shader = this.runningShaders[x++];) {\r\n\r\n for (let uniform in obj.uniforms) {\r\n if (uniform in shader.material.uniforms) {\r\n shader.material.uniforms[uniform].value = obj.uniforms[uniform];\r\n }\r\n }\r\n\r\n if ('cameraPosition' in shader.material.uniforms && this.mainCamera) {\r\n\r\n shader.material.uniforms.cameraPosition.value = this.mainCamera.position.clone();\r\n\r\n }\r\n\r\n if ('viewMatrix' in shader.material.uniforms && this.mainCamera) {\r\n\r\n shader.material.uniforms.viewMatrix.value = this.mainCamera.matrixWorldInverse;\r\n\r\n }\r\n\r\n if ('time' in shader.material.uniforms) {\r\n\r\n shader.material.uniforms.time.value = time;\r\n\r\n }\r\n\r\n }\r\n\r\n }", "updateDynamicProperties(context) {\n var _a, _b;\n let somethingChanged = false;\n if (this.m_dynamicProperties.length > 0) {\n let updateBaseColor = false;\n for (const [propName, propDefinition] of this.m_dynamicProperties) {\n const newValue = harp_datasource_protocol_1.Expr.isExpr(propDefinition)\n ? harp_datasource_protocol_1.getPropertyValue(propDefinition, context.env)\n : propDefinition(context);\n if (newValue === this.currentStyledProperties[propName]) {\n continue;\n }\n this.currentStyledProperties[propName] = newValue;\n // `color` and `opacity` are special properties to support RGBA\n if (propName === \"color\" || propName === \"opacity\") {\n updateBaseColor = true;\n }\n else {\n this.applyMaterialGenericProp(propName, newValue);\n somethingChanged = true;\n }\n }\n if (updateBaseColor) {\n const color = (_a = this.currentStyledProperties.color) !== null && _a !== void 0 ? _a : 0xff0000;\n const opacity = (_b = this.currentStyledProperties.opacity) !== null && _b !== void 0 ? _b : 1;\n this.applyMaterialBaseColor(color, opacity);\n somethingChanged = true;\n }\n }\n return somethingChanged;\n }" ]
[ "0.712549", "0.5439802", "0.5407007", "0.53918153", "0.52628845", "0.52441394", "0.52203596", "0.5194479", "0.5170766", "0.51698256", "0.50672144", "0.49962673", "0.49778146", "0.49462998", "0.49318582", "0.4916775", "0.489351", "0.48728788", "0.48521623", "0.48360083", "0.48298216", "0.47849274", "0.47843185", "0.47830757", "0.4746187", "0.47336218", "0.47256655", "0.47208676", "0.47119638", "0.47117257", "0.47077715", "0.46958968", "0.46816576", "0.46431813", "0.46363232", "0.46351704", "0.46252713", "0.46244448", "0.46232972", "0.46204093", "0.4619162", "0.45915848", "0.45863256", "0.45732635", "0.45713848", "0.45693418", "0.4557377", "0.4556817", "0.454702", "0.45460844", "0.4540369", "0.45280728", "0.45164827", "0.45077196", "0.45067877", "0.45027238", "0.4473145", "0.44497123", "0.44479704", "0.44456822", "0.44438627", "0.44418186", "0.44350645", "0.44333678", "0.44217125", "0.44049788", "0.43983397", "0.43979806", "0.4397967", "0.43923643", "0.43778017", "0.43769667", "0.43749338", "0.43699437", "0.43685365", "0.43622527", "0.43621475", "0.43616372", "0.4360305", "0.43582296", "0.43548542", "0.43523625", "0.43519348", "0.43449304", "0.43440104", "0.43435183", "0.43408933", "0.43386677", "0.43317816", "0.43270394", "0.43244877", "0.43241048", "0.43240035", "0.43233153", "0.43180352", "0.4315825", "0.43143743", "0.43091866", "0.43083718", "0.43070707" ]
0.72863024
0
add targetStep, but not resolve targetStep's outgoing target
function _parseNext(nodes, step, refs) { const output = []; if(step.isEnd){ return output; } if(!step.out || !step.out.length) throw `node ${step.id} have no outputs`; step.out.forEach(line=>{ const lineNode = _findLine(nodes, line.id); if(!lineNode) throw `no sequenceFlow ${line.id}`; const target = _findLineTarget(nodes, lineNode); let targetStep; targetStep = refs.find(r=>r.id == target.task.id); if(!targetStep) { if(!target.task.name) throw `all step must has name, but ${target.task.id} not`; for(const ref = refs.find(r=>r.name == target.task.name); ref ;){ throw `name ${target.name} have been used by node ${ref.id}`; } const props = {id:target.task.id, in:[], out:[], node:target.task}; if (target.isEnd) targetStep = new EndStep(props); else if (target.isServiceTask) targetStep = new ServiceStep(props); else if (target.isReceiveTask) { const msg = nodes.bpmn_message.find(n=>n.id==target.task.messageRef); if(!msg) throw `can not find message ${target.task.messageRef} definition`; if(!msg.name) throw `message ${target.task.messageRef} not have name`; props.message = msg.name; targetStep = new ReceiveStep(props); } else if (target.isExclusiveGateway) targetStep = new ExclusiveStep(props); else if (target.isParallelGateway) targetStep = new ParallelStep(props); else throw 'unknown step type'; output.push(targetStep); refs.push(targetStep); targetStep.in = []; targetStep.out = []; if(target.task.bpmn_outgoing) { targetStep.out = target.task.bpmn_outgoing.map(f => { const targetStepOutLine = _findLine(nodes, f); if (!targetStepOutLine) throw `no sequenceFlow ${f}`; return new Line({ id: f, in: targetStep, exp: targetStepOutLine.bpmn_conditionExpression && targetStepOutLine.bpmn_conditionExpression['#text'] }); }); } } line.out = targetStep; targetStep.in.push(line); }); return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTarget() {\n throw new Error('Extend the addTarget method to add your plugin to another plugin\\'s target');\n }", "async addAutoPassStep(silo, targetObj) {\n const stepId = await this.knexConnectionAsync.insert([{\n currentSiloId: silo.dbId,\n ruleSetName: 'autoPass',\n priority: 1000, // A low priority, as unless testing something these will always be run last\n ruleSetParams: null, // autoPass rules take no params and never will\n onPassSiloId: targetObj.dbId,\n onFailSiloId: null // autoPass rules cannot fail, even when this feature is implemented\n }], 'stepId').into('core.step');\n\n await this.knexConnectionAsync.insert([{\n stepId: stepId[0],\n onPassSiloId: targetObj.dbId,\n label: 'yes'\n }], 'stepId').into('core.step_passingSilos');\n }", "afterTarget () {\n // stub\n console.log(`[${this.name}] Added target.`);\n }", "addStep(step) {\r\n let run;\r\n if (typeof step === 'function') {\r\n run = step;\r\n }\r\n else if (typeof step.getSteps === 'function') {\r\n // getSteps is to enable support open slots\r\n // where devs can add multiple steps into the same slot name\r\n let steps = step.getSteps();\r\n for (let i = 0, l = steps.length; i < l; i++) {\r\n this.addStep(steps[i]);\r\n }\r\n return this;\r\n }\r\n else {\r\n run = step.run.bind(step);\r\n }\r\n this.steps.push(run);\r\n return this;\r\n }", "addLoadBalancerTarget(props) {\n if (this.targetType !== undefined && this.targetType !== props.targetType) {\n throw new Error(`Already have a of type '${this.targetType}', adding '${props.targetType}'; make all targets the same type.`);\n }\n this.targetType = props.targetType;\n if (this.targetType === enums_1.TargetType.LAMBDA && this.targetsJson.length >= 1) {\n throw new Error('TargetGroup can only contain one LAMBDA target. Create a new TargetGroup.');\n }\n if (props.targetJson) {\n this.targetsJson.push(props.targetJson);\n }\n }", "addTarget(id) {\n if (!this.targetQueue.includes(id)) {\n this.targetQueue.push(id);\n }\n this.target = getPlayerById(this.targetQueue[0]);\n this.printCurrentTarget();\n }", "function addTarget(shape) {\n // Make sure the shape is correctly formatted\n if (\n shape &&\n shape.type &&\n shape.type == \"poly\" &&\n typeof shape.points == \"undefined\"\n )\n return false;\n\n let id = GC.target_counter++;\n\n var target = { id: id, shape: shape };\n if (GC.tabs[GC.selected_tab].length > 0) {\n // if there are targets, copy the values from last one\n // to simplify adding linear actors\n\n var last_index = GC.tabs[GC.selected_tab].length - 1;\n var type = GC.tabs[GC.selected_tab][last_index].type;\n var actor = GC.tabs[GC.selected_tab][last_index].actor;\n target.type = type;\n target.actor = actor;\n } else {\n //target.type = \"Linear\"\n target.actor = \"Hover\"\n }\n\n if (shape.type && shape.type == \"poly\") {\n let polygon = [];\n for (let i = 0; i < shape.points.length; i++) {\n polygon.push([shape.points[i].x, shape.points[i].y]);\n }\n let center = polylabel([polygon])\n shape.centerX = center[0];\n shape.centerY = center[1];\n }\n\n let name = \"Target \" + id;\n target.name = name;\n target.description = \"Description\";\n target.childof = \"Parent\"\n GC.tabs[GC.selected_tab].push(target);\n\n // add this new target to the selected targets\n GC.selected_targets = [target];\n}", "makeTarget() {\n this.type = Node.TARGET;\n this.state = null;\n }", "startWithTarget(target) {\n this.originalTarget = target;\n this.target = target;\n }", "maybeStep(step) {\n let result = step.apply(this.doc);\n if (!result.failed)\n this.addStep(step, result.doc);\n return result;\n }", "startWithTarget(target) {\n this.originalTarget = target;\n this.target = target;\n }", "addStep(name, step) {\r\n let found = this._findStep(name);\r\n if (found) {\r\n let slotSteps = found.steps;\r\n // prevent duplicates\r\n if (!slotSteps.includes(step)) {\r\n slotSteps.push(step);\r\n }\r\n }\r\n else {\r\n throw new Error(`Invalid pipeline slot name: ${name}.`);\r\n }\r\n }", "addPipelineStep(name, step) {\r\n if (step === null || step === undefined) {\r\n throw new Error('Pipeline step cannot be null or undefined.');\r\n }\r\n this.pipelineSteps.push({ name, step });\r\n return this;\r\n }", "function tH_addStep_fx2() {\n tH.setDefaultAddNext()\n\n fx()\n tH.resetDefaultAddNext();\n }", "function addDependency(source, target, reason) {\n operateOnDependency(DependencyOperation.ADD, source, target, reason);\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "@action\n skipStep() {\n let step = this.currentStep.next;\n let skipToStep = this.currentStep.skip;\n\n while (step !== skipToStep) {\n this.skippedSteps.push(step);\n step = this.steps[step].next;\n }\n\n this.step = step;\n }", "function addTargetsToLineItem(){\r\n\tif (validateAddTargets()) {\r\n\t\tvar valueToPrint = \"\";\r\n\t\tvar selectedElements = [];\r\n\t\tvar level = \"--\";\r\n\t\tvar not= \"--\";\r\n\t\tvar operation = \"--\";\r\n\t\tvar previousRowId = $(\"#geoTargetsummary\" , \"#lineItemTargeting\").find(\"tr:last\").attr(\"id\");\r\n\t\tvar rowBeforeLastRowId = $(\"#geoTargetsummary\" , \"#lineItemTargeting\").find(\"tr:last\").prev('tr').attr(\"id\");\r\n\t\tvar rowName = \"geoTargetsummary\";\r\n\t\tif($('#geoTargetsummary tr').length == 1){\r\n\t\t\tvar rowCount = 1;\r\n\t\t}else{\r\n\t\t\tvar rowCount = Number(previousRowId.substring(rowName.length)) + 1;\r\n\t\t\tvar prevRowCount = Number(rowBeforeLastRowId.substring(rowName.length)) + 1;\r\n\t\t\tif(prevRowCount > rowCount){\r\n\t\t\t\trowCount = prevRowCount;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tvar rowId = \"geoTargetsummary\" + rowCount;\r\n\t\t\t\r\n\t\tif(\"Frequency Cap\" == $('#' + previousRowId + \" td:nth-child(2)\").html()){\r\n\t\t\toperation = \"<select onChange='setPlacementNameAndTargetingString();' id='targetAction_\" + rowId + \"'><option value='and'>And</option> <option value='or'>Or</option></select>\";\r\n\t\t\t$('#targetAction_' +rowId).val(\"and\");\r\n\t\t}else{\r\n\t\t\tvar prevRowOperation = \"<select id='targetAction_\" + previousRowId + \"'><option value='and'>And</option> <option value='or'>Or</option></select>\";\r\n\t\t\t$('#targetAction_' +previousRowId).val(\"and\");\r\n\t\t\t$('#' + previousRowId + \" td:nth-child(7)\").html(prevRowOperation);\r\n\t\t}\r\n\t\t\t\r\n\t\tif (\"Frequency Cap\" != $(\"#sosTarTypeId option:selected\").text()) {\r\n\t\t\tnot = \"<input type='checkbox' id='not_\" + rowId + \"' >\";\t\r\n\t\t}\r\n\t\t\t\r\n\t\tif(\"Behavioral\" == $(\"#sosTarTypeId option:selected\").text()){\r\n\t\t\tvar level = \"<select id='revenueScienceSegId_\" + rowId + \"' size='1'><option value='LEVEL1'>1</option> <option value='LEVEL2'>2</option></select>\"\r\n\t\t\t$('#revenueScienceSegId_' +rowId).val(\"LEVEL1\");\r\n\t\t}\r\n\t\t\t\r\n\t\t$(\"#sosTarTypeElement :selected\").each(function(){\r\n\t\t\tselectedElements.push($(this).text());\r\n\t\t});\r\n\t\t\t\r\n\t\tvalueToPrint = \"<tr id='\" + rowId + \"'><td width='12%'>\" + not + \"</td><td width='18%'>\" + $(\"#sosTarTypeId option:selected\").text() + \"</td><td style='display : none'>\" + $(\"#sosTarTypeId\").val();\r\n\t\tif (\"Zip Codes\" == $(\"#sosTarTypeId option:selected\").text() || \"Behavioral\" == $(\"#sosTarTypeId option:selected\").text()) {\r\n\t\t\tvalueToPrint = valueToPrint + \"</td><td width='50%' title='\" + $(\"#tarTypeElementText\").val() + \"' style=' white-space: nowrap; overflow: hidden; text-overflow: ellipsis;'>\" + $(\"#tarTypeElementText\").val() + \"</td><td style='display : none'>\" + $(\"#tarTypeElementText\").val() + \"</td>\";\r\n\t\t}else {\r\n\t\t\tvalueToPrint = valueToPrint + \"</td><td width='50%' title='\" + selectedElements.join(\", \") + \"' style=' white-space: nowrap; overflow: hidden; text-overflow: ellipsis;'>\" + selectedElements.join(\", \") + \"</td><td style='display : none'>\" + $(\"#sosTarTypeElement\").val() + \"</td>\";\r\n\t\t}\r\n\t\t\t\r\n\t\tvalueToPrint = valueToPrint + \"<td width='10%'>\" + level + \"</td>\" + \"</td><td width='10%'>\" + operation +\"</td>\" + \"<td width='10%'>\" + \"<a style='float:left;margin-left:5px' title='Edit' onClick=\\\"editLineItemTarget('\" + rowId + \"')\\\"> <span class='ui-icon ui-icon-pencil' style='cursor:pointer;'/></a> <a style='float:left;margin-left:5px' title='Delete' onClick=\\\"deleteLineItemTarget('\" + rowId + \"')\\\"> <span class='ui-icon ui-icon-trash' style='cursor:pointer;'/></a></td></tr>\";\r\n\t\t\t\r\n\t\tif(\"Frequency Cap\" == $('#' + previousRowId + \" td:nth-child(2)\").html()){\r\n\t\t\t$(\"#geoTargetsummary\" , \"#lineItemTargeting\").find(\"tr:last\").before(valueToPrint);\r\n\t\t}else{\r\n\t\t\t$('#geoTargetsummary').append(valueToPrint);\r\n\t\t}\r\n\t\t\t\r\n\t\tresetTargetingFields();\r\n\t\t$(\"#not_\" + rowId).bind(\"change\", function () {\r\n\t\t\tsetPlacementNameAndTargetingString();\r\n\t\t});\r\n\t\t\r\n\t\t$(\"#targetAction_\" + previousRowId).bind(\"change\", function () {\r\n\t\t\tsetPlacementNameAndTargetingString();\r\n\t\t});\r\n\t\t\r\n\t\tif(level != \"--\"){\r\n\t\t\t$(\"#revenueScienceSegId_\" + rowId).bind(\"change\", function () {\r\n\t\t\t\t $(\"#rateCardPrice\").val(\"\");\r\n\t\t\t\t $(\"#offImpressionLink\", \"#lineItemFinancialFieldsContainer\").hide();\r\n\t\t\t});\r\n\t\t}\r\n\t\tsetBasePrice();\r\n\t\tsetPlacementNameAndTargetingString();\r\n\t\tif ($(\"#lineItemType_r\", \"#lineItemTargeting\").is(':checked') || $(\"#lineItemType_e\", \"#lineItemTargeting\").is(':checked')) {\r\n\t\t\t$('#geoTargetsummary tbody tr').each(function(){\r\n\t\t\t\t$('td:eq(0),td:eq(5),td:eq(6)', this).hide();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?EventPluginUtils.getParentInstance(targetInst):null;EventPluginUtils.traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?EventPluginUtils.getParentInstance(targetInst):null;EventPluginUtils.traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?EventPluginUtils.getParentInstance(targetInst):null;EventPluginUtils.traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "goto(target) {\r\n this._nextTarget = target;\r\n this.uiDispatcher.debug(`Goto : ${target}`);\r\n }", "@action addUndoStep(value) {\n let that = this;\n let undoHistory = that.undoHistory;\n\n undoHistory.pushObject(value);\n\n that.undoHistory = undoHistory;\n }", "copyTo(target) {\n let paths = this.paths;\n\n if (paths !== undefined) {\n let path;\n\n for (path in paths) {\n if (paths[path] > 0) {\n target.add(path);\n }\n }\n }\n }", "function addTargetToXML(target) {\n var targetXMLContent = \"\";\n targetXMLContent += \"<target\";\n targetXMLContent += \" type='\" + target.targetType + \"'\";\n targetXMLContent += \" targetQuery='\" + target.targetQuery + \"'\"\n targetXMLContent += \">\\n\";\n if (target.extractArray.length > 0) {\n target.extractArray.map(function (extract) {\n targetXMLContent += addExtractToXML(extract);\n });\n }\n targetXMLContent += \"</target>\\n\";\n return targetXMLContent;\n}", "getTarget(step) {\n const me = this,\n target = step.target;\n\n if (!target) {\n return me.prevTarget || me.outerElement;\n }\n\n if (typeof target === 'function') {\n return target(step);\n }\n\n return document.querySelector(target);\n }", "getTarget(step) {\n const me = this,\n target = step.target;\n\n if (!target) {\n return me.prevTarget || me.outerElement;\n }\n\n if (typeof target === 'function') {\n return target(step);\n }\n\n return document.querySelector(target);\n }", "function addToSet(target, source) {\n try {\n for (var source_1 = tslib_1.__values(source), source_1_1 = source_1.next(); !source_1_1.done; source_1_1 = source_1.next()) {\n var value = source_1_1.value;\n target.add(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (source_1_1 && !source_1_1.done && (_a = source_1.return)) _a.call(source_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n var e_1, _a;\n}", "static add(v1, v2, target) \r\n {\r\n if (!target)\r\n target = v1.copy();\r\n else \r\n target.set(v1);\r\n\r\n target.add(v2);\r\n return target;\r\n }", "setupTargetData(newTarget) {\n if (this.target) {\n this.remoteHeadingobserver.disconnect();\n }\n this.target = newTarget;\n // add a backdoor for hax to have a hook into this\n this._haxSibling = this;\n // @todo need to add some kind of \"if this gets deleted let me know\"\n // or a hook that basically blocks this being deleted because it\n // is under control of the page-break tag\n this.remoteHeadingobserver.observe(this.target, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }", "function pushTypeResolution(target, propertyName) {\n var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName);\n if (resolutionCycleStartIndex >= 0) {\n // A cycle was found\n var length_2 = resolutionTargets.length;\n for (var i = resolutionCycleStartIndex; i < length_2; i++) {\n resolutionResults[i] = false;\n }\n return false;\n }\n resolutionTargets.push(target);\n resolutionResults.push(/*items*/ true);\n resolutionPropertyNames.push(propertyName);\n return true;\n }", "normalizeStep(step) {\n if (step.action) {\n if (typeof step.action === 'function') {\n return step.action(step);\n }\n return step;\n }\n\n if (typeof step === 'function') {\n step();\n return step;\n }\n\n // try to find action among properties\n for (let prop in step) {\n if (step.hasOwnProperty(prop) && !knownProps.includes(prop)) {\n step.action = prop.toLowerCase();\n step.to = step[prop];\n }\n }\n\n if (!step.target && (typeof step.to === 'string' || typeof step.to === 'function')) step.target = step.to;\n\n return step;\n }", "step(step) {\n let result = this.maybeStep(step);\n if (result.failed)\n throw new TransformError(result.failed);\n return this;\n }", "function _goToStep(step) {\n\t //because steps starts with zero\n\t this._currentStep = step - 2;\n\t if (typeof (this._introItems) !== 'undefined') {\n\t _nextStep.call(this);\n\t }\n\t }", "setNEOTarget(target) {\n App.pathFinder.data.target.coordinates = target.mercator;\n\n App.targeting.setTarget(target.mercator[0], target.mercator[1]);\n App.pathFinder.data.target.translate = true;\n }", "function addTarget() {\n const x = random(TANK_WIDTH / 2 + TARGET_SIZE / 2, CANVAS_WIDTH - TARGET_SIZE / 2 - TANK_WIDTH / 2);\n const y = random(TARGET_SIZE / 2, CANVAS_HEIGHT / 4);\n // specify a shape between three possible values\n let odds = random(0, 3);\n let shape = odds > 2 ? 'rect' : odds > 1 ? 'circle' : 'triangle';\n targets.push(new Target(x, y, shape));\n}", "addDep (dep) {\n if (!shouldTrack) return\n const id = dep.id\n if (!this.newDepIds.has(id)) {\n this.newDepIds.add(id)\n this.newDeps.push(dep)\n if (!this.depIds.has(id)) {\n dep.addSub(this)\n }\n }\n }", "function AddTarget(targetEntity) {\n targets.push(targetEntity);\n var light = new LightComponent(\"TMP/Target/Light\");\n light.radius = 32;\n light.colour.set(1, 0, 0, 1);\n lights.push(light);\n targetEntity.GetRootComponent().Add(light);\n}", "insertNextStepsUpTo(start, end) {\n let n = start;\n for (; n;) {\n if (n.kind == \"goto_step\" || n.kind == \"goto_step_if\") {\n let f = this.nextStep(n.blockPartner ? n.blockPartner : n);\n // Point to the destination step\n n.blockPartner = f;\n if (f) {\n n.name = f.name;\n }\n else {\n n.name = \"<end>\";\n }\n n = n.next[0];\n }\n else if (n.kind == \"if\" && n.next.length > 1) {\n this.insertNextStepsUpTo(n.next[1], n.blockPartner);\n n = n.next[0];\n }\n else {\n n = n.next[0];\n }\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if (typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function _goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n if(typeof (this._introItems) !== 'undefined') {\n _nextStep.call(this);\n }\n }", "function addStep(step){\n let oldSteps = steps.innerHTML; //explnation before adding anything\n let append = \"<p>\" + stepNum++ + \". \" +step + \"</p>\"; //what will be added in proper html format\n steps.innerHTML = oldSteps + append; //adds the text onto the old file.\n steps.scrollTop = steps.scrollHeight;\n}", "normalizeStep(step) {\n if (step.action) {\n if (typeof step.action === 'function') {\n return step.action(step);\n }\n\n return step;\n }\n\n if (typeof step === 'function') {\n step();\n return step;\n } // try to find action among properties\n\n for (const prop in step) {\n if (Object.hasOwnProperty.call(step, prop) && !knownProps.includes(prop)) {\n step.action = prop.toLowerCase();\n step.to = step[prop];\n }\n }\n\n if (!step.target && (typeof step.to === 'string' || typeof step.to === 'function')) step.target = step.to;\n return step;\n }", "function asyncStartLoadPartwayThrough(stepState) {\n return function(resolve, reject) {\n var loader = stepState.loader;\n var name = stepState.moduleName;\n var step = stepState.step;\n\n if (loader.modules[name])\n throw new TypeError('\"' + name + '\" already exists in the module table');\n\n // adjusted to pick up existing loads\n var existingLoad;\n for (var i = 0, l = loader.loads.length; i < l; i++) {\n if (loader.loads[i].name == name) {\n existingLoad = loader.loads[i];\n\n if (step == 'translate' && !existingLoad.source) {\n existingLoad.address = stepState.moduleAddress;\n proceedToTranslate(loader, existingLoad, Promise.resolve(stepState.moduleSource));\n }\n\n // a primary load -> use that existing linkset if it is for the direct load here\n // otherwise create a new linkset unit\n if (existingLoad.linkSets.length && existingLoad.linkSets[0].loads[0].name == existingLoad.name)\n return existingLoad.linkSets[0].done.then(function() {\n resolve(existingLoad);\n });\n }\n }\n\n var load = existingLoad || createLoad(name);\n\n load.metadata = stepState.moduleMetadata;\n\n var linkSet = createLinkSet(loader, load);\n\n loader.loads.push(load);\n\n resolve(linkSet.done);\n\n if (step == 'locate')\n proceedToLocate(loader, load);\n\n else if (step == 'fetch')\n proceedToFetch(loader, load, Promise.resolve(stepState.moduleAddress));\n\n else {\n console.assert(step == 'translate', 'translate step');\n load.address = stepState.moduleAddress;\n proceedToTranslate(loader, load, Promise.resolve(stepState.moduleSource));\n }\n }\n }", "function asyncStartLoadPartwayThrough(stepState) {\n return function(resolve, reject) {\n var loader = stepState.loader;\n var name = stepState.moduleName;\n var step = stepState.step;\n\n if (loader.modules[name])\n throw new TypeError('\"' + name + '\" already exists in the module table');\n\n // adjusted to pick up existing loads\n var existingLoad;\n for (var i = 0, l = loader.loads.length; i < l; i++) {\n if (loader.loads[i].name == name) {\n existingLoad = loader.loads[i];\n\n if (step == 'translate' && !existingLoad.source) {\n existingLoad.address = stepState.moduleAddress;\n proceedToTranslate(loader, existingLoad, Promise.resolve(stepState.moduleSource));\n }\n\n // a primary load -> use that existing linkset if it is for the direct load here\n // otherwise create a new linkset unit\n if (existingLoad.linkSets.length && existingLoad.linkSets[0].loads[0].name == existingLoad.name)\n return existingLoad.linkSets[0].done.then(function() {\n resolve(existingLoad);\n });\n }\n }\n\n var load = existingLoad || createLoad(name);\n\n load.metadata = stepState.moduleMetadata;\n\n var linkSet = createLinkSet(loader, load);\n\n loader.loads.push(load);\n\n resolve(linkSet.done);\n\n if (step == 'locate')\n proceedToLocate(loader, load);\n\n else if (step == 'fetch')\n proceedToFetch(loader, load, Promise.resolve(stepState.moduleAddress));\n\n else {\n console.assert(step == 'translate', 'translate step');\n load.address = stepState.moduleAddress;\n proceedToTranslate(loader, load, Promise.resolve(stepState.moduleSource));\n }\n }\n }", "function push(source,target) {\n target.appendChild(source);\n }", "addChild(dep) {\n const cycle = dep.findRoute(this);\n if (cycle.length !== 0) {\n cycle.push(dep);\n throw new Error(`Dependency cycle detected: ${cycle.filter(d => d.value).map(d => constructs_1.Node.of(d.value).uniqueId).join(' => ')}`);\n }\n this._children.add(dep);\n dep.addParent(this);\n }", "set target(value) {}", "function setNextStep(request, stepId){\n\trequest.act = defaultAct.setRequestData;\n\trequest.stepId = stepId;\n\tsendRequest(request);\n}", "function gameAdd(target, amount){\n target.amount = new Decimal(target.amount).add(amount);\n }", "function addGoal(worker, goal) {\n if (goal != null) {\n goal = datastore.createGoal(goal);\n worker.port.emit(\"GoalAdded\", goal);\n }\n}", "_addToPayload(source) {\r\n if (isFluidValue(source)) {\r\n if (Animated.context) {\r\n Animated.context.dependencies.add(source);\r\n }\r\n\r\n if (isAnimationValue(source)) {\r\n source = source.node;\r\n }\r\n }\r\n\r\n if (isAnimated(source)) {\r\n each(source.getPayload(), node => this.add(node));\r\n }\r\n }", "function _map_addDirections(map,target){\r\n\tif (map){\r\n\t\tgdir = new GDirections(map,target);\r\n\t\tGEvent.addListener(gdir, \"error\", __directions_handleErrors);\r\n\t}\r\n}", "nextstep(step) {}", "function jump(dest,line) {\n\tdebugMsg(\"jump(\"+dest+\",\"+line+\")\");\n\tnextStep=dest;\n\treportPublicVariables();\n\tpostMessage({\"type\":\"step\",\"line\":line});\n}", "function UnsupportedJumpTarget(target){this.target = target;}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n }", "__skipStep() {\n this.skipStep();\n }", "reverseBuild(target) {\t \n\t\tif (target === null) {\n\t\t\treturn;\n\t\t}\t\n\t\tconst hexagon = this.hexagonList.get(IDToKey(target));\n\t\tconst unit = hexagon.getTileUnit();\n\t\thexagon.setAsNotTile();\n\t\thexagon.setTileUnit(null);\n\t\tthis.pieceToPlace.push(unit);\n\t}", "__nextStep() {\n this.openNextStep();\n }", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t var targetInst = event._targetInst;\n\t var parentInst = targetInst ? getParentInstance(targetInst) : null;\n\t traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n }", "createAnotherStep(){\n if(this.state.step.value === ''){\n\n } else{\n this.setState(state => {\n const directions = state.directions.concat(state.step.value);\n return{\n directions\n }\n })\n this.setState({step: { value: ''}});\n }\n }", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}", "function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}" ]
[ "0.5997291", "0.5878346", "0.5549582", "0.55476564", "0.5544846", "0.5468995", "0.5448689", "0.5439655", "0.54350585", "0.543002", "0.542287", "0.53181684", "0.52781194", "0.5256718", "0.5243599", "0.51830536", "0.51830536", "0.51830536", "0.51830536", "0.51830536", "0.515234", "0.5145754", "0.5135929", "0.5135929", "0.5135929", "0.51017064", "0.5096253", "0.5078261", "0.50755847", "0.5042713", "0.5035518", "0.5032114", "0.50146776", "0.5000002", "0.4985086", "0.4968772", "0.49673596", "0.4953897", "0.49488354", "0.49433827", "0.49416307", "0.49314457", "0.4910078", "0.49062538", "0.49062538", "0.49062538", "0.49062538", "0.49062538", "0.48991436", "0.48877612", "0.4880803", "0.4880205", "0.4880205", "0.48775372", "0.48739436", "0.48723465", "0.48677558", "0.48670632", "0.4865327", "0.4836881", "0.48329717", "0.48208332", "0.4812699", "0.48078632", "0.48061052", "0.479489", "0.47876084", "0.47786164", "0.47714743", "0.4765772", "0.4765772", "0.4765772", "0.4752103", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213", "0.47484213" ]
0.50722444
29
Helper Functions Checks if an element has a class.
function hasClass(element, cls) { return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasClass(element, clas)\n{\n return (' ' + element.className + ' ').indexOf(' ' + clas + ' ') > -1;\n}", "function hasClass(element, cls) {\n return element.classList.contains(cls);\n}", "function verifyIsClass(element, nameOfClass){\n if(element != null){\n if(element.attr('class').indexOf(nameOfClass) == -1){\n return false;\n }else{\n return true;\n }\n }\n\n}", "function hasClass(element, cls) {\n var classes = element.className;\n if (!classes) return false;\n var l = classes.split(' ');\n for (var i = 0; i < l.length; i++) {\n if (l[i] == cls) {\n return true;\n }\n }\n return false;\n}", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}", "function class_exists(ele,className){return new RegExp(' '+className+' ').test(' '+ele.className+' ');}", "function hasClass(elem, className) {\n return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n }", "function hasClass(element, cls) {\n\t\treturn (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n\t}", "function hasClass(elem, cls) {\n // adapted from http://stackoverflow.com/a/5085587/233608\n return (\" \" + elem.className + \" \").replace(/[\\n\\t]/g, \" \").indexOf(\" \" + cls + \" \") > -1;\n}", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n }", "function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n }", "function hasClass(elem, className) {\r\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\r\n}", "function hasClass(elem, className) {\n return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ')\n}", "function hasClass(element, className) {\n return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;\n}", "function hasClass( ele, class_name ) {\n\treturn ele.className.match( new RegExp( '(\\\\s|^)' + class_name + '(\\\\s|$)' ) );\n}", "function hasClass(element, name) {\n\t var list = typeof element == 'string' ? element : classList(element);\n\t return list.indexOf(' ' + name + ' ') >= 0;\n\t }", "function hasClass(element, name) {\n\t var list = typeof element == 'string' ? element : classList(element);\n\t return list.indexOf(' ' + name + ' ') >= 0;\n\t }", "function hasClass(element, name) {\n\t var list = typeof element == 'string' ? element : classList(element);\n\t return list.indexOf(' ' + name + ' ') >= 0;\n\t }", "function hasClass(element, name) {\n\t var list = typeof element == 'string' ? element : classList(element);\n\t return list.indexOf(' ' + name + ' ') >= 0;\n\t }", "function hasClass(element, cls) {\n return !!element.className.match(new RegExp('(\\\\s|^)' + cls + '(\\\\s|)'));\n }", "function hasClass(element, className){\n var classes = element.className;\n return classes && new RegExp(\"(^| )\" + className + \"($| )\").test(classes);\n}", "function hasClass(elem, className) {\n return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n }", "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "function hasClass(elem, className) {\n\treturn new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');\n}", "function hasClass(element, className)\n{\n\treturn element.className.split(' ').indexOf(className);\n}", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(elm, cls) {\n var classes = elm.className.split(' ');\n for (var i = 0; i < classes.length; i++) {\n if (classes[i].toLowerCase() === cls.toLowerCase()) {\n return true;\n }\n }\n return false;\n}", "function hasClass(el, classname) {\n return el && el.getAttribute('class') && el.getAttribute('class').indexOf(classname) > -1;\n }", "function hasClass(el, classname) {\n return el && el.getAttribute('class') && el.getAttribute('class').indexOf(classname) > -1;\n }", "function hasClass(elm, cls) {\n\t var classes = elm.className.split(' ');\n\t for (var i = 0; i < classes.length; i++) {\n\t if (classes[i].toLowerCase() === cls.toLowerCase()) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "function hasClass(element, className) {\n return element.classList.contains(className);\n }", "function hasClass( elem, klass ) {\n\t\t\t return (\" \" + elem.className + \" \" ).indexOf( \" \"+klass+\" \" ) > -1;\n\t\t\t}", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(element, name) {\n var list = typeof element == 'string' ? element : classList(element);\n return list.indexOf(' ' + name + ' ') >= 0;\n }", "function hasClass(elem, className) {\n return elem && elem.classList && elem.classList.contains(className);\n}", "function hasClass (elem, cls) {\n\tvar str = \" \" + elem.className + \" \";\n\tvar testCls = \" \" + cls + \" \";\n\treturn (str.indexOf(testCls) != -1);\n}", "function hasClass(elem, className) {\n return elem.className && new RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$)\").test(elem.className);\n}", "function hasClass(element, className) {\n return classMatchingRegex(className).test(element.className);\n}", "function conteClass(element, nomClass) {\n return (' ' + element.classList + ' ').indexOf(' ' + nomClass + ' ') > -1;\n }", "function hasClass(ele,cls) {\n return !!ele.className.match(new RegExp('(\\\\s|^)'+cls+'(\\\\s|$)'));\n}", "function hasClass(el, c) {\r\n return el.classList ?\r\n el.classList.contains(c) :\r\n (el.className.split(\" \").indexOf(c) != -1);\r\n }", "function hasClass(css_class, element) {\r\n checkParams(css_class, element, 'hasClass');\r\n var className = ' ' + css_class + ' ';\r\n return ((' ' + element.className + ' ').replace(rclass, ' ').indexOf(className) > -1);\r\n }", "function hasClass(ele, className) {\n return $(ele).hasClass(className);\n}", "function xHasClass(e, c)\n{\n e = xGetElementById(e);\n if (!e || e.className=='') return false;\n var re = new RegExp(\"(^|\\\\s)\"+c+\"(\\\\s|$)\");\n return re.test(e.className);\n}", "function hasClass(e, c) {\n\tif (typeof e == \"string\") e = document.getElementById(e);\n\tvar classes = e.className;\n\tif (!classes) return false;\n\tif (classes == c) return true;\n\treturn e.className.search(\"\\\\b\" + c + \"\\\\b\") != -1;\n}", "function hasClass(ele,cls) {\n\treturn ele.className.match(new RegExp('(\\\\s|^)'+cls+'(\\\\s|$)'));\n}", "function hasClass(ele,cls) {\n return ele.className.match(new RegExp('(\\\\s|^)'+cls+'(\\\\s|$)'));\n}", "function hasClass(ele, cls) {\n return ele.className.match(new RegExp('(\\\\s|^)' + cls + '(\\\\s|$)'));\n }", "function hasClass(obj) {\n var result = false;\n if (obj.getAttributeNode(\"class\") != null) {\n result = obj.getAttributeNode(\"class\").value;\n }\n return result;\n }", "function classCheck(element, classesToCheck) {\n\t\tvar newClasses = classesToCheck.replace(/\\s+/g,'').split(\",\");\n\t\tvar currentClasses = element.className.trim().replace(/\\s+/g,' ') + ' ';\n\t\tvar ind = newClasses.length;\n\t\tvar hasClass = true;\n\n while(ind--) {\n\t\t\tvar testTerm = new RegExp(newClasses[ind] +' ');\n if (!testTerm.test(currentClasses)) {\n hasClass = false;\n break;\n } \n \t\t}\n \t\treturn hasClass;\n \t}", "function HasClassName(element, className) {\n\tif (typeof element == 'string') element = $(element);\n\tvar elementClassName = element.className;\n\tif (typeof elementClassName == 'undefined') return false;\n\treturn (elementClassName.length > 0 && (elementClassName == className || new RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$)\").test(elementClassName)));\n}", "function xHasClass(e, c) {\r\n e = xGetElementById(e);\r\n if (!e || !e.className)\r\n return false;\r\n return (e.className == c) || e.className.match(new RegExp('\\\\b'+c+'\\\\b'));\r\n}", "function hasClass(ele, cls) {\n\tif (!ele) throw new Error(\"not an element, can't add class name.\");\n\tif (ele.className) {\n\t\treturn getClassRegex(cls).test(ele.className);\n\t}\n}", "function hasClass(ele, cls) {\n if(ele) return ele.className.match(new RegExp('(\\\\s|^)'+cls+'(\\\\s|$)'));\n }", "function hasClass(obj) {\n var result = false;\n if (obj.getAttributeNode(\"class\") != null) {\n result = obj.getAttributeNode(\"class\").value;\n }\n return result;\n}", "function has_class(o, cn) {\n var parts = o.className.split(' ');\n for (x=0; x<parts.length; x++) {\n if (parts[x] == cn)\n return true;\n }\n return false;\n}", "hasClass(element, className) {\n if (!element) {\n return false;\n }\n // Allow templates to intercept.\n className = ` ${className} `;\n return ((` ${element.className} `).replace(/[\\n\\t\\r]/g, ' ').indexOf(className) > -1);\n }", "function has_css_class(dom_ob, cl) {\n var classes=dom_ob.className.split(\" \");\n\n return array_search(cl, classes)!==false;\n}", "function classContains(element, name) {\n var names, i,\n className = element.className;\n if (className === '' || className === null || className === undefined) {\n return false;\n }\n names = className.split(/\\s+/);\n for (i = names.length-1; i >= 0; --i) {\n if (names[i] === name) {\n return true;\n }\n }\n return false;\n }", "function hasClass(el, className) {\n return getClassRegEx(className).test(el.className);\n}", "function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}", "function hasClass(node, name) {\n return classRegex(name).test(node.className);\n }" ]
[ "0.8496227", "0.83868444", "0.83235204", "0.83164924", "0.828473", "0.828473", "0.828473", "0.8233917", "0.82230306", "0.81897163", "0.81763834", "0.8166916", "0.8166916", "0.8165932", "0.8154812", "0.814809", "0.8138781", "0.81339335", "0.81339335", "0.81339335", "0.81339335", "0.8133119", "0.81304044", "0.8116873", "0.8099641", "0.8099641", "0.8099641", "0.8077179", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80590975", "0.80578697", "0.8049482", "0.80329627", "0.8027073", "0.79994667", "0.79939985", "0.79916877", "0.79916877", "0.79916877", "0.79693955", "0.7967035", "0.7950221", "0.78993833", "0.78847444", "0.78736246", "0.7861125", "0.7856624", "0.78558797", "0.7849714", "0.78497", "0.78457505", "0.7825373", "0.78014266", "0.776879", "0.77595013", "0.7755947", "0.7752794", "0.77163947", "0.76895005", "0.7675719", "0.76651883", "0.7609015", "0.76086026", "0.7584437", "0.7567638", "0.75497967", "0.7537281" ]
0.8260407
7
Toggles a class on elements with a specific class.
function toggleClassOnElementWithClass(matchClass, addClass) { var elems = document.getElementsByTagName('*'), i; for (i in elems) { if((' ' + elems[i].className + ' ').indexOf(' ' + matchClass + ' ') > -1) { classie.toggle(elems[i], addClass); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleClass(className) {\n var classes = className.split(/\\s+/)\n , name\n , i;\n for(i = 0;i < classes.length;i++) {\n name = classes[i];\n if(this.hasClass(name)) {\n this.removeClass(name)\n }else{\n this.addClass(name)\n }\n }\n}", "function toggleClass(element, classesToToggle) {\n var classes = classesToToggle.replace(/\\s+/g,'').split(\",\")\n\t\tvar newClassName = element.className.trim().replace(/\\s+/g,' ') + ' ';\n\t\tvar len = classes.length;\n var ind = 0;\n while (ind < len) {\n var testTerm = new RegExp(classes[ind] + ' ');\n if (testTerm.test(newClassName)) {\n //class exists - remove it\n newClassName = newClassName.replace(classes[ind] + ' ', '');\n } else {\n //class doesn't exist - add it\n newClassName += classes[ind] + ' ';\n }\n ind++;\n }\n element.className = newClassName.trim(); \n }", "toggleClass(classname) {\n return this.forEach((el => el.classList.toggle(classname))), this;\n }", "toggleClass(el, cls) {\n // split string on spaces to detect if multiple classes are passed in\n cls = cls.indexOf(' ') !== -1 ? cls.split(' ') : cls\n\n if (Array.isArray(cls)) {\n cls.forEach((_class) => DOM.toggleClass(el, _class))\n return\n }\n\n if (el.classList) {\n el.classList.toggle(cls)\n } else {\n const classes = el.className.split(' ')\n const existingIndex = classes.indexOf(cls)\n\n if (existingIndex >= 0) {\n classes.splice(existingIndex, 1)\n } else {\n classes.push(cls)\n }\n\n el.className = classes.join(' ')\n }\n }", "function toggleClass(elem, className) {\n if (!$(elem).hasClass(className)) {\n $(elem).addClass(className);\n } else {\n $(elem).removeClass(className);\n }\n }", "function toggleElementClass(element, class1, class2)\n{\n\tvar classes = element.className.split(' ');\n \n\tif (hasClass(element, class1) !== -1)\n\t{\n\t\tclasses[classes.indexOf(class1)] = class2;\n\t\telement.className = classes.toString().replace(',', ' ');\n\t}\n\telse if (hasClass(element, class2) !== -1)\n\t{\n\t\tclasses[classes.indexOf(class2)] = class1;\n\t\telement.className = classes.toString().replace(',', ' ');\n\t}\n}", "function toggleClass(classlist,classname,toggle) {\n\tclasses = classlist.split(\" \");\n\tif(toggle) {\n\t\tif(classes.indexOf(classname)==-1) {\n\t\t\tclasses.push(classname);\n\t\t}\n\t} else {\n\t\tif(classes.indexOf(classname)>-1) {\n\t\t\tclasses.splice(classes.indexOf(classname),1);\n\t\t}\n\t}\n\treturn classes.join(\" \");\n}", "function toggleClass(ele, cls, yes) {\n\tif (yes) addClass(ele, cls);\n\telse removeClass(ele, cls);\n}", "function ToggleClass ( _El, _Class, _Set ) {\r\n if ($(_El)) {\r\n if (_Set) {\r\n $(_El).addClassName(_Class);\r\n } else {\r\n $(_El).removeClassName(_Class);\r\n }\r\n }\r\n}", "function toggleClasses(r, a) {\n var cArray = el.className.split(' ');\n if (a && cArray.indexOf(a) === -1) cArray.push(a);\n var rItem = cArray.indexOf(r);\n if (rItem !== -1) cArray.splice(rItem, 1);\n el.className = cArray.join(' ');\n }", "function toggleClasses(x, c) {\n x.classList.toggle(c)\n\n}", "function toggleClass(elem, className) {\n if (elem.className.indexOf(className) !== -1) {\n elem.className = elem.className.replace(className, '');\n }\n else {\n elem.className = elem.className.replace(/\\s+/g, ' ') + ' ' + className;\n }\n\n return elem;\n}", "function xToggleClass(e, c) {\r\n if (!(e = xGetElementById(e)))\r\n return null;\r\n if (!xRemoveClass(e, c) && !xAddClass(e, c))\r\n return false;\r\n return true;\r\n}", "function toggleClass(elemento, clase) {\n if (elemento.classList.contains(clase)) {\n elemento.classList.remove(clase);\n }else{\n elemento.classList.add(clase);\n }\n}", "function toggleClass(element, className) {\n\n // if the element or class name isn't found, return\n if (!element || !className) {\n return;\n }\n\n var classString = element.className, nameIndex = classString.indexOf(className);\n if (nameIndex === -1) {\n // add a space in between the class name being added an any current class name\n classString += ' ' + className;\n } else {\n classString = classString.substr(0, nameIndex) + classString.substr(nameIndex + className.length);\n }\n element.className = classString;\n }", "function toggleClass( classList, className, on ) {\r\n\t\tvar re = RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$)\");\r\n\t\tvar classExists = re.test(classList);\r\n\t\tif (on) {\r\n\t\t\treturn classExists ? classList : classList + SPACE_STRING + className;\r\n\t\t} else {\r\n\t\t\treturn classExists ? trim(classList.replace(re, PLACEHOLDER_STRING)) : classList;\r\n\t\t}\r\n\t}", "function toggleClass( classList, className, on ) {\r\n\t\tvar re = RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$)\");\r\n\t\tvar classExists = re.test(classList);\r\n\t\tif (on) {\r\n\t\t\treturn classExists ? classList : classList + SPACE_STRING + className;\r\n\t\t} else {\r\n\t\t\treturn classExists ? trim(classList.replace(re, PLACEHOLDER_STRING)) : classList;\r\n\t\t}\r\n\t}", "function toggleClass(className) {\n var callback = function(element) {\n element.classList.toggle(className);\n }\n\n $.forEach(this.elements, callback);\n\n return this;\n }", "function toggleClassElements(className, state) {\n let elements = document.getElementsByClassName(className);\n for (let i = 0; i < elements.length; i++) elements[i].style.display = state;\n}", "function toggleClass( classList, className, on ) {\n\t\tvar re = RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$)\");\n\t\tvar classExists = re.test(classList);\n\t\tif (on) {\n\t\t\treturn classExists ? classList : classList + SPACE_STRING + className;\n\t\t} else {\n\t\t\treturn classExists ? trim(classList.replace(re, PLACEHOLDER_STRING)) : classList;\n\t\t}\n\t}", "ToggleClass(node, className, toggleName = undefined) {\n\n var regexp = new RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$|\\:)\");\n if(regexp.test(node.className)) {\n HTML.RemoveClass(node, className);\n if(toggleName !== undefined) {\n HTML.AddClass(node, toggleName);\n }\n }\n else {\n HTML.AddClass(node, className);\n if(toggleName) {\n HTML.RemoveClass(node, toggleName);\n }\n }\n }", "function toggleClass(el, classname, callback) {\n\t\t\tif ((el !== undefined && el instanceof Node) && (classname !== undefined && typeof classname === 'string')) {\n\t\t\t\tel.classList.toggle(classname);\n\t\t\t\tif (typeof callback == 'function') {\n\t\t\t\t\tcallback(el, classname);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error('Function classToggle requires: a HTML Node and a class name of type String');\n\t\t\t}\n\t\t}", "function ToggleClass(element, firstClass, secondClass, event) {\n event.cancelBubble = true;\n var classes = element.className.split(\" \");\n var firstClassIndex = classes.indexOf(firstClass);\n var secondClassIndex = classes.indexOf(secondClass);\n if (firstClassIndex == -1 && secondClassIndex == -1) {\n classes[classes.length] = firstClass;\n }\n else if (firstClassIndex != -1) {\n classes[firstClassIndex] = secondClass;\n }\n else {\n classes[secondClassIndex] = firstClass;\n }\n element.className = classes.join(\" \");\n}", "function switchClass(_element,oldClass, newClass) {\n el = document.querySelectorAll(_element);\n el.forEach((e) => { \n e.classList.contains(newClass) \n ? e.classList.remove(oldClass) \n : (e.classList.add(newClass), e.classList.remove(oldClass)); })\n}", "function toggleElementClass( elm, className, on ) {\n\t\tvar oldClassName = elm.className;\n\t\tvar newClassName = toggleClass(oldClassName, className, on);\n\t\tif (newClassName != oldClassName) {\n\t\t\telm.className = newClassName;\n\t\t\telm.parentNode.className += EMPTY_STRING;\n\t\t}\n\t}", "function toggleClass(obj, cn) {\r\n\t// Determine whether cn is included\r\n\tif (hasClass(obj, cn)) {\r\n\t\tremoveClass(obj, cn);\r\n\t} else {\r\n\t\taddClass(obj, cn);\r\n\t}\r\n}", "function toggleElementClass( elm, className, on ) {\r\n\t\tvar oldClassName = elm.className;\r\n\t\tvar newClassName = toggleClass(oldClassName, className, on);\r\n\t\tif (newClassName != oldClassName) {\r\n\t\t\telm.className = newClassName;\r\n\t\t\telm.parentNode.className += EMPTY_STRING;\r\n\t\t}\r\n\t}", "function toggleElementClass( elm, className, on ) {\r\n\t\tvar oldClassName = elm.className;\r\n\t\tvar newClassName = toggleClass(oldClassName, className, on);\r\n\t\tif (newClassName != oldClassName) {\r\n\t\t\telm.className = newClassName;\r\n\t\t\telm.parentNode.className += EMPTY_STRING;\r\n\t\t}\r\n\t}", "function toggleClass(el, options) { \n (options.el.className.indexOf(options.className) == -1) ? addClass(options.el, options.className) : removeClass(options.el, options.className); \n }", "function toggleEl(el, className) {\n $(el).classList.toggle(className);\n}", "function toggleClass(element, className){\n if (!element || !className){\n return;\n }\n var ele = document.querySelector(element)\n ele.classList.toggle(className);\n }", "function toggleClass(obj, baseClass, onClass) {\n\tvar obj = findObj(obj);\n\tif(!obj) return;\n\t\n\tif (obj.className == baseClass) {\n\t\tobj.className = onClass;\n\t} else {\n\t\tobj.className = baseClass;\n\t}\n}", "function toggleClassName(el, className) {\n if (el.hasClass(className)) {\n el.removeClass(className);\n } else {\n el.addClass(className);\n }\n}", "function toggle(el, className) {\n\tif (el.classList.contains(className)) {\n\t\tel.classList.remove(className);\n\t} else {\n\t\tel.classList.add(className);\n\t}\n}", "function toggleClassName(el, className) {\n if (el.hasClass(className)) {\n el.removeClass(className);\n } else {\n el.addClass(className);\n }\n}", "function TUI_toggle_class(className)\n{\n var hidden = toggleRule('tui_css', '.'+className, 'display: none !important');\n TUI_store(className, hidden ? '' : '1');\n TUI_toggle_control_link(className);\n}", "function classToggle() {\n this.classList.toggle('.toggle-sprite-front')\n this.classList.toggle('.toggle-sprite-back')\n}", "function toggleClass(targetElement, addedClass) {\n if (targetElement.classList.contains(addedClass)) {\n targetElement.classList.remove(addedClass);\n }\n else {\n targetElement.classList.add(addedClass);\n }\n}", "function toggleClassMethod(className){\n\t$(className.data.key).toggleClass('non-visible');\n}", "function toggle(element, myClass) {\n if (hid) {\n removeClass(element, myClass);\n }\n else {\n addClass(element, myClass);\n }\n hid = !hid;\n}", "function toggleClass (v) {\n return v ? 'addClass' : 'removeClass';\n }", "function changeClass(element, target) {\n var classList = ['past', 'present','future'];\n var idx = classList.indexOf(target);\n\n for (var i = 0; i < classList.length; i++) {\n if (i === idx) {\n element.toggleClass(classList[i], true);\n } else {\n element.toggleClass(classList[i], false);\n }\n }\n}", "function toggleHideElement(elementClass) {\n const element = document.querySelector(elementClass);\n element.classList.contains('hide')\n ? element.classList.remove('hide')\n : element.classList.add('hide');\n}", "function toggleClass(id,c) {\n var x = document.getElementById(id);\n if (x.classList.contains(c))\n x.classList.toggle(c);\n}", "function toggleObjectClass(obj, classA, classB) {\n obj.className = (obj.className == classA) ? classB : classA;\n}", "function ToggleClassState(id, toggleClass, force) {\n var inputElement = document.getElementById(id);\n if (inputElement) {\n // Toggle the Class \n inputElement.classList.toggle(toggleClass, force);\n }\n}", "function ToggleClass(sender) {\n\n if($(sender).hasClass(\"bold\"))\n $(sender).removeClass(\"bold\");\n else\n $(sender).addClass(\"bold\");\n}", "function toggle(className, displayState){\n let elements = document.getElementsByClassName(className)\n\n for (let i = 0; i < elements.length; i++){\n elements[i].style.display = displayState;\n }\n}", "function classToggle() {\n const navs = document.querySelectorAll('.Navbar__Items')\n navs.forEach(nav => nav.classList.toggle('Navbar__ToggleShow'));\n }", "function changeClass(elem, oldclass, newclass) {\n elem.className = elem.className.replace(oldclass, newclass);\n}", "setClass(cssClass, active) {\n this._elementRef.nativeElement.classList.toggle(cssClass, active);\n this._changeDetectorRef.markForCheck();\n }", "function toggleClass (e, el) {\n e.preventDefault();\n // console.log(el.classList)\n\n el.classList.toggle('opend');\n\n let element = document.querySelector('div#additional_aqi_block');\n element.classList.toggle('block');\n element.classList.toggle('hidden');\n}", "function toggleClasses(element){\n\n element.classList.toggle(tbdStyle);\n element.classList.toggle(doneStyle);\n element.parentNode.querySelector(\"p\").classList.toggle(tbdText);\n element.parentNode.querySelector(\"p\").classList.toggle(doneText);\n \n}", "function toggleClass(){\n var element = document.getElementById(\"muteKick\");\n element.classList.toggle(\"mystyle\");\n}", "function addClassToggleToElements() {\n /**\n * Toggle class on element\n * @param {string} className - class to toggle\n */\n Element.prototype.toggleClass = function toggleClass(className) {\n var cl = this.classList;\n cl.contains(className) ? cl.remove(className) : cl.add(className);\n };\n }", "function SAtoggleClass(element, parentClass, toggleClass, hasClass, className) {\n\n $(element).parents(parentClass).toggleClass(toggleClass);\n\n if(hasClass) {\n\n $(element).toggleClass(className);\n\n }\n\n return false;\n\n }", "_toggleClasses(element, cssClasses, isAdd) {\n const classList = element.classList;\n Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceArray\"])(cssClasses).forEach(cssClass => {\n // We can't do a spread here, because IE doesn't support setting multiple classes.\n // Also trying to add an empty string to a DOMTokenList will throw.\n if (cssClass) {\n isAdd ? classList.add(cssClass) : classList.remove(cssClass);\n }\n });\n }", "function changeClass() {\n $(\"#myDiv\").toggleClass(\"showText hideText\");\n }", "toggle() {\n const self = this;\n if (!hasClass(self.element, showClass)) self.show();\n else self.hide();\n }", "function changeActiveClass() {\n this.classList.toggle('active');\n}", "function toggleCSSClass(elementID, className) {\n if (document.getElementById(elementID).classList.contains(className)) {\n document.getElementById(elementID).classList.remove(className);\n } else {\n document.getElementById(elementID).classList.add(className);\n }\n}", "_updateClasses() {\n toggleClass(this.el, 'expanded', this.isExpanded);\n this._updateAriaAttributes();\n }", "function toggle($section, className) {\n return $section.hasClass(className) ? $section.removeClass(className) : $section.addClass(className);\n}", "function toggleClasses(el, key, fn) {\n\t key = key.trim();\n\t if (key.indexOf(' ') === -1) {\n\t fn(el, key);\n\t return;\n\t }\n\t var keys = key.split(/\\s+/);\n\t for (var i = 0, l = keys.length; i < l; i++) {\n\t fn(el, keys[i]);\n\t }\n\t }", "function toggleClasses(el, key, fn) {\n\t key = key.trim();\n\t if (key.indexOf(' ') === -1) {\n\t fn(el, key);\n\t return;\n\t }\n\t var keys = key.split(/\\s+/);\n\t for (var i = 0, l = keys.length; i < l; i++) {\n\t fn(el, keys[i]);\n\t }\n\t }", "function toggleClasses(el, key, fn) {\n\t key = key.trim();\n\t if (key.indexOf(' ') === -1) {\n\t fn(el, key);\n\t return;\n\t }\n\t var keys = key.split(/\\s+/);\n\t for (var i = 0, l = keys.length; i < l; i++) {\n\t fn(el, keys[i]);\n\t }\n\t }", "function toggleClasses(el, key, fn) {\n\t key = key.trim();\n\t if (key.indexOf(' ') === -1) {\n\t fn(el, key);\n\t return;\n\t }\n\t var keys = key.split(/\\s+/);\n\t for (var i = 0, l = keys.length; i < l; i++) {\n\t fn(el, keys[i]);\n\t }\n\t }", "function removeClass(element) {\n var elementClasses = element.className.split(\" \");\n while (elementClasses.indexOf(\"show\") > -1) {\n elementClasses.splice(elementClasses.indexOf(\"show\"), 1);\n }\n element.className = elementClasses.join(\" \");\n}", "function toggleElementAndClass(elem1, elem2, className) {\n if ($(elem1).is(\":hidden\")) {\n $(elem1).slideDown(\"slow\");\n toggleClass(elem2, className);\n } else {\n $(elem1).hide();\n toggleClass(elem2, className);\n }\n }", "function switchClass(ev,elnm){\n ev.target.parentElement.querySelectorAll('.active').forEach(elnm => {\n elnm.classList.remove('active');\n \n });\n ev.target.classList.add('active');\n }", "classNameSmartToggle(element, class_label, toggle) {\n\n let class_name_fullstring = element.className;\n let class_name_fulllist = class_name_fullstring.split(\" \");\n\n // add it\n if (toggle) {\n\n // (do noting if already present)\n if (class_name_fulllist.indexOf(class_label) != -1) {\n return;\n }\n\n class_name_fulllist.push(class_label);\n }\n // remove it\n else {\n\n // (do nothing if already missing)\n if (class_name_fulllist.indexOf(class_label) == -1) {\n return;\n }\n\n for (let i = 0; i < class_name_fulllist.length; i++) {\n if (class_name_fulllist[i] == class_label) {\n class_name_fulllist[i] = \"\";\n }\n }\n }\n\n let filtered = class_name_fulllist.filter(function(el) {\n return el != \"\";\n });\n\n element.className = filtered.join(\" \");\n }", "function btnClass() {\r\n\t\t\tbtn.classList.toggle('on');\r\n\t\t}", "function triggererClassToggle(x){\n\tvar\te = e || window.event;\n\tvar source = e.target || e.srcElement;\n\tif(tst_css)console.log(\"ClassToggle: \"+source);\n\tsource.classList.toggle(x);\n//\tif(source.classList.contains(x)){\n//\t\tsource.classList.remove(x);\n//\t} else source.classList.add(x);\n}", "function toggleElem(elem) {\n elem.className = elem.className == 'selected' ? '' : 'selected';\n }", "function toggleClassJS () {\n\n\tlet el2 = document.querySelectorAll (\".wrapper\");\n\tel2.forEach (function (element) {\n\t\telement.addEventListener (\"click\", function () {\n\t\t\tthis.classList.toggle (\"bordered\");\n\t\t});\n\t});\n}", "toggleCSSClass(_elemId, _className, _state) {\n if (this.isntNullOrUndefined(_elemId)) {\n if (this.isString(_elemId)) {\n _elemId = this.markupElemIds[_elemId];\n }\n if (this.isInteger(_elemId) && this.isString(_className)) {\n if (this.isNullOrUndefined(_state)) {\n _state = !ELEM.hasClassName(_elemId, _className);\n }\n if (_state) {\n ELEM.addClassName(_elemId, _className);\n }\n else {\n ELEM.delClassName(_elemId, _className);\n }\n }\n else {\n console.error(`HView#toggleCSSClass error; elemId(${_elemId\n }) is not an integer or className('${_className\n }') is not a string!`);\n }\n }\n else {\n console.error(`HView#toggleCSSClass error; null or undefined elemId ${_elemId}`);\n }\n return this;\n }", "function toggleActive () {\n this.classList.toggle('active');\n}", "function editClasses(classes) {\n console.log($(classes[0]))\n\n for (var i = 0; i < classes.length; i++) {\n if (classes[i].action == \"remove\") {\n $(classes[i].target).removeClass(classes[i].class);\n }\n if (classes[i].action == \"add\") {\n $(classes[i].target).addClass(classes[i].class);\n }\n }\n}", "function replaceClass(element, oldclass, newclass) {\n\tremoveClass(element, oldclass);\n\taddClass(element, newclass);\n}", "function toggleClasses() {\n var $nav = $(\"#mainNav\");\n $nav.toggleClass(\"bg-primary\", $(document).scrollTop() > $nav.height());\n $nav.toggleClass(\"mx-lg-5\", $(document).scrollTop() <= $nav.height());\n $nav.toggleClass(\"border-bottom\", $(document).scrollTop() <= $nav.height());\n }", "function toggleClasses(el, key, fn) {\n key = key.trim();\n if (key.indexOf(' ') === -1) {\n fn(el, key);\n return;\n }\n var keys = key.split(/\\s+/);\n for (var i = 0, l = keys.length; i < l; i++) {\n fn(el, keys[i]);\n }\n }", "function toggleClasses(el, key, fn) {\n key = key.trim();\n if (key.indexOf(' ') === -1) {\n fn(el, key);\n return;\n }\n var keys = key.split(/\\s+/);\n for (var i = 0, l = keys.length; i < l; i++) {\n fn(el, keys[i]);\n }\n }", "function toggleClasses(el, key, fn) {\n key = key.trim();\n if (key.indexOf(' ') === -1) {\n fn(el, key);\n return;\n }\n var keys = key.split(/\\s+/);\n for (var i = 0, l = keys.length; i < l; i++) {\n fn(el, keys[i]);\n }\n }", "onClick(e){\n this.element.classList.toggle('active');\n }", "function toggleClassWithDelay(element, firstClass, secondClass, delay)\n{\n $(element).toggleClass(firstClass + ' ' + secondClass);\n\n window.setTimeout(function() {\n $(element).toggleClass(secondClass + ' ' + firstClass);\n }, delay);\n}", "function toggleIngredients() {\n if($(\".cocktail-ingredients\").hasClass(\"active\")) {\n $('.cocktail-ingredients').removeClass(\"active\").addClass(\"inactive\");\n }\n}", "function changeGrids(){\n var el=document.getElementById('gridContainer');\n el.classList.toggle('gridContainer2');\n}", "function addCLassListToggleEventForClass(targetedClass, class1, class2) {\n let toggles = document.querySelectorAll('.' + targetedClass);\n toggles.forEach(tog => {\n attachClassListEventForElement(tog, class1, class2);\n })\n}", "function toggleClass(el){ // toggles the mute button, if button has class soundoff then sounds muted\n\tif(el.className == \"soundon\"){\n el.className = \"soundoff\";\n fxCorrect.muted = true;\n fxWrong.muted = true;\n fxWon.muted = true; \n\t} else {\n el.className = \"soundon\";\n fxCorrect.muted = false;\n fxWrong.muted = false;\n fxWon.muted = false;\n\t}\n}", "function ona(elem) {\nelem.classList.toggle(\"ona\");\n}", "function removeClass(elementName, newClass) {\n const element = document.querySelectorAll(elementName)\n\n element.forEach(el => {\n el.classList.remove(newClass)\n })\n}", "function hamburger(x) {\n x.classList.toggle(\"change\");\n}", "function toggleBodyClass(removeClass, addClass)\n {\n $('body').removeClass(removeClass).addClass(addClass);\n }", "function changeClass(targets, oldClass, newClass){\n\t$(targets).removeClass(oldClass);\n\t$(targets).addClass(newClass);\n}", "classNameSwitch(attr, value) {\r\n if (value == \"false\") {\r\n this.button.classList.remove(attr);\r\n } else {\r\n this.button.classList.add(attr);\r\n }\r\n }", "function changeClass(lien){\n if($(\"#\"+lien).attr(\"class\") != \"nav-link active\"){ \n $(\".custom-nav\").find(\"a\").toggleClass(\"active\"); \n } \n}", "function myFunction(x) {\n x.classList.toggle(\"change\");\n}", "function checkItem(item) {\n(item).toggleClass(\"shopping-item__checked\"); // did I do this correctly?\n}", "function hideElementByClass(elementArray){\n Array.prototype.map.call(elementArray, function(element){\n return element.style.display = 'none'\n })\n}", "unsetClass(el, classname) {\n el.className = el.className.replace(' ' + classname, '');\n }" ]
[ "0.7680112", "0.73390853", "0.73075473", "0.73016757", "0.72978306", "0.72836673", "0.7282263", "0.7238954", "0.71577466", "0.714713", "0.71367276", "0.7097657", "0.70414776", "0.7038596", "0.70121723", "0.7001492", "0.7001492", "0.69995767", "0.6991174", "0.6971027", "0.6962179", "0.6951278", "0.6939887", "0.693601", "0.6928774", "0.69019645", "0.69013834", "0.69013834", "0.6876524", "0.68486893", "0.6844915", "0.6840695", "0.6839515", "0.6824422", "0.68039346", "0.67926294", "0.67760134", "0.6767588", "0.6743439", "0.6706661", "0.6680535", "0.6637687", "0.66354316", "0.6586053", "0.652004", "0.6500794", "0.6478524", "0.64561945", "0.6450889", "0.6442327", "0.64019424", "0.6370761", "0.6366639", "0.63412756", "0.63130176", "0.6286123", "0.62744814", "0.627288", "0.6200917", "0.6188899", "0.61533886", "0.6150019", "0.6143392", "0.6112324", "0.6112324", "0.6112324", "0.6112324", "0.60752", "0.6063464", "0.60511994", "0.6034621", "0.60332286", "0.6021859", "0.59813046", "0.59801877", "0.59398246", "0.5933583", "0.5927699", "0.59222454", "0.5918811", "0.59049934", "0.59049934", "0.59049934", "0.5900545", "0.58731025", "0.5864396", "0.5855966", "0.5835978", "0.5834338", "0.5823823", "0.58231395", "0.5811758", "0.5792442", "0.57877904", "0.57668537", "0.57663083", "0.576168", "0.57592696", "0.57546544", "0.5747916" ]
0.7216108
8
create a new instances of sale
constructor(){ this.sales = [] // set property of sale and set it to an empty array this.adapter = new SalesAdapter() // create adapter // this.bindEventListeners() this.fetchAndLoadSales() this.createSales() // this.clearCommission() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async create({ brand_id, sales_item_name, sales_item_uuid }) {\n return db\n .query(\n `INSERT INTO sales_item(brand_id,\n sales_item_uuid,\n sales_item_name)\n VALUES ($1, $2, $3) RETURNING *`,\n [brand_id, sales_item_uuid, sales_item_name]\n )\n .then(Result.one);\n }", "async paySale(sale){\n\t\t\ttry{\n\t\t\t\tlet response = await axios.put(\"/api/sales/\" + sale._id);\n\t\t\t\tawait this.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "async addSale() {\n\t\t\tif(this.addedName == ''){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis.calcCommission();\n\t\t\tthis.oldDate = this.addedDate;\n\t\t\ttry {\n\t\t\t\tlet r1 = await axios.post(\"/api/sales\",{\n\t\t\t\t\tname: this.addedName,\n\t\t\t\t\tdate: this.addedDate,\n\t\t\t\t\tcontractValue: this.totalContractValue,\n\t\t\t\t\tcommission: this.commission,\n\t\t\t\t\tpaid: false,\n\t\t\t\t});\n\t\t\t\t//call functions that incriment local variables. \n\t\t\t\tthis.salescount += 1;\n\t\t\t\tthis.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\tthis.clearValues();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "function createStore(event) {\n event.preventDefault();\n\n // get values - convert number inputs to floats\n var storeName = event.target.storeName.value;\n var minCust = parseInt(event.target.minCust.value);\n var maxCust = parseInt(event.target.maxCust.value);\n var cupsPer = parseFloat(event.target.cupsPer.value);\n var poundsPer = parseFloat(event.target.poundsPer.value);\n\n // instantiate a new item Object\n if (names.indexOf(storeName) !== -1) {\n updateStore(storeName, minCust, maxCust, cupsPer, poundsPer);\n updateHtmlTables();\n } else {\n var newLocation = new CoffeeStand(storeName, minCust, maxCust, cupsPer, poundsPer, hours);\n newLocation.methodCaller();\n updateHtmlTables();\n }\n}", "constructor({\n saleId, contactId, price, estimatedPaymentTime, estimatedDeliveryTime,\n creationDate, status,\n }) {\n this.saleId = saleId;\n this.contactId = contactId;\n this.price = price;\n this.estimatedPaymentTime = estimatedPaymentTime;\n this.estimatedDeliveryTime = estimatedDeliveryTime;\n this.creationDate = creationDate;\n this.status = status;\n }", "function newTransaction () {\n\t\t\t\t//create a new transaction\n\t\t\t\tvar Transaction = Parse.Object.extend(\"Transaction\");\n\t\t\t\tvar transaction = new Transaction();\n\t\t\t\t \n\t\t\t\ttransaction.set(\"credits\", credits);\n\t\t\t\ttransaction.set(\"dollars\", chargeAmount);\n\t\t\t\ttransaction.set(\"type\", \"purchase\");\n\t\t\t\ttransaction.set(\"status\", \"processed\");\n\t\t\t\ttransaction.set(\"user\", currentUser);\n\t\t\t\t \n\t\t\t\ttransaction.save(null, {\n\t\t\t\t success: function(transaction) {\n\t\t\t\t updateBalance();\n\t\t\t\t growl.addSuccessMessage('You have added ' + credits + ' new credits!');\n\t\t\t\t },\n\t\t\t\t error: function(transaction, error) {\n\t\t\t\t // Execute any logic that should take place if the save fails.\n\t\t\t\t // error is a Parse.Error with an error code and description.\n\t\t\t\t alert('Failed to create new object, with error code: ' + error.message);\n\t\t\t\t }\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}", "function crearProduto(req, res) {\n let body = req.body;\n let productoSucursal = new ProductoSucursal({\n nombreProducto: body.nombreProducto,\n stockExistente: body.stockExistente,\n cantidadVendida: body.cantidadVendida,\n idSucursal: body.idSucursal\n });\n\n productoSucursal.save((err, productoCreado) => {\n if (err) {\n return res.status(500).send({ ok: false, message: 'Hubo un error en la petición.' });\n }\n\n if (!productoCreado) {\n return res.status(500).send({ ok: false, message: 'Error al crear el producto.' });\n }\n\n return res.status(200).send({ ok: true, productoCreado });\n });\n}", "static newTransaction(props) {\n const transactionId = `TRX::${(0, idGenerator_1.generateId)()}`;\n const createdAt = luxon_1.DateTime.utc().toString();\n const newTransactionProps = {\n transactionId,\n createdAt,\n transactionStatus: 'new',\n inputs: props.inputs,\n outputs: props.outputs,\n };\n if (props.tags) {\n newTransactionProps.tags = Object.assign({}, props.tags);\n }\n if (props.xids) {\n newTransactionProps.xids = Object.assign({}, props.xids);\n }\n const newEntity = new Transaction(newTransactionProps);\n return newEntity;\n }", "async updateSale(saleID, storeID) {\n\n}", "function createOrder(req, res) {\n let newOrder = new Order;\n\n newOrder.id = req.body.id;\n // newOrder.products.push(req.body.id);\n newOrder.save((err) => {\n if (err) console.log(err);\n Order.find({})\n .then(order => res.json(order).status(200)); \n })\n}", "populateSale(sale) {\n $.each(sale, (key, sala) => {\n $(\".saleTbody\").append('<tr class= \"saleTr\"><td class=\"nomeSala\">' + sala.Nome + '</td><td class=\"nomeEdificio\">' + sala.NomeEdificio + '</td><td class=\"stato\">' + sala.Stato + '</td></tr>');\n $(\".saleTbody\").append('<tr><td class=\"numeroPostiDisponibili\" colspan=\"3\"><h6> Numero posti disponibili: </h6>' + sala.NumeroPostiDisponibili + '</td></tr>');\n });\n $('.saleTr').click(function () {\n $(this).nextUntil('.saleTr').toggleClass('hide');\n }).click();\n }", "salesCreate(event, data) {\n event.preventDefault();\n axios.post('/api/orders', data)\n .then((res) => {\n if (res.status === 200) {\n // add newest order id as new key/value into data\n data.latestOrderId = res.data.last_order.order_id;\n\n // trigger modal pop up to notify that sales has created\n this.salesCreatedToggle('success');\n this.getOrders();\n this.getInventoryCosts()\n\n // axios call to update useditem table and in inventory table in database\n axios.post('/api/useditems', data)\n\n } else {\n this.salesCreatedToggle('failed');\n }\n })\n\n }", "create(req, res, next) {\n var newSubscription = new Subscription(req.body);\n newSubscription.date = Date.now();\n newSubscription.save(function(err, subscription) {\n if (err) return validationError(res, err);\n var data = {\n creation: true,\n data: subscription\n };\n perf.ProcessResponse(res).send(200, data);\n });\n }", "function createTransaction(companyName, companyId, invoiceNum, vendorId, total, sheetId) {\n\tdb.Transaction.create({\n\t\tcompanyName: companyName,\n\t\tcompanyId: companyId,\n\t\tinvoiceNumber: invoiceNum,\n\t\tvendorId: vendorId,\n\t\ttotal: total,\n\t\tSheetId: sheetId\n\t}).then(function(result) {\n\t\tconsole.log('new transaction created for sheet ' + sheetId);\n\t}).catch(function (err) {\n\t\tconsole.log(err);\n\t});\n}", "addProduct (product) {\n\n }", "function NewStores(name, minCustsPerHour, maxCustsPerHour, avgCookiesPerCust){\n this.name = name;\n this.minCustsPerHour = minCustsPerHour;\n this.maxCustsPerHour = maxCustsPerHour;\n this.avgCookiesPerCust = avgCookiesPerCust;\n this.DailySales = [];\n this.custsEachHour = [];\n this.cookiesEachHour = [];\n this.totalDailySales = 0;\n allStores.push(this);\n}", "createSales() {\n\n this.setState({ isOpen: true, salesEditId: '', cusEditId: '', proEditId: '', strEditId: '', soldDate: '', proError: false, dateError: false, cusError: false, strError: false, proValMessage: '', cusValMessage: '', strValMessage: '', dateValMessage: ''});\n\n }", "create(req, res, next) {\n console.log(\"Saving Cart\", req.body);\n var newCart = new Cart();\n var user = req.user;\n newCart.cartItems = req.body.cartItems;\n newCart.userid = user._id;\n newCart.date = Date.now();\n newCart.save(function(err, cart) {\n if (err) return validationError(res, err);\n var data = {\n creation: true,\n data: cart\n };\n perf.ProcessResponse(res).status(200).json(data);\n });\n }", "function createProduct() {\n //... your code goes here\n}", "function crearNuevo(){\n let prodInputsValues = collectInputs(obtenerInputsIdsProducto());\n let tranInputsValues = collectInputs(obtenerInputsIdsTransaccion());\n \n if(nonEmptyFields([prodInputsValues[0],prodInputsValues[1],tranInputsValues[0],tranInputsValues[2],tranInputsValues[3],tranInputsValues[5]])){\n let producto = Producto.fromArray(prodInputsValues);\n let transaccion = Transaccion.fromArray(tranInputsValues); \n \n guardarProducto(producto, transaccion);\n mostrarListaProductos();\n }\n}", "add(req, res) {\n return businesses\n .create({\n name: req.body.name,\n description: req.body.description,\n category: req.body.category,\n link: req.body.link\n })\n .then((result) => res.status(201).send(result))\n .catch((error) => res.status(400).send(error))\n }", "create(req, res){\r\n let rental = new RentalController();\r\n \r\n rental.model = req.body.model;\r\n rental.dealer = req.body.dealer;\r\n rental.year = req.body.year;\r\n rental.color = req.body.color;\r\n rental.price = req.body.price;\r\n rental.hps = req.body.hps;\r\n rental.mileage = req.body.mileage;\r\n \r\n return this.rentalDao.create(rental)\r\n .then(this.common.editSuccess(res))\r\n .catch(this.common.serverError(res));\r\n }", "async store ({ request }) {\n const data = request.only(['depositos_sigla', 'depositos_descricao']);\n const deposito = await Deposito.create(data);\n return deposito;\n }", "function create(req, res, next){\n // Body validation\n var name = req.body.name;\n var description = req.body.description;\n var price = req.body.price;\n var stock = req.body.stock;\n\n var errors = [];\n\n if(name == null || name.length == 0) errors.push(\"missing 'name' parameter\");\n else if(typeof name != 'string') errors.push(\"'name' mush be a string\");\n\n if(description == null || description.length == 0) errors.push(\"missing 'description' parameter\");\n else if(typeof description != 'string') errors.push(\"'description' mush be a string\");\n\n if(price == null) errors.push(\"missing 'price' parameter\");\n else if(!Number.isInteger(price) || price < 1) errors.push(\"'price' must be a positive integer\");\n\n if(stock == null) errors.push(\"missing 'stock' parameter\");\n else if(!Number.isInteger(stock) || stock < 1) errors.push(\"'stock' must be a positive integer\");\n\n if(errors.length > 0) next({status: 400, errors: errors});\n // End body validation.\n\n else{\n // Create new product object.\n var product = new Product();\n product.name = name;\n product.description = description;\n product.price = price;\n product.stock = stock;\n product.active = true;\n product.popularity = 0;\n product.usersLikingId = [];\n\n // Save the product.\n product.save().then(function(_product){\n\n // Save log\n var log = new ProductLog();\n log.productId = product.id;\n log.userId = req.auth.user;\n log.type = 'create';\n log.date = Date.now();\n\n log.changes.push(\n {field: 'active', value: product.active, diff: 'set to ' + product.active},\n {field: 'price', value: product.price, diff: 'set to ' + product.price},\n {field: 'stock', value: product.stock, diff: 'set to ' + product.stock}\n );\n\n log.save();\n\n // Success response.\n res.status(201).json({\n request: req.object,\n entity: {\n _id: _product._id,\n name: _product.name,\n description: _product.description,\n price: _product.price,\n stock: _product.stock\n },\n delete: '/api/v1/products/' + _product._id,\n patch: '/api/v1/products/' + _product._id,\n list: '/api/v1/products'\n });\n\n // Any error is a server error.\n }).catch(next);\n }\n}", "createProductInstance (\n id,\n name = 'product',\n price = '1',\n brand = '',\n category = '',\n quantity = 1\n ) {\n return {\n id, name, price, brand, category, quantity\n };\n }", "function createSets() {\n self.indoorSet = new self.StoogeSet();\n self.indoorSet.set('name', 'indoor');\n self.desertSet = new self.StoogeSet();\n self.desertSet.set('name', 'desert');\n spec.integrationStore.putModel(self.indoorSet, function (model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n } else {\n spec.integrationStore.putModel(self.desertSet, function (model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n } else {\n createLines();\n }\n });\n }\n });\n }", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function addNew(newRental) {\n // Check that guest and apartment exist\n guestService.getById(newRental.guestId);\n apartmentService.getById(newRental.apartmentId);\n\n const rental = addItem(rentals, newRental);\n if(rental.status == null)\n rental.status = \"WAITING_FOR_PAYMENT\";\n return rental;\n}", "function createObject(makeNewItem, makeNewPrice) {\n\tthis.name = makeNewItem;\n\tthis.price = makeNewPrice;\n\treturn {name, price};\n}", "function create(req, res) {\n const { data: { name, description, price, image_url } = {} } = req.body;\n const newId = new nextId;\n const newDish = {\n id: newId,\n name: name,\n description: description,\n price: price,\n image_url: image_url,\n };\n dishes.push(newDish);\n res.status(201).json({ data: newDish });\n}", "async create({\n orderType,\n amount,\n priceType,\n pricePerEos,\n priceVar,\n paymentMethods,\n minTrx,\n }) {\n\n let actions = [];\n amount = amount.toString();\n actions.push(\n await this._formatAction({\n account: Contracts.EOSIO_TOKEN,\n name: 'transfer',\n data: {\n from: await this.getAccountName(),\n to: Contracts.TRADA,\n quantity: amount,\n memo: 'Offer creation',\n }\n }),\n );\n\n actions.push(\n await this._formatAction({\n name: 'create',\n data: {\n account: await this.getAccountName(),\n order_type: orderType,\n amount,\n price_type: priceType,\n price_per_eos: priceType === PriceTypes.EXACT_PRICE ? pricePerEos.toString() : new FiatAsset(),\n price_var: priceType === PriceTypes.MARKET_VAR ? priceVar : 0,\n payment_methods: paymentMethods,\n allow_partial: minTrx ? 1 : 0,\n }\n }),\n );\n\n await this.transactFull(actions);\n }", "async create(req, res) {\n const { endereco, cnpj } = req.body;\n const { empresa_id } = req.params;\n const usuario_id = req.authData.id;\n\n const sede = {\n endereco,\n cnpj,\n usuario_id,\n empresa_id\n };\n\n const data = await this.sedesRepo.create(sede)\n .catch(err => {\n return responses.failure(res, err);\n });\n\n return responses.success(res, `Created new sede ${JSON.stringify(data)}`, data, 201);\n }", "function create(customer) {\n const newCust = {}\n newCust.id = Date.now() % 100000;\n newCust.first_name = customer.first_name;\n newCust.last_name = customer.last_name;\n newCust.company_name = customer.company_name;\n newCust.address = customer.address;\n newCust.city = customer.city;\n newCust.province = customer.province;\n newCust.postal = customer.postal;\n newCust.phone1 = customer.phone1;\n newCust.phone2 = customer.phone2;\n newCust.email = customer.email;\n newCust.web = customer.web;\n\n customers.push(newCust);\n}", "save(){\n this.id=Math.random();\n // we will push this as we need to push the whole object\n products.push(this);\n }", "function placeOrder(req, res, next){\n\n\tlet sale = req.body.sale;\n\tlet purchases = req.body.purchases;\n\n\t//create the query to insert the sale\n\tlet query1 = pg.pgp.helpers.insert(sale, ['user_id', 'num_of_books', 'cost', 'credit_card_number', 'exp_date', 'street_number', 'street_name', 'city', 'province', 'postal_code'], 'sale');\n\n\t//first create a new sale\n\tdb.one(query1 + ' RETURNING sale_id, order_number;')\n\t.then(data => {\n\n\t\t//once the sale is created, create the new purchases\n\n\t for(let i = 0; i < purchases.length; i++){\n\t \tlet tmp = purchases[i];\n\t \ttmp[\"sale_id\"] = data.sale_id;\n\t \tconsole.log(purchases[i]);\n\t }\n\n\t //create the query to insert the purchases\n\t\tlet query2 = pg.pgp.helpers.insert(purchases, ['book_id', 'quantity', 'cost', 'sale_id'], 'purchase');\n\n\t\t//create the new purchases\n\t\t//send back the users order number\n\t\tdb.many(query2 + ' RETURNING sale_id;')\n\t\t.then(data2 => {\n\t\t\tbasket = {};\n\t\t\tres.writeHead(200, { 'Content-Type': 'text/html' });\n\t\t\tres.end(JSON.stringify(data.order_number));\n\t\t})\n\t\t.catch(error => {\n\t\t res.status(500).send(\"Database error: Error adding purchases\");\n\t\t\treturn;\n\t\t});\n\t})\n\t.catch(error => {\n\t res.status(500).send(\"Database error: Error adding the sale\");\n\t\treturn;\n\t});\n}", "create(req, res) {\n let trade = new Trade();\n if (req.body.id) {\n trade.id = req.body.id;\n }\n trade.type = req.body.type;\n trade.user = req.body.user;\n trade.symbol = req.body.symbol;\n trade.shares = req.body.shares;\n trade.price = req.body.price;\n trade.timestamp = req.body.timestamp;\n\n return this.tradeDao.create(trade)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n\n /*\n if (req.body.id) {\n return this.tradeDao.tradeWithId(trade)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n \n }\n else {\n return this.tradeDao.create(trade)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n \n } */\n\n }", "function createPayment(req, res) {\n const body = req.body;\n paymentModel.create(body, (err, data) => {\n if (err) {\n res.status(200).send({ status: false, message: 'Fallo al crear el pago' });\n } else {\n res.status(200).send({ status: true, message: 'Pago creado exitósamente' });\n }\n });\n}", "function DiscountFactory() {\r\n\t\r\n}", "addNewItemTransaction() {\n let transaction = new AddNewItem_Transaction(this);\n this.tps.addTransaction(transaction);\n }", "static createInstance(mall, shop, phone, count, createTime, updateTime) {\n return new Point({ mall, shop, phone, count, createTime, updateTime });\n }", "function newDeposit(paylode) {\r\n const {\r\n amount,\r\n currency,\r\n method,\r\n amount_in_usd,\r\n agent,\r\n brand,\r\n team,\r\n processor,\r\n client_dor,\r\n cid,\r\n affiliate,\r\n exchangeDate,\r\n depositDate,\r\n depositMonth\r\n } = paylode;\r\n const newdeposit = new DepositSchema({\r\n amount: amount,\r\n currency: currency,\r\n method: method,\r\n amount_in_usd: amount_in_usd,\r\n agent: agent,\r\n brand: brand,\r\n team: team,\r\n processor: processor,\r\n client_dor: client_dor,\r\n cid: cid,\r\n affiliate: affiliate,\r\n deposit_vertifi: \"no\",\r\n docs_sent: \"no_docs\",\r\n exchangeDate: exchangeDate,\r\n depositDate: depositDate,\r\n depositMonth: depositMonth\r\n });\r\n return newdeposit;\r\n /* ----------- exapel of ----------- \r\n {\r\n \r\n \"amount\": 500,\r\n \"currency\": \"USD\",\r\n \"method\": \"CC\",\r\n \"agent\": \"agent2\",\r\n \"team\": \"coolteam\"\r\n \r\n }\r\n*/\r\n}", "createProducts(req, res) {\n ProductModel.create(req.body)\n .then((product) => res.send(product))\n .catch((err) => res.send(err));\n }", "function createProductObjects () {\n for (var i = 0; i < namesOfProducts.length; i++) {\n productObject[namesOfProducts[i]] = new Product (namesOfProducts[i]);\n }\n}", "async function create(req, res, next) {\n try {\n // eslint-disable-next-line max-len\n const {\n name, createdDate, money, note,\n } = req.body;\n const importStock = new ImportStock({\n // eslint-disable-next-line max-len\n name,\n createdDate: new Date(createdDate),\n money: Number(money),\n note,\n });\n return importStock\n .save()\n .then((savedImportStock) => {\n if (savedImportStock) res.json(savedImportStock);\n else res.transforemer.errorBadRequest('Can not create item');\n })\n .catch((e) => {\n next(e);\n });\n } catch (e) {\n // console.log(e);\n next(e);\n }\n}", "function Sales(shopName,min,max,avg){\n this.shopName = shopName;\n this.minCust = min;\n this.maxCust = max ;\n this.avgCookies= avg;\n this.nOfCusts = [];\n this.avgCookiesH = [];\n this.total = 0;\n\n}", "function create(value, args) {\n console.log('Inserted venue in DB');\n let venue = new models.venue(args.venue);\n return venue.save();\n}", "async function create(body) {\n const newProd = {\n _id: body.id,\n serial: body.serial,\n title: body.title,\n price: body.price,\n shortDesc: body.shortDesc,\n longDesc: body.longDesc,\n imgFile: body.imgFile\n }\n return await Products.insert(newProd);\n}", "function create(req, res) {\n var _this2 = this;\n\n var _req$body$powerSeller = req.body.powerSeller,\n powerSeller = _req$body$powerSeller === undefined ? false : _req$body$powerSeller;\n\n var company = new _company2.default(req.body);\n var savedCompany = void 0,\n savedUser = void 0;\n company.save()\n // Create user\n .then(function (company) {\n savedCompany = company;\n // Successful save, create user\n var user = new _user2.default(req.body.contact);\n user.company = company._id;\n user.role = 'corporate-admin';\n return user.save();\n })\n // Add user to company users\n .then(function (user) {\n savedUser = user;\n company.users.push(user._id);\n return company.save();\n })\n // Add company ID to user\n .then(function (company) {\n savedUser.company = company._id;\n return savedUser.save();\n }).then(function () {\n if (powerSeller) {\n var store = new Store({\n name: 'default',\n companyId: savedCompany._id,\n users: [savedUser._id]\n });\n return store.save();\n }\n }).then(function (store) {\n if (store) {\n savedCompany.stores = [store._id];\n return savedCompany.save();\n }\n }).then(function () {\n return res.status(200).send();\n }).catch(function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(err) {\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n console.log('**************ERR IN CREATE NEW SUPPLIER COMPANY**********');\n console.log(err);\n\n _context3.next = 4;\n return _errorLog2.default.create({\n method: 'create',\n controller: 'company.controller',\n revision: (0, _errors.getGitRev)(),\n stack: err.stack,\n error: err,\n user: req.user._id\n });\n\n case 4:\n\n // Remove anything written on error\n if (savedCompany) {\n savedCompany.remove();\n }\n if (savedUser) {\n savedUser.remove();\n }\n return _context3.abrupt('return', generalError(res, err));\n\n case 7:\n case 'end':\n return _context3.stop();\n }\n }\n }, _callee3, _this2);\n }));\n\n return function (_x4) {\n return _ref3.apply(this, arguments);\n };\n }());\n}", "deposit(amt){\n\n if(amt > 0) { //only allows deposits that are greater then zero\n\n //1. create a transaction instance using amount passed in\n let newTransaction = new Transaction(amt, \"Deposit\");\n //2. add this newly created transaction to the transaction array\n this.transactions.push(newTransaction);\n\n }\n}", "createStock(req, res) {\n StockModel.create(req.body)\n .then((stockProduct) => res.send(stockProduct))\n .catch((err) => res.send(err));\n }", "create(restaurant) {\n let sqlRequest = \"INSERT into restaurants (name, description) \" +\n \"VALUES ($name, $description)\";\n let sqlParams = {\n $name: restaurant.name,\n $description: restaurant.description\n };\n return this.common.insert(sqlRequest, sqlParams).then(lastid => {\n return this.findById(lastid);\n });\n }", "create(data) {\n return http.post(\"/orders\", data);\n }", "async function createListing(event) {\n if (event) {\n event.preventDefault();\n }\n\n try {\n const { askingPrice, itemName, itemDesc, saleType } = formik.values;\n if (saleType === \"0\") {\n // invoke createListing method in marketplace contract to generate listing with given details, and asking price converted to wei\n await contracts.marketplace.methods\n .createListing(\n itemName,\n itemDesc,\n Web3.utils.toWei(askingPrice.toString(), \"ether\")\n )\n .send({ from: accounts[0] });\n } else if (saleType === \"1\") {\n // invoke createListing method in firstAuction contract\n await contracts.firstAuction.methods\n .createListing(itemName, itemDesc)\n .send({ from: accounts[0] });\n } else if (saleType === \"2\") {\n // invoke createListing method in secondAuction contract\n await contracts.secondAuction.methods\n .createListing(itemName, itemDesc)\n .send({ from: accounts[0] });\n } else if (saleType === \"3\") {\n // invoke createListing method in averageAuction contract\n await contracts.averageAuction.methods\n .createListing(itemName, itemDesc)\n .send({ from: accounts[0] });\n }\n } catch (ex) {\n // Catch any errors for any of the above operations.\n console.log(\"Error while creating listing\", ex);\n }\n }", "function createObject(e){\n\t\n\t// create random object data\n\tvar object={\n\t\tname: 'PeppaTest Object' + Math.floor(Math.random()*100),\n\t\tstatus: 'created',\n\t\tcost: 2.99\n\t};\n\t\n\t// Now Save It\n\tapi.Object.Create('PeppaTest',object,function(r){\n\t\tif(r.success){\n\t\t\talert('New Object persisted to server');\n\t\t}\n\t});\t\n\t\n}", "create(e) {\n e.preventDefault();\n let id = $(\"#id\").val();\n let des = $(\"#description\").val();\n let price = $(\"#price\").val();\n let rooms = $(\"#rooms\").val();\n let mail = $(\"#mail\").val();\n let name = $(\"#name\").val();\n let pho = $(\"#phoneNr\").val();\n let re = new Rent(id, des, price, rooms, mail, name, pho);\n reReg.create(re, function () {\n window.location.href='/view/Rent.html';\n });\n }", "function create(sender_psid, stepNew) {\n\n var report = [];\n var d = new Date();\n\n //creates a report object\n report[0] = new Report({\n sender_id: sender_psid,\n step: stepNew,\n response: \"\",\n responseAux: { \"text\": \"Responda utilizando los botones por favor.\" },\n responseAuxIndicator: 0,\n fromApp: true,\n cause: \"no cause indicated\",\n damages: \"no damages indicates\",\n date: d.getTime(),\n observation: \".\",\n X: 0,\n Y: 0,\n address: \"no addresss indicated\",\n img: \"no image\",\n tomarControl: false,\n formatedDate: d.toLocaleString() + \" \" + d.toTimeString()\n });\n\n //saves the created report object into the mongo data base\n report[0].save(function () {\n console.log(\"creado\");\n });\n\n //returns the created report\n return report;\n}", "function addRecord(){\r\n\r\n\tlet codigo = document.getElementById('codigo').value;\r\n\tlet nombre = document.getElementById('nombre').value;\r\n\tlet precio = document.getElementById('precio').value;\r\n\r\n\tproductos.push(new IngrProducto(codigo,nombre,precio));\r\n\r\n}", "function create(req,res){\n \n let product=new Product(req.body); // obtengo los valores del cuerpo de la peticion\n if(!req.body.name || !req.body.tipo) return res.status(500).send({message:'debe introducir un nombre o tipo'}) // si no tiene el nombre o el tipo relenado no dejo guardar en la base de datos\n console.log({product}) \n return product.save().then(product => res.status(201).send({mensage:\"Creado\",product})) // lo guardo en la base de datos\n .catch(error => res.status(500).send(error)); // si da fallo mando un mensage no discrimina err tipo y duplicado de entrada \n}", "function addNewProduct(cart, name, price) {\n let product = new Product(name, price, id++);\n cart.push(product);\n paintNewRow(product);\n}", "function handleClick(){\n base('reservation').create([\n {\n \"fields\": {\n \"res_cus_id\" : [newCustomerId],\n \"res_date\": moment(newDate).format('YYYY-MM-DDTHH:mm:ssZ'),\n \"res_em_id\": [newEmployeeId],\n \"res_remark\" : newRemark,\n }\n }\n ], function(err, records) {\n if (err) {\n console.error(err);\n alert(err);\n return;\n }\n records.forEach(function (record) {\n console.log(record.getId());\n alert(\"完成新增\");\n });\n });\n handleClose();\n }", "function Salad() {\n this.size = 0;\n this.additions = 0;\n this.deliveryfee = 0;\n this.totalcost = 0;\n this.type = \"Salad\";\n}", "saveProduct(productData) {\r\n let nuevoProducto = new Product(productData);\r\n let indice = this._checkExist(productData.code);\r\n console.log(indice);\r\n this._inventory[this._inventory.length] = nuevoProducto;\r\n console.log(nuevoProducto);\r\n console.log(this._inventory);\r\n }", "sellItem(req, res, next) {\n const newItem = req.body;\n delete newItem.categories;\n const sellerId = (req.user ? req.user.user.id : 39);\n\n newItem.images = JSON.stringify(newItem.images);\n console.log('Creating new item,', newItem);\n db.items.create(newItem)\n .then(product => {\n db.items.getById(product[0])\n .then((result) => {\n const id = result[0].id;\n const transaction = { item_id: id, buyer_id: null, seller_id: sellerId };\n res.json(result[0]);\n return db.transactions.create(transaction);\n })\n .catch(e => { console.log('Error getting item, ', e); next(e); });\n })\n .catch(e => { console.log('Error inserting item, ', e); next(e); });\n }", "function create(req, res) {\n const { data: { deliverTo, mobileNumber, dishes } = {} } = req.body;\n const newOrder = {\n id: nextId(),\n deliverTo: deliverTo,\n mobileNumber: mobileNumber,\n status: \"pending\",\n dishes: dishes,\n }\n orders.push(newOrder);\n res.status(201).json({ data: newOrder });\n}", "function create(req, res) {\n const {\n data: { id, name, description, price, image_url },\n } = req.body;\n\n const newId = nextId();\n const newName = req.body.data.name;\n const newDescription = req.body.data.description;\n const newPrice = req.body.data.price;\n const newImageUrl = req.body.data.image_url;\n\n const newDish = {\n id: newId,\n name: newName,\n description: newDescription,\n price: newPrice,\n image_url: newImageUrl,\n };\n dishes.push(newDish);\n res.status(201).json({ data: newDish });\n}", "function create(req, res) {\n const { data: { name, price, description, image_url } = {} } = req.body;\n const newDish = {\n id: nextId(), //function gives a new id to new dish\n name,\n price,\n description,\n image_url,\n };\n dishes.push(newDish);\n res.status(201).json({ data: newDish });\n}", "function createTypePayment(req, res) {\n const body = req.body;\n typePaymentModel.create(body, (err, data) => {\n if (err) {\n res.status(200).send({ status: false, message: 'Fallo al crear el tipo de pago' });\n } else {\n res.status(200).send({ status: true, message: 'Tipo de pago creado exitósamente' });\n }\n });\n}", "function create(req, res, next) {\n const { data: order = {} } = req.body;\n\n const newOrder = {\n id: nextId(),\n deliverTo: order.deliverTo,\n mobileNumber: order.mobileNumber,\n status: order.status,\n dishes: order.dishes,\n };\n //add to orders list\n orders.push(newOrder);\n\n res.status(201).json({ data: newOrder });\n}", "buyItems(item){\n let shopSells = new Shop('magic shop', 'sells magic things')\n this.items.push(item);\n shopSells.sellItems(item);\n }", "async function createProducts(req, res) {\n try {\n const body = await getPostData(req);\n const { title, description, price } = JSON.parse(body);\n\n const product = {\n title,\n description,\n price,\n };\n\n const newProduct = await ProductModel.createNewData(product);\n res.writeHead(201, { \"Content-Type\": \"application/json\" });\n return res.end(JSON.stringify(newProduct));\n } catch (error) {\n console.log(error);\n }\n}", "async store({ request, response }) {\n\t\tlet products = Product.create(request.only([\n\t\t\t'sku', 'name', 'description', 'brand',\n\t\t\t'buy_price', 'sell_price', 'stock_quantity'\n\t\t]));\n\n\t\tproducts.status = 'AVAILABLE';\n\t\treturn response.status(201).json({\n\t\t\tmessage: 'Product created successfully.',\n\t\t\tproducts\n\t\t});\n\t}", "async creatProduct({ commit }, payload) {\r\n try {\r\n let newone = await productsFunctions.postProduct(payload);\r\n\r\n commit(\"setProducts\", newone);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }", "function create(req, res) {\n // add validation kapag empty yung value sa req.body at kapag empty yung request.\n let data = {\n name: req.body.name,\n qty: req.body.qty,\n amount: req.body.amount\n };\n\n connection.query('INSERT INTO items SET ?', data, function(error, results) {\n if (error) {\n res.status(500).send({ message: 'Error occured while adding item.' });\n }\n // if sucess, add the ID of new item into data object.\n data.id = results.insertId;\n apiResult = {\n message: 'Successfully created.',\n total: results.length,\n data \n };\n\n res.send(apiResult);\n });\n }", "create(req, res) {\n Item.create(req.body)\n .then((newItem) => {\n res.status(200).json(newItem);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "function createShopItem(imageLink, bulkQty, description, price) {\n this.imageLink = imageLink;\n this.bulkQty = bulkQty; \n this.description = description;\n this.price = price;\n}", "create(req, res) {\n RegistroEstudo.create(req.body)\n .then(function (newRegistroEstudo) {\n res.status(200).json(newRegistroEstudo);\n })\n .catch(function (error) {\n res.status(500).json(error);\n });\n }", "create(req, res) {\n return OrderDetails.create({\n OrderId: req.params.orderid,\n ItemId: req.body.itemid,\n quantity: req.body.quantity\n })\n .then(orderitem => res.status(201).send(orderitem))\n .catch(error => res.status(400).send(error));\n }", "function createRandomCatalog(num){\n var catalog = [];\n for (var i = 0; i < num; i++){\n var obj = createRandomProduct();\n catalog.push({id:i,price:obj.price,type:obj.type});\n }\n return catalog;\n}", "function insertReservation(people_count, table_id, start_date, end_date) {\n const obj = { people_count, table_id, start_date, end_date };\n queries.insertReservation(obj)\n .then(data => {});\n\n return obj;\n}", "create(req, res, next) {\n const instrumentProps = req.body;\n\n Instrument.create(instrumentProps)\n .then(instrument => res.send(instrument))\n .catch(next)\n }", "function newInvoices() {\n return {\n foo: 130,\n bar: 250\n };\n}", "function create(req, res, next) {\n const data = {\n name: req.body.name,\n quantity: req.body.quantity,\n price: req.body.price,\n orderId: req.params.orderId\n };\n orderItemDao.create(data)\n .then((neworderItem, created) => {\n if (!neworderItem) {\n res.send(false);\n }\n if (neworderItem) {\n res.json(neworderItem);\n }\n });\n}", "async function addNewItem(req, res) {\ntry{\nconst newitem=new Item({\n name:req.body.name,\n costPrice:req.body.costPrice,\n sellPrice: req.body.sellPrice,\n qnty:req.body.qnty\n})\nawait newitem.save()\nres.status(201).json(newitem)\n}catch(error){\nthrow new Error(\"not save\")\n}\n}", "notify (storeName, discount) {\n this.sales.push({ storeName, discount })\n }", "async function createOrder(id, buyerID, sellerID, items) {\n const orderRegistry = await businessNetworkConnection.getAssetRegistry(\n `${NS}.Order`,\n );\n\n const order = factory.newResource(NS, 'Order', id);\n order.status = 'SUBMITTED';\n order.memo = '';\n order.amount = 0;\n order.items = items;\n order.buyer = factory.newRelationship(NS, 'Buyer', buyerID);\n\n await orderRegistry.add(order);\n\n const orderCreating = factory.newTransaction(NS, 'OrderCreating');\n orderCreating.paymentMethod = 'COD';\n orderCreating.buyer = factory.newRelationship(NS, 'Buyer', buyerID);\n orderCreating.seller = factory.newRelationship(NS, 'Seller', sellerID);\n orderCreating.order = factory.newRelationship(\n NS,\n 'Order',\n order.getIdentifier(),\n );\n\n await businessNetworkConnection.submitTransaction(orderCreating);\n\n return order;\n }", "function create(params) {\n var loan = new RequestLoan();\n loan.resource = params.resource;\n loan.user = params.user;\n return loan;\n}", "function saveNew(res, req, type){\n var newFactory = {\n name: req.body.name,\n email: req.body.email,\n phone_number: req.body.phone_number,\n city: req.body.city,\n state: req.body.state,\n company_type: type\n };\n factoryStore.add(newFactory, function(err) {\n if (err) throw err;\n\n res.json(newFactory);\n });\n}", "function createManager (data){\n const theManager = new Manager (data.name,data.id,data.email,data.officeNumber)\n emplyArr.push(theManager)\n}", "async createNewInstance() {\n const adapters = this.processAdapters();\n const datastores = this.api.config.models.datastores;\n const models = await this.loadModels();\n\n const ormStart = promisify(Waterline.start);\n\n this.waterline = await ormStart({\n adapters,\n datastores,\n models,\n });\n }", "function addNewProduct(req, res, next) {\n     requestCounterPost++;\n     console.log(\"   Request counter: \" +  requestCounterPost);\n console.log(\"sending request\")\n // json payload of the request\n var newProduct = req.body;\n\n productsSave.create(newProduct, function(err, product){\n var requestCounterString = \"======> Request Count: \" + requestCounterPost + \"\\n======================================\";\n console.log(\"Created new products\")\n // send 201 HTTP response code and created product object\n res.send(201, product);\n next();\n })\n}", "function saveProducts(productList){\n productList.forEach( product => {\n const newProduct = new productModel({\n title: product.title,\n ingredients: product.ingredients,\n description: product.description,\n category: product.category,\n price: product.price,\n cookingTime: product.cookingTime,\n calories: product.calories,\n featured: product.featured,\n available: product.available\n });\n newProduct.save( (err) => {\n if(err)\n console.log(err)\n else\n console.log(`${newProduct.title} Added to db`);\n })\n });\n}", "function createMeal(data) {\n id = \"\" + (new Date()).getTime();\n var meal = data;\n meal.id = id;\n meal.cook = cache.get(\"account\");\n _meals[id] = meal;\n}", "function addToAdmin(newObject){\n var line = {};\n line.Brand = newObject.brand;\n line.skuCode = newObject.skuCode;\n var supplierCode = newObject.supplierCodeList; \n line.attribute = newObject.attribute;\n line.attributeCount = newObject.attributeCount;\n line.ohmies = newObject.ohmies;\n line.wholesale = newObject.wholesale;\n line.msrp = newObject.msrp;\n var supplierRow = searchString(supplierCode);\n addNewRows(\"ADMIN_INFO\", supplierRow, 1, line)\n \n}", "static createAdventure(name,creator){\n return db.one(`insert into adventures\n (name,creator)\n values\n ($1,$2)\n returning id\n `, [name,creator])\n .then(data => {\n return new Adventure(data.id,name,creator)\n })\n }", "async createPayment (req, res) {\n try {\n const {orderId, employeeId} = req.body\n const order = await Order.findOne({\n where: {\n id: orderId\n }\n })\n const payment = await Payment.create({\n date: new Date(),\n sum: order.sum,\n employeeId: employeeId,\n createdAt: new Date()\n })\n /* After creating payment update order with foreign key */\n await Order.update({\n sum: order.sum,\n paymentId: payment.id,\n orderStateId: 4,\n employeeId: employeeId\n }, {\n where: {\n id: orderId\n }\n })\n res.send(payment)\n } catch (err) {\n console.log(err)\n res.status(500).send({\n error: 'An error has occured during creating'\n })\n }\n }", "function createCashier(req, res) {\n\n}", "function salesman(name1, age2){\n\tthis.name = name1;\n\tthis.age = age2;\n\tthis.showDetails=function(){\n\t\treturn this.name + \":\" + this.age;\n\t};\n}", "function createNewCatalog() {\n en.catalog.create(locationName, \n function(data) {\n locationID = data.response.id;\n },\n function(data) {\n error(\"Couldn't create catalog \" + locationName);\n }\n );\n}", "static createInstance(id, owner, tenant, price, metadata) {\n return new Estate({ id, owner, tenant, price, metadata });\n }", "constructor(n,p,s){\n this.name=n;\n this.price=p;\n this.shipping=s;\n }" ]
[ "0.5983404", "0.5942628", "0.58485675", "0.5845935", "0.5708195", "0.5590028", "0.55855465", "0.5555529", "0.55540186", "0.5527645", "0.5524985", "0.55055046", "0.5498997", "0.54971945", "0.5478306", "0.54668516", "0.54549795", "0.54534227", "0.54403514", "0.5413414", "0.54014784", "0.53952426", "0.538955", "0.5381025", "0.53806806", "0.53672594", "0.53570676", "0.5344037", "0.5336704", "0.5323577", "0.53230965", "0.5315367", "0.53112495", "0.5298836", "0.529686", "0.5296801", "0.52934486", "0.5279542", "0.52755463", "0.5256222", "0.5256212", "0.5253529", "0.52484566", "0.5247735", "0.52436024", "0.52408653", "0.52384144", "0.5238024", "0.5234476", "0.5231801", "0.5228493", "0.5227128", "0.5224326", "0.5212568", "0.52090985", "0.5205395", "0.5195153", "0.5190564", "0.5187236", "0.5185948", "0.51843274", "0.51740825", "0.517272", "0.5171354", "0.51672053", "0.51489097", "0.5147591", "0.514535", "0.51403385", "0.51389885", "0.5137871", "0.51364356", "0.51362157", "0.51324874", "0.5121097", "0.5120632", "0.5118229", "0.51166475", "0.5111983", "0.5104076", "0.51006776", "0.50969195", "0.5082837", "0.50769305", "0.5072151", "0.5068206", "0.50648797", "0.5059773", "0.50545084", "0.5049414", "0.50491756", "0.5048889", "0.5046603", "0.50387454", "0.5037463", "0.5033285", "0.5033126", "0.50248766", "0.50204605", "0.5017234" ]
0.55880404
6
validateForm() validate form by selector string.
function validateForm(formSelector) { var isValid = true; $(formSelector + ' :input').each(function() { if ($(this).val() === '') { isValid = false; } }); return isValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateForm(selector) {\n var formInput = $(selector).find('input');\n $.each(formInput, function(index, _input) {\n $(_input).on('focus', function() {\n // -------------------------------When focus on input ---------------------------------------------------\n $(_input).addClass('input-focus');\n if ($(_input).siblings('.select-option').length != 0) {\n showOption($(_input).siblings(\".select-option\"), function() {});\n }\n if ($(_input).val() != \"\") {\n $(_input).siblings(\".xselect\").css('visibility', 'visible');\n delOption(_input, \"\");\n }\n if (validateInput(_input) == false) {\n $(_input).parent().find(\".tooltipMgs\").remove();\n }\n })\n $(_input).on('blur', function() {\n $(_input).siblings(\".xselect\").css('visibility', 'hidden');\n $(_input).removeClass('input-focus');\n $(_input).parent().find(\".tooltipMgs\").remove();\n if ($(_input).siblings('.select-option').length != 0) {\n hideOption($(_input).siblings(\".select-option\"), function() {});\n }\n if (validateInput(_input) == false) {\n $(_input).addClass(\"invalid-input\");\n $(_input).removeClass(\"input-focus\");\n }\n })\n })\n}", "function isValidForm(formSelector) {\n var formList = document.querySelectorAll(formSelector + \" input, \" + formSelector + \" select\");\n var invalid = 0;\n formList.forEach(function (element) {\n if (element.value === \"\" || element.value === \"-\") {\n element.style.border = \"solid 3px red\";\n invalid++;\n } else {\n element.style.border = \"solid 1px gray\";\n }\n })\n return invalid === 0;\n}", "function formValidate(form) {\n function camelCase(string) {\n string = string||'';\n string = string.replace(/\\(|\\)/,'').split(/-|\\s/);\n var out = [];\n for (var i = 0;i<string.length;i++) {\n if (i<1) {\n out.push(string[i].toLowerCase());\n } else {\n out.push(string[i][0].toUpperCase() + string[i].substr(1,string[i].length).toLowerCase());\n }\n }\n return out.join('');\n }\n\n function nullBool(value) {\n return (value);\n }\n\n function getGroup(el) {\n return {\n container: el.closest('.form-validate-group'),\n label: $('[for=\"' + el.attr('id') + '\"]'),\n prompt: el.closest('.form-validate-group').find('.form-validate-prompt')\n }\n }\n\n function isValid(el) {\n function getType() {\n var attr = camelCase(el.attr('id')).toLowerCase();\n var tag = (el.attr('type') === 'checkbox') ? 'checkbox' : el[0].tagName.toLowerCase();\n function type() {\n var _type = 'text';\n if (attr.match(/zip(code|)/)) {\n _type = 'zipCode';\n } else if (attr.match(/zippostal/)) {\n _type = 'zipPostal';\n } else if (attr.match(/(confirm|)(new|old|current|)password/)) {\n _type = 'password'\n } else if (attr.match(/(confirm|)([a-zA-Z0-9_-]+|)email/)) {\n _type = 'email';\n } else if (attr.match(/(confirm|)([a-zA-Z0-9_-]+|)(phone)(number|)/)) {\n _type = 'phone';\n } else if (attr.match(/merchantid/)) {\n _type = 'merchantId';\n } else if (attr.match(/marketplaceid/)) {\n _type = 'marketplaceId';\n } else if (attr.match(/number/)) {\n _type = 'number';\n }\n return _type;\n }\n if (tag === 'input' || tag === 'textarea') {\n return type();\n } else {\n return tag;\n }\n } // Get Type\n var string = el.val()||'';\n var exe = {\n text: function () {\n return (string.length > 0);\n },\n password: function () {\n return (string.length > 6 && nullBool(string.match(/^[\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)a-zA-Z0-9_-]+$/)));\n },\n zipCode: function () {\n return (nullBool(string.match(/^[0-9]{5}$/)));\n },\n zipPostal: function () {\n return (nullBool(string.match(/^([0-9]{5}|[a-zA-Z][0-9][a-zA-Z](\\s|)[0-9][a-zA-Z][0-9])$/)));\n },\n email: function () {\n return (nullBool(string.match(/[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+\\.([a-z]{2}|[a-z]{3})/)));\n },\n merchantId: function () {\n var match = string.match(/^[A-Z0-9]+$/);\n return ((match) && (match[0].length > 9 && match[0].length < 22));\n },\n marketplaceId: function () {\n var match = string.match(/^[A-Z0-9]+$/);\n var length = {'United States of America':13}[region()];\n return ((match) && (match[0].length === length));\n },\n select: function () {\n return (el[0].selectedIndex > 0);\n },\n checkbox: function () {\n return el[0].checked;\n },\n phone: function () {\n return (nullBool(string.replace(/\\s|\\(|\\)|\\-/g,'').match(/^([0-9]{7}|[0-9]{10})$/)));\n },\n number: function () {\n return nullBool(string.match(/^[0-9\\.\\,]+$/));\n }\n }\n return exe[getType()]();\n }; // contentsValid\n\n return {\n confirm: function (el) {\n\n function condition(el) {\n var bool = dingo.get(el).find('form-validate').condition||false;\n if (bool && el.val().length > 0) {\n return el;\n } else {\n return false;\n }\n }\n\n function dependency(el) {\n // Needs to use recursion to climb the dependency tree to determine whether or not\n // the element is dependent on anything\n var dep = $('#' + dingo.get(el).find('form-validate').dependency);\n if (dep.size() > 0) {\n return dep;\n } else {\n return false;\n }\n }\n\n function confirm(el) {\n var match = $('#' + dingo.get(el).find('form-validate').confirm);\n if (match.size()) {\n return match;\n } else {\n return false;\n }\n }\n\n function normal(el) {\n var check = dingo.get(el).find('form-validate');\n var out = true;\n var attr = ['condition','dependency','confirm'];\n $.each(attr,function (i,k) {\n if (typeof check[k] === 'string' || check[k]) {\n out = false;\n }\n });\n return out;\n }\n\n function validate(el) {\n var group = getGroup(el);\n function exe(el,bool) {\n if (bool) {\n el.removeClass('_invalid');\n group.label.addClass('_fulfilled');\n animate(group.prompt).end();\n group.prompt.removeClass('_active');\n } else {\n el.addClass('_invalid');\n group.label.removeClass('_fulfilled');\n }\n }\n return {\n condition: function () {\n exe(el,isValid(el));\n },\n dependency: function (match) {\n if (normal(match) || condition(match)) {\n exe(el,isValid(el));\n }\n },\n confirm: function (match) {\n if (el.val() === match.val()) {\n exe(el,true);\n } else {\n exe(el,false);\n }\n },\n normal: function () {\n exe(el,isValid(el));\n }\n }\n }\n\n if (condition(el)) {\n validate(el).condition();\n } else if (dependency(el)) {\n validate(el).dependency(dependency(el));\n } else if (confirm(el)) {\n validate(el).confirm(confirm(el));\n } else if (normal(el)) {\n validate(el).normal();\n }\n },\n get: function () {\n return form.find('[data-dingo*=\"form-validate\"]').not('[data-dingo*=\"form-validate_submit\"]');\n },\n init: function (base, confirm) {\n if (el.size() > 0) {\n parameters.bool = bool;\n formValidate(el).fufilled();\n return formValidate(el);\n } else {\n return false;\n }\n },\n is: function () {\n return (form.find('.form-validate').size() < 1);\n },\n check: function () {\n var el;\n formValidate(form).get().each(function () {\n formValidate(form).confirm($(this));\n });\n return form.find('._invalid');\n },\n submit: function (event) {\n var out = true;\n var requiredField = formValidate(form).check();\n if (requiredField.size() > 0) {\n requiredField.each(function () {\n var group = getGroup($(this));\n group.prompt.addClass('_active');\n group.prompt.css('top',group.container.outerHeight() + 'px');\n if (typeof animate === 'function') {\n animate(group.prompt).start();\n }\n })\n if (requiredField.eq(0).closest('[class*=\"modal\"]').size() < 1) {\n if (typeof animate === 'function') {\n if (!dingo.isMobile()) { \n animate(requiredField.eq(0)).scroll(); \n }\n }\n requiredField.eq(0).focus();\n }\n out = false;\n }\n return out;\n }\n }\n}", "function validateForm() {\n\t\n\tvar error = 0;\n\t$('input').each(function(x,y) {\n\t\tvar val = $(y).val();\n\t\tif(!validate(y.name, val)) {\n\t\t\t$(y).css('border', 'solid 1px red')\n\t\t\terror = 1;\n\t\t} else {\n\t\t\t$(y).css('border', 'solid 1px 888');\n\t\t}\n\t});\n\t\n\t$('textarea').each(function(x,y) {\n\t\tvar val = $(y).val();\n\t\tif(!validate(y.name, val)) {\n\t\t\t$(y).css('border', 'solid 1px red')\n\t\t\terror = 1;\n\t\t} else {\n\t\t\t$(y).css('border', 'solid 1px 888');\n\t\t}\n\t});\n\t\n\tif(error === 1) {\n\t\treturn false;\n\t}\n}", "function validateForm(el) {\n\n\tvar isValid = true;\n\t$('.validation-error').remove();\n\t$(el).find(\"input,select, textarea\").each(function () {\n\t\tif (typeof ($(this).attr(\"require\")) != \"undefined\" && $.trim($(this).val()) == \"\") {\n\t\t\t$(this).addClass('invalid-input');\n\t\t\t$(this).parent('div').append(\"<span class='validation-error'><i class='glyphicon glyphicon-exclamation-sign'></i>\" + $(this).attr('data-validation-message') + \"</span>\");\n\t\t\tisValid = false;\n\t\t\t$('form .col-xs-4,form .col-xs-6,form .col-sm-4,form .col-sm-6').matchHeight();\n\t\t} else if (typeof ($(this).attr(\"require\")) != \"undefined\" && $.trim($(this).val()) != \"\") {\n\t\t\t$(this).removeClass('invalid-input');\n\n\t\t}\n\t});\n\n\treturn isValid;\n}", "function validateForm(event)\n{\n\tevent.preventDefault();\n\n\t//save the selection of the form to a variable\n\tvar form = document.querySelector('form');\n\t//save the selection of the required fields to an array\n\tvar fields = form.querySelectorAll('.required');\n\n\t//set a default value that will be used in an if statement\n\tvar valid = true;\n\n\t//check each box that has the required tag\n\tfor(var i = 0; i < fields.length; i++)\n\t{\n\t\t//check that the field has a value\n\t\t//if it does not\n\t\tif(!fields[i].value)\n\t\t{\n\t\t\t//valid is false\n\t\t\tvalid = false;\n\t\t}\n\t}\n\n\t//if valid is true by the end\n\t//each box should have a value\n\tif(valid == true)\n\t{\n\t\t//remove our disabled class from the button\n\t\tbtn.removeAttribute('class');\n\t\t//set the disabled property to false\n\t\tbtn.disabled = false;\n\t}\n}", "function validateForm() {\n\n\tvar valid = true;\n\n\tif (!validateField(\"firstname\"))\n\t\tvalid = false;\n\n\tif (!validateField(\"lastname\"))\n\t\tvalid = false;\n\n\tif (!checkPasswords())\n\t\tvalid = false;\n\n\tif (!checkEmail())\n\t\tvalid = false;\n\n\tif (valid)\n\t\tsubmitForm();\n\n\t// Return false to make sure the HTML doesn't try submitting anything.\n\t// Submission should happen via javascript.\n\treturn false;\n}", "function MM_validateForm() { //v4.0\n var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;\n for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);\n if (val) { nm=val.name; if ((val=val.value)!=\"\") {\n if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');\n if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\\n';\n } else if (test!='R') { num = parseFloat(val);\n if (isNaN(val)) errors+='- '+nm+' must contain a number.\\n';\n if (test.indexOf('inRange') != -1) { p=test.indexOf(':');\n min=test.substring(8,p); max=test.substring(p+1);\n if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\\n';\n } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\\n'; }\n } if (errors) alert('The following error(s) occurred:\\n'+errors);\n document.MM_returnValue = (errors == '');\n}", "function verifyFormData(form) {\n\t\n\tif (hasErrors) hasErrors = false;\n\t\n\tif (form == null) return false;\n\t\n\tvar elements = form.elements;\n\tif (elements.length == 0) return false;\n\t\n\tfor (var i = 0; i < elements.length; i++){\n\t\tvar element = elements[i];\n\t\t\n\t\t// checking text boxes \n\t\tif (element.tagName == \"INPUT\" && element.type && element.type == \"text\" && !element.optional) {\n\t\t\t\n\t\t\tif (element.value == null || element.value.trim() == \"\"){\n\t\t\t\t\n\t\t\t\thasErrors = true;\n\t\t\t\tvar error = document.getElementById(element.name);\n\t\t\t\terror.style.display = \"block\";\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tvar error = document.getElementById(element.name);\n\t\t\t\terror.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// checking radio buttons\n\t\tif (element.tagName == \"INPUT\" && element.type && element.type == \"radio\" && !element.optional) {\n\t\t\t\n\t\t\tvar elementName = element.name;\n\t\t\tvar radioGroup = document.getElementsByName(elementName);\n\t\t\t\n\t\t\tif (radioGroup[0].checked == false && radioGroup[1].checked == false) {\n\t\t\t\t\n\t\t\t\thasErrors = true;\n\t\t\t\tvar error = document.getElementById(elementName);\n\t\t\t\terror.style.display = \"block\";\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tvar error = document.getElementById(elementName);\n\t\t\t\tif (error != null)\n\t\t\t\t\terror.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t\t\n\t// checking text areas\n\t\tif (element.tagName == \"TEXTAREA\" && !element.optional) {\n\t\t\tif (element.value == null || element.value.trim() == \"\"){\n\t\t\t\t\n\t\t\t\thasErrors = true;\n\t\t\t\tvar error = document.getElementById(element.name);\n\t\t\t\tif (error != null)\n\t\t\t\t\terror.style.display = \"block\";\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tvar error = document.getElementById(element.name);\n\t\t\t\tif (error != null)\n\t\t\t\t\terror.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// checking the drop down or select\n\t\tif (element.tagName == \"SELECT\" && !element.optional) {\n\t\t\tif (element.value == null || element.value.trim() == \"\"){\n\t\t\t\t\n\t\t\t\thasErrors = true;\n\t\t\t\tvar error = document.getElementById(element.name);\n\t\t\t\tif (error != null)\n\t\t\t\t\terror.style.display = \"block\";\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tvar error = document.getElementById(element.name);\n\t\t\t\tif (error != null)\n\t\t\t\t\terror.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\t\n\tif (hasErrors == true){\n\t\tvar title = \"Fix Errors Before Continuing\";\n\t\tvar message = \"Oops, looks like you did not fill out the required fields, please go back to \" +\n\t\t \"the survey and fill them up.\";\n\t\tshowMessageBox(title, message);\n\t\treturn false;\n\t}\n\t\n\telse return true;\n}", "validateForm(e, name, select) {\n\t\tif(!this.re.test(name.value)) {\n\t\t\te.preventDefault();\n\t\t\tname.style.border = '1px solid red';\n\t\t\tthis.nameWarning.classList.add('warning');\n\t\t} else if(select.value === '') {\n\t\t\te.preventDefault();\n\t\t\tselect.style.border = '1px solid red';\n\t\t\tthis.selectWarning.classList.add('warning');\n\t\t}\n\t}", "function validateForm(form) {\n var idx;\n var formValid = true;\n\n if (occupationSelect.value == 'other') {\n requiredFields.push('occupationOther');\n }\n\n //retrieves the required field elements\n for (idx = 0; idx < requiredFields.length; ++idx) {\n var requiredField = form.elements[requiredFields[idx]];\n formValid &= validateRequiredField(requiredField);\n }\n return formValid;\n }", "function validateForm(frm) {\n var flag = true;\n if (!formInputValidations(frm)) {\n //console.log('formInputValidations');\n flag = false;\n }\n if (!formTextareaValidations(frm)) {\n //console.log('formTextareaValidations');\n flag = false;\n }\n if (!formSelectValidations(frm)) {\n //console.log('formSelectValidations');\n flag = false;\n }\n return flag;\n}", "function validate_form(){\n if (is_form_valid(form)) {\n sendForm()\n }else {\n let $el = form.find(\".input:invalid\").first().parent()\n focus_step($el)\n }\n }", "function validateForm(form) {\n\n var form = document.getElementById('edit-form');\n\tclearNotice();\n\n\tif (form.name.value.trim().length == 0) {\n\t\taddError('Please enter name.');\n\t}\n\n\tif (form.emailAddress.value.trim().length == 0) {\n\t\taddError('Please enter email.');\n\t}\n\n\tif (form.name.value.trim().length != 0 && isNotValidName(form.name.value)) {\n\t\taddError('Please enter valid name.');\n\t}\n\n\tif (form.emailAddress.value.trim().length != 0 && isNotValidEmail(form.emailAddress.value)) {\n\t\taddError('Please enter valid email.');\n\t}\n\n\tif (hasErrorNotice()) {\n\t\tdisplayNotice();\n\t\treturn false;\n\t}\n\n\tdisableButton();\n\tform.submit();\n\treturn true;\n}", "function isValidForm() {\n var mainTextValid = isValidRequiredTextAreaField(\"main_text\");\n var articleKeywordCategoryValid = isValidRequiredField(\"article_keyword_category\");\n var articleKeywordsValid = isValidRequiredKeywordsField(\"article_keywords\");\n var originalSourceURLValid = isValidUrlField(\"original_source_url\");\n return isValidPartialForm() && mainTextValid && articleKeywordCategoryValid && articleKeywordsValid && originalSourceURLValid;\n}", "function ValidaForm() {\n if ($('#txtTitulo').val() == '') {\n showErrorMessage('El Título es obligatorio');\n return false;\n }\n if ($('#dpFechaEvento').val() == '') {\n showErrorMessage('La Fecha de publicación es obligatoria');\n return false;\n }\n if ($('#txtEstablecimiento').val() == '') {\n showErrorMessage('El Establecimiento es obligatorio');\n return false;\n }\n if ($('#txtDireccion').val() == '') {\n showErrorMessage('La Dirección es obligatoria');\n return false;\n }\n if ($('#txtPrecio').val() == '') {\n showErrorMessage('El Precio es obligatorio');\n return false;\n }\n return true;\n}", "function validateForm()\n { \t \t\n \t\n \t$('#frmMain').addClass('submitted');\n \t\n \tvar validated = true;\n \t$('#frmMain').find(':input').each(function(){ \n \t\t\n \t\tvar id = $(this).prop('id');\n \t\tif(id!=\"\")\n \t\t{\n\t \t\tvar Value = $('#' + id).val(); \t\t\n\t \t\tvar requ = $(this).prop('required');\t\n\t \t\t \t\t\n\t \t\tif(Value == \"\" && requ == true) \t\t\n\t \t\t\tvalidated = false;\n \t\t}\n \t});\n\n \tif(validated == true)\n \t{ \t\t \t\t\t\n \t\tvar Lenght = $(\"#txtLengthInFeet\").val();\n \tvar Inch = $(\"#drpLengthInInch\").find(\"option:selected\").text();\n \tvar Fraction = $(\"#drpLengthInFraction\").find(\"option:selected\").text();\n \t\n \tvalidated = validateLength(Lenght,Inch,Fraction,\"Length\");\n \t}\n \t$('[data-required]').each(function() { \t\t\n \t if (!$(this).val()) \n \t {\n \t\t var id = $(this).attr('id') + 1;\n \t\t\n \t\t if ($(this).data('select2') && $('#' + id).is(':visible')) \n \t\t {\n \t\t \t$(\"#\"+id).addClass('error'); \n \t\t \tvalidated = false;\n \t\t }\n \t\t }\n \t});\n \t\n \treturn validated;\n \t\n }", "function validateForm() {\n validateFirstName();\n validateLastName();\n validateStreet();\n validateCity();\n validateZipCode();\n}", "function validateFields(selector) {\n var values = selector.map(function() {return $(this).val()}).get();\n return values.indexOf(\"\") === -1;\n}", "function validateForm(){\n\t//expresiones regulares para establecer la comparacion con el formulario\n\t\tvar nombreReg = /^[A-Za-z]+$/;\n\t\tvar correoReg = /^([\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4})?$/;\n\n\t//Rescatando los valores de los inputs\n\t\tvar nombre = $('#name').val();\n var apellido = $('#lastname').val();\n var correo = $('#input-email').val();\n var contrasena = $('#input-password').val();\n\n if(nombre == \"\" || !nombreReg.test(nombre)){\n \t$('#mensajeNombre').fadeIn();\n \t}else{\n \t\tif(apellido == \"\" || !nombreReg.test(apellido)){\n \t\t\t$('#mensajeApellido').fadeIn();\n \t\t\t}else{\n \t\t\t\tif(correo == \"\" || !correoReg.test(correo)){\n \t\t\t\t\t$('#mensajeMail').fadeIn();\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif(contrasena == \"\" || contrasena.length < 6 || contrasena == 'password' || contrasena == \"123456\" || contrasena == \"098765\"){\n \t\t\t\t\t\t$('#mensajePass').fadeIn();\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }", "function formValidator(){\n\t\tvar form = $(\"#create-client\");\n\t\tform.validate({\n\t\t\trules: {\n\t\t\t\tfullName: {\n\t\t\t\t\trequired: true,\n\t\t\t\t\tminlength: 5,\n\t\t\t\t\tmaxlength: 50,\n\t\t\t\t},\n\t\t\t\tphone: {\n\t\t\t\t\tdigits: true,\n\t\t\t\t\tmaxlength: 10,\t\n\t\t\t\t},\n\t\t\t\temail: {\n\t\t\t\t\temail: true,\n\t\t\t\t\tmaxlength: 100,\n\t\t\t\t},\n\t\t\t\taddress: {\n\t\t\t\t\tmaxlength: 100,\n\t\t\t\t},\n\t\t\t\tnationality: {\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmaxlength: 50,\n\t\t\t\t},\n\t\t\t\tdateOfBirth: {\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdate: true,\n\t\t\t\t},\n\t\t\t\teducation: {\n\t\t\t\t\tmaxlength: 100,\n\t\t\t\t},\n \t\t\t},\n \t\t\tinvalidHandler: function(event, validator) {\n \t\t\t\tresetError();\n\t\t\t\tvar errors = validator.numberOfInvalids();\n\t\t\t\tif(errors){\n\t\t\t\t\tshowError(validator);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function validateForm() {\n\n\tvar x, i, z, valid = true;\n\tx = document.getElementsByClassName(\"tab\");\n\ty = x[currentTab].getElementsByClassName(\"required\");\n\tz = x[currentTab].getElementsByTagName(\"select\");\n\n\tfor (i = 0; i < y.length; i++) { // Check every input field in the current tab\n\t\tif (y[i].value == \"\") { // Check if a field is empty\n\t\t y[i].className += \" invalid\"; // Add an \"invalid\" class to the field\n\t\t valid = false; // Set the current valid status to false\n\t\t}\n\t\tif (y[i].type == \"hidden\") {\n\t\t\tvalid = true;\n\t\t}\n\t}\n\n\tfor (i = 0; i < z.length; i++) { // Check every input field in the current tab\n\t\tif (z[i].value == \"\") { // Check if a field is empty\n\t\t z[i].className += \" invalid\"; // Add an \"invalid\" class to the field\n\t\t valid = false; // Set the current valid status to false\n\t\t}\n\t\tif (z[i].type == \"hidden\") {\n\t\t\tvalid = true;\n\t\t}\n\t}\n\n\tif (valid) { // If the valid status is true, mark the step as finished and valid\n\t\tdocument.getElementsByClassName(\"indicator\")[currentTab].className += \" finish\";\n\t}\n\treturn valid; // Return the valid status\n}", "function validateForm() {\n let res = true;\n //Valida cada uno de los campos por regex\n for (let key in regexList) {\n if (!evalRegex(key, document.forms[formName][key].value)) {\n setMsg(key, fieldList[key].error);\n res = false;\n } else setMsg(key, '');\n }\n\n //Valida la fecha de contrato\n if (!validateDate()) {\n setMsg('fechaContrato', fieldList['fechaContrato'].error);\n res = false;\n } else setMsg('fechaContrato', '');\n\n //Valida el salario introducido\n if (!validateSalary()) {\n setMsg('salario', fieldList['salario'].error);\n res = false;\n } else setMsg('salario', '');\n\n //Valida que la contraseña y la confirmacion sean iguales\n if (document.forms[formName]['passwordReply'].value != document.forms[formName]['password'].value) {\n setMsg('passwordReply', fieldList['passwordReply'].error);\n res = false;\n } else setMsg('passwordReply', '');\n\n //Valida si el usuario ya esta registrado\n if (validateUser(document.forms[formName]['usuario'].value)) {\n setMsg('usuario', 'El usuario ya ha sido registrado');\n res = false;\n }\n\n return res;\n}", "function validateForm() {\n\t\tvar fieldsWithIllegalValues = $('.illegalValue');\n\t\tif (fieldsWithIllegalValues.length > 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tkenyaui.clearFormErrors('htmlform');\n\n\t\tvar ary = $(\".autoCompleteHidden\");\n\t\t$.each(ary, function(index, value) {\n\t\t\tif (value.value == \"ERROR\"){\n\t\t\t\tvar id = value.id;\n\t\t\t\tid = id.substring(0, id.length - 4);\n\t\t\t\t$(\"#\" + id).focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\n\t\tvar hasBeforeSubmitErrors = false;\n\n\t\tfor (var i = 0; i < beforeSubmit.length; i++){\n\t\t\tif (beforeSubmit[i]() === false) {\n\t\t\t\thasBeforeSubmitErrors = true;\n\t\t\t}\n\t\t}\n\n\t\treturn !hasBeforeSubmitErrors;\n\t}", "function validateForm(){\n // Set error catcher\n var error = 0;\n // Check name\n if(!validateName('reg_name')){\n document.getElementById('nameError').style.display = \"block\";\n error++;\n }\n // Validate email\n var x =document.getElementById('reg_email').value;\n if(!validateEmail(x)){\n document.getElementById('emailError').style.display = \"block\";\n error++;\n }\n // Validate animal dropdown box\n if(!validateSelect('Occupation')){\n document.getElementById('animalError').style.display = \"block\";\n error++;\n }\n if(!validatePassword('reg_pass')){\n document.getElementById('pass_Error').style.display = \"block\";\n error++;\n }\n // Don't submit form if there are errors\n if(error > 0){\n return false;\n }\n else if(error == 0){\n regfun();\n }\n }", "function validateForm(tableName) {\n\n\tvar blnPopover = true;\n\tvar isError = true;\n\n\tvar table = document.getElementById(tableName);\n\tvar inputTag = table.getElementsByTagName(\"select\");\n\n\tif(!validateId(inputTag[0])) {\n\t\treturn false;\n\t}\n\tif(!validateId(inputTag[1])) {\n\t\treturn false;\n\t}\n\treturn isError;\n}", "function formValidation(formID) {\n var form = $('#' + formID);\n var fields = form.find('input, textarea');\n\n fields.on('focusout', function (field) {\n validate(field.target, validationRules[field.target.id]);\n });\n}", "function validateForm() {\n let result = false;\n $.each($(\".biginput\"), function(idx, element) {\n result = checkForm($(element).val());\n if (!result) return false;\n });\n\n return result;\n}", "function validateForm(the_form) {\n\tvalidForm = true;\t\t// assume the form is valid\n\tfirstError = null;\t\t// this will be the first element in the form that in not valid, if any. This var will allow the script to set the focus on that element\n\terrorstring = '';\t\t// a message used for non-W3C DOM browsers \n\t\n\t// should errors trigger a change in td color?\n\t// if the input_error_td form element is present \n\tif (the_form[input_error_td]) {\n\t\tchange_td_color = true;\t\n\t}\n\n\t\n\t// validate required fields\n\t// if there are required fields\n\tif (the_form[input_required_fields]) {\n\t\tvalidateFields_Required(the_form);\n\t}\n\n\t// validate numeric fields\n\t// if there are numeric fields\n\tif (the_form[input_numeric_fields]) {\n\t\tvalidateFields_Numeric(the_form)\n\t}\n\t\n\t// validate numeric range values\n\tvar numeric_range_name = input_numeric_range + '[0]';\t// the format of the first numeric range input name is the value of input_numeric_range plus [0], \"numeric_range[0]\". Remeber, this is a string, not really an array\n\tif (the_form[numeric_range_name]) {\n\t\tvalidateFields_IsInNumericRange(the_form);\n\t}\n\t\n\t\n\t// validate email fields\n\t// if there are email fields\n\tvar email_fields = new Array();\n\tif (the_form[input_email_fields]) {\n\t\t// the form passed can have a hidden field with a comma separated list of email fields to validate\n\t\t// split the value on the commas and pass that array\n\t\temail_fields = the_form[input_email_fields].value.split(',');\n\t\tvalidateFields_Email( the_form, email_fields );\n\t} else if (the_form.email) {\n\t\t// most forms just have one email field to validate. Look for an element named 'email'\n\t\temail_fields[0] = the_form.email.name;\n\t\tvalidateFields_Email( the_form, email_fields );\n\t}\n\t\n\t\n\t\n\t// if the browser is old, just alert a string\n\tif (!W3CDOM_validate_forms) {\n\t\talert(errorstring);\n\t}\n\t/*\n\t// this sets the focus of a form element, causing the cursor to move to the element. It is a bit buggy\n\tif (firstError) {\n\t\t//firstError.focus();\n\t}\n\t*/\n\t\n\t// alert a general message to indicate the form cannot be submitted\n\tif (!validForm) {\n\t\talert(invalid_form_message);\n\t}\n\n\t// return true or false\n\treturn validForm;\n}", "function formValidator() {\n\t$(\".form-validator\")\n\t\t\t.validate(\n\t\t\t\t\t{\n\t\t\t\t\t\tinvalidHandler : function(form, validator) {\n\t\t\t\t\t\t\tvar errors = validator.numberOfInvalids();\n\t\t\t\t\t\t\tif (errors) {\n\t\t\t\t\t\t\t\tvar message = errors == 1 ? 'You missed 1 field. It has been highlighted'\n\t\t\t\t\t\t\t\t\t\t: 'You missed '\n\t\t\t\t\t\t\t\t\t\t\t\t+ errors\n\t\t\t\t\t\t\t\t\t\t\t\t+ ' fields. They have been highlighted';\n\t\t\t\t\t\t\t\t$(\"div.error span\").html(message);\n\t\t\t\t\t\t\t\t$(\"div.error\").show();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$(\"div.error\").hide();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\trules : {\n\t\t\t\t\t\t\ttitlenews : {\n\t\t\t\t\t\t\t\trequired : true,\n\t\t\t\t\t\t\t\tminlength : 5\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttitle : \"required\",\n\t\t\t\t\t\t\tindustry : \"required\",\n\t\t\t\t\t\t\tjob_title : \"required\",\n\t\t\t\t\t\t\tjob : \"required\",\n\t\t\t\t\t\t\tcountry : \"required\",\n\t\t\t\t\t\t\tfirm_name : \"required\",\n\t\t\t\t\t\t\tfirstname : \"required\",\n\t\t\t\t\t\t\tlastname : \"required\",\n\t\t\t\t\t\t\tbegin_date : \"required\",\n\t\t\t\t\t\t\tusername : {\n\t\t\t\t\t\t\t\trequired : true,\n\t\t\t\t\t\t\t\tminlength : 2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpassword : {\n\t\t\t\t\t\t\t\trequired : true,\n\t\t\t\t\t\t\t\tminlength : 5\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpassword_confirm : {\n\t\t\t\t\t\t\t\trequired : true,\n\t\t\t\t\t\t\t\tminlength : 5,\n\t\t\t\t\t\t\t\tequalTo : \"#password\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\temail : {\n\t\t\t\t\t\t\t\trequired : true,\n\t\t\t\t\t\t\t\temail : true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdateformat : \"required\",\n\t\t\t\t\t\t\tterms : \"required\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmessages : {\n\t\t\t\t\t\t\ttitlenews : {\n\t\t\t\t\t\t\t\trequired : \"Enter a title\",\n\t\t\t\t\t\t\t\tminlength : jQuery\n\t\t\t\t\t\t\t\t\t\t.format(\"Enter at least {0} characters\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbegin_date : \"Select a begin date\",\n\t\t\t\t\t\t\tfirm_name : \"Provide a Firm name\",\n\t\t\t\t\t\t\tjob_title : \"Write a job title\",\n\t\t\t\t\t\t\ttitle : \"You must provide a title\",\n\t\t\t\t\t\t\tcountry : \"Select your country\",\n\t\t\t\t\t\t\tjob : \"Select your job\",\n\t\t\t\t\t\t\tdescription : \"Provide a description\",\n\t\t\t\t\t\t\tindustry : \"Write an industry\",\n\t\t\t\t\t\t\tdescription : \"Provide a description\",\n\t\t\t\t\t\t\tfirstname : \"Enter your firstname\",\n\t\t\t\t\t\t\tlastname : \"Enter your lastname\",\n\t\t\t\t\t\t\tusername : {\n\t\t\t\t\t\t\t\trequired : \"Enter a username\",\n\t\t\t\t\t\t\t\tminlength : jQuery\n\t\t\t\t\t\t\t\t\t\t.format(\"Enter at least {0} characters\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpassword : {\n\t\t\t\t\t\t\t\trequired : \"Provide a password\",\n\t\t\t\t\t\t\t\trangelength : jQuery\n\t\t\t\t\t\t\t\t\t\t.format(\"Enter at least {0} characters\")\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpassword_confirm : {\n\t\t\t\t\t\t\t\trequired : \"Repeat your password\",\n\t\t\t\t\t\t\t\tminlength : jQuery\n\t\t\t\t\t\t\t\t\t\t.format(\"Enter at least {0} characters\"),\n\t\t\t\t\t\t\t\tequalTo : \"Enter the same password as above\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\temail : {\n\t\t\t\t\t\t\t\trequired : \"Please enter a valid email address\",\n\t\t\t\t\t\t\t\tminlength : \"Please enter a valid email address\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdateformat : \"Choose your preferred dateformat\",\n\t\t\t\t\t\t\tterms : \" \"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// the errorPlacement has to take the\n\t\t\t\t\t\t// layout into account\n\t\t\t\t\t\terrorPlacement : function(error, element) {\n\t\t\t\t\t\t\terror.insertAfter(element.parent().find(\n\t\t\t\t\t\t\t\t\t'label:first'));\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// specifying a submitHandler prevents\n\t\t\t\t\t\t// the default submit, good for the demo\n\t\t\t\t\t\tsubmitHandler : function() {\n\t\t\t\t\t\t\talert(\"Data submitted!\");\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// set new class to error-labels to\n\t\t\t\t\t\t// indicate valid fields\n\t\t\t\t\t\tsuccess : function(label) {\n\t\t\t\t\t\t\t// set &nbsp; as text for IE\n\t\t\t\t\t\t\tlabel.html(\"&nbsp;\").addClass(\"ok\");\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n}", "function validateForm(form) {\n var fieldsRequired = ['firstName', 'lastName', 'address1',\n 'city', 'state', 'zip', 'birthdate'];\n var idx;\n var occupation1 = 'occupationOther';\n var formsValid = true;\n for (idx = 0; idx < fieldsRequired.length; idx++) {\n formsValid &= validateField(form.elements[fieldsRequired[idx]]);\n }\n if (document.getElementById('occupation').value === 'other') {\n formsValid &= validateField(form.elements[occupation1]);\n }\n\n return formsValid;\n}", "function validateForm() {\n isFormValid = true;\n\n validateName();\n validateEmail();\n validateDemand();\n validateOptions();\n\n if (isFormValid) {\n submit.disabled = false;\n } else {\n submit.disabled = true;\n\n }\n}", "function validateForm(fields) {\r\n\t// Error Boolean\r\n\tvar err = 0;\r\n\r\n\t// Loop through all form fields\r\n\tfor (var i = 0; i < fields.length; i++) {\r\n\t\t// If field is blank, insert error message\r\n\t\tif ( fields[i].value == '' ) {\r\n\t\t\t$(fields[i]).parent().siblings('.invalid').text('This field is required');\r\n\t\t\terr = 1; \r\n\t\t// If invalid image: insert image error\r\n\t\t} else if ( fields[i].id.includes('image') ) {\r\n\t\t\tif ( validateImage(fields[i].value) == false ) {\r\n\t\t\t\t$(fields[i]).parent().siblings('.invalid').text('This is an invalid image. The file extension must be .jpeg, .jpg or .png');\r\n\t\t\t\terr = 1;\r\n\t\t\t} else {\r\n\t\t\t\t$(fields[i]).parent().siblings('.invalid').text('');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$(fields[i]).parent().siblings('.invalid').text('');\r\n\t\t}\r\n\t}\r\n\r\n\tif (err == 0) return true;\r\n\telse return false\r\n}", "function validateForm() {\n let validCandidates = 0;\n optionNames.forEach((e) => {\n if (e !== null || e !== undefined || e !== \"\") validCandidates += 1;\n });\n return validCandidates >= 2;\n }", "function validateForm() {\n var form = $(this);\n var values = {};\n $.each(form.serializeArray(), function(i, field) {\n values[field.name] = field.value;\n });\n\n var input = parseInput(values['class']);\n if (input === null) {\n toggleError(true);\n displayErrorMessage('Class not found.');\n return false;\n }\n toggleError(false);\n displayErrorMessage('');\n\n var page = abbrToLinkMap[input['department'].toLowerCase()];\n var link = input['department'] + input['courseNumber'];\n form.attr('action', removeWhitespace(page + \"#\" + link));\n\n return true;\n}", "function validate_form() {\n valid = true;\n\n if (document.form.age.value == \"\") {\n alert(\"Please fill in the Age field.\");\n valid = false;\n }\n\n if (document.form.heightFeet.selectedIndex == 0) {\n alert(\"Please fill in the Height field.\");\n valid = false;\n }\n\n if (document.form.heightInches.selectedIndex == 0) {\n alert(\"Please fill in the Height field.\");\n valid = false;\n }\n\n if (document.form.weight.value == \"\") {\n alert(\"Please fill in the Weight field.\");\n valid = false;\n }\n\n if (document.form.position.selectedIndex == 0) {\n alert(\"Please fill in the Position field.\");\n valid = false;\n }\n\n if (document.form.playingStyle.selectedIndex == 0) {\n alert(\"Please fill in the Playing Style field.\");\n valid = false;\n }\n\n if (document.form.heightInches.selectedIndex == 0) {\n alert(\"Please fill in the Maximum Price field.\");\n valid = false;\n }\n\n return valid;\n}", "function checkFormValidity($form) {\n var valid = true;\n\n // Note that we've checked this form. Enables smart :invalid styles\n $form.addClass('submitted');\n\n // For each form element\n $form.find('input, select, textarea').each(function(i, el) {\n if (!el.validity.valid) {\n valid = false;\n $(el).focus();\n el.select();\n return false;\n }\n });\n\n return valid;\n }", "function formValidation() {\n $(\"form[name='artist_form']\").validate({\n rules: {\n id_field: {\n required: true,\n digits: true\n },\n birthyear: {\n required: true,\n digits: true,\n maxlength: 4, // birth year limited by 4 digits\n minlength: 3\n }\n },\n // Specify validation error messages\n messages: {\n field_id: \"Please enter only digits\"\n }\n });\n}", "function validaSelects(idForm) {\n\n idForm.validate({\n rules: {\n idComTipoClt: {\n required: true,\n number: true\n\n }\n },\n messages: {\n idComTipoClt: {\n required: \"Selecciona una opción valida\",\n number: \"Selecciona una opción valida\"\n }\n },\n });\n\n}", "function validar(form){\r\n\t\r\n\tif (Spry.Widget.Form.validate(form) == false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\telse{\r\n\t\treturn true;\r\n\t}\r\n}", "function validar(form){\r\n\t\r\n\tif (Spry.Widget.Form.validate(form) == false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\telse{\r\n\t\treturn true;\r\n\t}\r\n}", "function eleValidate(id) {\n\t// Se è presente l'identificativo dell'elemento form\n\t// allora recuperiamo tutti gli elementi di tipo input presenti nel form\n\t// e li sottoponiamo a verifica\n\t// altrimenti la verifica viene attivata dal listener\n\n\tvar pattern;\n\n\tif (typeof(id) == \"string\") {\n\t\t//scansione elementi\n\t\t// recuperiamo tutti gli elementi di tipo input presenti nel form\n\t\tpattern = \"#\" + id + \" input\";\n\t} else {\n\t\tpattern = \"#\" + this.name;\n\t}\n\n\tvar fields = YAHOO.util.Selector.query(pattern);\n\t\n\tfor (var i = 0; i < fields.length; i++) {\n\t\tvar className = fields[i].className;\n\t\tvar classResult = className.split(\" \");\n\t\tfor (var j = 0; j < classResult.length; j++) {\n\t\t\tvar rule = formValidation.rules[classResult[j]];\n\t\t\t/* Se esiste (typeof) la regola 'rule' nell'oggetto formValidation\n\t\t\t * verifichiamo (rule.test) la corrispondenza del valore inserito\n\t\t\t * dall'utente con la regola attuale. Se non c'è match vuol\n\t\t\t * dire che il valore inserito non è valido e accanto al modulo\n\t\t\t * viene inserito un elemento span per visualizzare il messaggio\n\t\t\t * di errore corrispondente\n\t\t\t */\n\n\t\t\tif (typeof rule != \"undefined\") {\n\t\t\t\t//\n\t\t\t\tif (!rule.test(fields[i].value)) {\n\t\t\t\t\t//YAHOO.util.Event.stopEvent(id);\n\t\t\t\t\tshowError(fields[i], formValidation.errors[classResult[j]]);\n\t\t\t\t\treturn false;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}\n\n\t// I controlli sono stati superati con successo\n\treturn true\n}", "function DoValidate_frmUpdateProduct() {\n var form = $(\"#updateProductForm\");\n form.validate({\n rules: {\n updateName: {\n required: true\n },\n updatePrice: {\n required: true\n },\n category: {\n required: true\n },\n updateDescription: {\n required: true\n }\n },\n messages: {\n updateName: {\n required: \"name is required\"\n },\n updatePrice: {\n required: \"price is required\"\n },\n category: {\n required: \"category should be selected\"\n },\n updateDescription: {\n required: \"description is required\"\n }\n }\n });\n return form.valid();\n}", "function ValidateChoices(form_id) {\n\tlet ctrl = true,\n\t\tformid = `form#${form_id} `,\n\t\tname_attr1 = formid + '[name=\"optionA\"]',\n\t\tname_attr2 = formid + '[name=\"optionB\"]',\n\t\tname_attr3 = formid + '[name=\"optionC\"]',\n\t\tname_attr4 = formid + '[name=\"optionD\"]',\n\t\tinput1 = $(name_attr1).val(),\n\t\tinput2 = $(name_attr2).val(),\n\t\tinput3 = $(name_attr3).val(),\n\t\tinput4 = $(name_attr4).val(),\n\t\tregex = /^\\s*$/,\n\t\trequired = !input1.match(regex) && !input2.match(regex) ? true : false,\n\t\tmistake =\n\t\t\t!input4.match(regex) == 1 && !input3.match(regex) == 0 ? false : true;\n\n\tswitch (false) {\n\t\tcase required:\n\t\tcase mistake:\n\t\t\t$(formid + 'input.options').addClass('is-invalid');\n\t\t\t$(formid + 'small.options')\n\t\t\t\t.removeClass('text-success')\n\t\t\t\t.addClass('text-danger')\n\t\t\t\t.html(\n\t\t\t\t\t'Give at least 2-3 choices. (At first, second, and third choice)'\n\t\t\t\t);\n\n\t\t\tctrl = false;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tunicode('optionA');\n\t\t\tunicode('optionB');\n\t\t\tunicode('optionC');\n\t\t\tunicode('optionD');\n\t\t\t/* $(formid + 'input.options')\n .val()\n .replace(/\"/g, '&quot;')\n .replace(/'/, '&apos;')\n .replace(/`/, '&#96;'); */\n\t\t\t$(formid + 'input.options').removeClass('is-invalid');\n\t\t\t$(formid + 'small.options')\n\t\t\t\t.removeClass('text-success')\n\t\t\t\t.html('');\n\t\t\tbreak;\n\t}\n\n\treturn ctrl;\n}", "function validateForm()\n {\n \t \t\n \tvar connectionTypeFormId;\n \t\n \t$('#frmMain').addClass('submitted');\n \t$('#frmRefrenceDrawing').addClass('submitted');\n \t\n \tif($('#ConnectiontypeMonorail').val()=='connectionTypeMonoEP'){\n \t\t\n \t\t$('#frmPostWithEndPlate').addClass('submitted');\n \t\t$('#frmDirectlyBolted').addClass('submitted');\n \t\t\n \t\tconnectionTypeFormId = \"frmPostWithEndPlate\";\n \n } \n else if($('#ConnectiontypeMonorail').val()=='connectionTypeMonoDB'){\n \t \n \t $('#frmDirectlyBolted').addClass('submitted');\n \t $('#frmPostWithEndPlate').removeClass('submitted');\n \t\t \n }\n \t \t\n \tvar validated = true;\n \t$('#frmMain').find(':input').each(function(){ \n \t\t\n \t\tvar id = $(this).prop('id');\n \t\tif(id!=\"\")\n \t\t{\n\t \t\tvar Value = $('#' + id).val(); \t\t\n\t \t\tvar requ = $(this).prop('required');\t\n\t \t\tvar elemetvisible = $('#' + id).is(':visible'); \t\t\n\t \t\tif(Value == \"\" && requ == true && elemetvisible) \t\t\n\t \t\t\tvalidated = false;\n \t\t}\n \t});\n \tif(validated==true)\n \t\t{\n \t\t\tvar Lenght = $(\"#txtLengthInFeet\").val();\n \tvar Inch = $(\"#drpLengthInInch\").find(\"option:selected\").text();\n \tvar Fraction = $(\"#drpLengthInFraction\").find(\"option:selected\").text(); \t\n \t\tvalidated = validateLength(Lenght,Inch,Fraction,\"Length\");\n \t\t\t\n \t\t}\n \t\n \t$('#'+connectionTypeFormId).find(':input').each(function(){ \t\t\n \t\t\n \t\tvar id = $(this).prop('id');\n \t\tif(id!=\"\")\n \t\t{\n\t \t\tvar Value = $('#' + id).val(); \t\t\n\t \t\tvar requ = $(this).prop('required');\n\t \t\tvar elemetvisible = $('#' + id).is(':visible');\n \t\t \t\t\n\t \t\tif(Value == \"\" && requ == true && elemetvisible) \t\t\n\t \t\t\tvalidated = false;\n \t\t}\n \t\t\n \t}); \n \tif(validated==true && connectionTypeFormId == \"frmPostWithEndPlate\")\n \t\t{\n \t\t\tvar PostLenght = $(\"#txtPostLengthInFeet\").val();\n \tvar PostInch = $(\"#drpPostLengthInInch\").find(\"option:selected\").text();\n \tvar PostFraction = $(\"#drpPostLengthInFraction\").find(\"option:selected\").text();\n \t\n \tvalidated = validateLength(PostLenght,PostInch,PostFraction,\"Post Length\");\n \t\t\n \t\t}\n \t\n \t$('#frmDirectlyBolted').find(':input').each(function(){ \t\t\n \t\t\n \t\tvar id = $(this).prop('id');\n \t\tif(id!=\"\")\n \t\t{\n\t \t\tvar Value = $('#' + id).val(); \t\t\n\t \t\tvar requ = $(this).prop('required');\n\t \t\t \t\t\n\t \t\tif(Value == \"\" && requ == true) \t\t\n\t \t\t\tvalidated = false;\n \t\t}\n \t\t\n \t}); \n \t\n \t$('[data-required]').each(function() { \t\t\n \t if (!$(this).val()) \n \t {\n \t\t var id = $(this).attr('id') + 1;\n \t\t\n \t\t if ($(this).data('select2') && $('#' + id).is(':visible')) \n \t\t {\n \t\t \t$(\"#\"+id).addClass('error'); \n \t\t \tvalidated = false;\n \t\t }\n \t\t }\n \t});\n \treturn validated; \n \t\n }", "function validateAll(type,formId){\n\t// Type: INDIVIDUAL, COMBINED or DETECT\n\tvar errorFound=0;\n\tif(type==\"INDIVIDUAL\") resetAll(formId); // reset all elems first\n\tvar form=document.getElementById(formId);\n\tfor(var i=0;i<form.elements.length;i++){\n\t\tvar elem=form.elements[i];\n\t\tif(elem==null) return false;\t// element not found\n\t\tif(elem.type.toUpperCase()==\"submit\".toUpperCase() || elem.type.toUpperCase()==\"reset\".toUpperCase()) continue; // skip submit/reset buttons\n\t\tif(type==\"INDIVIDUAL\")\n\t\t\tvar errorElem=document.getElementById(elem.id+\"_error\");\n\t\t// Text fields\n\t\tif(elem.tagName.toUpperCase()==\"input\".toUpperCase() && elem.type.toUpperCase()==\"text\".toUpperCase() && (elem.value==\"\" || elem.value==null)){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Password fields\n\t\tif(elem.tagName.toUpperCase()==\"input\".toUpperCase() && elem.type.toUpperCase()==\"password\".toUpperCase() && (elem.value==\"\" || elem.value==null)){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Text areas\n\t\tif(elem.tagName.toUpperCase()==\"textarea\".toUpperCase() && (elem.value==null || elem.value==\"\")){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Radios -- so far no way to check. ALT: have one radio selected by default\n\t\t// Checkboxes -- they are optional anyway, isn't it?\n\t\t// Select lists\n\t\tif(elem.tagName.toUpperCase()==\"select\".toUpperCase() && (elem.value==null || elem.value==\"\" || elem.value==\"-1\")){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t}\n\tif(type==\"INDIVIDUAL\")\n\t\tif(errorFound==0) return true;\n\t\telse return false;\n\telse if(type==\"DETECT\") return null;\n\telse return true;\n}", "function validateForm() {\n var $form = $('#album-form');\n $form.validator('validate');\n\n return !$form.find(':invalid').length;\n}", "function validateForm() {\n\tvar flag = true;\n\t\n\t// Get the values from the text fields\n\tvar songName = songNameTextField.value;\n\tvar artist = artistTextField.value;\n\tvar composer = composerTextField.value;\n\t\n\t// A regular expression used to test against the values above\n\tvar regExp = /^[A-Za-z0-9\\?\\$'&!\\(\\)\\.\\-\\s]*$/;\n\t\n\t// Make sure the song name is valid\n\tif (songName == \"\" || !regExp.test(songName)) {\n\t\tflag = false;\n\t\talert(\"Please enter a song name. Name can include letters, numbers, and the special characters ?!$&'().-\");\n\t}\n\t// Make sure the artist is valid\n\telse if (artist == \"\" || !regExp.test(artist)) {\n\t\tflag = false;\n\t\talert(\"Please enter an artist. Artist can include letters, numbers, and the special characters ?!$&'().-\");\n\t}\n\t// Make sure the composer is valid\n\telse if (composer == \"\" || !regExp.test(composer)) {\n\t\tflag = false;\n\t\talert(\"Please enter a composer. Composer can include letters, numbers, and the special characters ?!$&'().-\");\n\t}\n\t\n\treturn flag;\n}", "function handleForm( node, options ){\n\t\tvar failCount = 0;\n\t\t\n\t\tjQuery(node)\n\t\t.find(\"input, textarea\")\n\t\t.validate({\n\t\t\tpass: function( value ){\n\t\t\t\tif (debug) { console.log( value + ' - PASS' ); }\n\t\t\t},\n\t\t\tfail: function( value ){\n\t\t\t\tif (debug) { console.log( value + ' - FAIL' ); }\n\t\t\t\tfailCount++;\n\t\t\t}\n\t\t});\n\t\t\n\t\tif (failCount && options.fail) {\n\t\t\toptions.fail.call(this);\n\t\t}\n\t\telse if (options.pass) {\n\t\t\toptions.pass.call(this);\n\t\t}\n\t}", "function validateForm(){\r\n\r\n\tvar fn= document.forms[\"myform\"][\"fname\"].value;\r\n\tvar ln= document.forms[\"myform\"][\"lname\"].value;\r\n\tvar eml= document.forms[\"myform\"][\"email\"].value;\r\n\tvar mbl= document.forms[\"myform\"][\"mobile\"].value;\r\n\tvar trip= document.forms[\"myform\"][\"trip\"].value;\r\n\tvar prsn= document.forms[\"myform\"][\"person\"].value;\r\n\t\r\n\r\n\r\n\tif(fn == \"\"){\r\n\t\talert(\"Please enter First Name\");\r\n\t\treturn false;\r\n\t}\r\n\tif(ln == \"\"){\r\n\t\talert(\"Please enter last Name\");\r\n\t\treturn false;\r\n\t}\r\n\tif(eml == \"\"){\r\n\t\talert(\"Please enter Email-id\");\r\n\t\treturn false;\r\n\t}\r\n\tif(mbl == \"\"){\r\n\t\talert(\"Please enter Mobile Number\");\r\n\t\treturn false;\r\n\t}\r\n\tif(trip == \"\"){\r\n\t\talert(\"Select Your trip\");\r\n\t\treturn false;\r\n\t}\r\n\tif(prsn == \"\"){\r\n\t\talert(\"select persons for trip\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "function MM_validateForm() {\r\n if (document.getElementById){\r\n var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;\r\n for (i=0; i<(args.length-2); i+=3) { \r\n\t\t\ttest=args[i+2]; val=document.getElementById(args[i]);\r\n if (val) { nm=val.name; if ((val=val.value)!=\"\") {\r\n if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');\r\n if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\\n'; \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (test!='R') { num = parseFloat(val);\r\n\t\t\t\t\t\tif (isNaN(val)) errors+='- '+nm+' must contain a number.\\n';\r\n\t\t\t\t\t\tif (test.indexOf('inRange') != -1) { p=test.indexOf(':');\r\n min=test.substring(8,p); max=test.substring(p+1);\r\n if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\\n';\r\n\t\t\t\t\t} \r\n\t\t\t\t} \r\n\t\t\t} \r\n\t\t\telse if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\\n'; }\r\n } \r\n\t\tif (errors) alert('The following error(s) occurred:\\n'+errors);\r\n document.MM_returnValue = (errors == '');\r\n\t}\r\n}", "function _validate_form(form, form_rules, submithandler) {\n $.validator.setDefaults({\n highlight: function (element) {\n $(element).closest('.form-group').addClass('has-error');\n },\n unhighlight: function (element) {\n $(element).closest('.form-group').removeClass('has-error');\n },\n errorElement: 'span',\n errorClass: 'text-danger',\n errorPlacement: function (error, element) {\n if (element.parent('.input-group').length) {\n error.insertAfter(element.parent());\n } else {\n error.insertAfter(element);\n }\n }\n });\n\n $(form).validate({\n rules: form_rules,\n messages: {\n email: {\n remote: 'Email already exists'\n },\n reference_product: {\n remote: 'Reference already exists'\n },\n code_barre: {\n remote: 'Code Barre existe déjà.'\n },\n code_barre_verifie: {\n remote: \"Code Barre n'existe pas.\"\n },\n num_commande: {\n remote: \"Numéro de commande existe déjà.\"\n },\n telephone: {\n remote: 'Téléphone ne doit pas contenir +212 (Voilà la forme : 0600000000).'\n },\n phonenumber: {\n remote: 'Téléphone ne doit pas contenir +212 ou plus que 10 chiffres (Voilà la forme standart : 0600000000).'\n }\n },\n ignore: [],\n submitHandler: function (form) {\n if (typeof (submithandler) !== 'undefined') {\n submithandler(form);\n } else {\n return true;\n }\n }\n });\n\n setTimeout(function () {\n var custom_required_fields = $('[data-custom-field-required]');\n if (custom_required_fields.length > 0) {\n $.each(custom_required_fields, function () {\n $(this).rules(\"add\", {\n required: true\n });\n });\n }\n\n }, 10);\n return false;\n}", "function validateForm(form) {\n var formEltName = \"\";\n var formObj = \"\";\n var str = \"\";\n var realName = \"\";\n var alertText = \"\";\n var firstMissingElt = null;\n var hardReturn = \"\\r\\n\";\n\n for (i=0; i<elts.length; i++) {\n formEltName = elts[i].formEltName;\n formObj = eval(\"form.\" + formEltName);\n realName = elts[i].realName;\n\n if (elts[i].eltType == \"text\") {\n str = formObj.value;\n\n if (eval(elts[i].upToSnuff)) continue;\n\n if (str == \"\") {\n if (allAtOnce) {\n alertText += beginRequestAlertForText + realName + endRequestAlert + hardReturn;\n if (firstMissingElt == null) {firstMissingElt = formObj};\n } else {\n alertText = beginRequestAlertForText + realName + endRequestAlert + hardReturn;\n alert(alertText);\n }\n } else {\n if (allAtOnce) {\n alertText += str + beginInvalidAlert + realName + endInvalidAlert + hardReturn;\n } else {\n alertText = str + beginInvalidAlert + realName + endInvalidAlert + hardReturn;\n }\n if (elts[i].format != null) {\n alertText += beginFormatAlert + elts[i].format + hardReturn;\n }\n if (allAtOnce) {\n if (firstMissingElt == null) {firstMissingElt = formObj};\n } else {\n alert(alertText);\n }\n }\n } else {\n if (eval(elts[i].upToSnuff)) continue;\n if (allAtOnce) {\n alertText += beginRequestAlertGeneric + realName + endRequestAlert + hardReturn;\n if (firstMissingElt == null) {firstMissingElt = formObj};\n } else {\n alertText = beginRequestAlertGeneric + realName + endRequestAlert + hardReturn;\n alert(alertText);\n }\n }\n if (!isIE3) {\n var goToObj = (allAtOnce) ? firstMissingElt : formObj;\n if (goToObj.select) goToObj.select();\n if (goToObj.focus) goToObj.focus();\n }\n if (!allAtOnce) {return false};\n }\n \n dateString = form.departDate.value;\n \tdateArray = dateString.split(\"/\");\n \tdepartDay = new Date(parseInt(dateArray[2], 10), \n parseInt(dateArray[0],10)-1, \n parseInt(dateArray[1],10));\n \tdateString = form.returnDate.value;\n \tdateArray = dateString.split(\"/\");\n \treturnDay = new Date(parseInt(dateArray[2], 10), \n parseInt(dateArray[0],10)-1, \n parseInt(dateArray[1],10));\n \ttoday = new Date();\n \t\n \tif (departDay.getTime() < today.getTime()) {\n \t\talertText += \"Departure date needs to be later.\" + hardReturn;\n \t}\n \tif (returnDay.getTime() < departDay.getTime()) {\n \t\talertText += \"Return date must be after departure date.\" + hardReturn;\n \t}\n \t\n \tif (form.arrive.selectedIndex == form.depart.selectedIndex) {\n \t\talertText += \"Departure and arrival cities must be different.\" + hardReturn;\n \t}\n \t\n if (allAtOnce) {\n if (alertText != \"\") {\n alert(alertText);\n return false;\n }\n } \n// alert(\"I am valid!\"); //remove this line when you use the code\n return true; //change this to return true\n}", "function validarRegistroEvaluacion(){\r\n\r\n\t$(\"#formRegistroEvaluacion\").validate({\r\n\t\trules : {\r\n\t\t\tselectDetallePeriodoEvaluacion : {\r\n\t\t\t\trequired : true,\r\n\t\t\t\tmin : 1\r\n\t\t\t},\r\n\t\t\tselectDetalleTipoFormacionEvaluacion : {\r\n\t\t\t\trequired : true,\r\n\t\t\t\tmin : 1\r\n\t\t\t}\r\n\t\t},\r\n\t\tmessages : {\r\n\t\t\tselectDetallePeriodoEvaluacion : \"Debe escoger un periodo\",\r\n\t\t\tselectDetalleTipoFormacionEvaluacion : \"Debe escoger un tipo formacion\"\r\n\t\t},\r\n\t\tnormalizer : function(valor) {\r\n\t\t\treturn $.trim(valor);\r\n\t\t},\r\n\t\tvalidClass: 'valido-validate',\r\n\t\terrorClass: \"error-validate\"\r\n\t})\t\r\n}", "function validarRegistroPregunta(){\r\n\r\n\t$(\"#formRegistroPregunta\").validate({\r\n\t\trules : {\r\n\t\t\ttxtNombrePregunta : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\tselectDetalleTipoFormacionPregunta : {\r\n\t\t\t\trequired : true,\r\n\t\t\t\tmin : 1\r\n\t\t\t},\r\n\t\t\tselectDetalleEstadoPregunta : {\r\n\t\t\t\trequired : true,\r\n\t\t\t\tmin : 1\r\n\t\t\t}\r\n\t\t},\r\n\t\tmessages : {\r\n\t\t\ttxtNombrePregunta : \"Debe escribir un nombre\",\r\n\t\t\tselectDetalleTipoFormacionPregunta : \"Debe escoger un tipo formacion\",\r\n\t\t\tselectDetalleEstadoPregunta : \"Debe escoger un estado\"\r\n\t\t},\r\n\t\tnormalizer : function(valor) {\r\n\t\t\treturn $.trim(valor);\r\n\t\t},\r\n\t\tvalidClass: 'valido-validate',\r\n\t\terrorClass: \"error-validate\"\r\n\t})\t\r\n}", "constructor(selector, onValidCallbackFn = function () {}, onInvalidCallbackFn = function () {}) {\n this.form = document.querySelector(selector);\n this.elements = this.constructElements();\n this.onInvalidCallbackFn = onInvalidCallbackFn;\n this.onValidCallbackFn = onValidCallbackFn;\n\n // Validate the form on submission\n this.form.addEventListener(\"submit\", e => {\n if (this.isValid()) {\n this.onValidCallbackFn();\n return true;\n } else {\n // Prevent form from performing default action\n e.preventDefault();\n // TODO: pass a list of elements which failed valid testing\n this.onInvalidCallbackFn(this.getInvalidElements());\n return false;\n }\n });\n }", "function validateForm(pFormFields, pFormDescriptions)\n{\n var retValue = true;\n for (var i = 0; i < pFormFields.length; i++)\n {\n if(document.getElementById(pFormFields[i]).value == \"\")\n {\n alert(\"You must provide a \" + pFormDescriptions[i]);\n retValue = false;\n i = pFormFields.length;\n }\n }\n return retValue;\n}", "function setup_validation(form_selector, prevent_ignore) {\n var inputs = $(form_selector).find('input, textarea'),\n validator_obj = (function() { /* this IFFE makes the rules object out of the classes of the elements */\n var rules_obj = {},\n messages_obj = {};\n inputs.each(function(i, el) {\n var name = $(el).attr('name');\n rules_obj[name] = {};\n messages_obj[name] = {};\n if ($(el).hasClass(\"req\")) {\n rules_obj[name]['required'] = true;\n messages_obj[name]['required'] = \"Please enter a value\";\n }\n if ($(el).hasClass(\"email\")) {\n rules_obj[name]['email'] = true;\n messages_obj[name]['required'] = \"Please enter a valid email\";\n }\n if ($(el).hasClass(\"repeat\")) {\n rules_obj[name]['equalTo'] = $(el).data('equalTo');\n messages_obj[name]['equalTo'] = \"Values must match\";\n }\n if ($(el).hasClass(\"req-number\")) {\n rules_obj[name]['number'] = true;\n messages_obj[name]['number'] = \"A number is required\";\n }\n if ($(el).hasClass(\"req-url\")) {\n rules_obj[name]['shelfUrl'] = true;\n }\n if ($(el).hasClass(\"date-req\")) {\n rules_obj[name]['shelfDate'] = true;\n }\n if ($(el).hasClass(\"after-date\")) {\n rules_obj[name]['dateAfter'] = $(el).data('after');\n }\n })\n return {\n rules: rules_obj,\n messages: messages_obj\n }\n })();\n\n return $(form_selector).validate({\n rules: validator_obj.rules,\n messages: validator_obj.messages,\n highlight: function(element, errorClass, validClass) {\n $(element).addClass(errorClass).removeClass(validClass);\n $(element).parents('fieldset').addClass(errorClass).removeClass(validClass);\n },\n unhighlight: function(element, errorClass, validClass) {\n $(element).removeClass(errorClass).addClass(validClass);\n $(element).parents('fieldset').removeClass(errorClass).addClass(validClass);\n },\n ignore: prevent_ignore ? [] : \":hidden\"\n })\n}", "function validateForm(event) {\n // Prevent default form actions\n event.preventDefault();\n\n // Check full name\n if (checkLength(fullName.value, 2)) {\n fullNameError.style.display = \"none\";\n } else {\n fullNameError.style.display = \"block\";\n }\n\n // Check e-mail\n if (validateEmail(email.value)) {\n emailError.style.display = \"none\";\n } else {\n emailError.style.display = \"block\";\n }\n\n // Check password\n if (checkLength(password.value, 8)) {\n passwordError.style.display = \"none\";\n } else {\n passwordError.style.display = \"block\";\n }\n}", "function validate(form, index) {\n\n for (var i = 0; i < form.elements.length; i++) {\n if (form.elements[i].name !== 'filename') {\n resetError(form.elements[i].name + 'Input', form);\n }\n }\n\n for (var i = 0; i < form.elements.length; i++) {\n if (form.elements[i].name == \"password\") {\n checkPassword(form.elements[i].name + 'Input', form);\n }\n if (form.elements[i].value == \"\" && form.elements[i].name != \"filename\") {\n\n showError(form.elements[i].name + 'Input', 'Fill the ' + form.elements[i].name + ' field', form);\n\n\n }\n\n }\n\n\n if (form == \"privateCabinetform\" || index == \"registerform\") {\n checkEmail('emailInput', form);\n }\n\n }", "function validateForm() {\n\n\tvar blnvalidate = true;\n\tvar elementsInputs;\n\tvar elementsInputs2;\n\tvar elementsSelect =(formElem.fr_estado.value);\n\n\telementsInputs = document.getElementsByTagName('input');\n\n \tfor (var intCounter = 0; intCounter < elementsInputs.length; intCounter++)\n {\n \telementsInputs2 = elementsInputs[intCounter].id;\n if (elementsInputs[intCounter].id != \"photoin\" && elementsInputs[intCounter].id != \"check\" && elementsInputs[intCounter].id != \"fr_comp\" && elementsInputs[intCounter].id != \"fr_email\")\n {\n \tif (validateText(elementsInputs, intCounter) == true)\n {\n \tblnvalidate = false;\n \tdocument.getElementById(elementsInputs2).style.backgroundColor=\"#FFEDEF\"; \n }\n else \n \t\t{\n \t\tdocument.getElementById(elementsInputs2).style.backgroundColor=\"#FFFFFF\";\n \t\t}\t\t\n } \n else if (elementsInputs[intCounter].id == \"fr_email\")\n {\n \tif (validateEmail(elementsInputs, intCounter) == true)\n {\n \tblnvalidate = false;\n \tdocument.getElementById(elementsInputs2).style.backgroundColor=\"#FFEDEF\"; \n \t}\n \telse \n \t\t{\n \t\tdocument.getElementById(elementsInputs2).style.backgroundColor=\"#FFFFFF\";\n \t\t}\t\t\n }\n else if (elementsInputs[intCounter].id == \"check\")\n {\n if (elementsInputs[intCounter].checked == false)\n {\n blnvalidate = false;\n document.getElementById('fr_error').innerHTML = '<p class=\"p_erro\"><h11>Por favor, marcar o campo \"Aceito os termos de Uso.\"</h11></p>';\n }\n }\n else if (elementsSelect == \"all\") \n {\n \tformElem.fr_estado.style.backgroundColor=\"#FFEDEF\"; \n }\n else \n {\n \tformElem.fr_estado.style.backgroundColor=\"#FFFFFF\";\n }\n\t}\n $(\"body\").animate({\"scrollTop\":\"0\"},500);\n\treturn blnvalidate;\n}", "function DoValidate_frmSaveProduct() {\n var form = $(\"#saveProductForm\");\n form.validate({\n rules: {\n productName: {\n required: true\n },\n productPrice: {\n required: true\n },\n category: {\n required: true\n },\n description: {\n required: true\n }\n },\n messages: {\n productName: {\n required: \"name is required\"\n },\n productPrice: {\n required: \"price is required\"\n },\n category: {\n required: \"category should be selected\"\n },\n description: {\n required: \"description is required\"\n }\n }\n });\n return form.valid();\n}", "function validarForm(sender)\n{\n //obtengo mi formulario por ID\n form = document.getElementById('formul');\n //MUESTRO CONFIRMACION PARA HACER EL SUBMIT\n \n form.submit();\n\n\n \n}", "function ValidateForm(objFrm)\n{ \n\tvar iConventionPos;\n\tvar sChangedName; \n\tfor( var i =0; i< objFrm.length;i++)\n\t{\n\t\tif(objFrm[i].type=='text' || objFrm[i].type=='textarea' || objFrm[i].type=='select-one' || objFrm[i].type=='select-multiple' || objFrm[i].type=='password' || objFrm[i].type=='file' )\n\t\t{\n\t\t\tif(objFrm[i].type=='text' || objFrm[i].type=='textarea' || objFrm[i].type=='password')\n\t\t\t\tobjFrm[i].value = fnFixSpace(objFrm[i].value);\n\t\t\t\n\t\t\tvar objDataTypeHolder = objFrm[i].name.substring(0,3);\n\t\t\tif(objFrm[i].name.substring(0,5)=='TREF_' || objFrm[i].name.substring(0,5)=='TNEF_')\n\t\t\t\tobjDataTypeHolder = objFrm[i].name.substring(0,5);\n\t\t\tif((objFrm[i].type=='select-one' && objFrm[i].options[objFrm[i].selectedIndex].value=='' && objDataTypeHolder==\"TR_\"))\n\t\t\t{\n\t\t\t\tsChangedName = objFrm[i].name.substring(3);\n\t\t\t\tsChangedName = getFormattedmsg(sChangedName)\n\t\t\t\talert(\"Please select \"+ sChangedName +\".\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif(objFrm[i].type=='password' && objFrm[i].value!='' && objFrm[i].value.indexOf(\" \")!=-1)\n\t\t\t{\n\t\t\t\talert(\"Spaces are not allowed in password.\");\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(objFrm[i].type=='password' && objFrm[i].name=='TR_Confirm_Password' && objFrm[i].value!=objFrm.TR_Password.value)\n\t\t\t{\n\t\t\t\talert(\"Password and Confirm Password fields are not matching.\");\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(objFrm[i].type=='text' && objFrm[i].name=='TREF_Confirm_Email' && objFrm[i].value!=objFrm.TREF_EMAIL.value)\n\t\t\t{\n\t\t\t\talert(\"Email and confirm email fields are not matching.\");\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(objFrm[i].type=='password' && objFrm[i].name=='TR_Password')\n\t\t\t{\n\t\t\t\tvar val=objFrm[i].value;\n\t\t\t\tvar pass_length = val.length;\n\t\t\t\tif (pass_length < 4 || pass_length > 16){\n\t\t\t\talert(\"Please enter 4-character minimum. 16-character maximum for password\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t \t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif((objDataTypeHolder==\"TR_\" || objDataTypeHolder==\"IR_\" || objDataTypeHolder==\"MR_\" )&& (objFrm[i].value==''))\n\t\t\t{\t\n\t\t\t\tsChangedName = objFrm[i].name.substring(3);\n\t\t\t\tsChangedName = getFormattedmsg(sChangedName)\n\t\t\t\talert(\"Please Enter \"+ sChangedName +\".\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(objDataTypeHolder==\"TREF_\" && objFrm[i].value=='')\n\t\t\t{\n\t\t\t\talert(\"Please enter email.\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(objDataTypeHolder==\"PO_\" && objFrm[i].value=='')\n\t\t\t{\n\t\t\t\talert(\"Please enter Phone.\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}else if(objDataTypeHolder==\"PO_\" && objFrm[i].value!=''){\n\t\t\t\n\t\t\tvar val=objFrm[i].value;\n\t\t\t\tif (val!=\"\")\n\t\t\t\t{\n\t\t\t\t\tvar re5digit=/^\\(\\d\\d\\d\\)-\\d\\d\\d\\d\\d\\d\\d$/ //regular expression defining a 5 digit number\n\t\t\t\t\tif (val.search(re5digit)==-1)\n\t\t\t\t\t{ //if match failed\n\t\t\t\t\talert(\"Please enter phone in form (123)-1234567\") ; \n\t\t\t\t\t//document.register.TR_Phone.focus();\n\t\t\t\t\treturn false; \n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t\tif((objDataTypeHolder==\"IR_\" || objDataTypeHolder==\"MR_\" )&& (isNaN(objFrm[i].value)))\n\t\t\t{\n\t\t\t\tsChangedName = objFrm[i].name.substring(3);\n\t\t\t\tsChangedName = getFormattedmsg(sChangedName)\n\t\t\t\talert(\"Please enter numeric \"+ sChangedName +\".\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t/*if((objDataTypeHolder==\"IR_\" || objDataTypeHolder==\"MR_\" )&& (objFrm[i].value)<0)\n\t\t\t{\n\t\t\t\tsChangedName = objFrm[i].name.substring(3);\n\t\t\t\tsChangedName = getFormattedmsg(sChangedName)\n\t\t\t\talert(\"Please enter valid \"+ sChangedName +\".\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\tif((objDataTypeHolder==\"IN_\" || objDataTypeHolder==\"MN_\" )&& (isNaN(objFrm[i].value) && objFrm[i].value!='' ))\n\t\t\t{\n\t\t\t\tsChangedName = objFrm[i].name.substring(3);\n\t\t\t\tsChangedName = getFormattedmsg(sChangedName)\n\t\t\t\talert(\"Please enter numeric \"+ sChangedName +\".\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*if((objDataTypeHolder==\"IN_\" || objDataTypeHolder==\"MN_\" )&& (objFrm[i].value<0 && objFrm[i].value!=''))\n\t\t\t{\n\t\t\t\tsChangedName = objFrm[i].name.substring(3);\n\t\t\t\tsChangedName = getFormattedmsg(sChangedName)\n\t\t\t\talert(\"Please enter valid \"+ sChangedName +\".\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif((objDataTypeHolder==\"IR_\" || objDataTypeHolder==\"IN_\" ) && (objFrm[i].value.indexOf(\".\")!=-1))\n\t\t\t{\n\t\t\t\tsChangedName = objFrm[i].name.substring(3);\n\t\t\t\tsChangedName = getFormattedmsg(sChangedName)\n\t\t\t\talert(\"Please enter valid \"+ sChangedName +\".\");\n\t\t\t\tobjFrm[i].focus();\n\t\t\t\tobjFrm[i].select();\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\tfunction checkpostal(text){ \n\t\t\t\tvar re5digit=/^\\(\\d\\d\\d\\)-\\d\\d\\d\\d\\d\\d\\d$/ //regular expression defining a 5 digit number\n\t\t\t\tif (document.register.TR_Phone.value.search(re5digit)==-1)\n\t\t\t\t{ //if match failed\n\t\t\t\talert(\"Please enter phone in form (123)-1234567\") ; \n\t\t\t\tdocument.register.TR_Phone.focus();\n\t\t\t\treturn false; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif((objDataTypeHolder==\"TREF_\") || (objDataTypeHolder==\"TNEF_\" && objFrm[i].value!='' ))\n\t\t\t{\n\t\t\t\tif(!ValidateEMail(objFrm[i].value))\n\t\t\t\t{\n\t\t\t\t\tobjFrm[i].focus();\n\t\t\t\t\tobjFrm[i].select();\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//ValidateNumber(objName)\n\t\t\tif((objDataTypeHolder==\"NR_\"))\n\t\t\t{\n\t\t\t\tif(!ValidateNumber(objFrm[i].value))\n\t\t\t\t{\n\t\t\t\t\tobjFrm[i].focus();\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\t\t\t\n\t\t\tif(objDataTypeHolder==\"PHR_\")\n\t\t\t{\n\t\t\t\n\t\t\t\tvar val=objFrm[i].value;\n\t\t\t\tif (val!=\"\")\n\t\t\t\t{\n\t\t\t\t\tvar re5digit=/^\\(\\d\\d\\d\\)-\\d\\d\\d\\d\\d\\d\\d$/ //regular expression defining a 5 digit number\n\t\t\t\t\tif (val.search(re5digit)==-1)\n\t\t\t\t\t{ //if match failed\n\t\t\t\t\talert(\"Please enter phone in form (123)-1234567\") ; \n\t\t\t\t\t//document.register.TR_Phone.focus();\n\t\t\t\t\treturn false; \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\talert(\"Please Enter Phone Number\");\n\t\t\t\t\tobjFrm[i].focus();\n\t\t\t\t\tobjFrm[i].select();\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//ValidateNumber(objName)\n\t\t\tif((objDataTypeHolder==\"NR_\"))\n\t\t\t{\n\t\t\t\tif(!ValidateNumber(objFrm[i].value))\n\t\t\t\t{\n\t\t\t\t\tobjFrm[i].focus();\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(parseFloat(objFrm[i].value)<=0)\n\t\t\t\t{\n\t\t\t\t\tobjFrm[i].focus();\t\n\t\t\t\t\talert('Price should be greater then 0');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(objDataTypeHolder==\"PHN\")\n\t\t\t{\n\t\t\t\tvar val=objFrm[i].value;\n\t\t\t\tif (val!=\"\")\n\t\t\t\t{\n\t\t\t\t\tfor(var j=0; j < val.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif((val.charAt(j)!='(')&&(val.charAt(j)!=')')&&(val.charAt(j)!=' ')&&(val.charAt(j)!=\"-\")&& !((val.charAt(j)>=0)&&(val.charAt(j)<=9)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talert(\"Please enter valid Phone Number\");\n\t\t\t\t\t\t\tobjFrm[i].focus();\n\t\t\t\t\t\t\tobjFrm[i].select();\n\t\t\t\t\t\t\treturn false;\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\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "function formFieldsValid(formID) {\n //Iterate over inputs to check for is-valid class\n var valid = true;\n $(formID + ' :input').each(function(index){\n if (!$(this).hasClass('is-valid') && $(this).prop('required')) {\n if ($(this).attr('type') !== 'email') {\n $(this).addClass('is-invalid');\n valid = false;\n } else { //handle prepopulated email field\n if(checkEmailFormat($(this))) {\n $(this).addClass('is-valid'); //email is validly formatted\n } else { //email is invalidly formatted\n $(this).addClass('is-invalid');\n valid = false;\n }\n }\n }\n });\n return valid;\n}", "function ValidarForm(){\r\n\t/*Validando el campo nombre*/\r\n\tif(document.frmCliente.nombre.value.length==0){\r\n\t\talert(\"Debe escribir el Nombre\")\r\n\t\tdocument.frmCliente.nombre.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo apellidos*/\r\n\tif(document.frmCliente.apellidos.value.length==0){\r\n\t\talert(\"Debe escribir los Apellidos\")\r\n\t\tdocument.frmCliente.apellidos.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo cedula*/\r\n\tif(document.frmCliente.cedula.value.length==0){\r\n\t\talert(\"Debe escribir el numero de Cedula\")\r\n\t\tdocument.frmCliente.cedula.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo telefono*/\r\n\tif(document.frmCliente.telefono.value.length==0){\r\n\t\talert(\"Debe escribir el numero de Telefono\")\r\n\t\tdocument.frmCliente.telefono.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo correo*/\r\n\tif(document.frmCliente.correo.value.length==0){\r\n\t\talert(\"Debe escribir su Correo\")\r\n\t\tdocument.frmCliente.correo.focus()\r\n\t\treturn false\r\n\t}\r\n\t/*Validando el campo direccion*/\r\n\tif(document.frmCliente.direccion.value.length==0){\r\n\t\talert(\"Debe escribir su Direccion\")\r\n\t\tdocument.frmCliente.direccion.focus()\r\n\t\treturn false\r\n\t}\r\n}", "function validateForm(e) {\n 'use strict';\n\n //Handles window-generated events (i.e. non-user)\n if (typeof e == 'undefined') {\n e = window.event;\n }\n\n //Get form object references\n var firstName = U.$('firstName');\n var lastName = U.$('lastName');\n var userName = U.$('userName');\n var email = U.$('email');\n var phone = U.$('phone');\n var city = U.$('city');\n var state = U.$('state');\n var zip = U.$('zip')\n var terms = U.$('terms');\n\n\n //Flag variable\n var error = false;\n\n //Validate the first name using a regular expression\n if (/^[A-Z \\.\\-']{2,20}$/i.test(firstName.value)) {\n //Everything between / and / is the expression\n //Allows any letter A-Z (case insensitive)\n //Allows spaces, periods, and hyphens\n //Name must be 2-20 characters long\n\n //alert(\"Valid first name\");\n removeErrorMessage('firstName');\n }\n else {\n //alert(\"Invalid first name\");\n addErrorMessage(\n 'firstName',\n 'Invalid/missing first name'\n );\n error = true;\n }\n\n //Validate the last name using a regular expression\n\n //Validate the username using a validation function\n if (validateUsername(userName.value)) {\n removeErrorMessage('userName');\n }\n else {\n addErrorMessage(\n 'userName',\n 'username does not meet criteria'\n );\n error = true;\n }\n\n //Validate the email using a regular expression\n //Validate the phone using a regular expression\n //Validate the city using a regular expression\n //Validate the zip using a regular expression\n\n //Prevent form from resubmitting\n if (error) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n }\n\n return false;\n\n} // End of validateForm() function.", "function validateForm()\n{\n // Get values from required fields so that I can make sure they are there\n var make = $(\"#make\").val();\n var model = $(\"#model\").val();\n var year = $(\"#year\").val();\n\n // If make, model, or year are empty, return false so the form does not submit\n if(make == \"\")\n {\n $(\"#make\").css({border: \"3px solid red\"}); // Use this to make the box red\n alert(\"You must provide a make\"); // Use this to let user know what went wrong\n return false; // Return false so the form does not submit\n }\n if(model == \"\")\n {\n $(\"#model\").css({border: \"3px solid red\"});\n alert(\"You must provide a model\");\n return false;\n }\n if(year == \"\")\n {\n $(\"#year\").css({border: \"3px solid red\"});\n alert(\"You must provide a year\");\n return false;\n }\n\n // Otherwise, return true so the form does submit\n return true;\n}", "function EnableFormValidation() {\n const $form = $(\"form\");\n // all validation rules that shall be applied\n const rules = [];\n // all validation controls, the controls showing the error messages\n const validationControls = [];\n // all selectors for controls that shall be validated\n const validatedControlSelectors = [];\n\n /* When used with javascript we modify the form to not do \n HTML 5 validation so we can meet the requirements. \n Still, when Js is disabled, why not use it? */\n $form.attr(\"novalidate\", \"novalidate\");\n\n /* OnlyDigits verifies that there are only numerical\n characters within the text passed in. We need that \n for the validation of the credit card.\n */\n function OnlyDigits(text) {\n var validCharacters = \"1234567890\";\n\n for( let i = 0; i < text.length; i++ ) {\n if ( validCharacters.indexOf(text[i])===-1 ) {\n return false;\n }\n } \n\n return true;\n }\n\n function RegisterValidationControlFor(selector, controlId, $control) {\n const newControlInfo = { \n for: selector, \n name: controlId,\n $control: $control\n }; \n\n if ( $control === undefined ) {\n newControlInfo.$control = $(controlId);\n }\n\n validationControls.push(newControlInfo);\n validatedControlSelectors.push(selector);\n }\n\n function AppendValidationControlFor(selector) {\n let controlId = '#validationControl_' + (validationControls.length+1).toString();\n let $control = $('<div id=\"' + controlId + '\" class=\"validationControl\" data-validatorFor=\"' + selector + '\"></div>');\n $control.insertAfter($(selector));\n\n RegisterValidationControlFor(selector, controlId, $control);\n }\n\n function ShowValidationMessage(forSelector, message) {\n // We convert our messages to HTML, encode them, \n // then we can savely replace line feeds with <br>'s.\n let messageHtml = $('<div/>').text(message).html().replace(/\\n/g, \"<br/>\");\n\n for (let i = 0; i < validationControls.length; i++) {\n if ( validationControls[i].for === forSelector ) {\n validationControls[i].$control.html(messageHtml);\n }\n }\n }\n\n function IsFormValid() {\n $(\".validationControl\").html(\"\");\n \n let result = true;\n\n for (let i = 0; i < rules.length; i++) {\n let evaluatedRule = rules[i]();\n\n if (evaluatedRule.for !== undefined) {\n ShowValidationMessage(evaluatedRule.for, evaluatedRule.message);\n result = false;\n }\n }\n\n if ( result === false ) {\n $(\"#registerButtonValidationControl\").text(\"Sorry, there are still warnings. Please correct your data before submitting.\");\n window.setTimeout(() => { $(\"#registerButtonValidationControl\").text(\"\"); }, 2000);\n }\n\n return result;\n }\n\n /* Partial validation method. Does exactly the same validation \n but only shows the message for the selector that is specified\n by the parameter. \n With this we can change all validations to live validations and\n still keep the UI clean from validation happening before the \n user has entered any text into the UI.\n */\n function PartialValidationFor(selector) {\n console.log(\"executing partial validation for \" + selector);\n let $validator = $(\".validationControl[data-validatorFor='\" + selector + \"']\");\n $validator.html(\"\"); \n \n let result = true;\n\n for (let i = 0; i < rules.length; i++) {\n let evaluatedRule = rules[i]();\n\n if (evaluatedRule.for === selector) {\n ShowValidationMessage(evaluatedRule.for, evaluatedRule.message);\n }\n }\n }\n\n /* Attach event handlers for the validation: We need an event handler that\n fires on blur and on changes within a field and executes the partial \n validation rules.\n The validator needs to be attached to every field that shall be instantly\n validated while typing.\n */\n function AttachInstantValidationToDom() {\n function AttachValidation(selector, validatedControlSelector) {\n $(selector)\n .on(\"blur\", function(event) { PartialValidationFor(validatedControlSelector); event.stopPropagation(); })\n .on(\"change\", function(event) { PartialValidationFor(validatedControlSelector); event.stopPropagation(); })\n .on(\"keyup\", function(event) { PartialValidationFor(validatedControlSelector); event.stopPropagation(); })\n .on(\"click\", function(event) { PartialValidationFor(validatedControlSelector); event.stopPropagation(); });\n };\n\n for (let i = 0; i < validatedControlSelectors.length; i++) {\n if ( validatedControlSelectors[i] === \".activities\" ) continue;\n if ( validatedControlSelectors[i] === \".credit-card-row1\" ) continue; // its a virtual selector\n\n AttachValidation(validatedControlSelectors[i], validatedControlSelectors[i]);\n }\n\n AttachValidation(\"#cc-num\", \".credit-card-row1\");\n AttachValidation(\"#zip\", \".credit-card-row1\");\n AttachValidation(\"#cvv\", \".credit-card-row1\");\n }\n\n AppendValidationControlFor(\"#name\");\n AppendValidationControlFor(\"#email\");\n RegisterValidationControlFor(\".activities\", \"#registerActivitiesValidationControl\");\n\n // .credit-card-row1 is virtual, just an identifier\n RegisterValidationControlFor(\".credit-card-row1\", \"#cardnumber-zipcode-cvv-validation\");\n AppendValidationControlFor(\"#payment\");\n\n // R8.1 Name field isn’t blank\n rules.push(() => {\n if ( $(\"#name\").val() === \"\" ) { return { for: \"#name\", message: \"The name field shoudn't be blank.\" }; }\n return {};\n });\n // R8.2 Email-field isn't blank\n rules.push(() => {\n if ( $(\"#email\").val() === \"\" ) {\n return { for: \"#email\", message: \"The e-mail field is required. Please enter your email address.\" };\n }\n\n const emailRegEx = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/\n if ( !emailRegEx.test($(\"#email\").val()) ) {\n return { for: \"#email\", message: \"The e-mail field does not contain a valid email address.\" };\n }\n return {};\n });\n // R8.3 there should be an activity that is checked; at least one\n rules.push(() => {\n if ( $(\".activities input:checked\").length == 0 ) {\n return { for: \".activities\", message: \"There should be at least one activity that is selected.\" };\n } \n return {};\n });\n // R8.4 If \"Credit Card\" is the selected payment option, the three fields accept only numbers: a 13 to 16-digit credit card number, a 5-digit zip code, and 3-number CVV value\n rules.push(() => {\n let message = \"\"; \n\n if ( $(\"#payment\").val() !== \"credit card\" ) {\n return {};\n }\n\n if ( $(\"#cc-num\").val().length < 13 || \n $(\"#cc-num\").val().length > 16 ) {\n message += \"The credit card number should be between 13 and 16 numbers long.\\n\";\n }\n\n if ( !OnlyDigits($(\"#cc-num\").val()) ) {\n message += \"You have entered non-numerical characters into the credit card number.\\n\";\n }\n\n if ( $(\"#zip\").val().length !== 5 ) {\n message += \"The zip code should be 5 digits long.\\n\";\n }\n if ( !OnlyDigits($(\"#zip\").val() )) {\n message += \"The zip code should contain only numerical characters.\\n\";\n }\n\n if ( $(\"#cvv\").val().length !== 3 ) {\n message += \"The cvv should be 3 digits long.\\n\";\n }\n\n if ( !OnlyDigits($(\"#cvv\").val()) ) {\n message += \"You have entered non-numerical characters into the cvv.\\n\";\n }\n \n if ( message !== \"\" ) {\n return { for: \".credit-card-row1\", message: message.trim() };\n }\n\n // Todo: We should split the error message when the screen is very small and\n // the layout gets rearranged. It works this way, its ok, but it would be better still.\n\n return {};\n });\n\n rules.push(() => {\n if ( $(\"#payment\").val() === \"select_method\" ) {\n return { for: \"#payment\", message: \"Please select a payment method...\" };\n }\n return {};\n });\n\n\n // When the form is submitted, then we first want to check if all rules apply.\n $form.on(\"submit\", (event) => {\n if (!IsFormValid()) {\n event.preventDefault();\n }\n });\n // Instant validation = on\n AttachInstantValidationToDom();\n }", "function validateForm() {\n return true;\n}", "function validateForm(formId,loading){\n\tloading=typeof loading!=='undefined'?loading:'true';\n\tif($('#'+formId).valid()){\n\t\tif(loading=='true'){\n\t\t\tstartloading();\n\t\t}\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function dirvalidates(form){\n\t\n\t\n\tvar result = 'true';\n\tform.find('input, textarea, select, radio, file').each(function(){\n\t\tif(typeof jQuery(this).attr('req') != 'undefined'){\n\t\t\tif(jQuery(this).attr('req') != ''){\n\n\n\t\n\t\t\t\t\tif(typeof jQuery(this).attr('reqdep') != 'undefined'){\n\t\t\t\t\tvar reqdep = jQuery(this).attr('reqdep');\n\t\t\t\n\n\t\t\t\t\t// checks if form state matches to invoke required fields\n\t\t\t\t\tif(form.find('*[name=\"'+reqdep+'\"]').val() == jQuery(this).attr('req')){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(jQuery(this).is(':checkbox')){\n\t\t\t\t\t\t\tvar name = jQuery(this).attr('name');\n\t\t\t\t\t\t\tif(jQuery('input[name=\"'+name+'\"]:checked').length > 0){\n\t\t\t\t\t\t\t\tjQuery(this).closest('fieldset').removeClass('invalid');\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.log(name+' is empty');\n\t\t\t\t\t\t\t\tjQuery(this).closest('fieldset').addClass('invalid');\t\n\t\t\t\t\t\t\t\tresult = 'false';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if(jQuery(this).val() == ''){\n\t\t\t\t\t\t\tjQuery(this).addClass('invalid');\n\t\t\t\t\t\t\tresult = 'false';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tjQuery(this).removeClass('invalid');\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(jQuery(this).attr('req') == 'save'){\n\t\t\t\t\n\t\t\t\t\t\tif(jQuery(this).is(':checkbox')){\n\t\t\t\t\t\t\tvar name = jQuery(this).attr('name');\n\t\t\t\t\t\t\tif(jQuery('input[name=\"'+name+'\"]:checked').length > 0){\n\t\t\t\t\t\t\t\tjQuery(this).closest('fieldset').removeClass('invalid');\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.log(name+' is empty');\n\t\t\t\t\t\t\t\tjQuery(this).closest('fieldset').addClass('invalid');\t\n\t\t\t\t\t\t\t\tresult = 'false';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if(jQuery(this).val() == ''){\n\t\t\t\t\t\t\tjQuery(this).addClass('invalid');\n\t\t\t\t\t\t\tresult = 'false';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tjQuery(this).removeClass('invalid');\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t});\n\t\n\tif(form.find('.invalid').length > 0) result = 'false';\n\n\tconsole.log('validation result: '+result);\n\treturn result;\n}", "function isValidateForm() {\n var validName = validateName();\n var validEmail = validateEmail();\n var validActivity = validateActivity();\n var validPayment = validatePayment();\n\n return validName && validEmail && validActivity && validPayment;\n }", "function validate($form) {\n\t\tvar allValid = true;\n\t\t$form.find('.input-field.text-field').each(function() {\n\t\t\tif (!$(this).hasClass('filled')) {\n\t\t\t\tinvalid($(this), 'Required');\n\t\t\t\tallValid = false;\n\t\t\t} else {\n\t\t\t\tvalid($(this));\n\t\t\t}\n\t\t});\n\t\t$form.find('.input-field input[name=zipcode]').each(function() {\n\t\t\tvar length = $(this).val().length;\n\t\t\tif (length === 0) {\n\t\t\t\tinvalid($(this), 'Required');\n\t\t\t\tallValid = false;\n\t\t\t} else if (length !== 5) {\n\t\t\t\tinvalid($(this), 'Invalid postal code');\n\t\t\t\tallValid = false;\n\t\t\t}\n\t\t});\n\t\t$form.find('.input-field input[name=phonenumber]').each(function() {\n\t\t\tvar $input = $(this);\n\t\t\tvar length = $input.val().length;\n\t\t\tif (length == 10 || length == 11) valid($input);\n\t\t\telse {\n\t\t\t\tallValid = false;\n\t\t\t\tif (length == 7) invalid($input, 'Please include your area code');\n\t\t\t\telse if (length == 0) invalid($input, 'Required');\n\t\t\t\telse invalid($input, 'Invalid phone number');\n\t\t\t}\n\t\t});\n\t\tvar $emailInput = $form.find('.input-field input[name=email]');\n\t\tif ($emailInput.val().length == 0) {\n\t\t\tinvalid($emailInput, 'Required');\n\t\t\tallValid = false;\n\t\t} else if (!validateEmail($emailInput.val())) {\n\t\t\tinvalid($emailInput, 'Invalid email address');\n\t\t\tallValid = false;\n\t\t} else {\n\t\t\tvalid($emailInput);\n\t\t}\n\t\tvar $birthdayInput = $form.find('.birthday input[name=birthday]');\n\t\tvar date = $birthdayInput.val();\n\t\tif(date.length == 0){\n\t\t\tinvalid($birthdayInput, 'Required');\n\t\t\tallValid = false;\n\t\t} else{\n\t\t\tvar year = parseInt(date.split('-')[0]);\n\t\t\tvar age = new Date().getFullYear() - year;\n\t\t\tif(age > 100 || age < 12){\n\t\t\t\tinvalid($birthdayInput, 'Invalid Date');\n\t\t\t\tallValid = false;\n\t\t\t} else{\n\t\t\t\tvalid($birthdayInput);\n\t\t\t}\n\t\t}\n\t\treturn allValid;\n\t}", "function validateForm(){\n if (!nameRegex.test($(\"#name\").val())){\n toggleError(true, $(\"#nameError\"), $(\"label[for=name]\"), errorMessages.name);\n $(\"#name\").addClass(\"errorInput\");\n } else {\n toggleError(false, $(\"#nameError\"));\n $(\"#name\").removeClass(\"errorInput\");\n }\n// Trigger warning\n $(\"#mail\").trigger(\"keyup\");\n\n if ($(\"#design option\").first().prop(\"selected\")){\n toggleError(true, $(\"#designError\"), $(\".shirt-box\"), errorMessages.design);\n $(\"#design\").addClass(\"errorInput\");\n } else {\n toggleError(false, $(\"#designError\"));\n $(\"#design\").removeClass(\"errorInput\");\n }\n\n if ($(\".activities input:checked\").length == 0){\n toggleError(true, $(\"#activityError\"), $(\".activities label\").first(), errorMessages.activities);\n } else {\n toggleError(false, $(\"#activityError\"));\n }\n\n if ($(\"option[value='credit card']\").prop(\"selected\")){\n ccErrorEvaluation ();\n\n if (!zipRegex.test($(\"#zip\").val())){\n toggleError(true, $(\"#zipCodeError\"), $(\".credit-card\"), errorMessages.zipCode);\n $(\"#zip\").addClass(\"errorInput\");\n } else {\n toggleError(false, $(\"#zipCodeError\"));\n $(\"#zip\").removeClass(\"errorInput\");\n }\n\n if (!cvvRegex.test($(\"#cvv\").val())){\n toggleError(true, $(\"#cvvError\"), $(\".credit-card\"), errorMessages.cvv);\n $(\"#cvv\").addClass(\"errorInput\");\n } else {\n toggleError(false, $(\"#cvvError\"));\n $(\"#cvv\").removeClass(\"errorInput\");\n }\n }\n}", "function validateForm() {\n\t\tvar $fields = $(\".form-control:visible\");\n\t\tvar $thisStep = $('.formPaso-stepper:visible');\n\t\tvar $nextStep = $thisStep.attr('data-nextStep');\n\t\tvar $filledFields = $fields.find('input[value!=\"\"]');\n\t\tvar $emptyFields = $fields.filter(function() {\n\t \treturn $.trim(this.value) === \"\";\n\t });\n \tfunction continueForm() {\n\t \t// apaga stepper\n\t \t// $('#stepper_portabilidad li').removeClass('active');\n\t \t// prende stepper correcto\n\t \t$('#stepper_portabilidad li.stepperLED-' + $nextStep).addClass('active');\n\t \t// deshabilita este boton\n\t \t$($thisStep).find('.nextStep').addClass('disabled');\n\t \t// oculta este paso\n\t \t$($thisStep).slideUp('1200');\n\t \t// muestra el paso siguiente\n\t \t$('#portateForm-' + $nextStep).slideDown('1200');\n\t \t// habilita el boton a paso siguiente\n\t \t$('#portateForm-' + $nextStep).find('.nextStep').removeClass('disabled');\n\t \t// anima el DOM hasta el stepper\n\t \t$('html, body').animate({scrollTop: $(\"#stepper_portabilidad\").offset().top - 30}, 500);\n\t\t // cancela form button\n\t \treturn false;\n\t }\n\t\tif (!$emptyFields.length) {\n\t\t\t// if form is ok...\n\t\t\t$('#camposvacios').slideUp();\n\t\t\tcontinueForm();\n\t\t} else {\n\t\t console.log($emptyFields);\n\t\t $emptyFields.parents('.form-group').addClass('invalidInput').removeClass('input-effect');\n\t\t $filledFields.addClass('totallyValidInput');\n\t\t console.log($filledFields);\n\t\t $('#camposvacios').slideToggle();\n\t\t $('html, body').animate({scrollTop: $(\"#camposvacios\").offset().top}, 200);\n\t\t}\n\t}", "function validateForm()\n{\n return true;\n}", "function validateForm()\n{\n return true;\n}", "function validateForm(form) {\n\tvar reqField = []\n\treqField.push(form.elements['firstName']);\n\treqField.push(form.elements['lastName']);\n\treqField.push(form.elements['address1']);\n\treqField.push(form.elements['city']);\n\treqField.push(form.elements['state']);\n\tzip = form.elements['zip']\n\tbirthdate = form.elements['birthdate']\n\n\ttoReturn = true;\n\n\treqField.forEach(function(field) {\n\t\tif (field.value.trim().length == 0) {\n\t\t\tfield.className = field.className + \" invalid-field\";\n\t\t\ttoReturn = false;\n\t\t} else {\n\t\t\tfield.className = 'form-control'\n\t\t}\n\t});\n\n\tif (document.getElementById('occupation').value == 'other') {\n\t\tvar otherBox = document.getElementsByName('occupationOther')[0]\n\t\tif (otherBox.value.trim().length == 0) {\n\t\t\totherBox.className = otherBox.className + ' invalid-field';\n\t\t\ttoReturn = false;\n\t\t} else {\n\t\t\totherBox.className = 'form-control'\n\t\t}\n\t}\n\n\tvar zipRegExp = new RegExp('^\\\\d{5}$');\n\n\tif (!zipRegExp.test(zip.value.trim())) {\n\t\tzip.className = zip.className + ' invalid-field';\n\t\ttoReturn = false;\n\t} else {\n\t\tzip.className = 'form-control';\n\t}\n\n\tif (birthdate.value.trim().length == 0) {\n\t\tbirthdate.className = birthdate.className + ' invalid-field'\n\t} else {\n\t\tvar dob = new Date(birthdate.value);\n\t\tvar today = new Date();\n\t\tif (today.getUTCFullYear() - dob.getUTCFullYear() == 13) {\n\t\t\tif (today.getUTCMonth() - dob.getUTCMonth() == 0) {\n\t\t\t\tif (today.getUTCDate() - dob.getUTCDate() == 0) {\n\t\t\t\t\tcorrectAge(birthdate)\n\t\t\t\t} else if (today.getUTCDate() - dob.getUTCDate() < 0) {\n\t\t\t\t\ttoReturn = tooYoung(birthdate);\n\t\t\t\t} else {\n\t\t\t\t\tcorrectAge(birthdate)\n\t\t\t\t}\n\t\t\t} else if (today.getUTCMonth() - dob.getUTCMonth() < 0) {\n\t\t\t\ttoReturn = tooYoung(birthdate);\n\n\t\t\t} else {\n\t\t\t\tcorrectAge(birthdate)\n\t\t\t}\n\t\t} else if (today.getUTCFullYear() - dob.getUTCFullYear() < 13) {\n\t\t\ttoReturn = tooYoung(birthdate);\n\n\t\t} else {\n\t\t\tcorrectAge(birthdate)\n\t\t}\n\t}\n\n\treturn toReturn;\n}", "function validateForm({ firstName, lastName, title, section, siteMap, items }) {\n const errors = [];\n\n if(firstName && lastName) {\n if(firstName.length > 100 || lastName.length > 100) {\n errors.push(\"Fields must not exceed 100 characters\");\n }\n } else {\n errors.push(\"First and last names required\");\n }\n\n if(title && title.length > 50) {\n errors.push(\"Title must not exceed 50 characters\");\n }\n if(!title) {\n errors.push(\"Entry must have a title\");\n }\n\n if(sections.indexOf(section) == -1) {\n errors.push(\"Invalid section\");\n }\n\n const siteMapInt = parseInt(siteMap);\n if(!siteMapInt || siteMapInt > 100 || siteMapInt < 1) {\n errors.push(\"Site MAP number must be from 1 to 100\");\n }\n\n if(!items.length || items.length < 1) {\n errors.push(\"You must add at least one catalogue item.\");\n } else {\n items.forEach((item, i) => {\n const val = parseInt(item.value, 10);\n if(isNaN(val) || val < 0 || val > 100000) {\n // i is zero indexed\n errors.push(`Item ${i + 1} has an invalid price`);\n }\n if(mediums.indexOf(item.medium) == -1) {\n errors.push(`Item ${i + 1} has an invalid medium`);\n }\n if(item.dimensions && item.dimensions.length > 14) {\n errors.push(`Item ${i + 1} has invalid dimensions`);\n }\n });\n }\n\n return errors;\n}", "function validateForm(theForm) {\n\tif (!ordersTitleValid(theForm.orderstitle.value))\n\t\treturn false;\n\tif (!ordersAuthorValid(theForm.ordersauthor.value))\n\t\treturn false;\n\tif (!ordersIsbnValid(theForm.ordersisbn.value))\n\t\treturn false;\n\tif (!ordersCustNameValid(theForm.orderscustname.value))\n\t\treturn false;\n\tif (!ordersCustPhoneValid(theForm.orderscustphone.value, theForm.orderscustmobile.value))\n\t\treturn false;\n\tif (!ordersCustEmailValid(theForm.orderscustemail.value))\n\t\treturn false;\n\tif (!ordersDeliveryNoValid(theForm.ordersdeliveryno.value))\n\t\treturn false;\n\tif (!ordersDeliveryStreetValid(theForm.ordersdeliverystreet.value))\n\t\treturn false;\n\tif (!ordersDeliveryCityValid(theForm.ordersdeliverycity.value))\n\t\treturn false;\n\tif (!ordersDeliveryStateValid(theForm.ordersdeliverystate.value))\n\t\treturn false;\n\tif (!ordersDeliveryPostcodeValid(theForm.ordersdeliverypost.value))\n\t\treturn false;\n\tif (!ordersDeliveryCountryValid(theForm.ordersdeliverycountry.value))\n\t\treturn false;\n\tif (!ordersPayNameValid(theForm.orderspayname.value))\n\t\treturn false;\n\tif (!ordersPayCardValid(theForm.orderspaycard.value, theForm.orderspaytype.value))\n\t\treturn false;\n\tif (!ordersPayCcvValid(theForm.orderspayccv.value))\n\t\treturn false;\n\treturn true;\n}", "function validation(forma){\n forma.find(\"#myForm\").validate({\n rules : {\n name : {\n required : true,\n minlength : 4, \n },\n login :{\n required : true,\n minlength : 5,\n },\n password: { \n required : true,\n minlength : 5,\n }, \n c_password: { \n required : true, \n equalTo : forma.find(\"#password\"), \n minlength : 5,\n },\n tel : {\n required : true,\n number : true,\n },\n email : {\n required : true,\n email : true,\n },\n },\n\n messages : {\n name : {\n required : \"This field is required\",\n minlength : \"Username must be at least 4 characters\",\n },\n login : { \n required : \"This field is required\",\n minlength : \"Minimum length of login is five characters\",\n },\n password : { \n required : \"This field is required\",\n minlength : \"Minimum length of password is five characters\",\n },\n c_password : { \n required : \"This field is required\",\n equalTo : \"Your passwords do not match\",\n minlength : \"Minimum length of password is five characters\",\n },\n tel : {\n required : \"This field is required\",\n number : \"You can use only numbers\",\n },\n email : {\n required : \"This field is required\",\n email : \"Wrong email format\",\n },\n }\n });\n }", "function verifyForm(form) {\n\tif (!requestValidation(form)) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function validate(){\r\n validateFirstName();\r\n validateSubnames();\r\n validateDni();\r\n validateTelephone ();\r\n validateDate();\r\n validateEmail();\r\n if(validateFirstName() && validateSubnames() && validateDni() && validateTelephone() &&\r\n validateDate() && validateEmail()){\r\n alert(\"DATOS ENVIADOS CORRECTAMENTE\");\r\n form.submit(); \r\n }\r\n\r\n}", "function formIsValid(id, isCreate) {\n if ($(\"#\" + id).valid()) { return true; }\n if (isCreate) { return false; }\n $(\"#\" + id + \" input\").each(function (index) {\n if ($(this).data(\"ismodified\") && $(this).hasClass(\"input-validation-error\")) { return false; }\n });\n return true;\n}", "function validForm() \n{\n\tvar allGood = true;\n\tvar allTags = document.getElementsByTagName(\"*\");\t\n\tfor (var i=0; i<allTags.length; i++){\t\n\t\t\t\t\t\n\t\t\tif (!validTag(allTags[i])) {\n\t\t\t\tallGood = false;\n\t\t\t}\n\t\t\n\t}\n\treturn allGood;\n\n\tfunction validTag(thisTag) \n\t{\n\t\tvar outClass = \"\";\n\t\tvar allClasses = thisTag.className.split(\" \");\n\t\t\t\n\t\tfor (var j=0; j<allClasses.length; j++) \n\t\t{\tif(j==allClasses.length-1)\n\t\t\t\toutClass += validBasedOnClass(allClasses[j]) + \"\";\n\t\t\telse\n\t\t\t\toutClass += validBasedOnClass(allClasses[j]) + \" \";\n\t\t}\n\t\n\t\tthisTag.className = outClass;\n\t\t//alert(outClass.indexOf(\"invalid\"));\n\t\t\t\t\t\n\t\tif (outClass.indexOf(\"invalid\") > -1) \n\t\t{\n\t\t\t//thisTag.focus();\n\t\t\t//if (thisTag.nodeName == \"INPUT\") \n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t\t\n\t\tfunction validBasedOnClass(movida) \n\t\t{\n\t\t\tvar classBack = \"\";\n\t\t\t\n\t\t\t//if (thisTag.nodeName == \"INPUT\") \n\t\t\t//alert(movida);\n\t\t\n\t\t\tswitch(movida) \n\t\t\t{\n\t\t\t\tcase \"\":\n\t\t\t\t\n\t\t\t\tcase \"invalid\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"reqd\":\n\t\t\t\t\tif (thisTag.value == \"\") \n\t\t\t\t\t{\n\t\t\t\t\t\tclassBack = \"invalid \";\n\t\t\t\t\t}\n\t\t\t\t\tclassBack += movida;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"isNum\":\n\t\t\t\t\tif (!isNum (thisTag.value)) \n\t\t\t\t\t\tclassBack = \"invalid \";\n\t\t\t\t\tclassBack += movida;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"box\":\n\t\t\t\t\tif(!checkBox(thisTag))\n\t\t\t\t\t\tclassBack = \"invalid \";\n\t\t\t\t\tclassBack += movida;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"email\":\n if (!validEmail (thisTag.value)) \n\t\t\t\t\t\tclassBack = \"invalid \";\n\t\t\t\t\tclassBack += movida;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tclassBack = movida;\n\t\t\t}\n\t\t\treturn classBack;\n\t\t}\n\t}\n}", "function validarModificarPregunta(){\r\n\r\n\t$(\"#formModificarPregunta\").validate({\r\n\t\trules : {\r\n\t\t\ttxtNombrePreguntaMod : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\tselectDetalleTipoFormacionPreguntaMod : {\r\n\t\t\t\trequired : true,\r\n\t\t\t\tmin : 1\r\n\t\t\t},\r\n\t\t\tselectDetalleEstadoPreguntaMod : {\r\n\t\t\t\trequired : true,\r\n\t\t\t\tmin : 1\r\n\t\t\t}\r\n\t\t},\r\n\t\tmessages : {\r\n\t\t\ttxtNombrePreguntaMod : \"Debe escribir un nombre\",\r\n\t\t\tselectDetalleTipoFormacionPreguntaMod : \"Debe escoger un tipo formacion\",\r\n\t\t\tselectDetalleEstadoPreguntaMod : \"Debe escoger un estado\"\r\n\t\t},\r\n\t\tnormalizer : function(valor) {\r\n\t\t\treturn $.trim(valor);\r\n\t\t},\r\n\t\tvalidClass: 'valido-validate',\r\n\t\terrorClass: \"error-validate\"\r\n\t})\r\n\r\n}", "function checkFormInput( f )\n{\n var v = false;\n\n for( var i = 0; i < f.length; i++ )\n {\n var e = f.elements[i];\n\n if((e.type == \"text\") || ( e.type == \"textarea\" ))\n {\n if( e.value.match( /\\S+/ ))\n {\n v = true;\n }\n else if( e.required )\n {\n return false;\n }\n }\n }\n\n return v;\n}", "function validateForm(event) {\n\n //Forhindrer at siden lastes inn på nytt når jeg sender in formen (skjema)\n event.preventDefault();\n console.log(\"The form was submitted\");\n\n //Finner 'firstName' med ID og 'firstNameError'\n const firstName = document.querySelector(\"#firstName\");\n const firstNameError = document.querySelector(\"#firstNameError\");\n\n //Sjekker med funksjon 'checkInputLenght' at 'firstName' verdien er mer en (2) ( på funksjonen neste)\n if (checkInputLength(firstName.value) === true) {\n firstNameError.style.display = \"none\"; //gjemmer feilmeldingen\n } else {\n firstNameError.style.display = \"block\"; //viser feilmeldingen om funksjonen returnerer 'false'\n }\n}", "function validateForm() {\n\t// get the values from the inputs\n\tconst firstNameValue = firstName.value.trim();\n\tconst lastNameValue = lastName.value.trim();\n\tconst emailValue = email.value.trim();\n\tconst phoneValue = phone.value.trim();\n\tconst countryValue = country.value.trim();\n\tconst cityValue = city.value.trim();\n\tconst businessValue = business.value.trim();\n\tconst roleValue = role.value.trim();\n\tconst addressValue = address.value.trim();\n\tconst passwordValue = password.value.trim();\n\tconst password2Value = password2.value.trim();\n\n\t// Check Firstname\n\tif (firstNameValue === \"\") {\n\t\tsetErrorFor(firstName, \"First name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(firstName);\n\t}\n\n\t// Check Firstname\n\tif (lastNameValue === \"\") {\n\t\tsetErrorFor(lastName, \"Last name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(lastName);\n\t}\n\n\t// Check Email\n\tif (emailValue === \"\") {\n\t\tsetErrorFor(email, \"Email cannot be blank\");\n\t} else if (!isEmail(emailValue)) {\n\t\tsetErrorFor(email, \"Please enter a valid email\");\n\t} else {\n\t\tsetSuccessFor(email);\n\t}\n\n\t// Check Number\n\tif (phoneValue === \"\") {\n\t\tsetErrorFor(phone, \"Phone number cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(phone);\n\t}\n\n\t// Check country\n\tif (countryValue === \"\") {\n\t\tsetErrorFor(country, \"Please select a country\");\n\t} else {\n\t\tsetSuccessFor(country);\n\t}\n\n\t// Check City\n\tif (cityValue === \"\") {\n\t\tsetErrorFor(city, \"Please enter a city\");\n\t} else {\n\t\tsetSuccessFor(city);\n\t}\n\n\t// Check business\n\tif (businessValue === \"\") {\n\t\tsetErrorFor(business, \"School cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(business);\n\t}\n\n\t// Check role\n\tif (roleValue === \"\") {\n\t\tsetErrorFor(role, \"Please select a role\");\n\t} else {\n\t\tsetSuccessFor(role);\n\t}\n\n\t// Check addresss\n\tif (addressValue === \"\") {\n\t\tsetErrorFor(address, \"Please enter a address\");\n\t} else {\n\t\tsetSuccessFor(address);\n\t}\n\n\t// Check passwords\n\tif (passwordValue === \"\") {\n\t\tsetErrorFor(password, \"Password cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(password);\n\t}\n\n\t// Check password2\n\tif (password2Value === \"\") {\n\t\tsetErrorFor(password2, \"Password confirmation is required\");\n\t} else if (password2Value !== passwordValue) {\n\t\tsetErrorFor(password2, \"Passwords do not match\");\n\t} else {\n\t\tsetSuccessFor(password);\n\t}\n\n\tif (genders[0].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\t\treturn true;\n\t} else if (genders[1].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\n\t\treturn true;\n\t} else {\n\t\t// no checked\n\t\tsetErrorFor(genderInput, \"Please select a gender\");\n\t\treturn false;\n\t}\n}", "function validateFormInputs() {\n var emailPattern = new RegExp(\n /^((\"[\\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 );\n var phonePattern = new RegExp(\n /^[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}$/im\n );\n // validate name\n if (messageFormState.name === undefined || messageFormState.name === \"\") {\n return \"Please Enter a Valid Name on the Form\";\n } else if (!emailPattern.test(messageFormState.email)) {\n return \"Please Enter a Valid Email on the form\";\n } else if (!phonePattern.test(messageFormState.phone)) {\n return \"Please Enter a Valid Phone Number on the form\";\n }\n return \"\";\n }", "function validation(form) {\n function isEmail(email) {\n return /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(\n email\n );\n }\n\n function isPostCode(postal) {\n if (\n /^[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJKLMNPRSTVWXYZ]( )?\\d[ABCEGHJKLMNPRSTVWXYZ]\\d$/i.test(\n postal\n ) ||\n /^\\d{5}$|^\\d{5}-\\d{4}$/.test(postal)\n )\n return true;\n else return false;\n }\n\n function isPhone(phone) {\n if (/^\\d{10}$/.test(phone)) return true;\n else return false;\n }\n\n function isPassword(password) {\n // Input Password and Submit [7 to 15 characters which contain only characters, numeric digits, underscore and first character must be a letter]</h2\n if (/^[A-Za-z]\\w{7,14}$/.test(password)) {\n return true;\n } else {\n return false;\n }\n }\n\n let isError = false;\n let password = '';\n\n validationFields.forEach((field) => {\n const isRequired =\n [\n 'firstName',\n 'LastName',\n 'email',\n 'address',\n 'postalCode',\n 'password',\n 'conPassword',\n ].indexOf(field) != -1;\n\n if (isRequired) {\n const item = document.querySelector('#' + field);\n\n if (item) {\n const value = item.value.trim();\n if (value === '') {\n setErrorFor(item, field + ' cannot be blank!');\n isError = true;\n } else if (field === 'email' && !isEmail(value)) {\n setErrorFor(item, 'Invalid Email Address!');\n isError = true;\n } else if (field === 'postalCode' && !isPostCode(value)) {\n setErrorFor(item, 'Invalid Postal Code!');\n isError = true;\n } else if (field === 'phone' && !isPhone(value)) {\n setErrorFor(item, 'Invalid Phone Number!');\n isError = true;\n } else if (field === 'password' && isPassword(value)) {\n setSuccessFor(item);\n password = value;\n } else if (field === 'password' && !isPassword(value)) {\n setErrorFor(\n item,\n ' Minimum 7 and Maximum 15 characters, numeric digits, underscore and first character must be a letter!'\n );\n isError = true;\n password = '';\n } else if (field === 'conPassword' && password !== value) {\n setErrorFor(item, 'Confirmation Password Not Match!');\n isError = true;\n } else {\n setSuccessFor(item);\n }\n }\n }\n });\n\n return isError === false;\n}", "function validarForm(form){\r\n\t// Campos relacionados a inscri??o de origem\r\n\tvar localidadeOrigem = form.localidadeOrigemID;\r\n\tvar setorComercialOrigem = form.setorComercialOrigemCD;\r\n\tvar quadraOrigem = form.quadraOrigemNM;\r\n\tvar loteOrigem = form.loteOrigem;\r\n\r\n\t// Campos relacionados a inscri??o de destino\r\n\tvar localidadeDestino = form.localidadeDestinoID;\r\n\tvar setorComercialDestino = form.setorComercialDestinoCD;\r\n\tvar quadraDestino = form.quadraDestinoNM;\r\n\tvar loteDestino = form.loteDestino;\r\n\r\n\tvar obrigatorio = true;\r\n\r\n\t//Origem\r\n\t//if (localidadeOrigem.value.length < 1){\r\n\t//\talert(\"Informe a Localidade da inscri??o de origem\");\r\n\t//\tlocalidadeOrigem.focus();\r\n\t//}else\r\n\tif (!testarCampoValorZero(localidadeOrigem, \"Localidade Inicial.\")){\r\n\t\tlocalidadeOrigem.focus();\r\n\t}else if (setorComercialOrigem.value.length > 0 && \r\n\t\t\t !testarCampoValorZero(setorComercialOrigem, \"Setor Comercial Inicial.\")){\r\n\r\n\t\tsetorComercialOrigem.focus();\r\n\t}else if (quadraOrigem.value.length > 0 && !testarCampoValorZero(quadraOrigem, \"Quadra Inicial.\")){\r\n\t\tquadraOrigem.focus();\r\n\t}else if (loteOrigem.value.length > 0){\r\n\t\tloteOrigem.focus();\r\n\t}else{\r\n\t\tobrigatorio = campoObrigatorio(setorComercialOrigem, quadraOrigem, \"Setor Comercial Inicial.\");\r\n\t\tif (!obrigatorio){\r\n\t\t\tobrigatorio = campoObrigatorio(quadraOrigem, loteOrigem, \"Quadra Inicial.\");\r\n\t\t}\r\n\t}\r\n\r\n\t//Destino\r\n\tif (!obrigatorio){\r\n\t\tif (localidadeDestino.value.length < 1 && localidadeOrigem.value.length > 0){\r\n\t\t\talert(\"Localidade Final.\");\r\n\t\t\tlocalidadeDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else if (!testarCampoValorZero(localidadeDestino, \"Localidade Final.\")){\r\n\t\t\tlocalidadeDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else if (setorComercialDestino.value.length > 0 && \r\n\t\t\t !testarCampoValorZero(setorComercialDestino, \"Setor Comercial Final.\")){\r\n\r\n\t\t\tsetorComercialDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else if (quadraDestino.value.length > 0 && !testarCampoValorZero(quadraDestino, \"Quadra Final.\")){\r\n\t\t\tquadraDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else if (loteDestino.value.length > 0){\r\n\t\t\tloteDestino.focus();\r\n\t\t\tobrigatorio = true;\r\n\t\t}else{\r\n\t\t\tobrigatorio = campoObrigatorio(setorComercialDestino, quadraDestino, \"Informe Setor Comercial Final.\");\r\n\t\t\tif (!obrigatorio){\r\n\t\t\t\tobrigatorio = campoObrigatorio(quadraDestino, loteDestino, \"Informe Quadra Final.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//Origem - Destino\r\n\tif (!obrigatorio){\r\n\t\tobrigatorio = campoObrigatorio(setorComercialDestino, setorComercialOrigem, \"Informe Setor Comercial Final.\");\r\n\t\tif (!obrigatorio){\r\n\t\t\tobrigatorio = campoObrigatorio(quadraDestino, quadraOrigem, \"Informe Quadra Inicial.\");\r\n\t\t\tif (!obrigatorio){\r\n\t\t\t\tobrigatorio = campoObrigatorio(loteDestino, loteOrigem, \"Informe Lote Inicial\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//\r\n\t//valida se os campos preenchido tao com seus correspondentes preenchidos tbm(obrigatorio)\r\n\t//\r\n\tif(!validaPreenchimentoCamposFaixa()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t\r\n\t//valida questoes referente a faixa de campos(campo inicial tem q ser menor ou igual ao final)\t\r\n\tif(validaPesquisaFaixaSetor()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t//valida questoes referente a faixa de campos(campo inicial tem q ser menor ou igual ao final)\t\r\n\tif(validaPesquisaFaixaQuadra()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t//valida questoes referente a faixa de campos(campo inicial tem q ser menor ou igual ao final)\t\r\n\tif(validaPesquisaFaixaLote()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t\r\n\t//valida questoes referente a faixa de campos(campo inicial tem q ser menor ou igual ao final)\t\r\n\tif(validaPesquisaFaixaLocalidade()){\r\n\t\tobrigatorio = true;\r\n\t}\r\n\t\r\n\r\n\t// Confirma a valida??o do formul?rio\r\n\tif (!obrigatorio && validateImovelOutrosCriteriosActionForm(form)){\r\n\t\tform.target = 'Relatorio';\r\n\t\tform.submit();\t\r\n\t}\r\n\r\n}", "function validateForm(e) {\n 'use strict';\n\n if (typeof e == 'undefined') {\n //This is a browser window-generated event\n e = window.event;\n }\n\n //Get form references:\n var firstName = U.$('firstName');\n var lastName;\n var email;\n var phone;\n var city;\n var state;\n var zip;\n var terms; //We'll populate these later\n\n //error flag:\n var error = false;\n\n //Validate the first name using a\n //regular expression:\n if (/^[A-Z \\.\\-']{2,20}$/i.test(firstName.value)) {\n // Everything between / and / is the expression\n //Any letter A-Z (case insensitive) is valid\n //Spaces, periods, and hyphens are valid\n //name must be 2 - 20 characters long\n\n //First name matches the expression\n //and is valid\n //alert(\"Valid first name\");\n removeErrorMessage('firstName');\n }\n else {\n //alert(\"Invalid first name\");\n addErrorMessage('firstName',\n 'Invalid/missing first name');\n error = true;\n }\n\n if (error) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n }\n\n return false;\n} // End of validateForm() function.", "function validateForm() {\n var label = document.getElementsByName(\"label\");\n if (label.length === 0) {\n\t\talert(\"Have not labeled!\");\n\t\treturn false;\n\t}\n}", "function validateUserForm() {\n\tvar isValid = true;\n\tvar value = $(\"#name\").val();\n\tif (!value) {\n\t\t$(\"#nameDiv\").addClass(\"error\");\n\t\t$(\"#nameHelp\").html(\"Nome inválido.\");\n\t\tisValid = false;\n\t}\n\n\tvalue = $(\"#email\").val();\n\tif (!value) {\n\t\t$(\"#emailDiv\").addClass(\"error\");\n\t\t$(\"#emailHelp\").html(\"E-mail inválido.\");\n\t\tisValid = false;\n\t}\n\n\tvalue = $(\"#password\").val();\n\tif (!value) {\n\t\t$(\"#passwordDiv\").addClass(\"error\");\n\t\t$(\"#passwordHelp\").html(\"Password inválido.\");\n\t\tisValid = false;\n\t}\n\n\tif (false) {\n\t\tvar ddd = $(\"#ddd\").val();\n\t\tvar phone = $(\"#phone\").val();\n\t\tif (!ddd || !phone) {\n\t\t\t$(\"#phoneDiv\").addClass(\"error\");\n\t\t\t$(\"#phoneHelp\").html(\"Telefone inválido.\");\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\tif (isValid) {\n\t\t$(\"#userForm\").submit();\n\t}\n}", "function ValidateForm() {\r\n\tvar regex;\r\n\r\n\t// Validate name.\r\n\tvar name = $('#name').val();\r\n\tvar namemessage = $('#namemessage');\r\n\tif (name.length != 0) {\r\n\t\tnamemessage.innerHTML\r\n\t\t= 'Valid!';\r\n\t\tnamemessage.setAttribute('class', 'green');\r\n\t}\r\n\telse {\r\n\t\tnamemessage.innerHTML = 'Not Valid, it should not be blank!';\r\n\t\tnamemessage.setAttribute('class', 'red');\r\n\t}\r\n\r\n\t// Validate age.\r\n\tvar age = document.getElementById('age').value;\r\n\tvar agemessage = document.getElementById('agemessage');;\r\n\tif (isNumeric(age)) {\r\n\t\tagemessage.innerHTML = 'Valid!';\r\n\t\tagemessage.setAttribute('class', 'green');\r\n\t}\r\n\telse {\r\n\t\tagemessage.innerHTML = 'Not Valid!';\r\n\t\tagemessage.setAttribute('class', 'red');\r\n\t}\r\n}", "function formValidator() {\n var imgRule = {extension: \"png|jpg\"};\n var imgErrorMsg = \"Invalid img, only png & jpg accepted\";\n $(\"#storyForm\").validate({\n debug: true,\n rules: {\n title: {required: true, minlength: 10},\n city: {required: true, minlength: 3},\n dateFrom: \"required\",\n dateTo: \"required\",\n countryList: \"required\",\n fieldsList: \"required\",\n storyInShort: \"required\",\n aboutOpportunity: \"required\",\n aboutInstitution : \"required\",\n providerOrg: {minlength: 5},\n \"img-1\": imgRule,\n \"img-2\": imgRule,\n \"img-3\": imgRule\n },\n messages: {\n title: {\n minlength: \"Please entar a valid title with at least 10 charater\"\n },\n city: {\n minlength: \"Please entar a valid city name with at least 3 charater\"\n },\n providerOrg: {\n minlength: \"Please entar a valid city name with at least 3 charater\"\n },\n \"img-1\": imgErrorMsg,\n \"img-2\": imgErrorMsg,\n \"img-3\": imgErrorMsg\n }\n });\n}", "function validateForm() {\r\n\tif((validateUsername()) && (validatePass()) && (validateRepPass()) && (validateAddress1())&& (validateAddress2()) && (validateZipCode() == true) && (validateCity()) && (validateLast()) && (validateFirst())&& (validatePhone()) && (validateEmail())) \r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n}", "validate(event) {\n\t\tevent.preventDefault();\n\n\t\tlet valid = true;\n\n\t\tconst form = document.forms['form'];\n\t\tconst formNodes = Array.prototype.slice.call(form.childNodes);\n\t\tvalid = this.props.schema.fields.every(field => {\n\t\t\tconst input = formNodes.find(node => node.id === field.id);\n\n\t\t\t// Check field is answered if mandatory\n\t\t\tif (!field.optional || typeof field.optional === 'object') {\n\t\t\t\tlet optional;\n\n\t\t\t\t// Check type of 'optional' field.\n\t\t\t\tif (typeof field.optional === 'object') {\n\n\t\t\t\t\t// Resolve condition in 'optional' object.\n\t\t\t\t\tconst dependentOn = formNodes.find(node => node.id === field.optional.dependentOn);\n\t\t\t\t\tconst dependentOnValue = this.getValue(dependentOn, field.type);\n\n\t\t\t\t\t// Try and find a value in schema 'values' object that matches a value\n\t\t\t\t\t// given in 'dependentOn' input.\n\t\t\t\t\t// Otherwise, use the default value provided.\n\t\t\t\t\tconst value = field.optional.values.find(val => dependentOnValue in val);\n\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\toptional = value[dependentOnValue];\n\t\t\t\t\t} else {\n\t\t\t\t\t\toptional = field.optional.default;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t// Else 'optional' field is just a boolean value.\n\t\t\t\t\toptional = field.optional;\n\t\t\t\t}\n\n\t\t\t\t// If not optional, make sure input is answered.\n\t\t\t\tif (!optional) {\n\t\t\t\t\treturn Boolean(this.getValue(input, field.type));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn field.validations.every(validation => {\n\t\t\t\tif (validation.containsChar) {\n\t\t\t\t\t// Ensure input value has the specified char.\n\t\t\t\t\treturn this.getValue(input, field.type).trim().includes(validation.containsChar);\n\n\t\t\t\t} else if (validation.dateGreaterThan) {\n\t\t\t\t\t// Ensure difference between today and given date is larger than specified interval.\n\t\t\t\t\tconst value = this.getValue(input, field.type);\n\n\t\t\t\t\tlet diff = Date.now() - new Date(value).getTime();\n\n\t\t\t\t\t// Convert from milliseconds to the unit given in schema.\n\t\t\t\t\tswitch(validation.dateGreaterThan.unit) {\n\t\t\t\t\t\tcase \"seconds\":\n\t\t\t\t\t\t\tdiff = diff / 1000;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"minutes\":\n\t\t\t\t\t\t\tdiff = diff / 1000 / 60;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"hours\":\n\t\t\t\t\t\t\tdiff = diff / 1000 / 60 / 60;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"days\":\n\t\t\t\t\t\t\tdiff = diff / 1000 / 60 / 60 / 24;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"years\":\n\t\t\t\t\t\t\tdiff = diff / 1000 / 60 / 60 / 24 / 365;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\treturn diff > validation.dateGreaterThan.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// If all checks pass, submit the form. Otherwise alert the user.\n\t\tif (valid) {\n\t\t\tthis.submit();\n\t\t} else {\n\t\t\talert(\"Form is not valid. Please make sure all inputs have been correctly answered.\");\n\t\t}\n\n\t}" ]
[ "0.67448467", "0.65959346", "0.6462639", "0.636946", "0.59862995", "0.5976459", "0.59722906", "0.594177", "0.5899047", "0.58980185", "0.5871631", "0.5867758", "0.585019", "0.5838626", "0.58349013", "0.5789055", "0.5788806", "0.57767963", "0.5738808", "0.5715723", "0.5699007", "0.5694713", "0.568004", "0.56596226", "0.56514704", "0.56380785", "0.5635631", "0.56345856", "0.561584", "0.5611774", "0.5590795", "0.55872124", "0.5580272", "0.55744433", "0.5569579", "0.5563554", "0.55630773", "0.5523163", "0.5497584", "0.54970145", "0.54970145", "0.549372", "0.5486029", "0.5482288", "0.54776126", "0.54734117", "0.54681224", "0.546649", "0.54527646", "0.5452251", "0.54502076", "0.5448102", "0.5447565", "0.544197", "0.5421112", "0.5416588", "0.5414991", "0.5395279", "0.5393944", "0.5387304", "0.53803486", "0.5377798", "0.5374829", "0.53665113", "0.5352321", "0.53485644", "0.5348313", "0.53477824", "0.5346818", "0.53357834", "0.53333265", "0.5327808", "0.5322124", "0.53022516", "0.5300368", "0.5298552", "0.5291155", "0.5291155", "0.5282151", "0.5274654", "0.5265497", "0.52653056", "0.52612895", "0.5257278", "0.52572006", "0.5256209", "0.5255596", "0.52555096", "0.5252667", "0.5247409", "0.52340525", "0.52313447", "0.5220818", "0.52101713", "0.52072424", "0.52051413", "0.520398", "0.51988846", "0.51985085", "0.5196774" ]
0.648889
2
getCookie() get CSRF cookie.
function getCookie(name) { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function csrfcookie () {\n var cookieValue = null,\n name = 'csrftoken';\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = cookies[i].trim();\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n}", "function getCSRFToken() {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n if (cookie.substring(0, 10) == ('csrftoken' + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(10));\n break;\n }\n }\n }\n return cookieValue;\n }", "function csrfcookie() {\n var cookieValue = null,\n name = 'csrftoken';\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = cookies[i].trim();\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n}", "function getCSRFToken() {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n if (cookie.substring(0, 10) == ('csrftoken' + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(10));\n break;\n }\n }\n }\n return cookieValue;\n}", "function getCSRFToken()\n\t{\n\t\tvar input = document.getElementById(\"csrftoken\");\n\t\treturn input.value;\n\t\t\n\t}", "function getToken() {\n if (!document.cookie) {\n return null;\n }\n const cookies = document.cookie.split(';')\n .map((item) => { return item.trim();});\n\n for (const cookie of cookies) {\n const [name, value] = cookie.split('=');\n if (name === SESSION_COOKIE_NAME) {\n return value;\n }\n }\n return null;\n }", "function getCSRFToken() {\r\n var csrfToken = $('#forgeryToken').val();\r\n return csrfToken;\r\n }", "function getCookie(name) {\n \n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n //RETORNANDO EL TOKEN\n return cookieValue;\n\n }//end function getCookie", "function getCSRF() {\n var metas = document.getElementsByTagName(\"meta\");\n for (var i = 0; i < metas.length; i++) {\n if (metas[i].getAttribute(\"name\") == \"csrf_token\") {\n return metas[i].getAttribute(\"content\");\n }\n }\n}", "getToken() {\n return this.cookies.get('token', {\n signed: true,\n encrypt: true\n });\n }", "_getCSRFToken() {\n let that = this;\n return that._request('GET', that._getUrl('simplecsrf/token.json'), {}, that.localHeaders)\n .then(function (res) {\n console.log(\"CSRF\",res.body);\n that.csrf = res.body.token;\n });\n }", "function getToken() {\n var meta = document.querySelector(\"meta[name=\\\"csrf-token\\\"]\");\n return meta && meta.getAttribute('content');\n}", "function getCookie() {\n\n\t // Restore the document.cookie property\n\t delete document.cookie;\n\n\t var result = document.cookie;\n\n\t // Redefine the getter and setter for document.cookie\n\t exports.observeCookie();\n\n\t report(\"document.getCookie\", [null] , result);\n\t return result;\n \t}", "csrfToken() {\n let selector = document.querySelector('meta[name=\"csrf-token\"]');\n\n if (this.options.csrfToken) {\n return this.options.csrfToken;\n } else if (selector) {\n return selector.getAttribute('content');\n }\n\n return null;\n }", "function getToken() {\n var token = document.cookie.replace(/(?:(?:^|.*;\\s*)token\\s*\\=\\s*([^;]*).*$)|^.*$/, \"$1\");\n return token;\n}", "getCookie() {\n if (! ('localStorage' in window) || this.settings.requireLogin) {\n return false;\n }\n return localStorage.getItem(this.storageKey);\n }", "function getCookie(token) {\n var name = token + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for(var i = 0; i <ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n }", "function get_cookie() {\n var cookie = $.cookie(cookie_name);\n if (cookie == null)\n return false;\n else\n return $.cookie(cookie_name);\n}", "function getCSRFToken(name) {\n\t/* Django has cross site request forgery protection, so we have to\n\tsend a unique token along with certain requests or the web server\n\twill flat-out reject the request.\n\n\tWhen a form is submitted our template will store this special token\n\tin a cookie named \"csrftoken\". The getCSRFToken function will get\n\tthe token from the cookie so it can be sent along with any request\n\tthat needs a CSRF token to work.*/\n\n\tlet tokenValue = null;\n\n\t// If the cookie exists, grab the data inside of it\n\tif (document.cookie && document.cookie !== '') {\n\t\tconst tokens = document.cookie.split(';');\n\t\t// Cycle through the token's characters\n\t\tfor (let i = 0; i < tokens.length; i++) {\n\t\t\t// Remove whitespace\n\t\t\tconst token = tokens[i].trim();\n\t\t\t// Verify that this is a valid CSRF token generated by Django\n\t\t\tif (token.substring(0, name.length + 1) === (name + '=')) {\n\t\t\t\t// Decode the token and store it in tokenValue\n\t\t\t\ttokenValue = decodeURIComponent(token.substring(name.length + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn tokenValue;\n}", "async function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n //RETORNANDO EL TOKEN\n return cookieValue;\n }//end function getCookie", "function getCookie() {\n return $cookies.get(\"role\");\n }", "function getCookie() {\n\n // Check if the user is logged in\n if($.cookie('logged_in') != null){\n\n var token = $.cookie('logged_in')\n } \n else { \n // @todo - do we need this ?\n // Creates a user automatically if no user is logged in\n var token = \"guest\"\n }\n\n return token\n}", "csrfToken() {\n if (!this.isSafe() && !this.isCrossOrigin()) {\n return up.protocol.csrfToken()\n }\n }", "function getCsrfToken(request) {\n return request.headers['x-xsrf-token'];\n}", "getToken() {\n return Cookies.get(\"cTok\");\n }", "function getCookie(name) {\n // from tornado docs: http://www.tornadoweb.org/en/stable/guide/security.html\n var r = document.cookie.match('\\\\b' + name + '=([^;]*)\\\\b');\n return r ? r[1] : void 0;\n }", "function getCookie(cookie_name) {\n var cookie_array = document.cookie.split('; ');\n var id_token = null;\n for (var i=0; i < cookie_array.length; i++) {\n var cookie = cookie_array[i];\n if (cookie.indexOf(cookie_name) == 0) {\n id_token = cookie.substring(cookie_name.length, cookie.length);\n }\n }\n return id_token;\n}", "get cookie() {\n return (this.tokenGenerated) ? this.config.cookie : new Error(\"Cookie not Generated... Please use getUserToken()\");\n }", "function getCookie(name) {\n let cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n let cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n let cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getcookie( name ) {\n if ( ! document.cookie ) return null ;\n var start = document.cookie.indexOf( name + \"=\" ) ;\n var len = start + name.length + 1 ;\n if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) return null ;\n if ( start == -1 ) return null ;\n var end = document.cookie.indexOf( \";\", len ) ;\n if ( end == -1 ) end = document.cookie.length ;\n return unescape( document.cookie.substring( len, end ) ) ;\n }", "function getCookie(cname) {\n\treturn $.cookie(cname);\n}", "function getCookie (e) {\n var t = \"; \" + document.cookie,\n i = t.split(\"; \" + e + \"=\");\n return 2 != i.length ? void 0 : i.pop().split(\";\").shift();\n}", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "static token() {\n return document.querySelector('meta[name=\"csrf-token\"]').content\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "getCookie(name) {\n let cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].trim();\n\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getUserToken(){\n\t\treturn $cookies.get('user.token');\n\t}", "function _getCookie(name){\n\tvar iStart = document.cookie.indexOf(name + \"=\");\n\tvar iLength = iStart + name.length + 1;\n\tif( (iStart == -1) || (!iStart && (name == document.cookie.substring(0)) ) ) return null;\n\tvar iEnd = document.cookie.indexOf(\";\", iLength);\n\tif( iEnd == -1 ) iEnd = document.cookie.length;\n\treturn unescape(document.cookie.substring(iLength, iEnd));\n}", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n}", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for(var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n \"use strict\";\n var cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n}", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(\",\");\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n\t\tvar cookieValue = null;\n\t\tif (document.cookie && document.cookie != '') {\n\t\t\tvar cookies = document.cookie.split(';');\n\t\t\tfor (var i = 0; i < cookies.length; i++) {\n\t\t\t\tvar cookie = jQuery.trim(cookies[i]);\n\t\t\t\t// Does this cookie string begin with the name we want?\n\t\t\t\tif (cookie.substring(0, name.length + 1) == (name + '=')) {\n\t\t\t\t cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cookieValue;\n\t}", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n\n var cookieValue = null;\n\n if (document.cookie && document.cookie != '') {\n\n var cookies = document.cookie.split(';');\n\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n\t\t\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n var i = 0;\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (i; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n var i = 0;\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (i; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function GetCookie(name){\n var result = null;\n if(document.cookie && $.trim(document.cookie) != ''){\n var cookies = document.cookie.split(';');\n var cookiesLen = cookies.length;\n if(cookiesLen > 0){\n for(var i = 0; i < cookiesLen; i++){\n var cookie = $.trim(cookies[i]);\n if (cookie.substring(0, name.length + 1) == (name + '=')){\n result = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n }\n return result;\n }", "function ht_getcookie(name) {\n\tvar cookie_start = document.cookie.indexOf(name);\n\tvar cookie_end = document.cookie.indexOf(\";\", cookie_start);\n\treturn cookie_start == -1 ? '' : unescape(document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length)));\n}", "function getCookie(name) {\r\n var cookieValue = null;\r\n if (document.cookie && document.cookie != '') {\r\n var cookies = document.cookie.split(';');\r\n for (var i = 0; i < cookies.length; i++) {\r\n var cookie = jQuery.trim(cookies[i]);\r\n // Does this cookie string begin with the name we want?\r\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\r\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\r\n break;\r\n }\r\n }\r\n }\r\n return cookieValue;\r\n }", "function getCookie(name) {\n let cookieValue = null;\n if (document.cookie && document.cookie != '') {\n let cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n let cookie = cookies[i].trim();\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = cookies[i].trim();\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name, request) {\n // Return cookie if we're on the client.\n if (__CLIENT__) {\n return Cookie().get(name);\n }\n\n // Get cookie from request if we're on the server.\n if (__SERVER__ && request) {\n return (new Cookie(request)).get(name);\n }\n\n return null;\n}", "function getCookie(name) {\n\t\tlet cookieValue = null;\n\t\tif (document.cookie && document.cookie !== \"\") {\n\t\t\tconst cookies = document.cookie.split(\";\");\n\t\t\tfor (let i = 0; i < cookies.length; i++) {\n\t\t\t\tconst cookie = cookies[i].trim();\n\t\t\t\t// Does this cookie string begin with the name we want?\n\t\t\t\tif (cookie.substring(0, name.length + 1) === name + \"=\") {\n\t\t\t\t\tcookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cookieValue;\n\t}", "function getCookie(name) {\n let cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].trim();\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "getCookie(cname) {\n var name = cname + \"=\";\n var ca = decodeURIComponent(document.cookie).split(';');\n for(var i=0; i <ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n }", "getCookies() {\n return this.cookies;\n }", "function getCookie(name) {\n\t var cookieValue = null;\n\t if (document.cookie && document.cookie != '') {\n\t var cookies = document.cookie.split(';');\n\t for (var i = 0; i < cookies.length; i++) {\n\t var cookie = jQuery.trim(cookies[i]);\n\t if (cookie.substring(0, name.length + 1) == (name + '=')) {\n\t cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n\t break;\n\t }\n\t }\n\t }\n\t return cookieValue;\n\t}", "function getCookie(name) {\n let cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].trim();\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n }", "function getCookie(name) {\n\tvar cookieValue = null;\n\tif (document.cookie && document.cookie != '') {\n\t var cookies = document.cookie.split(';');\n\t for (var i = 0; i < cookies.length; i++) {\n\t\tvar cookie = jQuery.trim(cookies[i]);\n\t\t// Does this cookie string begin with the name we want?\n\t\tif (cookie.substring(0, name.length + 1) == (name + '=')) {\n\t\t cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n\t\t break;\n\t\t}\n\t }\n\t}\n\treturn cookieValue;\n }", "function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n}" ]
[ "0.80601245", "0.80209386", "0.7975315", "0.79567957", "0.70088995", "0.69183916", "0.68589664", "0.6802252", "0.6763289", "0.6641691", "0.6622045", "0.6598849", "0.65397525", "0.65147835", "0.6503101", "0.6495262", "0.64921814", "0.64658403", "0.64603716", "0.64295155", "0.6387904", "0.6362675", "0.63207555", "0.62931186", "0.628538", "0.6266399", "0.62213844", "0.6140301", "0.61329985", "0.61230695", "0.612062", "0.61190754", "0.6101234", "0.6101234", "0.6101234", "0.60841304", "0.60705876", "0.60618424", "0.60618424", "0.60530525", "0.60530525", "0.60530525", "0.604922", "0.6048512", "0.60465467", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.60357046", "0.6031122", "0.6026749", "0.60186166", "0.6018528", "0.6013004", "0.60127825", "0.60123116", "0.6009675", "0.60075164", "0.60075164", "0.60019624", "0.6001962", "0.6001962", "0.6000704", "0.59980315", "0.5991286", "0.5986339", "0.5983539", "0.5977259", "0.5977221", "0.5974858", "0.59689885", "0.59666526", "0.596304", "0.5963001", "0.59583455", "0.5954612", "0.594757" ]
0.6031208
72
csrfSafeMethod() these HTTP methods do not require CSRF protection.
function csrfSafeMethod(method) { return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function csrfSafeMethod(method) {\n\t // these HTTP methods do not require CSRF protection\n\t return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n\t }", "function csrfSafeMethod(method) {\n// these HTTP methods do not require CSRF protection\nreturn (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n\t// these HTTP methods do not require CSRF protection\n\treturn (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n\t // these HTTP methods do not require CSRF protection\n\t return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n\t}", "function csrfSafeMethod(method) {\n\t// these HTTP methods do not require CSRF protection\n\treturn (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n}", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function csrfSafeMethod(method) {\n\t\treturn (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n\t}", "function csrfSafeMethod(method) {\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }", "function ignoreCsrfProtection(){\n function csrfSafeMethod(method){\n // these HTTP methods do not require CSRF protection\n return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n }\n $.ajaxSetup({\n beforeSend: function(xhr, settings){\n if (!csrfSafeMethod(settings.type) && !this.crossDomain){\n xhr.setRequestHeader(\"X-CSRFToken\", Cookies.get('csrftoken'));\n }\n }\n });\n }", "csrfToken() {\n if (!this.isSafe() && !this.isCrossOrigin()) {\n return up.protocol.csrfToken()\n }\n }", "function csrfSafeSend(xhr, settings){\n if (!csrfSafeMethod(settings.type) && !this.crossDomain) {\n xhr.setRequestHeader(\"X-CSRFToken\", csrftoken);\n }\n\n}", "function shouldSendCSRF(httpMethod) {\n return !(['GET', 'HEAD', 'OPTIONS', 'TRACE'].includes(httpMethod))\n}", "function handleCsrfToken(){\n var token = $(\"meta[name='_csrf']\").attr(\"content\");\n var header = $(\"meta[name='_csrf_header']\").attr(\"content\");\n $(document).ajaxSend(function(e, xhr, options) {\n xhr.setRequestHeader(header, token);\n });\n }", "function status()\n{\n $.ajax({url:\"/status\",type:\"get\",async:false}).done(function(r)\n {\n if(r!=\"\")\n {\n csrf_token=r;\n $(\"_csrf_token\").val(r);\n }\n })\n}", "function methodNotAllowed() {\n return Promise.reject(new Error('Method not allowed'));\n }", "function resetCsrfToken () {\n getCsrfToken.token = false;\n }", "_getCSRFToken() {\n let that = this;\n return that._request('GET', that._getUrl('simplecsrf/token.json'), {}, that.localHeaders)\n .then(function (res) {\n console.log(\"CSRF\",res.body);\n that.csrf = res.body.token;\n });\n }", "function csrfCheck(req, res, next) {\n\n //Only check for non-GET requests, since GETs don't modify state\n if ('GET' !== req.method && 'HEAD' !== req.method) {\n\n if (req.get('Origin')) {\n\n for (var i = 0; i < whitelist.length; i++) {\n //whitelist can also contain regexps\n if (whitelist[i] instanceof RegExp && whitelist[i].test(req.headers.origin)) {\n return next();\n } else if (whitelist[i] === req.headers.origin) {\n return next();\n }\n }\n\n _logger.warn('CSRF request failed for origin, %s', req.headers.origin);\n return res.sendStatus(400);\n } else {\n return next();\n }\n } else {\n return next(); //no need to check origin\n }\n\n}", "csrfToken() {\n let selector = document.querySelector('meta[name=\"csrf-token\"]');\n\n if (this.options.csrfToken) {\n return this.options.csrfToken;\n } else if (selector) {\n return selector.getAttribute('content');\n }\n\n return null;\n }", "static token() {\n return document.querySelector('meta[name=\"csrf-token\"]').content\n }", "function getCSRF() {\n var metas = document.getElementsByTagName(\"meta\");\n for (var i = 0; i < metas.length; i++) {\n if (metas[i].getAttribute(\"name\") == \"csrf_token\") {\n return metas[i].getAttribute(\"content\");\n }\n }\n}", "static get _method() {\r\n return {\r\n POST: 'POST',\r\n PUT: 'PUT',\r\n DELETE: 'DELETE'\r\n };\r\n }", "function getCSRFToken() {\r\n var csrfToken = $('#forgeryToken').val();\r\n return csrfToken;\r\n }", "use (axios) {\n axios.interceptors.request.use(CSRFInterceptor.accept, CSRFInterceptor.reject)\n }", "function getCSRFToken()\n\t{\n\t\tvar input = document.getElementById(\"csrftoken\");\n\t\treturn input.value;\n\t\t\n\t}", "function Acsrf(clientApi) {\n this.api = clientApi;\n}", "function isSimpleMethod() {\n return qq.indexOf([\"GET\", \"POST\", \"HEAD\"], options.method) >= 0;\n }", "static checkSecurity (req, res) {\n res.status(200).send()\n }", "function handleMethod(link) {\n\t\tvar href = link.attr('href'),\n\t\t\tmethod = link.attr('data-method'),\n\t\t\tcsrf_token = $('meta[name=csrf-token]').attr('content'),\n\t\t\tcsrf_param = $('meta[name=csrf-param]').attr('content'),\n\t\t\tform = $('<form method=\"post\" action=\"' + href + '\"></form>'),\n\t\t\tmetadata_input = '<input name=\"_method\" value=\"' + method + '\" type=\"hidden\" />';\n\n\t\tif (csrf_param !== undefined && csrf_token !== undefined) {\n\t\t\tmetadata_input += '<input name=\"' + csrf_param + '\" value=\"' + csrf_token + '\" type=\"hidden\" />';\n\t\t}\n\n\t\tform.hide().append(metadata_input).appendTo('body');\n\t\tform.submit();\n\t}", "function serverCsrfCheck (req, res) {\n assert.ok(isReq(req), 'is req')\n assert.ok(isRes(res), 'is res')\n\n const header = req.headers['x-csrf-token']\n if (!header) return false\n\n const cookies = new Cookies(req, res)\n const cookie = cookies.get('CSRF_token')\n if (!cookie) return false\n\n return header === cookie\n}", "function checkMethod(req, res, next) {\n // If the method is GET then do something with it \n if (req.method === 'GET') {\n next();\n }\n // Any other method give correct HTTP code and informative JSON message \n else {\n res.json(405, {\n 'error': 'Method not allowed'\n });\n }\n}", "function csrfPOST(action, form_el, success) {\n var csrftoken = getCookie(\"csrftoken\");\n if (csrftoken === null) {\n console.log(\"CSRF cookie not found!\");\n return;\n }\n $.ajax({\n url: action,\n type: \"POST\",\n headers: {\"X-CSRFToken\": csrftoken},\n data: form_el.serialize(),\n dataType: \"json\",\n success: success\n });\n}", "function ajaxCsrfToken() {\n\t$.ajaxSetup({\n\t headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') }\n\t});\n}", "validate(form_data, form) {\n\n let method = form.method;\n\n //check if data attribute is set. This is for put and delete request\n if (typeof form.dataset.method !== 'undefined') {\n method = form.dataset.method;\n }\n\n return form_data[method](form.action);\n }", "function method() {\n return \"post\";\n}", "function method() {\n return \"post\";\n}", "getFormRequestMethod(element) {\n return element.getAttribute(\"method\");\n }", "getFormRequestMethod(element) {\n return element.getAttribute(\"method\");\n }", "function doMethod(method, data) {\n var url = baseURL + $(\"#core-id\").val() + \"/\" + method;\n $.ajax({\n type: \"POST\",\n url: url,\n data: { access_token: $(\"#api-token\").val(), args: data },\n success: onMethodSuccess,\n dataType: \"json\"\n }).fail(function(obj) {\n onMethodFailure();\n });\n }", "denyAllMethods() {\n addMethod.call(this, 'deny', '*', '*', null);\n }", "function setCsrfToken () {\n return function* setCsrfCookieMidleware (next) {\n yield next\n if (this.session)\n this.cookies.set('XSRF-TOKEN', this.csrf, {httpOnly: false})\n }\n}", "function getToken() {\n var meta = document.querySelector(\"meta[name=\\\"csrf-token\\\"]\");\n return meta && meta.getAttribute('content');\n}", "function myFormSubmit(action, method, input) {\n 'use strict';\n var form;\n form = $('<form />', {\n action: action,\n method: method,\n style: 'display: none;'\n });\n if (typeof input !== 'undefined' && input !== null) {\n $.each(input, function (name, value) {\n $('<input />', {\n type: 'hidden',\n name: name,\n value: value\n }).appendTo(form);\n });\n }\n var csrf_input;\n csrf_input = $('<input />', {\n type: 'hidden',\n name: 'csrfmiddlewaretoken',\n value: csrftoken\n });\n \n form.append(csrf_input);\n form.appendTo('body').submit();\n}", "function method (request) {\n\t if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n\t request.headers.set('X-HTTP-Method-Override', request.method);\n\t request.method = 'POST';\n\t }\n\t}", "function antiForgeryToken() {\n return $('#anti-forgery-token input').val();\n}", "function checkBodyAllowed(options) {\n var method = options.method.toUpperCase();\n if ('HEAD' !== method && 'GET' !== method && 'DELETE' !== method && 'OPTIONS' !== method) {\n return true;\n }\n if (options.body && !options.forceAllowBody) {\n throw new Error(\"The de facto standard is that '\" + method + \"' should not have a body.\\n\" +\n \"Most web servers just ignore it. Please use 'query' rather than 'body'.\\n\" +\n \"Also, you may consider filing this as a bug - please give an explanation.\\n\" +\n \"Finally, you may allow this by passing { forceAllowBody: 'true' } \");\n }\n if (options.body && options.jsonp) {\n throw new Error(\"The de facto standard is that 'jsonp' should not have a body (and I don't see how it could have one anyway).\\n\" +\n \"If you consider filing this as a bug please give an explanation.\");\n }\n }", "function unknownMethodHandler(req, res) {\n if (req.method.toLowerCase() === 'options') {\n var allowHeaders = ['Accept', 'Accept-Version', 'Content-Type', 'Api-Version', 'Origin', 'X-Requested-With', 'Authorization', 'X-Auth-App', 'X-Auth-Token']; // added Origin & X-Requested-With & **Authorization**\n\n if (res.methods.indexOf('OPTIONS') === -1) res.methods.push('OPTIONS');\n\n res.header('Access-Control-Allow-Credentials', true);\n res.header('Access-Control-Allow-Headers', allowHeaders.join(', '));\n res.header('Access-Control-Allow-Methods', res.methods.join(', '));\n res.header('Access-Control-Allow-Origin', req.headers.origin);\n\n return res.send(200);\n }\n else\n return res.send(new restify.MethodNotAllowedError());\n}", "method(method)\n {\n if ( method )\n {\n return method.toUpperCase() === Request.method;\n }\n\n return Request.method;\n }", "function getCsrfToken(request) {\n return request.headers['x-xsrf-token'];\n}", "onNoMatch(req, res) {\n res.status(405).json({ error: `Method '${req.method}' Not Allowed` });\n }", "function mightHaveBody(method) {\n switch (method) {\n case 'DELETE':\n case 'GET':\n case 'HEAD':\n case 'OPTIONS':\n case 'JSONP':\n return false;\n default:\n return true;\n }\n}", "function includeCSRFToken ({ method, csrf=true, headers }) {\n if (!csrf || !CSRF_METHODS.includes(method)) return\n const token = getTokenFromDocument(csrf)\n if (!token) return\n return {\n headers: { ...headers, 'X-CSRF-Token': token }\n }\n}", "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers['X-HTTP-Method-Override'] = request.method;\n request.method = 'POST';\n }\n\n next();\n }", "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers['X-HTTP-Method-Override'] = request.method;\n request.method = 'POST';\n }\n\n next();\n }", "function setCsrfToken(request, response, next) {\n response.cookie('XSRF-TOKEN', request.csrfToken());\n next();\n}", "function returnMethod(){\n return 'GET';\n}", "ajaxMethod (data, callback, settings = this.settings) {\n $.ajax({\n type : 'POST',\n dataType : settings.dataType,\n url : settings.url,\n data : data,\n headers : {\n [settings.csrf.name]: settings.csrf.token\n },\n success (data) {\n if (data.success === true) {\n callback(data)\n if (settings.dev) {\n console.log('Success:', data)\n }\n } else {\n console.error('Error:', data)\n }\n return data;\n },\n error (data) {\n console.error('Template Error:', data.responseJSON.error)\n }\n })\n }", "function normalizedHttpMethod( httpMethod ) {\n httpMethod = ( httpMethod || \"\" ).toLowerCase();\n switch ( httpMethod ) {\n case \"get\":\n case \"post\":\n case \"delete\":\n case \"put\":\n case \"head\":\n return( httpMethod );\n break;\n }\n return( \"get\" );\n }", "function csrfcookie () {\n var cookieValue = null,\n name = 'csrftoken';\n if (document.cookie && document.cookie !== '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = cookies[i].trim();\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n return cookieValue;\n}", "function addRestCsrfCustomHeader(xhr, settings) {\n// if (settings.url == null || !settings.url.startsWith('/webhdfs/')) {\n\t if (settings.url == null ) {\n return;\n }\n var method = settings.type;\n if (restCsrfCustomHeader != null && !restCsrfMethodsToIgnore[method]) {\n // The value of the header is unimportant. Only its presence matters.\n if (restCsrfToken != null) {\n xhr.setRequestHeader(restCsrfCustomHeader, restCsrfToken);\n } else {\n xhr.setRequestHeader(restCsrfCustomHeader, '\"\"');\n }\n }\n }", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}" ]
[ "0.8502617", "0.8448504", "0.84455997", "0.8421866", "0.8421866", "0.8421866", "0.8421631", "0.839149", "0.8374523", "0.8336507", "0.8336507", "0.8336507", "0.8336507", "0.8336507", "0.8336507", "0.8336507", "0.8336507", "0.8336507", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83308566", "0.83169186", "0.80604297", "0.79818547", "0.7275031", "0.6704744", "0.62315184", "0.60093665", "0.600798", "0.57866514", "0.5757901", "0.55615354", "0.55514044", "0.552674", "0.5486338", "0.54776335", "0.546491", "0.5457643", "0.5429565", "0.5341235", "0.5325388", "0.53171176", "0.53135335", "0.5309071", "0.5305312", "0.52734685", "0.52685034", "0.52651304", "0.52516437", "0.5251473", "0.51961684", "0.51961684", "0.51915014", "0.51915014", "0.5154081", "0.5053853", "0.5046062", "0.50397784", "0.5031009", "0.5013184", "0.49982247", "0.4990149", "0.49798667", "0.49797183", "0.4976458", "0.4930269", "0.49142712", "0.49112293", "0.49103218", "0.49103218", "0.49036267", "0.4893337", "0.4882056", "0.48766035", "0.48664507", "0.48646966", "0.48628843", "0.48628843", "0.48628843", "0.48628843", "0.48628843", "0.48628843", "0.48628843" ]
0.7953583
40
sameOrigin() test that a given url is a sameorigin URL. Url could be relative or scheme relative or absolute.
function sameOrigin(url) { var host = document.location.host, protocol = document.location.protocol, sr_origin = '//' + host, origin = protocol + sr_origin; return (url == origin || url.slice(0, origin.length + 1) == origin + '/') || (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') || !(/^(\/\/|http:|https:).*/.test(url)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sameOrigin (url) {\n // Url could be relative or scheme relative or absolute\n var sr_origin = '//' + document.location.host,\n origin = document.location.protocol + sr_origin;\n\n // Allow absolute or scheme relative URLs to same origin\n return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||\n (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||\n // or any other URL that isn't scheme relative or absolute i.e relative.\n !(/^(\\/\\/|http:|https:).*/.test(url));\n\n }", "function isSameOrigin(originalURI, redirectURI) {\n var originalScheme = originalURI.scheme.toLowerCase();\n var redirectScheme = redirectURI.scheme.toLowerCase();\n var originalAuthority = originalURI.authority.toLowerCase();\n var redirectAuthority = redirectURI.authority.toLowerCase();\n \n if ((originalScheme == redirectScheme) && \n (originalAuthority == redirectAuthority)) {\n return true;\n }\n \n return false;\n }", "function isSameOrigin(baseUrl, otherUrl) {\n try {\n var base = new URL(baseUrl);\n if (!base.origin || base.origin === 'null') {\n return false; // non-HTTP url\n }\n } catch (e) {\n return false;\n }\n\n var other = new URL(otherUrl, base);\n return base.origin === other.origin;\n }", "function isSameOriginEvent( event ) {\n\n\t\ttry {\n\t\t\treturn window.location.origin === event.source.location.origin;\n\t\t}\n\t\tcatch ( error ) {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function sameOrigin(href) {\n if(!href || !isLocation) return false;\n var url = toURL(href);\n\n var loc = pageWindow.location;\n return loc.protocol === url.protocol &&\n loc.hostname === url.hostname &&\n loc.port === url.port;\n }", "function sameOrigin(href) {\n if(!href || !isLocation) return false;\n var url = toURL(href);\n\n var loc = pageWindow.location;\n return loc.protocol === url.protocol &&\n loc.hostname === url.hostname &&\n loc.port === url.port;\n }", "function sameOrigin(href) {\n if(!href || !isLocation) return false;\n var url = toURL(href);\n\n var loc = pageWindow.location;\n return loc.protocol === url.protocol &&\n loc.hostname === url.hostname &&\n loc.port === url.port;\n }", "function isCrossOrigin(url) {\n var reURL = /^(?:(https?:)\\/\\/)?((?:[0-9a-z\\.\\-]+)(?::(?:\\d+))?)/\n , matches = reURL.exec(url)\n , protocol = matches[1]\n , host = matches[2]\n return !(protocol == location.protocol && host == location.host)\n}", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return 0 == href.indexOf(origin);\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return 0 == href.indexOf(origin);\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return 0 == href.indexOf(origin);\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return 0 == href.indexOf(origin);\n }", "function sameOrigin(href) {\n\t var origin = location.protocol + '//' + location.hostname;\n\t if (location.port) origin += ':' + location.port;\n\t return (href && (0 === href.indexOf(origin)));\n\t }", "function sameOrigin(href) {\n\t var origin = location.protocol + '//' + location.hostname;\n\t if (location.port) origin += ':' + location.port;\n\t return (href && (0 === href.indexOf(origin)));\n\t }", "function sameOrigin(href) {\n let origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n}", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "function sameOrigin(href) {\n var origin = location.protocol + '//' + location.hostname;\n if (location.port) origin += ':' + location.port;\n return (href && (0 === href.indexOf(origin)));\n }", "function isCrossOriginUrl(url) {\n if (!defaultValue.defined(a$1)) {\n a$1 = document.createElement(\"a\");\n }\n\n // copy window location into the anchor to get consistent results\n // when the port is default for the protocol (e.g. 80 for HTTP)\n a$1.href = window.location.href;\n\n // host includes both hostname and port if the port is not standard\n const host = a$1.host;\n const protocol = a$1.protocol;\n\n a$1.href = url;\n // IE only absolutizes href on get, not set\n // eslint-disable-next-line no-self-assign\n a$1.href = a$1.href;\n\n return protocol !== a$1.protocol || host !== a$1.host;\n }", "function isSameDomain(originalURI, redirectURI) {\n if (isSameOrigin(originalURI, redirectURI)) {\n // If the URIs have same origin, then they implicitly have same\n // domain.\n return true;\n }\n\n var originalScheme = originalURI.scheme.toLowerCase();\n var redirectScheme = redirectURI.scheme.toLowerCase();\n \n // We should allow redirecting to a more secure scheme from a less\n // secure scheme. For example, we should allow redirecting from \n // ws -> wss and wse -> wse+ssl.\n if (redirectScheme.indexOf(originalScheme) == -1) {\n return false;\n }\n \n var originalHost = originalURI.host.toLowerCase();\n var redirectHost = redirectURI.host.toLowerCase();\n if (originalHost == redirectHost) {\n return true;\n }\n \n return false;\n }", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function isURLTypeOrigin(urlSuffix) {\n\t\treturn urlSuffix === 'origin';\n\t}", "function isValidReturnURL(url: string) {\n if (url.startsWith('/')) return true;\n const whitelist = process.env.CORS_ORIGIN\n ? process.env.CORS_ORIGIN.split(',')\n : [];\n return (\n validator.isURL(url, {\n require_tld: false,\n require_protocol: true,\n protocols: ['http', 'https'],\n }) && whitelist.includes(getOrigin(url))\n );\n}", "function validate(origin) {\n var data = url.parse(origin);\n if(typeof data !== 'object') {\n return false;\n }\n // Match against the provided data\n return !Object.keys(domainData).some(function (key) {\n if(data[key] !== domainData[key]) {\n console.log(data[key], domainData[key]);\n return true;\n }\n });\n }", "function originIsAllowed(origin) {\n return true;\n if(origin === 'http://dbwebb.se' || origin === 'http://localhost') {\n return true; \n }\n return false;\n}", "function hasValidOrigin(base) {\n if (!(/^https:\\/\\//.test(base) || /^\\/\\//.test(base))) {\n return false;\n }\n var originStart = base.indexOf('//') + 2;\n var originEnd = base.indexOf('/', originStart);\n // If the base url only contains the prefix (e.g. //), or the slash\n // for the origin is right after the prefix (e.g. ///), the origin is\n // missing.\n if (originEnd <= originStart) {\n throw new Error(\"Can't interpolate data in a url's origin, \" +\n \"Please make sure to fully specify the origin, terminated with '/'.\");\n }\n var origin = base.substring(originStart, originEnd);\n if (!/^[0-9a-z.:-]+$/i.test(origin)) {\n throw new Error('The origin contains unsupported characters.');\n }\n if (!/^[^:]*(:[0-9]+)?$/i.test(origin)) {\n throw new Error('Invalid port number.');\n }\n if (!/(^|\\.)[a-z][^.]*$/i.test(origin)) {\n throw new Error('The top-level domain must start with a letter.');\n }\n return true;\n}", "function originIsAllowed(origin) {\n\t//debido a que no se restringen clientes, no se realiza ningun tratamiento\n\treturn true;\n}", "function isPeerDomain(originalURI, redirectURI) {\n if (isSameDomain(originalURI, redirectURI)) {\n // If the domains are the same, then they are peers.\n return true;\n }\n\n var originalScheme = originalURI.scheme.toLowerCase();\n var redirectScheme = redirectURI.scheme.toLowerCase();\n \n // We should allow redirecting to a more secure scheme from a less\n // secure scheme. For example, we should allow redirecting from \n // ws -> wss and wse -> wse+ssl.\n if (redirectScheme.indexOf(originalScheme) == -1) {\n return false;\n }\n\n var originalHost = originalURI.host;\n var redirectHost = redirectURI.host;\n var originalBaseDomain = getBaseDomain(originalHost);\n var redirectBaseDomain = getBaseDomain(redirectHost);\n\n if (redirectHost.indexOf(originalBaseDomain, (redirectHost.length - originalBaseDomain.length)) == -1) {\n // If redirectHost does not end with the base domain computed using\n // the originalURI, then return false.\n return false;\n }\n\n if (originalHost.indexOf(redirectBaseDomain, (originalHost.length - redirectBaseDomain.length)) == -1) {\n // If originalHost does not end with the base domain computed using\n // the redirectURI, then return false.\n return false;\n }\n \n // Otherwise, the two URIs have peer-domains.\n return true;\n }", "function isOriginAllowed(requestOrigin) {\r\n var allowed = false;\r\n _.each(allowedOrigins, function (origin) {\r\n return !(allowed = origin.test(requestOrigin));\r\n });\r\n return allowed;\r\n}", "function originMatch(givenOrigin, allowedOrigins) {\n var allowedOriginsList = [], i = 0, origin = \"\";\n\n if (allowedOrigins.constructor === Array) {\n allowedOriginsList = allowedOrigins;\n } else {\n allowedOriginsList = [allowedOrigins];\n }\n for (i = allowedOriginsList.length - 1; i >= 0; i--) {\n var allowedOrigin = allowedOriginsList[i].trim();\n while (allowedOrigin.endsWith('/')) {\n // if the configured originURL ends with a '/', remove it\n allowedOrigin = allowedOrigin.slice(0, allowedOrigin.length-1);\n }\n if (allowedOrigin.indexOf('*') === -1) {\n // no wildcard, so just check if they are same\n if (allowedOrigin === givenOrigin) {\n return true;\n }\n continue;\n }\n //*.foo.bar matches a.b.c.foo.bar\n origin = \"^\" + allowedOrigin.replace('*.', \"(([a-z0-9][a-z0-9_-]*[a-z0-9]|[a-z0-9]).)+\").replace(/\\//g, \"\\\\/\").replace(/\\./g, \"\\\\.\") + \"$\";\n if (new RegExp(origin).test(givenOrigin)) {\n return true;\n }\n }\n return false;\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "function ensureOrigin(maybeOrigin) {\n var origin = \"\";\n \n var m = reURI.exec(maybeOrigin);\n if (m) {\n var scheme = m[2];\n var authority = m[4];\n \n if (scheme) {\n origin += scheme;\n origin += \":\";\n }\n if (authority) {\n origin += \"//\";\n origin += authority;\n }\n } // else malformed\n \n return origin;\n}", "function checkAllowedOrigin(origin) {\n const allowedOrigins = process.env.ALLOWED_ORIGINS.split(\",\");\n return allowedOrigins.includes(origin);\n}", "function equalUrlsWithSubpath(url1, url2, ignoreScheme) {\n if (ignoreScheme) {\n return url1.host === url2.host && url2.pathname.toLowerCase().startsWith(url1.pathname.toLowerCase());\n }\n return url1.origin === url2.origin && url2.pathname.toLowerCase().startsWith(url1.pathname.toLowerCase());\n}", "function isExternalUrl(url) {\n return protocolReg.test(url);\n }", "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "function isLocalFrame( frame ) {\n\t\t\tvar origin, src = frame.src;\n\n\t\t\t// Need to compare strings as WebKit doesn't throw JS errors when iframes have different origin.\n\t\t\t// It throws uncatchable exceptions.\n\t\t\tif ( src && /^https?:\\/\\//.test( src ) ) {\n\t\t\t\torigin = window.location.origin ? window.location.origin : window.location.protocol + '//' + window.location.host;\n\n\t\t\t\tif ( src.indexOf( origin ) !== 0 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tif ( frame.contentWindow.document ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} catch(e) {}\n\n\t\t\treturn false;\n\t\t}", "isInDomain(url) {\n return url.replace(/(https|http):/i, \"\").startsWith(\"//\" + this.args.domain);\n }", "function verifyCurrentUrl(url) {\n return requestMatches(url);\n}", "function getOrigin(url: string) {\n if (!url || url.startsWith('/')) return '';\n return (x => `${String(x.protocol)}//${String(x.host)}`)(URL.parse(url));\n}", "function isHostnameMatch(url) {\n // return urlWithoutProtocol(url).substring(hostReg, host.length) === host;\n return false;\n }", "isValidUrl (url) {\n if (!url) {\n return false;\n }\n return new RegExp('^(https?:\\/\\/)?(.+)\\.(.+)').test(url);\n }", "function isOwnDomain(url) {\n return (url.indexOf('//') === -1 ||\n url.indexOf('//www.ebi.ac.uk') !== -1 ||\n url.indexOf('//wwwdev.ebi.ac.uk') !== -1 ||\n url.indexOf('//srs.ebi.ac.uk') !== -1 ||\n url.indexOf('//ftp.ebi.ac.uk') !== -1 ||\n url.indexOf('//intranet.ebi.ac.uk') !== -1 ||\n url.indexOf('//pdbe.org') !== -1 ||\n url.indexOf('//' + document.domain) !== -1);\n }", "static isS3URL(url) {\n const s3Host =\n game.data.files.s3 &&\n game.data.files.s3 &&\n game.data.files.s3.endpoint &&\n game.data.files.s3.endpoint.host\n ? game.data.files.s3.endpoint.host\n : \"\";\n\n if (s3Host === \"\") return false;\n\n const regex = new RegExp(\"http[s]?://([^.]+)?.?\" + s3Host + \"(.+)\");\n const matches = regex.exec(url);\n\n const activeSource = matches ? \"s3\" : null; // can be data or remote\n const bucket = matches && matches[1] ? matches[1] : null;\n const current = matches && matches[2] ? matches[2] : null;\n\n if (activeSource === \"s3\") {\n return {\n activeSource,\n bucket,\n current,\n };\n } else {\n return false;\n }\n }", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#') || url.startsWith('?')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#') || url.startsWith('?')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isValidUrl(url, allowRelative) {\n if (!url) {\n return false;\n }\n // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)\n // scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n var protocol = /^[a-z][a-z0-9+\\-.]*(?=:)/i.exec(url);\n if (!protocol) {\n return allowRelative;\n }\n protocol = protocol[0].toLowerCase();\n switch (protocol) {\n case 'http':\n case 'https':\n return true;\n default:\n return false;\n }\n}", "hasOrigin() {\n return this.originJuggler != null;\n }", "hasOrigin() {\n return this.originJuggler != null;\n }", "function checkShouldAllowCors(request) {\n return corsUrls.some(url => testString(url, request.url));\n}", "function verifyValidCodeforcesURL(url) {\n\tif (url.includes(\"https://codeforces.com\") || url.includes(\"http://codeforces.com\")) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function parseUrlOrigin (url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash\n // if such is given\n //\n // can ignore everything after that\n\n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n var urlHostMatch = URL_HOST_PATTERN.exec(url) || []\n\n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils.getLocationOrigin)();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[-_a-zA-Z.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n const locationOrigin = (0, _utils.getLocationOrigin)();\n const resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n const locationOrigin = (0, _utils.getLocationOrigin)();\n const resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n const locationOrigin = (0, _utils.getLocationOrigin)();\n const resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true;\n\n try {\n // absolute urls can be local if they are on the same origin\n const locationOrigin = (0, _utils.getLocationOrigin)();\n const resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}", "function isValidUrl(url,obligatory,ftp)\n{\n // Si no se especifica el paramatro \"obligatory\", interpretamos\n // que no es obligatorio\n if(obligatory==undefined)\n obligatory=0;\n // Si no se especifica el parametro \"ftp\", interpretamos que la\n // direccion no puede ser una direccion a un servidor ftp\n if(ftp==undefined)\n ftp=0;\n\n if(url==\"\" && obligatory==0)\n return true;\n\n if(ftp)\n var pattern = /^(http|https|ftp)\\:\\/\\/[a-z0-9\\.-]+\\.[a-z]{2,4}/gi;\n else\n var pattern = /^(http|https)\\:\\/\\/[a-z0-9\\.-]+\\.[a-z]{2,4}/gi;\n\n if(url.match(pattern))\n return true;\n else\n return false;\n}", "function hasScheme(url) {\n const hasSchemeRE = new RegExp('^\\\\w+://');\n return hasSchemeRE.test(url);\n}", "function isUrl(url) {\n\n return !!(url.match(/^http(s)?:\\/\\/\\S+$/));\n \n}", "function isRelativeUrl(url) {\n return url.protocol === \"\" &&\n url.separator === \"\" &&\n url.authority === \"\" &&\n url.domain === \"\" &&\n url.port === \"\";\n}", "function isurl(theurl) {\n\treturn /^\\s*https?:\\/\\/.+$/.test(theurl);\n}", "function isValidUrl(url, allowRelative) {\n if (!url || typeof url !== 'string') {\n return false;\n }\n // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)\n // scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n var protocol = /^[a-z][a-z0-9+\\-.]*(?=:)/i.exec(url);\n if (!protocol) {\n return allowRelative;\n }\n protocol = protocol[0].toLowerCase();\n switch (protocol) {\n case 'http':\n case 'https':\n case 'ftp':\n case 'mailto':\n case 'tel':\n return true;\n default:\n return false;\n }\n }", "function isValidUrl(url, allowRelative) {\n if (!url) {\n return false;\n }\n // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)\n // scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n var protocol = /^[a-z][a-z0-9+\\-.]*(?=:)/i.exec(url);\n if (!protocol) {\n return allowRelative;\n }\n protocol = protocol[0].toLowerCase();\n switch (protocol) {\n case 'http':\n case 'https':\n case 'ftp':\n case 'mailto':\n case 'tel':\n return true;\n default:\n return false;\n }\n}" ]
[ "0.843504", "0.7679328", "0.7623121", "0.7370065", "0.7309821", "0.7309821", "0.7309821", "0.7254329", "0.7099114", "0.7099114", "0.7099114", "0.7099114", "0.70799434", "0.70799434", "0.7049594", "0.70393306", "0.70393306", "0.70393306", "0.70393306", "0.70393306", "0.70393306", "0.70393306", "0.70393306", "0.69072604", "0.66690636", "0.6515636", "0.6515636", "0.6515636", "0.6515636", "0.6515636", "0.6515636", "0.6515636", "0.6515636", "0.64919615", "0.6373352", "0.61631763", "0.61342293", "0.60900825", "0.6072284", "0.6007246", "0.5916914", "0.5912072", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5832333", "0.5827007", "0.57724404", "0.5738394", "0.5728996", "0.5699616", "0.5699616", "0.5699616", "0.5699616", "0.5699616", "0.56910723", "0.5683577", "0.56772804", "0.5675664", "0.5662787", "0.56512034", "0.5630019", "0.561956", "0.56080234", "0.56080234", "0.5592521", "0.55891657", "0.55891657", "0.55851406", "0.558226", "0.55807257", "0.5577527", "0.5577527", "0.5577527", "0.5577527", "0.5577527", "0.5577527", "0.5577527", "0.5577527", "0.55600166", "0.5537932", "0.5537932", "0.5537932", "0.5537932", "0.55333054", "0.55261016", "0.55242264", "0.5523312", "0.5511458", "0.55114067", "0.5497075" ]
0.84728515
0
sendData() send data via post request.
function sendData(data, successCb, errorCb) { var csrftoken = getCookie('csrftoken'); $.ajaxSetup({ beforeSend: function(xhr, settings) { if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) { xhr.setRequestHeader("X-CSRFToken", csrftoken); } } }); $.ajax({ url: '/api/messages/', dataType: 'json', type: 'post', contentType: 'application/json', data: JSON.stringify(data), processData: false, success: function(data, textStatus, jQxhr) { successCb(data); }, error: function(jqXhr, textStatus, errorThrown) { errorCb(errorThrown); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendData(requestMethod, postURL, dataToSubmit) {\n let request = new XMLHttpRequest();\n\n request.open(requestMethod, postURL, true);\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n request.send(dataToSubmit);\n }", "sendData(requestMethod, postURL, dataToSubmit) {\n let request = new XMLHttpRequest();\n\n request.open(requestMethod, postURL, true);\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n request.send(dataToSubmit);\n }", "function send (data) {\n\tpostMessage(JSON.stringify(data));\n}", "function send(data) {\n\tpostMessage(data);\n}", "function sendData(data){\n return $http.post('/process', data);\n }", "function sendDataByPost (formData) {\n var xmlhttp = new XMLHttpRequest()\n xmlhttp.open('POST', BASE_URL, true)\n xmlhttp.setRequestHeader('Content-Type', 'application/json')\n xmlhttp.send(JSON.stringify(formData))\n}", "send (url = null, data = null, type = TransferInterface.TYPE_POST) {\n /* @TODO complete method in children class */\n }", "post(url, data, opt = {}) {\n opt.method = 'POST';\n opt.data = data;\n return this.sendRequest(url, opt);\n }", "sendData(data) {\n this.sendMessage({\n type: index_1.CONNECTOR_REQUEST_CODES.DATA,\n data,\n });\n }", "_sendData() {\n\n }", "send(data) {\n if (data === void 0 && typeof this.dataDelegate === 'function') {\n data = this.dataDelegate();\n }\n return this.handleSocketEvent('data', data);\n }", "function sendHttpPost(sData) {\n\n // Put the data in an object\n var payload =\n {\n \"data\" : sData,\n };\n\n // Set the form options\n // (Because payload is a JavaScript object, it will be interpreted as\n // an HTML form. (We do not need to specify contentType; it will\n // automatically default to either 'application/x-www-form-urlencoded'\n // or 'multipart/form-data')). \n\n var options =\n {\n \"method\" : \"post\",\n \"payload\" : payload\n };\n\n\n // Do the post\n UrlFetchApp.fetch(\"http://port-3000-yaygd0akwz.treehouse-app.com/upload\", options);\n}", "function send(data) {\n //console.log(data);\n client.send(JSON.stringify(data))\n }", "function postData(donnee, valeur){\n\tvar querystring = require('querystring');\n\tvar http = require('http');\n\n // Build the post string from an object\n var post_data = querystring.stringify({\n 'action': 'datalizer_setData',\n 'donnee' : donnee,\n 'valeur' : valeur\n });\n\n // An object of options to indicate where to post to\n var post_options = {\n host: 'localhost',\n port: '80',\n path: '/wp-admin/admin-ajax.php',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': post_data.length\n }\n };\n\n // Set up the request\n var post_req = http.request(post_options, function(res) {\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n //console.log('Response: ' + chunk);\n });\n });\n post_req.on('error', function(e) {\n console.log('problem with request: ' + e.message);\n });\n\n // post the data\n post_req.write(post_data);\n post_req.end();\n\n}", "function sendData() {\n\n var data = document.getElementById(\"dataChannelSend\").value;\n sendChannel.send(data);\n log('Sent data: ' + data);\n}", "function sendData(which) {\n conn.send(which + \" \" + $(\"#\" + which).val())\n}", "async function postData(data) {\n fetch(ENDPT, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n body: JSON.stringify(data),\n })\n .then((res) => handleFormToast(res.status === 200))\n .catch(() => handleFormToast(false));\n }", "function sendData(data){\n \n var auth = Utilities.base64Encode(username+':'+api_key, Utilities.Charset.UTF_8);\n var option = {\n headers: {\n 'Authorization' : 'Basic ' + auth,\n 'contentType' : 'application/json',\n },\n 'method' : 'post',\n 'payload' : JSON.stringify(data)\n };\n \n Logger.log('About to perform a '+ option.headers['method'] + ' request to ' + url);\n \n // perform request\n var response = UrlFetchApp.fetch(url, option);\n response2 = JSON.parse(response);\n \n Logger.log('Request complete');\n \n // Logger.log('Logging response: ' + response.getContentText());\n}", "function sendPostRequest( url, data ) {\n if (mockPost) {\n var deferred;\n deferred = $q.defer();\n deferred.resolve({ data: data });\n return deferred.promise;\n } else {\n return $http.post( url, data );\n }\n }", "function sendData(data) {\n process.stdout.write(JSON.stringify(data));\n}", "function _sendPOSTRequest (url, data) {\n var request = new XMLHttpRequest();\n request.open('POST', url, true);\n request.setRequestHeader('Content-Type', 'application/json');\n request.send(data);\n }", "function sendData () {\n\t\t\tfetch(form.action, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: new FormData(form),\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json'\n\t\t\t\t}\n\t\t\t}).then(function (response) {\n\t\t\t\tif (response.ok) {\n\t\t\t\t\treturn response.json();\n\t\t\t\t}\n\t\t\t\tthrow response;\n\t\t\t}).then(function (data) {\n\t\t\t\tshowStatus(data.msg, true);\n\t\t\t\tif (data.redirect) {\n\t\t\t\t\twindow.location.href = data.redirect;\n\t\t\t\t}\n\t\t\t}).catch(function (error) {\n\t\t\t\terror.json().then(function (err) {\n\t\t\t\t\tshowStatus(err.msg);\n\t\t\t\t});\n\t\t\t}).finally(function () {\n\t\t\t\tform.removeAttribute('data-submitting');\n\t\t\t});\n\t\t}", "function send(data){\n //\n}", "function send(data) {\n return bridge.send(data)\n}", "sendPostRequest(data, url) {\n return this.httpClient.post(url, data, httpOptions).subscribe((result) => result);\n }", "function sendData(data, handler) {\n\tvar req = Request({\n\t\turl: prefs.SERVER_ADDRESS,\n\t\theaders: {\n\t\t\t\"Authorization\": \"Basic \" + base64.encode(prefs.AUTH_USERNAME + \":\" + prefs.AUTH_PASSWORD),\n\t\t\t\"Content-type\": \"application/json\"\n\t\t},\n\t\tcontent: JSON.stringify(data),\n\t\tonComplete: handler\n\t});\n\treq.post();\n}", "send(data) {\n try {\n this._send(data);\n } catch (e){\n console.log(e);\n }\n }", "function sendData(data){\n /*\n Send data to the server.\n */\n var packet = new Uint8Array(1);\n packet[0] = data;\n ws.send(packet);\n}", "function sendData1(data1) {\r\n let postData = {\r\n method: \"POST\",\r\n Headers: {\r\n 'Content-Type': \"application/json;charset=UTF-8\",\r\n 'Authorization': Auth,\r\n 'Accept': \"application/json, text/plain, */*\"\r\n },\r\n\r\n \"in\": data1\r\n };\r\n httpPost(url1, 'application/json', postData, function (result) {\r\n console.log(postData);\r\n });\r\n}", "function post_to_judobase(data) {\n querystring = require('querystring');\n\n var options = {\n host: config.judobase.url,\n port: 80,\n path: config.judobase.path,\n method: 'GET',\n path: config.judobase.path + '?' + querystring.stringify(data)\n };\n\n var http = require('http');\n var req = http.request(options, function (res) {\n\n });\n req.end();\n}", "async _sendData({ service, msg, data }) {\n const correlationId = msg.properties.correlationId;\n const replyHost = msg.properties.headers.replyHost;\n const replyPort = msg.properties.headers.replyPort;\n debug('sending data to %s:%s for %s', replyHost, replyPort, correlationId);\n try\n {\n const buffer = JSON.stringify({ data: convertToBuffer(data), correlationId });\n const req = http.request({\n host: replyHost,\n port: replyPort,\n path: '/receive',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Content-Length': buffer.length\n }\n }, (res) => {\n // TODO requeue original on failure\n });\n req.write(buffer);\n req.end();\n }\n catch(ex) {\n // TODO requeue original on failure\n console.log(ex.stack);\n }\n }", "function sendData2(data2) {\r\n let postData = {\r\n method: \"POST\",\r\n Headers: {\r\n 'Content-Type': \"application/json;charset=UTF-8\",\r\n 'Authorization': Auth,\r\n 'Accept': \"application/json, text/plain, */*\"\r\n },\r\n\r\n \"in\": data2\r\n };\r\n httpPost(url2, 'application/json', postData, function (result) {\r\n console.log(postData);\r\n });\r\n}", "function sendData2(data2) {\r\n let postData = {\r\n method: \"POST\",\r\n Headers: {\r\n 'Content-Type': \"application/json;charset=UTF-8\",\r\n 'Authorization': Auth,\r\n 'Accept': \"application/json, text/plain, */*\"\r\n },\r\n\r\n \"in\": data2\r\n };\r\n httpPost(url2, 'application/json', postData, function (result) {\r\n console.log(postData);\r\n });\r\n}", "function sendData(request, response) {\n response.send(projectData);\n}", "function postdata(url, data) {\n return httpService(url, data, 'POST');\n }", "sendDataToServer() {\n var data = this.state.dataFromFile;\n request\n .post('/')\n .set('Accept', /application\\/json/)\n .send({ data: data })\n .end((err, res) => {\n if (err) {\n console.log('Some error occured while sending ...' + err);\n return;\n }\n //if data successfully posted to server...alert back user confirmation message\n if (res) {\n alert('Data sent to server...check server console for JSON..');\n alert(res.text);\n }\n });\n }", "async send ({ route, data, headers = {}}) {\n return await Axios.post( route, data, headers )\n }", "function send_post(url, data, successfun) {\r\n wx.request({\r\n url: BASE_Server + url, //仅为示例,并非真实的接口地址\r\n method: \"POST\",\r\n header: {\r\n 'content-type': 'application/x-www-form-urlencoded'\r\n },\r\n data: data,\r\n success(res) {\r\n // console.log(res)\r\n successfun(res)\r\n }\r\n })\r\n}", "function send(url, data) {\n const postRequest = new XMLHttpRequest(); \n const callback = function (data) { \n return data;\n };\n\n handleRequest(postRequest, callback);\n\n postRequest.open('POST', url, true); // \"true\" is the default value to make the request an async call\n postRequest.send(data);\n\n return callback;\n}", "static async postData(data) {\n const url = 'http://cparkchallenge.herokuapp.com/report';\n return await fetch(url, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data),\n })\n .then(dataFromServer => dataFromServer.json());\n\n }", "function send(data)\n\t{\n\t\tres.status(200).send(JSON.stringify(data));\n\t}", "function postData(postUrl, fdata, dType) {\r\n console.log('in postData: ' + postUrl);\r\n var dFlg, data;\r\n\r\n // turn on spinner\r\n uiLoading(true);\r\n\r\n // process post\r\n $.post(postUrl, fdata, function(res) {\r\n dFlg = (res == undefined) ? false : true; // set flag\r\n\r\n // load data based on display type\r\n switch (dType) {\r\n case 'login':\r\n processLogin(res, dFlg);\r\n\tbreak;\r\n case 'pixi':\r\n processPixiData(res);\r\n\tbreak;\r\n case 'post':\r\n resetPost(dFlg);\r\n\tbreak;\r\n case 'inv':\r\n\tgoToUrl('../html/invoices.html');\r\n\tbreak;\r\n case 'comment':\r\n showCommentPage(res);\r\n\tbreak;\r\n case 'bank':\r\n invFormType == 'new' ? loadInvForm(data, true) : loadBankPage(res, dFlg); \r\n\tbreak;\r\n case 'reply':\r\n loadPosts(res, dFlg);\r\n\tbreak;\r\n case 'card':\r\n loadTxnPage(res, dFlg, 'invoice');\r\n\tbreak;\r\n default:\r\n return res;\r\n\tbreak;\r\n }\r\n },\"json\").fail(function (a, b, c) {\r\n \tuiLoading(false);\r\n PGproxy.navigator.notification.alert(a.responseText, function() {}, 'Post Data', 'Done');\r\n console.log(a.responseText + ' | ' + b + ' | ' + c);\r\n });\r\n}", "function post_tracking_data(json_data) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", data_endpoint);\n xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n xhr.send(JSON.stringify(json_data));\n }", "senddata(e, Data) {\n return socket.emit('req', { event: e, data: Data });\n }", "function sendPost(data, callback) {\nvar options = {\n host: 'ws.audioscrobbler.com',\n path: '/2.0/',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': data.length\n }\n }\n , doPOST = http.request(options, function(request) {\n var reqReturn = ''\n request.setEncoding('utf8')\n request.on('data', function(chunk) {\n reqReturn += chunk\n })\n request.on('end', function() {\n // console.log('[POST RESPONSE] : ' + reqReturn)\n if (typeof(callback) == 'function')\n callback(reqReturn)\n })\n }).on('error', function(err) {\n // TODO\n })\ndoPOST.write(data)\ndoPOST.end()\n}", "function postData(data, cb) {\n\tdata._seed = Math.floor(Math.random() * 1000000)\n\tif(cb) {\n\t\teth._callbacks[data._seed] = cb;\n\t}\n\n\tif(data.args === undefined) {\n\t\tdata.args = [];\n\t}\n\n\tnavigator.qt.postMessage(JSON.stringify(data));\n}", "function submitData(data) {\n fetch(url, {\n method: \"POST\",\n body: JSON.stringify(data),\n headers: { \"Content-Type\": \"application/json\", Accept: \"application/json\" }\n });\n}", "sendPost(e) {\n\t\t// Prevent the page from reloading\n\t\te.preventDefault();\n\n\t\t// Create the object we send to the server\n\t\tlet data = {\n\t\t\t\"text\": document.querySelector(\"#postText\").value,\n\t\t\t\"img\": \n\t\t\t(document.querySelector(\".preview img\").src != \"\") ? document.querySelector(\".preview img\").src : \"\"\n\t\t};\n\t\t// Use fetch() and send the data from this.postInput\n\t\tfetch(postURL, {\n\t\t\tmethod: 'POST', // or 'PUT'\n\t\t\tbody: JSON.stringify(data), // data can be `string` or {object}!\n\t\t\theaders: new Headers({\n\t\t\t\t'Content-Type': 'application/json'\n\t\t})});\n\t}", "function post(url, data, options) {\n sendRequest(url, \"POST\", data, options);\n }", "function sendData(){\n\t\n//var data = \"hye\";\n//console.log(msg.data);\ndataChannel.send(messageToSend.value);\nmessageToSend.value=\"\";\n\n}", "sendData(data) {\r\n axios\r\n .post(baseUrl + '/admins/add/post', {admin: data})\r\n .then(function (response) {\r\n console.log(response);\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n });\r\n }", "function sendData(type, data) {\n\n var dest = {\n targetRoom: room\n };\n\n //sends data to server\n easyrtc.sendDataWS(dest, type, JSON.stringify(data));\n\n\n}", "function sendData (request, response) {\n response.status(200).send(projectData);\n // console.log(projectData);\n}", "function sendData(data, callback) {\n $.ajax({\n type: data.method,\n data: data.data,\n url: data.url,\n dataType: data.dataType\n }).done((response)=> {\n //DEBUG\n console.log(\"Data sent\");\n if(callback !== undefined) {\n callback(response);\n }\n })\n}", "function postData(url, data, method) {\n method = method || \"post\";\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", method);\n form.setAttribute(\"action\", url);\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n var hiddenField = document.createElement(\"input\");\n hiddenField.setAttribute(\"type\", \"hidden\");\n hiddenField.setAttribute(\"name\", key);\n hiddenField.setAttribute(\"value\", data[key]);\n form.appendChild(hiddenField);\n }\n }\n document.body.appendChild(form);\n form.submit();\n }", "function sendData(endpoint, data) {\r\n return fetch((url+endpoint), {\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json; charset=utf-8\",\r\n },\r\n body: JSON.stringify(data)\r\n }).then(data => {\r\n return data;\r\n });\r\n}", "function privlyPostContent(data_to_send, successCallback, errorCallback) {\n \n var url = window.location.protocol + \"//\" + window.location.host + \"/posts\";\n \n $.ajax({\n data: data_to_send,\n type: \"POST\",\n url: url,\n contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n dataType: \"json\",\n accepts: \"json\",\n success: successCallback,\n error: errorCallback\n });\n}", "function postData() {\n\t\n\t//Datos a enviar, (JSON)\n\tvar postDataJson = {var1:\"var1Value\", var2:\"var2Value\" };\n\t\n\t$.post(\"http://jsonplaceholder.typicode.com/posts\", postDataJson)\n\t.done(function(data){\n\t\t//data es el valor retornado (JSON)\n\t\talert(\"Resultado del servicio Post: \" + data.id);\n\t})\n\t.success(function(data){\n\t\t//data es el valor retornado (JSON)\n\t\tconsole.log(JSON.stringify(data, null, 2));\n\t});\n}", "send(data) {\n if (this._readyState !== 'open')\n throw new errors_1.InvalidStateError('not open');\n if (typeof data === 'string') {\n this._channel.notify('datachannel.send', this._internal, data);\n }\n else if (data instanceof ArrayBuffer) {\n const buffer = Buffer.from(data);\n this._channel.notify('datachannel.sendBinary', this._internal, buffer.toString('base64'));\n }\n else if (data instanceof Buffer) {\n this._channel.notify('datachannel.sendBinary', this._internal, data.toString('base64'));\n }\n else {\n throw new TypeError('invalid data type');\n }\n }", "function post(type, data) {\n pm({\n target: window.parent,\n type: type,\n data: data,\n origin: document.referrer // TODO: Change this (and above) to explicity set a domain we'll be receiving requests from\n });\n}", "function sendData(postData){\n var clientServerOptions = {\n body: JSON.stringify(postData),\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n }\n }\n // on response from server, log response\n let response = request('POST', 'http://localhost:8983/solr/gettingstarted/update/json/docs?commit=true&overwrite=true', clientServerOptions);\n if (response.statusCode !== 200) {\n throw(response.body)\n } else {\n //console.log('sent')\n }\n}", "function sendData(data) {\n setTimeout(function() {\n websocket.send(data);\n }, 100);\n}", "function Send(command, data) \n{\t\n\tpostMessage({\"command\": command, \"data\": data});\n}", "setSendData(sendData) {\r\n if (this.encodeData == \"encodeQueryString\") {\r\n this.sendData = ArrayToQueryString(sendData);\r\n }\r\n else if(this.encodeData == \"json\"){\r\n this.sendData = JSON.stringify(sendData);\r\n }\r\n else if(this.encodeData == \"queryString\"){\r\n let outR = new Array();\r\n\r\n for(var key in sendData){\r\n outR.push(key + '=' + sendData[key]);\r\n }\r\n this.sendData = outR.join('&');\r\n }\r\n else if (this.encodeData == \"FormData\") {\r\n this.sendData = sendData;\r\n }\r\n }", "async function postData(endpoint = '', data) {\n\treturn await sendHTTPRequest(endpoint, 'POST', JSON.stringify(data));\n}", "async function postData(url = \"\", data = {}) {\n\tawait fetch(url, {\n\t\tmethod: \"POST\",\n\t\tcredentials: \"same-origin\",\n\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\tbody: JSON.stringify(data),\n\t});\n}", "function sendRequest ()\n\t{\n\t\t// Create post comment request queries\n\t\tvar postQueries = queries.concat ([\n\t\t\tbutton.name + '=' + encodeURIComponent (button.value)\n\t\t]);\n\n\t\t// Send request to post a comment\n\t\thashover.ajax ('POST', form.action, postQueries, commentHandler, true);\n\t}", "function sendDataToChannel(data) {\n console.log(data);\n sendChannel.send(data);\n}", "function post(data) {\n const postData = JSON.stringify(data);\n fetch(config.endpoint, {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"x-apikey\": config.key,\n \"cache-control\": \"no-cache\",\n },\n body: postData,\n })\n .then((res) => res.json())\n .then((data) => {\n form.elements.submit.disabled = false;\n window.location.href = \"pdf.html\";\n });\n}", "send() {\n\n this.request.open(this.method, this.url);\n\n for (var header in this.headers) {\n this.request.setRequestHeader(header, this.headers[header]);\n }\n\n var str_data = '';\n\n if (this.data instanceof FormData) {\n this.request.send(this.data);\n } else {\n for(var name in this.data) {\n str_data = str_data + name + '=' + encodeURIComponent(this.data[name]) + '&';\n }\n this.request.send(str_data);\n }\n\n }", "function post_data() {\n $.post('http://hinckley.cs.northwestern.edu/~rbi054/post.php/', \n { data: request_data }, \n function(data, status, xhr) {\n \n $('p').append('status: ' + status + ', data: ' + data);\n\n }).done(function() { console.log('Request done!'); })\n .fail(function(jqxhr, settings, ex) { console.log('failed, ' + ex); });\n }", "function send (ep, data) {\n\tvar msg = {\n\t\tmsg: data\n\t};\n\tvar jsonstr = JSON.stringify(msg);\n\ttry {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('POST', '/' + ep, false);\n\t\txhr.setRequestHeader('Content-Type', 'application/json');\n\t\txhr.send(jsonstr);\n\t} catch (e) {\n\n\t}\n}", "function sendCloudData(data, photonFunc) {\n //format data for POST-ing\n var post_data = querystring.stringify({\n args: data\n });\n\n var options = {\n host: \"api.particle.io\",\n path: \"/v1/devices/\" + device + \"/\" + photonFunc + \"?access_token=\" + token,\n port: '443', //need to send via https\n method: 'POST',\n headers: { \"Content-type\": \"application/x-www-form-urlencoded\" }\n };\n\n //this retrieves the photon's response\n //node retrieves the response in chunks\n callback = function(response) {\n var str = '';\n response.on('data', function (chunk) {\n str += chunk;\n });\n\n //output end response\n response.on('end', function () {\n console.log(str);\n });\n }\n\n var req = http.request(options, callback);\n //data to be posted\n req.write(post_data);\n req.end();\n}", "function loadPostData()\n{\n let sending = browser.runtime.sendMessage({\n action: 'getPostData'\n });\n \n sending.then(\n \n response => {\n let postData = [];\n\n // iterate over post object\n for( var obj in response.postData )\n {\n if( !response.postData.hasOwnProperty( obj ) )\n continue;\n\n postData.push( obj + '=' + response.postData[obj][0] );\n }\n\n postDataInput.value = postData.join( '&' );\n },\n\n error => {\n console.error( error );\n }\n\n );\n}", "sendKeyboard(data) {\n if (this.connection) {\n this.connection.sendKeyboard(data);\n }\n }", "function sendDataToServer(URL, data) {\n // return $.post(URL, data, function(resp){console.log(resp);});\n return $.post(URL, data);\n}", "async function postData(url, data) {\n try {\n console.log('click submit')\n if (!data.drivers_arr.length || !data.drivers_arr)\n return 'No data supplied to fetch'\n let mode\n if (!isDevelopment()) {\n mode = 'cors'\n } else {\n mode = 'no-cors'\n }\n const response = await fetch(url, {\n method: 'POST',\n mode: mode,\n cache: 'default', // *default, no-cache, reload, force-cache, only-if-cached\n credentials: 'same-origin', // include, *same-origin, omit\n headers: {\n 'Content-Type': 'application/json',\n 'X-Api-Key': '12345',\n },\n redirect: 'follow', // manual, *follow, error\n referrer: 'no-referrer', // no-referrer, *client\n body: JSON.stringify(data), // body data type must match \"Content-Type\" header\n })\n return await response // parses JSON response into native JavaScript objects\n } catch (e) {\n console.error('An error in driver postData', e)\n }\n}", "function queryDataPost(url,dataSend,callback){\n \n $.ajax({\n type: 'POST',\n url: url,\n data: dataSend,\n async: true,\n dataType: 'text',\n success: callback\n });\n}", "function sendRequestData( params, method) {\n method = method || \"post\"; // il metodo POST � usato di default\n //console.log(\" sendRequestData params=\" + params + \" method=\" + method);\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", method);\n form.setAttribute(\"action\", hostAddr);\n var hiddenField = document.createElement(\"input\");\n hiddenField.setAttribute(\"type\", \"hidden\");\n hiddenField.setAttribute(\"name\", \"move\");\n hiddenField.setAttribute(\"value\", params);\n \t//console.log(\" sendRequestData \" + hiddenField.getAttribute(\"name\") + \" \" + hiddenField.getAttribute(\"value\"));\n form.appendChild(hiddenField);\n document.body.appendChild(form);\n console.log(\"body children num= \"+document.body.children.length );\n form.submit();\n document.body.removeChild(form);\n console.log(\"body children num= \"+document.body.children.length );\n}", "async function sendAndGet() {\n // Get post parameters.\n const textEle = document.getElementById('text-input');\n const nameEle = document.getElementById('sender');\n const tagEle = document.getElementById('tags');\n\n // TODO: use FormData function to post image file.\n \n // Create a |URLSearchParams()| and append parameters to it. \n const params = new URLSearchParams();\n params.append('text-input', textEle.value);\n params.append('sender', nameEle.value);\n params.append('tags', tagEle.value);\n\n // Post parameters to the server and fetch instantly to build the page.\n fetch('/data', {method: 'POST', body: params})\n .then(response => response.json()).then((msgs) => {\n const statsListElement = document.getElementById('posts-list');\n msgs.forEach((msg) => {\n statsListElement.appendChild(createListElement(msg));\n })\n });\n}", "function post(type, value) {\n if (port) port.postMessage({type: type, value: value});\n }", "function sendDataToServer(dataString) {\n var orig_data=dataString.split('+');\n var dataName=orig_data[0];\n var dataAge=orig_data[1];\n var dataCountry=orig_data[2];\n var dataGender=orig_data[3];\n var dataQ1=orig_data[4];\n var dataQ2=orig_data[5];\n\n var data = {\n\tcommit: \"Create Datum\",\n\tdatum: {\n\t name: dataName,\n\t age: dataAge,\n\t country: dataCountry,\n gender: dataGender,\n q1: dataQ1,\n q2: dataQ2\n\t}\n }\n $.ajax({\n\ttype: \"POST\",\n\turl: \"/data\",\n\tdata: data,\n\tdataType: \"json\"\n });\n}", "static postData(data) {\n return fetch('/', {\n method: 'POST',\n mode: 'cors',\n cache: 'no-cache',\n referrer: 'no-referrer',\n body: data,\n }).then(response => response.json());\n }", "static sendData(httpMethod, url, data) {\n const requestObject = new XMLHttpRequest();\n\n requestObject.responseType = \"json\";\n\n requestObject.open(httpMethod, url, true);\n\n requestObject.setRequestHeader('Content-Type', 'application/json');\n\n requestObject.send(JSON.stringify(data));\n\n requestObject.readyState(\"load\", this.loadFunction);\n }", "async function postData(url = '', data = {}) {\n await fetch(url, {\n method: 'POST', // *GET, POST, PUT, DELETE, etc.\n mode: 'cors', // no-cors, *cors, same-origin\n cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n credentials: 'same-origin', // include, *same-origin, omit\n headers: {\n 'Content-Type': 'application/json'\n },\n redirect: 'follow', // manual, *follow, error\n referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url\n body: JSON.stringify(data) // body data type must match \"Content-Type\" header\n });\n}", "function postData(url, data) {\n return fetch(url, {\n method: 'POST',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': \"application/json\"\n },\n body: JSON.stringify(data) // strinfigify convert object into a string \n });\n}", "function send () {\n Cute.get(\n // Send the event name and emission number as URL params.\n Beams.endpointUrl + '&m=' + Cute.escape(name) + '&n=' + Beams.emissionNumber,\n // Send the message data as POST body so we're not size-limited.\n 'd=' + Cute.escape(data),\n // On success, there's nothing we need to do.\n function () {\n Beams.retryTimeout = Beams.retryMin\n },\n // On failure, retry.\n function () {\n Beams.retryTimeout = Math.min(Beams.retryTimeout * Beams.retryBackoff, Beams.retryMax)\n setTimeout(send, Beams.retryTimeout)\n }\n )\n }", "function send_data(socket_id, circuit_id, stream_id, data) {\n let stream_identifier = hash_stream(socket_id, circuit_id, stream_id);\n\n if (!OPENED.has(stream_identifier))\n return;\n\n for (let i = 0; i < data.length;) {\n let lo = i;\n i = Math.min(i + consts.CELL_SIZE.RelayBody, data.length);\n let body = data.slice(lo, i);\n\n cell.data(socket_id, circuit_id, stream_id, body);\n }\n }", "async function sendData() {\r\n const res = await fetch(\"/formulier/afhalen\", {\r\n method: \"POST\",\r\n body: JSON.stringify({\r\n naam: `${voorNaam} ${achterNaam}`,\r\n \"materiaal\": materiaal,\r\n datumTijd: currentDate,\r\n \"teruggebracht\": \"neen\",\r\n }),\r\n headers: {\r\n \"content-type\": \"application/json; charset=UTF-8\"\r\n }\r\n });\r\n if (!res.ok || res.status !== 200) {\r\n console.error('Error at sending data: ', res);\r\n return\r\n };\r\n const feedback = await res.json();\r\n if (feedback.message !== \"\") {\r\n sendErrorMessage(feedback.message);\r\n } else {\r\n const wrapper = document.querySelector(\".afhalen-wrapper\");\r\n wrapper.style.display = \"none\";\r\n // just to clear the error box if there is any\r\n sendErrorMessage(\"\");\r\n // reset the state\r\n resetState();\r\n }\r\n }", "function sendData(data) {\n\n // Je fetch sur l'URL requise et j'utilise la méthode \"post\"\n return fetch('http://localhost:3000/api/furniture/order', {\n method: 'post',\n headers: {\n 'Content-Type': \"application/JSON\"\n },\n body: JSON.stringify(data)\n })\n\n // Je transforme la réponse en JSON\n .then(response => response.json())\n\n // Je stocke la réponse \"orderId\" dans la clé \"Order\" du local storage en la stringifiant\n .then(responseParsed => {\n localStorage.setItem(\"Order\", JSON.stringify(responseParsed.orderId));\n\n // Redirection vers la page de vérification de commande\n window.location.href = \"page_commande.html\"\n })\n\n // Si la réponse ne se fait pas j'envoi un message d'erreur\n .catch(error => alert(error))\n}", "sendData(message, data){\n this.socket.emit(message, data);\n }", "_send_TouchPadData() {\n // TODO: Check that the webSocketId isn't undefined;\n this._webSocket.send(JSON.stringify({\n \"messageType\": \"TouchPadData-Request\",\n \"data\": {},\n }))\n }", "function doPost(url, data, callback) {\n\tmakeCall(\"POST\", url, data, callback);\n}", "function postData(url, data, method) \n{\n method = method || \"post\";\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", method);\n form.setAttribute(\"action\", url);\n for(var key in data) {\n if(data.hasOwnProperty(key)) \n {\n var hiddenField = document.createElement(\"input\");\n hiddenField.setAttribute(\"type\", \"hidden\");\n hiddenField.setAttribute(\"name\", key);\n hiddenField.setAttribute(\"value\", data[key]);\n form.appendChild(hiddenField);\n }\n }\n document.body.appendChild(form);\n form.submit();\n}", "function CallbackData(data,page, handler,method){\n\tvar methodTxt = 'POST';\n\tif(CallbackData.arguments[3]) methodTxt = CallbackData.arguments[3];\n\tvar request = createRequest();\n\tif(request)\n\t{\n\t\t// prepare request\n\t\trequest.open(methodTxt, page, true);\n\t\trequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n\t\t// when the request is answered, relayResponse() will be called\n\t\trequest.onreadystatechange = function(){ relayResponse(request, handler); }\n\n\t\t// fire off the request\n\t\trequest.send(data);\n\t}\n\telse\n\t{\n\t\t// request object wasn't instantiated\n\t\thandler(false, 'Unable to create request object.');\n\t}\n}", "function sendPost(tags) {\n send(json_post_message(tags))\n}", "async function postData(url = '', data = {}) {\r\n // Default options are marked with *\r\n const response = await fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n // 'Content-Type': 'application/x-www-form-urlencoded',\r\n },\r\n body: JSON.stringify(data) // body data type must match \"Content-Type\" header\r\n });\r\n return response.json(); // parses JSON response into native JavaScript objects\r\n}", "'submit .send-data'(event){\n\t\tevent.preventDefault();\n\n\t\tvar temp = event.target.temp.value;\n\t\tvar lat = event.target.lat.value;\n\t\tvar lon = event.target.lon.value;\n\n\t\tvar template = Template.instance();\n\t\tmyContract.sendData(temp, lat, lon, {data: code}, function (err, res){console.log(res);});\n\n\t\tevent.target.temp.value = \" \";\n\t\tevent.target.lat.value = \" \";\n\t\tevent.target.lon.value = \" \";\n\n\n\n\t}", "function sendData (req, res) {\n res.send(projectData);\n }", "function sendData(){\n\tvar data;\n\tif(document.getElementById(food)){\n\t\tdata = {id: document.getElementById(id), name: document.getElementById(name), price: document.getElementById(price), calories: document.getElementById(cal), stadate: document.getElementById(sdate), enddate: document.getElementById(edate)};\n\t\t\n\t\t//call function at server to make a food object\n\t}\n\tif(document.getElementById(drink)){\n\t\tdata = {id: document.getElementById(id), name: document.getElementById(name), price: document.getElementById(price), calories: document.getElementById(cal), stadate: document.getElementById(sdate), enddate: document.getElementById(edate), size document.getElementById(size)};\n\t\t\n\t\t//call function at server to make a drink object\n\t}\n\t// send the \"data\" variable to the server (other members are working on how to send to server, I do not know how yet)\n}", "function dataSend(data) {\n Object.keys(connections).forEach(function (id) {\n if (connections[id].connected) {\n connections[id].send(data);\n }\n });\n}" ]
[ "0.6932507", "0.6932507", "0.6836339", "0.6713825", "0.6649343", "0.65926427", "0.6560687", "0.6556802", "0.65054226", "0.6485511", "0.6460434", "0.6416603", "0.6415888", "0.6412817", "0.6412572", "0.63982004", "0.6380699", "0.6366727", "0.63596374", "0.63534594", "0.6321976", "0.63053465", "0.6303271", "0.6261117", "0.62435883", "0.62049973", "0.62038004", "0.6186749", "0.6158774", "0.61534286", "0.6142737", "0.6117442", "0.6117442", "0.6102361", "0.6099646", "0.60733384", "0.6072464", "0.60676867", "0.60537577", "0.6052238", "0.604151", "0.60366666", "0.6029602", "0.6014942", "0.6010469", "0.6007014", "0.600627", "0.5994439", "0.5959756", "0.59557325", "0.5946196", "0.59156257", "0.59045583", "0.59006727", "0.58970016", "0.5874274", "0.5811686", "0.58056694", "0.5795024", "0.5780205", "0.5759887", "0.57559276", "0.57540184", "0.5751091", "0.57495224", "0.57241803", "0.57008535", "0.57001907", "0.5696233", "0.56949294", "0.5692764", "0.5683666", "0.5669647", "0.56692255", "0.5660392", "0.5657894", "0.5652509", "0.56484413", "0.5644777", "0.5625099", "0.5621667", "0.5613375", "0.5606156", "0.5598914", "0.5588395", "0.5587612", "0.55867296", "0.5584689", "0.5578106", "0.5576387", "0.5575957", "0.55740064", "0.55682385", "0.55652565", "0.55650795", "0.55621195", "0.55597186", "0.55595785", "0.5557322", "0.55568135", "0.5552442" ]
0.0
-1
Displays and hides cards depending on what the user selected
function filterMajors() { let menu = document.querySelector('select'); let selected = menu.options[menu.selectedIndex].text; let cards = document.querySelectorAll('.card'); for (let i = 0; i < cards.length; i++) { if (cards[i].classList.contains("d-none")) { cards[i].classList.remove("d-none"); } } if (selected !== "No filter") { if (selected === "Bachelor of Sciences") { for (let i = 0; i < cards.length; i++) { if (!cards[i].classList.contains("bs")) { cards[i].classList.add("d-none"); } } } else if (selected === "Bachelor of Arts") { for (let i = 0; i < cards.length; i++) { if (!cards[i].classList.contains("ba")) { cards[i].classList.add("d-none"); } } } else if (selected === "Capacity-contrained major") { for (let i = 0; i < cards.length; i++) { if (!cards[i].classList.contains("cap")) { cards[i].classList.add("d-none"); } } } else if (selected === "Minimum major") { for (let i = 0; i < cards.length; i++) { if (!cards[i].classList.contains("min")) { cards[i].classList.add("d-none"); } } } else if (selected === "Open major") { for (let i = 0; i < cards.length; i++) { if (!cards[i].classList.contains("open")) { cards[i].classList.add("d-none"); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCard(){\n $(\".rehearse_card\").hide();\n $(\".card-title-question\").hide();\n $(\".card-text-answer\").hide();\n $(\".rehearse_card:eq(\" + visibleCard + \")\").show();\n $(\".card-title-question\").show();\n}", "function toggleCards() {\n if (typeof data === 'undefined') {\n loadData();\n }\n flashcards.removeClass(showing ? 'cards-show' : 'cards-hide');\n flashcards.addClass(showing ? 'cards-hide' : 'cards-show');\n showing = !showing;\n }", "function displayPlayerCards() {\n\tconst allPossibleInputs = [\"two\", \"three\", \"ten\"];\n\tconst classLookup = { 2: \"two\", 3: \"three\", 10: \"ten\" };\n\n\tfor (const n of allPossibleInputs) {\n\t\t$(`.${n}-card`).hide();\n\t}\n\t$(`.${classLookup[possibleInputs]}-card`).show();\n}", "function displayCard(currentCard) {\n currentCard.classList.toggle('open');\n currentCard.classList.toggle('show');\n }", "function showData(option) {\n document.getElementById(\"msg\").innerHTML = \"\";\n document.getElementById(\"alert\").style.display = \"none\";\n if (option == \"card\") {\n document.getElementById(\"bank\").style.display = \"none\";\n document.getElementById(\"card\").style.display = \"block\";\n }\n else {\n document.getElementById(\"card\").style.display = \"none\";\n document.getElementById(\"bank\").style.display = \"block\";\n }\n document.getElementById(\"btns\").style.display = \"block\";\n}", "function showCard() {\n if (openCards.length < 2) {\n this.classList.toggle(\"open\");\n this.classList.toggle(\"show\");\n this.classList.toggle(\"disable\");\n } else {\n return false;\n }\n }", "function showCard1() {\n\tlet card1 = document.getElementById(\"c1\");\n\tif (card1.style.display === \"flex\") {\n\t\tcard1.style.display = \"none\";\n\t} else {\n\t\thideCards();\n\t\tcard1.style.display = \"flex\";\n\t}\n}", "function showAllCardsFor(user) {\n if (user == 'admina') {\n // Show everything to admina\n let elems = document.querySelectorAll(`[id^='card_'], [id^='edit_icon'], [id^='delete_icon']`);\n let index;\n for (index = 0; index < elems.length; ++index) {\n elems[index].style.display = 'block';\n }\n } else {\n // Show something to normalo\n let elems = document.querySelectorAll(`[id^='card_']`);\n let index;\n for (index = 0; index < elems.length; ++index) {\n elems[index].style.display = 'block';\n }\n // Don't show admina's private cards to normalo\n let cardsToHide = document.querySelectorAll(`[id^='card_admina_private']`);\n let index2;\n for (index2 = 0; index2 < cardsToHide.length; ++index2) {\n cardsToHide[index2].style.display = 'none';\n }\n // Don't show edit/delete icons for normalo\n let iconsToHide = document.querySelectorAll(`[id^='edit_icon'], [id^='delete_icon']`);\n let index3;\n for (index3 = 0; index3 < iconsToHide.length; ++index3) {\n iconsToHide[index3].style.display = 'none';\n }\n }\n}", "function showCard(){\n\tif (parents.length == 1){\n\t\tparents[0].className = 'card open show';\n\t}\n\telse if (parents.length ==2){\n\t\tparents[0].className = 'card open show';\n\t\tparents[1].className = 'card open show';\n\t}\n}", "function showCard2() {\n\tlet card2 = document.getElementById(\"c2\");\n\tif (card2.style.display === \"flex\") {\n\t\tcard2.style.display = \"none\";\n\t} else {\n\t\thideCards();\n\t\tcard2.style.display = \"flex\";\n\t}\n}", "function displayCard (selector) {\n const deck = document.querySelector('.deck')\n if (selector !== deck && !(selector.classList.contains(\"show\"))) {\n selector.classList.add('open', 'show');\n return selector;\n }\n}", "setShown(toShow) {\n this.currentlyShown = toShow;\n if (this.currentlyShown === true)\n $('#' + this.cardID).show();\n else\n $('#' + this.cardID).hide();\n }", "function showCard4() {\n\tlet card4 = document.getElementById(\"c4\");\n\tif (card4.style.display === \"flex\") {\n\t\tcard4.style.display = \"none\";\n\t} else {\n\t\thideCards();\n\t\tcard4.style.display = \"flex\";\n\t}\n}", "function showCard3() {\n\tlet card3 = document.getElementById(\"c3\");\n\tif (card3.style.display === \"flex\") {\n\t\tcard3.style.display = \"none\";\n\t} else {\n\t\thideCards();\n\t\tcard3.style.display = \"flex\";\n\t}\n}", "function displayDeck(event) {\n event.preventDefault();\n clearForm();\n let id = this.dataset.id;\n main.style = \"visibility: hidden;\"\n main.innerHTML = '';\n displayForms();\n fetch(MAIN_URL + `/decks/${id}`)\n .then(resp => resp.json())\n .then(deck => {\n if(deck.cards.length === 0) {\n renderFlashcardNoCards(deck.id)\n } else {\n for (const card of deck.cards) {\n renderFlashcard(card);\n }\n }\n })\n}", "function displayCard(cardClick) {\n\tcardClick.classList.toggle(\"open\");\n\tcardClick.classList.toggle(\"show\");\n}", "function showHighscoreCardOnly() {\n quizEndedCard.attr(\"style\", \"display: none\");\n currentQuestionCard.attr(\"style\", \"display: none\");\n launchScreenCard.attr(\"style\", \"display: none\");\n highscoresCard.attr(\"style\", \"display: flex\");\n\n viewHighscoresLink.attr(\"style\", \"display: none\");\n takeQuizLink.attr(\"style\", \"display: block\");\n}", "function showCard(card) {\n if((card.className === 'card') && (cardsOpen.length<2)){\n card.classList.add('flip');\n moveCounter();\n openedCards(card);\n }\n}", "show(hideFirstCard = false)\n\t{\n\t\tif (this.numCards == 0)\n\t\t\treturn;\n\n\t\tif (hideFirstCard == true)\n\t\t\tcout(\"** \");\n\t\telse\n\t\t{\n\t\t\tthis.cards[0].print(true);\n\t\t\tcout(\" \");\n\t\t}\n\n\t\tfor (let x = 1; x < this.numCards; x++)\n\t\t{\n\t\t\tthis.cards[x].print(true);\n\t\t\tcout(\" \");\n\t\t}\n\t}", "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 }", "function showLaunchQuizCardOnly(){\n quizEndedCard.attr(\"style\", \"display: none\");\n currentQuestionCard.attr(\"style\", \"display: none\");\n launchScreenCard.attr(\"style\", \"display: flex\");\n highscoresCard.attr(\"style\", \"display: none\");\n\n viewHighscoresLink.attr(\"style\", \"display: block\");\n takeQuizLink.attr(\"style\", \"display: none\");\n}", "function displayCard(card) {\n card.className = \"card open show disable\";\n}", "function displayCard() {\n console.log(\"Displaycard function ran\");\n // once the start button is clicked, sets the card to its initial state\n if (card.style.display === \"none\") {\n card.style.display = \"initial\";\n }\n // if start button is clicked again, will rehide the card\n else {\n card.style.display = \"none\";\n }\n}", "function displayCards() {\n jQuery('.card-image').animate({left:-2000},1000,function(){$(this).remove()});\n var cols = board.showColumns();\n /*els.column1.innerHTML = cols[0].listCards(\"column1\");\n els.column2.innerHTML = cols[1].listCards(\"column2\");\n els.column3.innerHTML = cols[2].listCards(\"column3\");*/\n showColumnCards(cols[0],els.column1);\n showColumnCards(cols[1],els.column2);\n showColumnCards(cols[2],els.column3);\n }", "function displayCard(card) {\n\treturn $(card).toggleClass('open show animated');\n}", "function switch1(){\n\t\n\tvar i;\n\tfor(i = 0; i < 17; i++){\n\t\tdocument.getElementsByClassName(\"card\")[i].style.display=\"none\";\n\t}\n\tdocument.getElementsByClassName(\"bioCard\")[0].style.display=\"block\";\n\t\n}", "function toggleCards() {\n\n // if the currently selected card was clicked, nothing to do; ignore click.\n if ($(this).parent().hasClass('pure-menu-selected')) {\n console.log('ignoring useless click');\n event.preventDefault();\n return;\n }\n\n $('#cards .card').hide();\n var selected = $(this).attr('data-card');\n $('#' + selected).show();\n\n $(this).parent().parent().find('.pure-menu-selected').removeClass('pure-menu-selected');\n $(this).parent().addClass('pure-menu-selected');\n\n\tevent.preventDefault();\n}", "function renderCompanyCards() { // Render the Limited Cards\n\n $('.CompanyCard').slice(0, renderCardSize).show();\n if(renderCardSize < companyList_size){\n $('#showMoreBtn').show()\n $('#showLessBtn').hide()\n } else {\n $('#showMoreBtn').hide()\n $('#showLessBtn').show()\n }\n }", "function hideOrShowDoneCard(card) {\n if (localStorage.doneColumn == 'false') {\n card.css('display', 'none');\n } else {\n card.css('display', 'block');\n }\n}", "function toggleDisplay() {\n\n for(let a = 0; a < fiveDayCard.length; a++) {\n fiveDayCard[a].style.display = 'none';\n }\n\n card.style.display = 'block';\n h1.innerHTML = \"Current Weather\";\n form.style.display = 'block';\n backBtn.style.display = 'none';\n\n //Card animation\n $(document).ready(() => {\n $(\".card\").hide().fadeIn(1500);\n });\n}", "display() {\n if (this.cards.length) {\n // show the top card and make all cards move towards the position\n // of the deck\n this.cards[0].display(this.pos.x, this.pos.y, true);\n this.cards.forEach(c => c.approach(this.pos));\n } else {\n //show the empty slot\n stroke(0);\n strokeWeight(3);\n fill(255, 255, 255, 100);\n rect(this.pos.x, this.pos.y, CARDWIDTH, CARDHEIGHT);\n }\n }", "function showGameContainers() {\n $(\"#question\").show();\n $(\"#choice-1\").show();\n $(\"#choice-2\").show();\n $(\"#choice-3\").show();\n $(\"#choice-4\").show();\n }", "function flipCard(){\n if(cardSide == \"QuestionSide\"){\n cardSide = \"AnswerSide\";\n $(\".card-title-question\").hide();\n $(\".card-text-answer\").show();\n console.log(\"show Q\")\n }else{\n $(\".card-title-question\").show();\n $(\".card-text-answer\").hide();\n console.log(\"show A\");\n cardSide = \"QuestionSide\"\n }\n }", "function cardClicked(e) {\n\n const clickedCard = e.target;\n if (clickedCard.classList.contains('card') && !clickedCard.classList.contains('show')) {\n clickedCard.classList.add('show');\n addToOpenCards(clickedCard);\n }\n }", "function showCard (obj) {\n cardsFlipped.push(obj[0].children[0].className);\n cardIDs.push(obj[0].id);\n $(obj).addClass('show');\n $(obj).addClass('open');\n showGameResult();\n}", "function displayImage(obj){\n $('.kidsName').html(obj.name);\n productDetails.name = obj.name;\n $('.kidsDescription').html(obj.description);\n productDetails.description = obj.description;\n $('.kidsArt').attr('src', 'img/' + obj.month + obj.year + \"/preview/\" + obj.src);\n productDetails.image = 'img/' + obj.month + obj.year + \"/preview/\" + obj.src;\n // save date\n productDetails.date = obj.date;\n // save size \n productDetails.size = obj.size;\n\n // IF CARD THEN DISPLAY CARD EXTRAS OTHERWISE ACCESORISE\n console.log('obj.size:', obj.size);\n if(obj.size === \"card\") {\n $('.cardExtras').show();\n $('.frames').hide();\n } else {\n $('.cardExtras').hide();\n $('.frames').show();\n\n }\n\n}", "function editCardStep1() {\n $('.saved-1-card').hide();\n $('.change-1-card-stage-1').show();\n}", "function placeCards(tubbieList, putWhere, tubbieStatus) {\n var buttonLabel = '';\n var hideButton = false;\n var buttonColor = 'btn-outline-secondary';\n switch(tubbieStatus) {\n case 0:\n buttonLabel = 'Select';\n break;\n case 1:\n buttonLabel = 'Battle';\n buttonColor = 'btn-warning';\n\n break;\n case 2:\n buttonLabel = 'Attack';\n buttonColor = 'btn-danger';\n break;\n case 3:\n hideButton = true;\n break; \n default:\n buttonLabel = 'Select';\n }\n for (var i = 0; i < tubbieList.length; i++) {\n $( `.row.${putWhere}` ).append( $( `\n <div class=\"col-md-3\">\n <div class=\"card mb-3 box-shadow\">\n <img src=\"${tubbieList[i].pic}\" class=\"card-img-top tt-pics\" alt=\"${tubbieList[i].name}\">\n <div class=\"card-body\"><h4>${tubbieList[i].name}</h4>\n <p class=\"card-text\">Energy: ${tubbieList[i].energy}\n <br>Attack: ${tubbieList[i].minAtk}-${tubbieList[i].maxAtk}</p>\n <div class=\"d-flex justify-content-between align-items-center ${tubbieList[i].sname}\">\n </div>\n </div>\n </div>\n </div>\n </div>`));\n if (hideButton===false) { // Only show button when it's time to pick a tubbie\n $( `.d-flex.justify-content-between.align-items-center.${tubbieList[i].sname}` ).append( $( `<div class=\"btn-group\"><button type=\"button\" class=\"btn ${buttonColor} btn-sm ${tubbieList[i].id}\">${buttonLabel}</button></div>`));\n }\n }\n}", "function hideCard() {\n for (let card of currCards) {\n card.className = 'card';\n }\n\n currCards.pop();\n currCards.pop();\n openedCards.pop();\n openedCards.pop();\n}", "function showMine(user) {\n let elems = document.querySelectorAll(`[id^='card_${user}'], [id^='edit_icon'], [id^='delete_icon']`);\n let index;\n for (index = 0; index < elems.length; ++index) {\n elems[index].style.display = 'block';;\n }\n}", "function showCard(event) {\n\n const thisCard = event.target.classList;\n\n if (thisCard.contains('card')) {\n if (!thisCard.contains('show') || !thisCard.contains('match')) {\n thisCard.add('open', 'show');\n addToOpen();\n countMoves();\n }\n } else {\n event.preventDefault(); //stop counting moves when an open or matched card is clicked\n }\n}", "function view_change(next) {\n cards.forEach(card => {card.classList.remove('is-show');});\n next.classList.add('is-show');\n}", "function view_change(next) {\n cards.forEach(card => {card.classList.remove('is-show');});\n next.classList.add('is-show');\n}", "function displayCard(e){\n e.target.setAttribute(\"class\",\"card open show\");\n addToOpenCards(e.target);\n}", "function displayCard (clickTarget) {\n clickTarget.classList.toggle(\"open\");\n clickTarget.classList.toggle(\"show\");\n}", "function hideDoneCard(card) {\n $(card).css('display', 'none');\n}", "function showCard(clickedCard) {\n $(clickedCard).addClass('open show');\n}", "function refreshDisplay() {\n\t\t$('body > .container .nav').children().each(function(i, obj) {\n\t\t\tobj = $(obj);\n\t\t\tif (obj.hasClass('active')) {\n\t\t\t\texperienceCards[i].removeClass('hide');\n\t\t\t}\n\t\t});\n\t}", "function displayCard(card) {\n card.setAttribute('class', 'card show open');\n openCards.push(card);\n}", "function show(card) {\n\tcard.setAttribute(\"class\", \"card show open\");\n}", "function displayCard(i) {\n switch (i) {\n case 0:\n previousBtn.classList.add(\"d-none\");\n break;\n case 4:\n nextBtn.classList.add(\"d-none\");\n submitBtn.classList.remove(\"d-none\");\n break;\n default:\n nextBtn.classList.remove(\"d-none\");\n previousBtn.classList.remove(\"d-none\");\n submitBtn.classList.add(\"d-none\");\n }\n question.textContent = i + 1 + \" of 5: \" + questionsList[i].question;\n optionLabel.forEach(function(arr, j) {\n arr.textContent = questionsList[i].answers[j];\n });\n radio.forEach(function(arr, j) {\n arr.value = questionsList[i].answers[j];\n if (radio[j].value == questionsList[i].selectedAnswer) {\n radio[j].checked = true;\n } else {\n radio[j].checked = false;\n }\n });\n}", "function showAddCard() {\n var x = document.getElementById('addCardDiv');\n if (x.style.display === 'none') {\n x.style.display = 'block';\n } else {\n x.style.display = 'none';\n }\n}", "function show(e) {\n\tif(openedCards.length >= 2 || e.target.classList.contains('open','show') || e.target.classList.contains('match')) {\n\t\treturn;\n\t}\n\n\te.target.classList.add('open','show','disable');\n\topenedCards.push(e.target);\n\tif(openedCards.length === 2) {\n\t\tmoveCounter++;\n\t\tmoves.textContent=moveCounter;\n\t\tmatchCard();\n\t\tratings();\n\t}\n}", "function filter() {\r\n var category = categoryInput.value == 'No' ? null : categoryInput.value; // if no category, set it to null\r\n for (var i = 0; i < divsToFilter.length; ++i) { // iterate through all cards\r\n divsToFilter[i].classList.add('d-none'); // hide them\r\n if (divsToFilter[i].classList.contains(category) || category == null) { // if they match the category, or no category, show\r\n divsToFilter[i].classList.remove('d-none');\r\n }\r\n }\r\n}", "function displayCard(image) {\n\t$('.results-sec').replaceWith(\n\t\t`<div class=\"results-sec\">\n <img src=\"${cardBack}\" class=\"cards\" alt=\"Deck of Cards\">\n <img src=\"${image}\" class=\"cards\" alt=\"${currentCard.value} of ${currentCard.suit}\">\n </div>`\n\t);\n\t$('.results').removeClass('hidden');\n}", "function displayComputerCard(index) {\n\tconst params = outputDisplays[possibleInputs];\n\tif (params.images) {\n\t\tfor (const c in params.classes) {\n\t\t\t$(\"#computer-card-image\").removeClass(params.classes[c]);\n\t\t}\n\t\t$(\"#computer-card-image\").addClass(params.classes[index]);\n\t\t$(\"#computer-card-image\").show();\n\t\t$(\"#computer-card-text\").hide();\n\t} else {\n\t\t$(\"#computer-card-text\").text(params.outputs[index]);\n\t\tfor (const c in params.classes) {\n\t\t\t$(\"#computer-card-text\").removeClass(params.classes[c]);\n\t\t}\n\t\t$(\"#computer-card-text\").addClass(params.classes[index]);\n\t\t$(\"#computer-card-image\").hide();\n\t\t$(\"#computer-card-text\").show();\n\t}\n\n\t// set timer for start of animation\n\t$(\".flip-card\").addClass(\"active-flipped\");\n\tanimating = true;\n\tsetTimeout(allowAnimationSkip, minCardDisplayDuration);\n}", "function displayCard() {\n\tevent.target.classList.add('show', 'open');\n}", "function hideCards() {\n if (openCards.length === 2) {\n openCards[0].classList.remove(\"open\", \"show\");\n openCards[1].classList.remove(\"open\", \"show\");\n openCards[0].classList.remove(\"noMatch\");\n openCards[1].classList.remove(\"noMatch\");\n removeOpenCards();\n } else {\n return;\n }\n}", "function view_change(next) {\n cards.forEach(card => {\n card.classList.remove('is-show');\n });\n next.classList.add('is-show');\n}", "function hideCards() {\n\tlet cards = document.getElementsByClassName(\"text\");\n\tfor (var i = 0; i < cards.length; i++) {\n\t\tcards[i].style.display = \"none\";\n\t}\n}", "function showAll() {\n for (var simCount = 0; simCount < simData[\"simulations\"].length; simCount++) {\n var card = document.getElementsByClassName('thumbnail-view')[simCount],\n cardDelete = document.getElementsByClassName('tile-delete')[simCount],\n cardDownload = document.getElementsByClassName('tile-download')[simCount];\n card.classList.remove('hide-back');\n cardDelete.classList.add('hide');\n cardDownload.classList.remove('hide');\n }\n }", "function switchToNew() {\n $('#saved-card-pane').hide();\n $('#new-card-pane').show();\n}", "function showCardDetails (index) {\n // var movies = retrieveMovies()\n hideAllForms()\n\n if (movieDetailsEnabled) {\n hideMovieDetails()\n }\n\n movieDetailsEnabled = true\n\n document.getElementById('mainRight').style.display = 'block'\n\n // main div\n var mainCard = document.createElement('div')\n mainCard.setAttribute('class', 'showMovieDetails')\n mainCard.setAttribute('id', 'showMovieDetails')\n\n // sub div1\n var div1 = document.createElement('div')\n var div1Image = document.createElement('img')\n div1Image.setAttribute('src', movies[index].image)\n div1.appendChild(div1Image)\n\n // sub div2\n var div2 = document.createElement('div')\n // console.log(movies[index].title)\n div2.innerHTML = movies[index].title\n\n // sub div3\n var div3 = document.createElement('div')\n div3.innerHTML = movies[index].description\n\n // sub div4\n var div4 = document.createElement('div')\n div4.innerHTML = movies[index].rating\n\n // sub div5\n var div5 = document.createElement('div')\n div5.innerHTML = movies[index].year\n\n // sub div6\n var div6 = document.createElement('div')\n div6.innerHTML = movies[index].trailer\n\n // sub div7\n var div7 = document.createElement('div')\n div7.innerHTML = movies[index].download\n\n // add to card\n mainCard.appendChild(div1)\n mainCard.appendChild(div2)\n mainCard.appendChild(div3)\n mainCard.appendChild(div4)\n mainCard.appendChild(div5)\n mainCard.appendChild(div6)\n mainCard.appendChild(div7)\n\n // add to super card\n document.getElementById('mainRight').appendChild(mainCard)\n\n if (fullView) {\n fullToHalf()\n }\n}", "function displayCard() {\n\tvar child = this.childNodes;\n\tchild[1].classList.add(\"front\");\n\tchild[3].classList.remove(\"back\");\n\n\t// adding opened card to an array if not present\n\tif (!openedCards.includes(this)) {\n\t\topenedCards.push(this);\n\t}\n\tconsole.log(openedCards);\n\tif (openedCards.length == 2) {\n\t\topenedCard();\n\t}\n}", "function showCard(card)\n\t{\n\t\tcard.addClass('show open');\n\t\taddOpened(card);\n\t}", "function defShow(){\n $(\".a\"+cardPos).toggle();\n}", "function showCard(event) {\n if (cardPair.length < 1) {\n gameTime();\n }\n if (cardPair.length < 2) {\n event.target.classList.add('show', 'open');\n }\n}", "function displayer(card) {\n card.classList.add(\"open\");\n card.classList.add(\"show\");\n}", "function renderCard() {\n window.question.style.display = \"block\";\n window.cardTitle.style.display = \"none\";\n window.answer.style.display = \"none\";\n\n const card = window.cardList[window.currentPage];\n console.log(card.language_id);\n window.language.innerText = languageList[card.language_id - 1].name;\n window.cardTitle.innerText = card.title;\n window.answer.innerText = card.answer;\n window.question.innerText = card.question;\n\n // creating deleteButton that appears on each card\n let cardItem = document.getElementById(\"card-item\");\n}", "function onCardClicked() {\n //get the card that was clicked\n let selectedId = $(this).attr('id').replace('card-','');\n let selectedCard = cards[selectedId];\n\n if (selectedCard.isDisplayed() || openCards.length >= 2) {\n return;\n } else {\n //increment click counter\n moveCount++;\n $('.moves').text(moveCount);\n\n //check move count and decrement stars if needed.\n if (moveCount == 20) {\n $('#star-3').removeClass('fa-star');\n $('#star-3').addClass('fa-star-o');\n } else if (moveCount == 30) {\n $('#star-2').removeClass('fa-star');\n $('#star-2').addClass('fa-star-o');\n }\n\n //display the card.\n selectedCard.flip();\n\n //after short delay, check if there is a match.\n //this is done so that the cards do not immediately flip back\n //preventing you from seeing the 2nd card.\n setTimeout(function() {\n if (!findCardMatch(selectedCard)) {\n //add selected card to list of open cards\n openCards.push(selectedCard);\n\n if (openCards.length == 2) {\n //hide both cards\n openCards[0].flip();\n openCards[1].flip();\n openCards = [];\n }\n }\n }, 800);\n }\n}", "function displayPaymentDetails(){\n if ($(\"#payment\").val() === \"credit card\") {creditCardPayment.show()}\n else creditCardPayment.hide();\n if ($(\"#payment\").val() === \"paypal\") {payPalPayment.show()}\n else payPalPayment.hide();\n if ($(\"#payment\").val() === \"bitcoin\") {bitcoinPayment.show()}\n else bitcoinPayment.hide();\n}", "function showhide() {\n cardsWrapper.classList.toggle('hidden');\n}", "function toggleCardDisplay(clickedCard) {\n clickedCard.classList.add('show', 'open');\n}", "function displayButton() {\n const sel1 = W.selectionManager.getSelectedFeatures();\n\n if (sel1.length > 0) {\n if(sel1[0].model.type == 'venue') {\n $('#MyclosedVenueContainer').css('display', 'block');\n } else {\n $('#MyclosedVenueContainer').css('display', 'none');\n }\n }else {\n $('#MyclosedVenueContainer').css('display', 'none');\n }\n }", "function showall(){\n document.getElementById(\"card0\").style.display = \"none\"; /* start page with options */\n\n for (var c=1;c<karten+1;c++) {\n pre = \"<div class='plugin__flashcards_fp_border'><div class='plugin__flashcards_fp_header'>\" + \"Karte \" + c + \"</div>\";\n document.getElementById(\"card\"+c).innerHTML = pre + document.getElementById(\"card\"+c).innerHTML + \"</div>\";\n\n document.getElementById(\"card\"+c).style.display = \"block\";\n document.getElementById(\"card\"+c).style.minHeight = 0;\n }\n}", "function displayCards() {\n for (let i = 0; i < deckOfCards.length; i++) {\n let deck = document.querySelector(\".deck\");\n let liCard = document.createElement(\"li\");\n deck.appendChild(liCard);\n let cardName = deckOfCards[i];\n liCard.className = \"card fa fa-\" + cardName + \" hide\";\n liCard.addEventListener(\"click\", showCard);\n }\n}", "function displayCards() {\n\t\t// Resize the container of the cards\n\t\tswitch (parseInt(pairs)) {\n\t\t\tcase 2:\n\t\t\t\t// For 2 pairs only (4 cards)\n\t\t\t\tvar boxWidth = 250;\n\t\t\t\tbreak;\n\n\t\t\tcase (3, 4):\n\t\t\t\t// For 3 pairs (6 cards) and 4 pairs (8 cards)\n\t\t\t\tvar boxWidth = 370;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// For 5 pairs or more\n\t\t\t\tvar boxWidth = 490;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//console.log(\"Pairs: \" + pairs + \" Width: \" + boxWidth);\n\n\t\t// Set the with of the cards grid\n\t\t$(\"#gifBox\").css(\"max-width\", boxWidth);\n\n\t\t// Remove all the existing cards\n\t\t$(\"#gifs\").html(\"\");\n\n\t\t// For each GIF append an element to the DOM\n\t\tfor (var c in cardsArray) {\n\t\t\t// Create a CARD div\n\t\t\tvar cardDiv = $(\"<div>\").addClass(\"card m-2\");\n\n\t\t\t// Append the character image to the front of the card, but HIDE this image - this to mimic the fact of the card being \"facing donw\"\n\t\t\tvar cardImg = $(\"<img>\")\n\t\t\t\t.attr(\"src\", cardsArray[c])\n\t\t\t\t.attr(\"id\", \"frnt\" + c)\n\t\t\t\t.css(\"display\", \"none\")\n\t\t\t\t.addClass(\"staticgif card-img-top\")\n\t\t\t\t.appendTo(cardDiv);\n\n\t\t\t// Append the image of the back if the card - this to mimic the fact of the card being \"facing donw\"\n\t\t\tvar cardback = $(\"<img>\")\n\t\t\t\t.attr(\"src\", \"./assets/images/card_back.png\")\n\t\t\t\t.attr(\"id\", \"back\" + c)\n\t\t\t\t.attr(\"data-url\", cardsArray[c])\n\t\t\t\t.addClass(\"staticgif card-img-top\")\n\t\t\t\t.appendTo(cardDiv);\n\n\t\t\t// Append each card\n\t\t\t$(\"#gifs\").append(cardDiv);\n\t\t}\n\n\t\t// Start the countdown clock for the TIMED and CHALLENGE modes\n\t\tif (mode === \"timed\" || mode === \"challenge\") {\n\t\t\t// console.log(\"calling the clock with \" + time + \" seconds\");\n\n\t\t\ttimerRun(time);\n\n\t\t\t$(\"#box-clock\").show();\n\t\t} else {\n\t\t}\n\t}", "function hideAllCardsOfUser(userToHide) {\n let elems = document.querySelectorAll(`[id^='card_${userToHide}']`);\n let index;\n for (index = 0; index < elems.length; ++index) {\n elems[index].style.display = 'none';;\n }\n}", "function showCard(event) {\n\n\tevent.currentTarget.classList.toggle('card__turn');\n\tevent.currentTarget.removeEventListener('click', showCard);\n\n\tif (compareA === undefined) {\n\t\tDing.volume = 0.3;\n\t\tDing.currentTime = 0;\n\t\tDing.play();\n\t\tcompareA = event.currentTarget.getAttribute('data-pair');\n\t} else {\n\t\tcompareB = event.currentTarget.getAttribute('data-pair');\n\t\tcompareCards();\n\t}\n}", "function showCard(card) {\n timer.start();\n if (openCards.length === 0) {\n card.classList.add(\"open\", \"show\");\n openCards.push(card);\n } else if (openCards.length === 1) {\n card.classList.add(\"open\", \"show\");\n openCards.push(card);\n } else {\n openCards.push(card);\n }\n}", "function cards() {\n\tvar task = document.getElementById(\"choose\").value;\n\tdocument.getElementById(\"btn\").style.display = \"none\"; \n \tif (task === \"colors\"){\n \tsetVars(colors);\n \tcolor();\n \ttype = \"color\";\n }\n else if (task === \"shapes\"){\n \tsetVars(shapes);\n \timage();\n \ttype = \"image\";\n }\n \telse if (task === \"nums\"){\n \tsetVars(nums);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"capLet\"){\n \tsetVars(caps);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"lowLet\"){\n \tsetVars(low);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry1\"){\n \tsetVars(fry1);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry2\"){\n \tsetVars(fry2);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry3\"){\n \tsetVars(fry3);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry4\"){\n \tsetVars(fry4);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry5\"){\n \tsetVars(fry5);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry6\"){\n \tsetVars(fry6);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry7\"){\n \tsetVars(fry7);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry8\"){\n \tsetVars(fry8);\n \ttext();\n \ttype = \"text\";\n }\t\n \telse if (task === \"fry9\"){\n \tsetVars(fry9);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"fry10\"){\n \tsetVars(fry10);\n \ttext();\n \ttype = \"text\";\n }\n \telse if (task === \"oneTOone10\"){\n \tsetVars(oneTOone10);\n \timage();\n \ttype = \"image\";\n }\n}", "function showAllCards() {\r\n deleteAllBooks();\r\n displayAllBooks();\r\n addAllBtn();\r\n \r\n addDeleteEvent();\r\n addCompletedEvent();\r\n addEditEvent();\r\n\r\n logLibraryInfo();\r\n updateLocalStorage();\r\n}", "function hideGameContainers() {\n $(\"#question\").hide();\n $(\"#choice-1\").hide();\n $(\"#choice-2\").hide();\n $(\"#choice-3\").hide();\n $(\"#choice-4\").hide();\n }", "function hideTweetCard(index) {\n const selectedCard = document.querySelector(`#tweetCard${index}`);\n selectedCard.style.display = 'none';\n}", "function hdShow(action) {\n if(action == 'show'){\n resultsUser.classList.add('show');\n } else if (action == 'hide'){\n resultsUser.classList.remove('show');\n }\n\n}// end hide or show results for member section", "function cardDeckFlashDisplay(cElements) {\n cardDeckDisplay(cElements);\n cardDeckHide(cElements)\n}", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function hideField() {\n var camelArray = [camelBlue, camelGreen, camelRed, camelYellow];\n var waitingMessArray = [waitingForBlueCamelRider,waitingForGreenCamelRider,waitingForRedCamelRider,waitingForYellowCamelRider]\n\n $.each(waitingMessArray, function (index) {\n this.attr({\n visibility: 'hidden'\n });\n\n });\n\n\n\n\n $.each(camelArray, function (index) {\n this.attr({\n visibility: 'hidden'\n });\n\n });\n\n $.each(fieldArray, function (index) {\n this.attr({\n visibility: 'hidden'\n });\n });\n\n\n\n if(Session.get('PlayerId')== 0) blueidentity.attr({ visibility: 'hidden' });\n if(Session.get('PlayerId')== 1) greenidentity.attr({ visibility: 'hidden'});\n if(Session.get('PlayerId')== 2) redidentity.attr({ visibility: 'hidden' });\n if(Session.get('PlayerId')== 3) yellowidentity.attr({ visibility: 'hidden' });\n\n }", "function showCardSymbol(card){\n \tcard.addClass(\"show\");\n \tcard.addClass(\"disabled\"); // This will ensure the card is not clickable when it is showed and is facing up.\n}", "function display_card_list(card_list, expand, card_list_div, visible, action){\n\t//console.log(card_list);\n\tvar li;\n\tvar card_name;\n\tvar ul = document.createElement(\"ul\");\n\t\tul.setAttribute(\"class\", \"list_box\");\n\tif (expand) {\n\t\tvar iterations = card_list.cards.length; // as many iterations as cards\n\t}\n\telse { // display one if the list has at least one; otherwise, none\n\t\tvar iterations = Math.min(1, card_list.cards.length);\n\t}\n\tif (iterations > 0) {\n\t\tfor (var index=0; index < iterations; index++ ){ // for each card in list\n\t\t\tcard_name = card_list.cards[index].name; // get its name\n\t\t\tif (card_name == 'Unknown'){\n\t\t\t\tcard_name = '';\n\t\t\t}\n\t\t\tif (visible) {\n\t\t\t\tcard = display_icon(index, action, card_name);\n\t\t\t\tli = document.createElement(\"li\").appendChild(card);\n\t\t\t} else {\n\t\t\t\tli = document.createElement(\"li\").appendChild(display_back());\n\t\t\t//\tli.innerHTML = \"&nbsp;\";\n\t\t\t\tli.setAttribute(\"id\", index);\n\t\t\t}\n\t\t\tul.appendChild(li); // add this card to the list\n\t\t}\n\t}\n\tcard_list_div.appendChild(ul);\n}", "function showFlashcards() {\n db.allDocs({include_docs: true, descending: true}).then(function(doc){\n redrawFlashcardsUI(doc.rows);\n }).catch(function(err){\n console.log(err);\n });\n }", "function displayProfile(profile) {\n if (toShow) {\n toShow.style.display = \"none\"\n toShow = profile\n toShow.style.display = \"block\"\n }\n} //end of displayProfile", "function displayCards(cardsArray){\n let html = '';\n cardsArray.forEach(function(card){\n html += '<div class=\"flip-container ' + card.name + '\" id=\"' + card.name + card.instance + '\">';\n html += '<div class=\"flipper\">';\n html += '<div class=\"front\">';\n html += '<img class=\"card-front active\" src=\"images/card-back.png\" alt=\"Front of card\">';\n html += '</div>';\n html += '<div class=\"back\">';\n html += '<img src=\"images/' + card.img + '\" alt=\"' + card.name + '\">';\n html += '</div>';\n html += '</div>';\n html += '</div>';\n });\n $(\"#cards-container\").html(html);\n}", "function displayCard (target) {\n\ttarget.classList.remove('close');\n\ttarget.classList.add('open', 'show');\n}", "function goToCard(cardNum){\n\tdocument.querySelector('x-deck').showCard(cardNum);\n\t\n\t/*reset inputs and clear lists*/\n\t$('input[name=branch]').val(\"\");\n\t$('input[name=repo]').val(\"\");\n\t$('input[name=user]').val(\"\");\n\t$('#list_his').empty();\n\t$('#star_list').empty();\t\n\t\n}", "function showCard(card) {\n $('section#card img').src = card.src;\n }", "function displayCards() {\n // aus HTML wird card-container in cardContainerDiv gespeichert\n let cardContainerDiv = document.getElementById(\"card-container\");\n // Geht jede Karten auf der Spielfläche durch und stellt sie dann dar\n for (let i = 0; i < cardPool.length; i++) {\n // ein neues div wird erstellt und in cardDiv gespeichert\n let cardDiv = document.createElement(\"div\");\n // für css zum gestalten\n cardDiv.setAttribute(\"class\", \"card-div\");\n // neues img element wird erstellt und in cardImg gespeichert\n let cardImg = document.createElement(\"img\");\n // Das Sakura Bild (Kartenrückseite) wird dem cardImg zugewiesen\n cardImg.src = \"./pictures/ui/sakura.png\";\n // --Jede Rückseite bekommen verschiedene id's || warum i? Damit das onCardClick() weiß an welcher Position die Karte im cardPool array war\n cardImg.setAttribute(\"id\", i.toString());\n // für css\n cardImg.setAttribute(\"class\", \"card-image\");\n // beim klicken wird onCardClick() aufgerufen\n cardImg.addEventListener(\"click\", onCardClick);\n // cardImg ist ein Unterelement von cardDiv\n cardDiv.appendChild(cardImg);\n // cardDiv ist ein Unterelement von cardContainerDiv\n cardContainerDiv.appendChild(cardDiv);\n }\n }", "function hideCard(id) {\n var el = document.getElementById(id);\n el.style.visibility = \"hidden\";\n}", "function showCard(event) {\n return event.target.classList.add('open', 'show');\n }", "function isTwoCards() {\n\tcardsInPlay.push(this.getAttribute('data-card')); //add clicked card's data to cardsInPlay\n\tthis.firstChild.setAttribute('style', 'display: block;'); //allow img to be displayed\n\t\n\tif (cardsInPlay.length === 2) {\n\t\tisMatch(cardsInPlay);\n\t\tcardsInPlay = [];\n\t}\n}", "function showPlayersSelectionLyF() {\n $(\"#players\").toggle();\n $(\".mi-team\").show();\n $(\".btn-filters\").show();\n $('.btn-done, .btn-edit-team').toggle();\n $(\"body\").removeClass('show-msj');\n $(\".count-rol\").toggle();\n // $(\".formations\").toggle();\n $(\"#subtitle\").toggle();\n\n}" ]
[ "0.7106892", "0.7103846", "0.69929266", "0.6968872", "0.6947049", "0.6903098", "0.6778681", "0.6770809", "0.67636245", "0.67420655", "0.6734902", "0.67277277", "0.67166984", "0.6647408", "0.66249126", "0.6622975", "0.6578236", "0.6542416", "0.6523601", "0.6510359", "0.6505258", "0.6461903", "0.64579606", "0.64546543", "0.6452264", "0.64394695", "0.64380103", "0.64215803", "0.6406368", "0.64014566", "0.6398153", "0.6366258", "0.6351527", "0.634435", "0.6335544", "0.6334951", "0.6320693", "0.6312367", "0.63122135", "0.6287912", "0.6287603", "0.62572265", "0.62572265", "0.62555707", "0.6254868", "0.6243198", "0.6216218", "0.621556", "0.61988974", "0.61976135", "0.6188859", "0.61756974", "0.617213", "0.61579245", "0.6154329", "0.6137291", "0.61363506", "0.6128751", "0.6128596", "0.6128507", "0.6128428", "0.61217326", "0.6121313", "0.61096716", "0.6108215", "0.6103214", "0.6100063", "0.60979366", "0.60820115", "0.60805243", "0.6073825", "0.60486066", "0.6048422", "0.6041658", "0.60356563", "0.6015835", "0.601194", "0.6011501", "0.6009483", "0.5997123", "0.5990631", "0.5986901", "0.5981695", "0.5975378", "0.5967593", "0.59637094", "0.5963589", "0.5959697", "0.5957988", "0.5954317", "0.5952341", "0.59274733", "0.59216064", "0.59209794", "0.5920729", "0.59204155", "0.5920165", "0.5918743", "0.5917558", "0.59091395", "0.5891119" ]
0.0
-1
tworze konstruktor gry wlasciwosci i metody
function Game(){ this.board = document.querySelectorAll('section#board div');//plansza gry this.furry = new Furry();//egzemplarz stworka this.coin = new Coin();//moneta, jej pozycja x i y jest juz gotowa this.score = 0;//aktualny wynik gracza this.index = function(x, y){ return x + (y * 10);//przelicza pozycje x i y na indeks tablicy } this.showFurry = function(){//pokazuje Furrego this.hideVisibleFurry();//wywolanie metody, ktora pozbywa sie klonow this.board[this.index(this.furry.x,this.furry.y)].classList.add('furry'); //tu nadaje klase .furry elementowi planszy odpowiadajacemu pozycji Furrego } this.hideVisibleFurry = function(){//pozbywam sie klonow Furrego var furryCreepy = document.querySelector('.furry'); if (furryCreepy !== null){ furryCreepy.classList.remove('furry');//pozbywam sie poprzedniego stwora } } this.showCoin = function(){//pokazuje monete na odpowiednich polach planszy this.board[this.index(this.coin.x, this.coin.y)].classList.add('coin'); //tu nadaje klase .coin elementowi planszy odpowiadajacemu pozycji monety } this.moveFurry = function(){//modyfikacja pozycji Furrego zeleznie od kierunku this.gameOver(); switch (this.furry.direction) { case 'right': this.furry.x = this.furry.x + 1; this.showFurry(); break; case 'left': this.furry.x = this.furry.x - 1; this.showFurry(); break; case 'down': this.furry.y = this.furry.y + 1; this.showFurry(); break; case 'up': this.furry.y = this.furry.y - 1; this.showFurry(); break; } this.checkCoinCollision(); } var self = this; this.turnFurry = function(event){//event, sterowanie stworkiem switch (event.which){//wlasciwosc which obiektu event case 37: self.furry.direction = 'left'; break; case 38: self.furry.direction = 'up'; break; case 39: self.furry.direction = 'right'; break; case 40: self.furry.direction = 'down'; break; } } this.checkCoinCollision = function(){//sprawdzanie kolizji z moneta if (this.furry.x === this.coin.x && this.furry.y === this.coin.y){//sprawdzam czy pozycje stwora i monety sa takie same var myCoin = document.querySelector('.coin'); if (myCoin != undefined) {//jesli nastapilo zderzenie to myCoin.classList.remove('coin');//usuwam monete z ekranu } var myPoint = document.querySelector('div strong'); this.score++;//dodaje 1 punkt do wyniku myPoint.innerText = this.score;//pokazuje zaktualizowany wynik this.coin = new Coin();//nowa moneta this.showCoin();//pokazuje nowa monete } } this.gameOver = function(){ if (this.furry.x < 0 || this.furry.x > 9 || this.furry.y < 0 || this.furry.y > 9){//stworek wpada na krawedz to: this.hideVisibleFurry();//ukrywam stworka clearInterval(this.idSetInterval);//kasuje intervala var gameIsOver = document.getElementById('over'); gameIsOver.innerHTML = '<pre>Game Over<br>Score: '+ this.score + '</pre>' ;//dodaje element, ktory mam w css, z wynikiem gameIsOver.classList.remove('invisible');//i pokazuje go } return this.score;//zwracam wynik } this.startGame = setInterval(function(){//zaczynam gre // console.log('hura z setIntervala');//dziala! self.moveFurry();//wywoluje metode odpowiadajaca za poruszanie sie Furrego }, 250); this.idSetInterval = this.startGame; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function escoltaDictat () {\r\n this.capa.innerHTML=\"\";\r\n if(!this.validate) {\r\n this.putSound (this.paraules[this.wordActual].so);\r\n this.capa.innerHTML += this.actual+this.putCursor ('black');\r\n }\r\n else {\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n }\r\n}", "function Komunalne() {}", "constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }", "constructor(nombreLugar='Tierra de mordor', tipoDescripcion='Es un lugar rodeado de arboles muertos y arena negra, donde no se puede ver nada por su densa niebla.')\r\n {\r\n this.nombreLugar = nombreLugar;\r\n this.tipoDescripcion = tipoDescripcion;\r\n }", "function zwrocRozmCzcionki(liczbaWyst) {\n let wynik = \"\";\n\n switch (liczbaWyst) {\n case 1:\n\twynik = \"8px\";\n\tbreak;\n case 2:\n\twynik = \"12px\";\n\tbreak;\n case 3:\n\twynik = \"16px\";\n\tbreak;\n case 4:\n\twynik = \"20px\";\n\tbreak;\n default:\n wynik = \"24px\";\t\n }\n return wynik;\n}", "function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap(\"\\u0901\", \"?\", \"z\", true), // Candrabindu\n new KeyMap(\"\\u0902\", \"\\u1E41\", \"M\"), // Anusvara\n new KeyMap(\"\\u0903\", \"\\u1E25\", \"H\"), // Visarga\n new KeyMap(\"\\u1CF2\", \"\\u1E96\", \"Z\"), // jihvamuliya\n new KeyMap(\"\\u1CF2\", \"h\\u032C\", \"V\"), // upadhmaniya\n new KeyMap(\"\\u0905\", \"a\", \"a\"), // a\n new KeyMap(\"\\u0906\", \"\\u0101\", \"A\"), // long a\n new KeyMap(\"\\u093E\", null, \"A\", true), // long a attached\n new KeyMap(\"\\u0907\", \"i\", \"i\"), // i\n new KeyMap(\"\\u093F\", null, \"i\", true), // i attached\n new KeyMap(\"\\u0908\", \"\\u012B\", \"I\"), // long i\n new KeyMap(\"\\u0940\", null, \"I\", true), // long i attached\n new KeyMap(\"\\u0909\", \"u\", \"u\"), // u\n new KeyMap(\"\\u0941\", null, \"u\", true), // u attached\n new KeyMap(\"\\u090A\", \"\\u016B\", \"U\"), // long u\n new KeyMap(\"\\u0942\", null, \"U\", true), // long u attached\n new KeyMap(\"\\u090B\", \"\\u1E5B\", \"q\"), // vocalic r\n new KeyMap(\"\\u0943\", null, \"q\", true), // vocalic r attached\n new KeyMap(\"\\u0960\", \"\\u1E5D\", \"Q\"), // long vocalic r\n new KeyMap(\"\\u0944\", null, \"Q\", true), // long vocalic r attached\n new KeyMap(\"\\u090C\", \"\\u1E37\", \"L\"), // vocalic l\n new KeyMap(\"\\u0962\", null, \"L\", true), // vocalic l attached\n new KeyMap(\"\\u0961\", \"\\u1E39\", \"LY\"), // long vocalic l\n new KeyMap(\"\\u0963\", null, \"LY\", true), // long vocalic l attached\n new KeyMap(\"\\u090F\", \"e\", \"e\"), // e\n new KeyMap(\"\\u0947\", null, \"e\", true), // e attached\n new KeyMap(\"\\u0910\", \"ai\", \"E\"), // ai\n new KeyMap(\"\\u0948\", null, \"E\", true), // ai attached\n new KeyMap(\"\\u0913\", \"o\", \"o\"), // o\n new KeyMap(\"\\u094B\", null, \"o\", true), // o attached\n new KeyMap(\"\\u0914\", \"au\", \"O\"), // au\n new KeyMap(\"\\u094C\", null, \"O\", true), // au attached\n\n // velars\n new KeyMap(\"\\u0915\\u094D\", \"k\", \"k\"), // k\n new KeyMap(\"\\u0916\\u094D\", \"kh\", \"K\"), // kh\n new KeyMap(\"\\u0917\\u094D\", \"g\", \"g\"), // g\n new KeyMap(\"\\u0918\\u094D\", \"gh\", \"G\"), // gh\n new KeyMap(\"\\u0919\\u094D\", \"\\u1E45\", \"f\"), // velar n\n\n // palatals\n new KeyMap(\"\\u091A\\u094D\", \"c\", \"c\"), // c\n new KeyMap(\"\\u091B\\u094D\", \"ch\", \"C\"), // ch\n new KeyMap(\"\\u091C\\u094D\", \"j\", \"j\"), // j\n new KeyMap(\"\\u091D\\u094D\", \"jh\", \"J\"), // jh\n new KeyMap(\"\\u091E\\u094D\", \"\\u00F1\", \"F\"), // palatal n\n\n // retroflex\n new KeyMap(\"\\u091F\\u094D\", \"\\u1E6D\", \"t\"), // retroflex t\n new KeyMap(\"\\u0920\\u094D\", \"\\u1E6Dh\", \"T\"), // retroflex th\n new KeyMap(\"\\u0921\\u094D\", \"\\u1E0D\", \"d\"), // retroflex d\n new KeyMap(\"\\u0922\\u094D\", \"\\u1E0Dh\", \"D\"), // retroflex dh\n new KeyMap(\"\\u0923\\u094D\", \"\\u1E47\", \"N\"), // retroflex n\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"lY\"), // retroflex l\n new KeyMap(\"\\u0933\\u094D\\u0939\\u094D\", \"\\u1E37\", \"lYh\"), // retroflex lh\n\n // dental\n new KeyMap(\"\\u0924\\u094D\", \"t\", \"w\"), // dental t\n new KeyMap(\"\\u0925\\u094D\", \"th\", \"W\"), // dental th\n new KeyMap(\"\\u0926\\u094D\", \"d\", \"x\"), // dental d\n new KeyMap(\"\\u0927\\u094D\", \"dh\", \"X\"), // dental dh\n new KeyMap(\"\\u0928\\u094D\", \"n\", \"n\"), // dental n\n\n // labials\n new KeyMap(\"\\u092A\\u094D\", \"p\", \"p\"), // p\n new KeyMap(\"\\u092B\\u094D\", \"ph\", \"P\"), // ph\n new KeyMap(\"\\u092C\\u094D\", \"b\", \"b\"), // b\n new KeyMap(\"\\u092D\\u094D\", \"bh\", \"B\"), // bh\n new KeyMap(\"\\u092E\\u094D\", \"m\", \"m\"), // m\n\n // sibillants\n new KeyMap(\"\\u0936\\u094D\", \"\\u015B\", \"S\"), // palatal s\n new KeyMap(\"\\u0937\\u094D\", \"\\u1E63\", \"R\"), // retroflex s\n new KeyMap(\"\\u0938\\u094D\", \"s\", \"s\"), // dental s\n new KeyMap(\"\\u0939\\u094D\", \"h\", \"h\"), // h\n\n // semivowels\n new KeyMap(\"\\u092F\\u094D\", \"y\", \"y\"), // y\n new KeyMap(\"\\u0930\\u094D\", \"r\", \"r\"), // r\n new KeyMap(\"\\u0932\\u094D\", \"l\", \"l\"), // l\n new KeyMap(\"\\u0935\\u094D\", \"v\", \"v\"), // v\n\n\n // numerals\n new KeyMap(\"\\u0966\", \"0\", \"0\"), // 0\n new KeyMap(\"\\u0967\", \"1\", \"1\"), // 1\n new KeyMap(\"\\u0968\", \"2\", \"2\"), // 2\n new KeyMap(\"\\u0969\", \"3\", \"3\"), // 3\n new KeyMap(\"\\u096A\", \"4\", \"4\"), // 4\n new KeyMap(\"\\u096B\", \"5\", \"5\"), // 5\n new KeyMap(\"\\u096C\", \"6\", \"6\"), // 6\n new KeyMap(\"\\u096D\", \"7\", \"7\"), // 7\n new KeyMap(\"\\u096E\", \"8\", \"8\"), // 8\n new KeyMap(\"\\u096F\", \"9\", \"9\"), // 9\n\n // accents\n new KeyMap(\"\\u0951\", \"|\", \"|\"), // udatta\n new KeyMap(\"\\u0952\", \"_\", \"_\"), // anudatta\n new KeyMap(\"\\u0953\", null, \"//\"), // grave accent\n new KeyMap(\"\\u0954\", null, \"\\\\\"), // acute accent\n\n // miscellaneous\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"L\"), // retroflex l\n new KeyMap(\"\\u093D\", \"'\", \"'\"), // avagraha\n new KeyMap(\"\\u0950\", null, \"om\"), // om\n new KeyMap(\"\\u0964\", \".\", \".\") // single danda\n ];\n\n PhoneticMapper.call(this, map);\n}", "setearParams(kv, ma, md, fltr, anod) {\n\n //console.log(\"seteo nuevos parametros\");\n this.kilovolt = kv;\n this.miliamperios = ma;\n this.modo = md;\n this.filtro = fltr;\n this.anodo = anod;\n }", "function dwa() {\n \n //wypisanie do konsoli zawartości zmienna1, zdeklarowanej w funkcji nadrzednej, wartośc zostanie pobrana poprzez hoisting\n console.log(zmienna1);\n \n //Deklaracja i przypisanie w funkcji wewnetrznej\n var zmienna2 = 3;\n }", "function e(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function cetakPesan(nama, bahasa='id')\n{\n var pesan = 'Selamat datang, ' + nama;\n if(bahasa == 'en')\n {\n pesan = 'Welcome, ' + nama;\n }\n else if(bahasa=='id'){\n console.log(pesan);\n }\n console.log('Mohon maaf bahasa yang diminta belum terdaftar');\n}", "provincia() {\n return super.informacion('provincia');\n }", "constructor(nombre, apellido, altura) {\r\n this.nombre = nombre;\r\n this.apellido = apellido;\r\n this.altura = altura;\r\n }", "distrito() {\n return super.informacion('distrito');\n }", "function t(e,t,n,o){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function defaultNames(){\r\n //CETE\r\n //return \"Par défaut\";\r\n return \"Par d\\u00e9faut\";\r\n //FIN CETE\r\n}", "function kh(a){this.s=a}", "function wa(){}", "function comportement (){\n\t }", "constructor(nama, tahunLahir, asal, specialty, pengalaman) {\n super(nama, tahunLahir, asal)\n this.specialty = specialty\n this.pengalaman = pengalaman\n }", "LiberarPreso(valor){\nthis.liberation=valor;\n }", "function mostraNotas(){}", "kartica1()\n {\n this.karticaForma=true;\n this.karticaRezultati=false;\n }", "constructor (angka) {\n this.hasil = angka;\n }", "function PlcGeral(){\r\n}", "misDatos() { // un metodo es una funcion declarativa sin el function dentro de un objeto, puede acceder al universo del objeto\n return `${this.nombre} ${this.apellido}`; // por medio del \"this\", que es una forma de acceder a las propiedades del objeto en un metodo\n }", "function c(e,c,t,n){switch(t){case\"s\":return c?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(c?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(c?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(c?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(c?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(c?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(c?\" жил\":\" жилийн\");default:return e}}", "function comprovarDictat () {\r\n this.capa.innerHTML=\"\";\r\n if (this.actual.toLowerCase() !=this.correcte.toLowerCase()) {\r\n this.putImg(\"imatges/error.gif\");\r\n this.putSound(this.soMal);\r\n this.actual = \"\";\r\n }\r\n else\r\n {\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge);\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.actual = \"\";\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n this.validate=1;\r\n }\r\n}", "function Constr() {}", "function Wn(){}", "function e(e,t,n,r){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function escribirInstruccion (instruccion){\n let instruccion = {\n Selecciona:'Selecciona Piedra, Pajaro o Agua',\n\n }\n}", "function karinaFaarNotifikation() {\n\n\n\n}", "function e(t,e,i,n){switch(i){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function undici () {}", "constructor (nombre, apellido,sueldo, cargo){ //solicitio los parametros incluidos los que vincule\n super(nombre,apellido) // con super selecciono los parametros que pide la clase vinculada\n this.sueldo= sueldo;\n this.cargo=cargo;\n }", "getBiografia(){\n return super.getBiografia()+` Puesto: ${this.puesto}, Salario: ${this.sueldo}`;\n\n }", "function t(e,t,n,g){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function zalogujDoKonsoli() {\n console.log('podpiete');\n}", "function e(t,e,r,i){switch(r){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "constructor(nombre, apellido, altura){\n super(nombre,apellido,altura)\n }", "function t(e,t,a,i){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,a,i){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,r,a){switch(r){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "constructor(texto=''){\n this._texto = texto;\n }", "function IndicadorRangoEdad () {}", "static get properties() {\n return {\n clase: { type: String },\n disabled: { type: Boolean },\n texto: { type: String },\n };\n }", "constructor(name){ // this constructor() method achepts one argument: name\n this.nama = name; //inside constructor(), we use 'this' keyword.\n this.behavior = 0;\n }", "function Interfaz(){}", "function t(e,t,a,n){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,a,n){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function iniciar() {\n \n }", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,n,i){switch(n){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function Mascota(nombre, especie, raza='')//no importa el orden de los datos\n//se pone comillas en la raza para que no te salga undefined por si no lo sabemos\n\n{\n this.nombre = nombre\n this.especie = especie\n this.raza = raza//los parametros de una funcion constructora son parametros y pueden tener valores por defecto\n\n}", "function t(e,t,i,n){switch(i){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function e(t,e,r,n){switch(r){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function e(t,e,r,n){switch(r){case\"s\":return e?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return t+(e?\" секунд\":\" секундын\");case\"m\":case\"mm\":return t+(e?\" минут\":\" минутын\");case\"h\":case\"hh\":return t+(e?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return t+(e?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return t+(e?\" сар\":\" сарын\");case\"y\":case\"yy\":return t+(e?\" жил\":\" жилийн\");default:return t}}", "function Ge(e,t,a,s){switch(a){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function continuaDictat ()\r\n{\r\n this.wordActual = this.getNewWord ();\r\n this.actual = \"\";\r\n this.init ();\r\n}", "function obliczPunkty(dane)\n{\n var ro = 1.21; // gęstośc czynnika\n var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych\n\n var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora\n var u2 = ((dane.D2 * Math.PI * dane.n) / 60).toPrecision(3); // prędkość obwodowa wirnika\n var c2u = ((dane.deltapzn * 1000) / (ro * u2 * dane.etazn)).toPrecision(3); // prędkość zależna od ułopatkowania wirnika\n var fi2r = ((c2u * Math.tan(dane.alfa2 * Math.PI / 180)) / u2).toPrecision(3); // wskaźnik prędkości koła wirnikowego\n var fi2r0 = ((mi0 * fi2r) / (mi0 - (c2u / u2))).toPrecision(3); // wartośc wskaznika prędkości koła wirnikowego dla wartości zerowej charakterystyki koła wirnikowego\n var Qmax = (dane.Qzn * (fi2r0 / fi2r)).toPrecision(3); // przepływ maksymalny\n\n var krok = 0.6;\n\n var daneDoWykresu = {};\n daneDoWykresu.deltap = []; // tablica wartości sprężu (deltap)\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.eta = []; // etazn * stosunek_et\n\tdaneDoWykresu.wspQ = []; //współczynnik Q: 1-Q/Qmax\n\tdaneDoWykresu.mp = [] ; // tablica wartości mocy pobieranej\n\t\n /* obliczanie punktów charakterystyk */\n\t\n for (var i = 0; i < 5; i++)\n\t{\n daneDoWykresu.Q[i] = krok * dane.Qzn;\n daneDoWykresu.wspQ[i] = 1 - (daneDoWykresu.Q[i] / Qmax);\n daneDoWykresu.eta[i] = dane.etazn * stosunek_et[i];\n\t\tdaneDoWykresu.deltap[i] =((293/(273+dane.tc))*((ro * (Math.pow(u2, 2)) * mi0 * daneDoWykresu.wspQ[i] * daneDoWykresu.eta[i])) / 1000); // kPa\n\t\tdaneDoWykresu.mp[i] = ((daneDoWykresu.Q[i]*daneDoWykresu.deltap[i])/(daneDoWykresu.eta[i]*dane.etas))/100; // kW/100\n krok += 0.2;\n }\n return daneDoWykresu;\n}", "function parametros(nombre, edad, pais='Colombia'){\n return `${nombre} Edad:${edad}, Pais:${pais}`;\n}", "function dizerOla(nome) {\n console.log('Olá ' + nome);\n console.log(\"Ol\\u00E1 \" + nome); //interpolarização\n}", "mosaicoSeccion(x, y, wd, ht){\n let colorPromedio = this.colorPromedio(x, y, wd, ht); //Obtenemos el color promedio\n this.colorSeccion(x, y, wd, ht, colorPromedio); //Aplicamos este color a la seccion\n }", "function verConfiguracion(){console.log(copiaConfiguracionBase);}", "function komunikatOLogowaniu(zamiana, wartoscWCss, res) {\n\n fs.readFile(__dirname + '/src-web' + '/logowanie.html', 'utf8', (err, data) => {\n if (err) {\n\n\n console.error(err)\n return\n }\n\n data = data.replace(`${wartoscWCss}`, `${zamiana}`)\n\n res.end(data)\n })\n}", "function t(e,t,r,n){switch(r){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,r,n){switch(r){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "function t(e,t,n,i){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}" ]
[ "0.569646", "0.5602836", "0.5485706", "0.5483454", "0.54334605", "0.5425114", "0.53979206", "0.5360927", "0.5345566", "0.53444153", "0.53362715", "0.532879", "0.532264", "0.5315222", "0.53151643", "0.53082275", "0.5304127", "0.53021896", "0.52902585", "0.5288144", "0.52878326", "0.5279037", "0.52695435", "0.5255247", "0.5254602", "0.52359223", "0.5224618", "0.5220886", "0.52203554", "0.5219744", "0.5214522", "0.52095026", "0.5199392", "0.5188816", "0.51868844", "0.5185961", "0.5183108", "0.5182376", "0.51806355", "0.5176397", "0.5173298", "0.5173298", "0.5172182", "0.5166962", "0.51665246", "0.5165751", "0.5160335", "0.5159266", "0.5159047", "0.5159047", "0.51558644", "0.51546985", "0.51546985", "0.51546985", "0.51546985", "0.51546985", "0.51546985", "0.51546985", "0.51546985", "0.51546985", "0.51546985", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.51542115", "0.5151395", "0.51513106", "0.5148722", "0.5148722", "0.51485264", "0.5146741", "0.5141584", "0.51314425", "0.51257783", "0.51255953", "0.5121815", "0.5110826", "0.51096874", "0.51096874", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336", "0.5102336" ]
0.0
-1
Build a query by user id
function userIdQuery(user) { return { userId: user.userId }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserQuery(userId) {\n let query = {};\n if(userId) {\n if (userId.match(/^[0-9a-fA-F]{24}$/)) {\n query = { _id: userId }\n } else {\n query = { username: userId }\n }\n }\n\n return query;\n}", "function getUserByIdQuery(_id) {\n return User.findById(_id);\n}", "function SelectUser(userID) {\n let query = {\n text: `SELECT * FROM ${userDb} WHERE discord_id = $1`,\n values: [userID]\n };\n return query;\n}", "function buildQuery(u,s){\n // TODO: add cooky user\n return {\"query\": {\n\t\"bool\": {\n\t \"must\": [\n\t\t{\"match\": {\n\t\t \"user_id\": u\n\t\t}},\n\t {\"exists\":{\"field\":\"resource\"}}\n\t\t]\n\t}\n },\n \"size\": s,\n \"sort\": [{\"date\": \"desc\"}]\n\t } \n}", "getUmpireUsingId(id) {\r\n let sql_getUmpire = `SELECT A.id, A.user_id, B.full_name \r\n FROM umpire_tb A\r\n INNER JOIN user_tb B\r\n ON (A.user_id = B.id)\r\n WHERE A.id = ${id}`;\r\n let result = this.apdao.all(sql_getUmpire);\r\n return result;\r\n }", "function getUser(id) {\n\t\tvar query = User.findOne({'_id': id});\n\t\treturn query;\n\t}", "function getUserById(userid) {\n}", "getUserQueryBuilder() {\n return this.getQueryClient().from(this.config.usersTable);\n }", "getUserById(id) {\r\n return new SiteUser(this, `getUserById(${id})`);\r\n }", "user(_, { id }) {\n return User.find(id);\n }", "function getByIdWithUser(id) {\n\t\treturn TokenFactory.query('SELECT * FROM `token` t JOIN `user` u ON t.`userid` = u.`id` WHERE t.`id` = ' + parseInt(id, 10) + ';');\n\t}", "function getApplicationQuery(id){\n\n const REV_QUERY = gql`\n {\n applicationById(id: \"${id}\") {\n applicant {\n id\n name\n }\n professor {\n id\n name\n }\n dateSubmitted\n areasOfResearch\n resumeDocumentId\n diplomaDocumentId\n auditDocumentId\n reviews {\n id\n title\n dateSubmitted\n ranking\n body\n }\n }\n }\n\n `;\n\n return REV_QUERY;\n}", "async function getUserById(id) {\n try {\n const {\n rows: [user],\n } = await client.query(\n `\n SELECT *\n FROM users\n WHERE id=$1;\n `,\n [id]\n );\n\n //get orders for user\n const orders = await getAllOrdersByUserId({ id });\n if (orders.length != 0) {\n user.orders = orders;\n }\n\n\n\n //get reviews for user\n const reviews = await getAllReviewsByUserId({ id });\n if (reviews.length != 0) {\n user.reviews = reviews;\n }\n\n return user;\n } catch (error) {\n throw error;\n }\n}", "function dbSearchUser(userId, query, page, limit, searchKey) {\n var followingUsers, followingIds, postResult, authedUser, searchUserRequest;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function dbSearchUser$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"select\"])(_store_reducers_circles_circleSelector__WEBPACK_IMPORTED_MODULE_13__[\"circleSelector\"].getFollowingUsers);\n\n case 2:\n followingUsers = _context3.sent;\n followingIds = followingUsers.keySeq().map(function (key) {\n return \"userId:\".concat(key);\n }).toArray();\n followingIds.push(\"userId:\".concat(userId));\n _context3.next = 7;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"put\"])(_store_actions_globalActions__WEBPACK_IMPORTED_MODULE_8__[\"showTopLoading\"]());\n\n case 7:\n _context3.prev = 7;\n _context3.next = 10;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"call\"])(userService.searchUser, query, \"NOT userId:\".concat(userId), page, limit, searchKey);\n\n case 10:\n postResult = _context3.sent;\n\n if (postResult.hasMore) {\n _context3.next = 14;\n break;\n }\n\n _context3.next = 14;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"put\"])(_store_actions_userActions__WEBPACK_IMPORTED_MODULE_11__[\"notMoreSearchPeople\"]());\n\n case 14:\n _context3.next = 16;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"select\"])(_store_reducers_authorize__WEBPACK_IMPORTED_MODULE_12__[\"authorizeSelector\"].getAuthedUser);\n\n case 16:\n authedUser = _context3.sent;\n searchUserRequest = _api_UserAPI__WEBPACK_IMPORTED_MODULE_2__[\"UserAPI\"].createUserSearchRequest(authedUser.get('uid'));\n searchUserRequest.status = _store_actions_serverRequestStatusType__WEBPACK_IMPORTED_MODULE_10__[\"ServerRequestStatusType\"].OK;\n _context3.next = 21;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"put\"])(_store_actions_serverActions__WEBPACK_IMPORTED_MODULE_9__[\"sendRequest\"](searchUserRequest));\n\n case 21:\n _context3.next = 23;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"put\"])(_store_actions_userActions__WEBPACK_IMPORTED_MODULE_11__[\"addPeopleInfo\"](postResult.users));\n\n case 23:\n _context3.next = 25;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"put\"])(_store_actions_userActions__WEBPACK_IMPORTED_MODULE_11__[\"addUserSearch\"](postResult.ids, page === 0));\n\n case 25:\n _context3.next = 33;\n break;\n\n case 27:\n _context3.prev = 27;\n _context3.t0 = _context3[\"catch\"](7);\n _context3.next = 31;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"put\"])(_store_actions_globalActions__WEBPACK_IMPORTED_MODULE_8__[\"showMessage\"](_context3.t0.message));\n\n case 31:\n _context3.next = 33;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"put\"])(_store_actions_userActions__WEBPACK_IMPORTED_MODULE_11__[\"notMoreSearchPeople\"]());\n\n case 33:\n _context3.prev = 33;\n _context3.next = 36;\n return Object(redux_saga_effects__WEBPACK_IMPORTED_MODULE_6__[\"put\"])(_store_actions_globalActions__WEBPACK_IMPORTED_MODULE_8__[\"hideTopLoading\"]());\n\n case 36:\n return _context3.finish(33);\n\n case 37:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _marked3, null, [[7, 27, 33, 37]]);\n}", "getUserId(username: string, callback: (number, {}) => mixed) {\n super.query(\n 'select id from User where username = ?',\n [username],\n callback\n );\n }", "getUserById(db, userId) {\n return db('users').select('*').where('id', userId).first();\n }", "function createUserQuery(key, val){\n\tvar queryArr = _.map(val.split(' '), function (q) {\n var queryObj = {};\n queryObj[key] = new RegExp(escapeRegExp(q), 'i');\n return queryObj;\n });\n var find = {$or: queryArr};\n\treturn User.find(find, {email:1, name:1, username:1}); // find and delete using id field\n}", "fetchQuizzesMadeByUserId ({ commit }, payload) {\n db.collection('quizzes')\n .where('createdBy', '==', payload.userId)\n .where('isDeleted', '==', false)\n .orderBy('created', 'desc')\n .onSnapshot(snap => {\n commit('SAVE_QUIZZES_MADE_BY_USER', snap.docs.map(doc => {\n let result = doc.data();\n result.id = doc.id;\n return result;\n }));\n });\n }", "static getIdQuery(id, idField) {\n const query = {};\n query[idField] = id;\n return query;\n }", "users(parent, args, {prisma}, info) {\n const opArgs = {\n skip: args.skip,\n first: args.first,\n orderBy: args.orderBy,\n after: args.after, \n };\n if(args.query){\n opArgs.where={\n OR:[\n {\n name_contains: args.query\n },\n {\n id: args.query\n },\n {\n email: args.query\n }\n ]\n }\n } \n return prisma.query.users(opArgs, info);\n }", "async getUserById(userId) {\n return db.oneOrNone('select * from users where user_id = $1', userId)\n }", "getUser(_, { id }) {\n return db.user.findById(id);\n }", "function buildQuery() {\n let q = {\n \"query\": query, // the query\n \"max_results\": 100, // max results per request, 100 is the maximum for standard licenses in sandboxed environments \n \"expansions\": \"geo.place_id\", // whenever a tweet has geographical information in the form a of place_id, get more info on that place_id\n \"tweet.fields\": \"author_id,created_at,geo\", // by default the Tweet id and and the text are returned, but here we're also including the author_id, the time of publishing, and its geographical features\n \"place.fields\": \"geo,name,full_name,place_type\" // the additional information associated with a place_id, namely its name and a geo object with geographical coordinates, either in the form of a point or a bounding box\n };\n // the nextToken paramenter is optional (as there is none in the first request\n // but if a nextToken was passed, then it inserts it into the query object\n if(nextToken !== undefined) q[\"next_token\"] = nextToken;\n return q;\n }", "static build({ params: { include, exclude }, user }) {\n\t\tconst { defaultTypes, operators } = this;\n\t\tconst includeTagsOperator = include.tagsExclusive ? Op.and : Op.or;\n\t\tconst includeParamsOperator = include.paramsExclusive ? Op.and : Op.or;\n\t\tconst excludeTagsOperator = exclude.tagsExclusive ? Op.and : Op.or;\n\t\tconst excludeParamsOperator = exclude.paramsExclusive ? Op.and : Op.or;\n\t\tconst includeTagsAndParamsOperator = Op.and;\n\t\t\n\t\tconst includeQuery = {\n\t\t\t[includeTagsAndParamsOperator]: {}\n\t\t};\n\n\t\tif (!Object.keys(include.params).length && !Object.keys(include.tags).length && !Object.keys(exclude.tags).length) {\n\t\t\treturn {\n\t\t\t\tuserId: user.id\n\t\t\t};\n\t\t}\n\n\t\tif (Object.keys(include.params).length) {\n\t\t\tincludeQuery[includeTagsAndParamsOperator][includeParamsOperator] = {}\n\t\t};\n\n\t\tif (Object.keys(include.tags).length){\n\t\t\tincludeQuery[includeTagsAndParamsOperator].tags = {\n\t\t\t\t[includeTagsOperator]: {}\n\t\t\t};\n\t\t};\n\n\t\tfor (let param in include.params) {\n\t\t\tconst { type, value0, value1 } = include.params[param];\n\t\t\tconst defaultValue = defaultTypes.find(type => new RegExp(`^${param}$`, 'i').test(type.tagName));\n\n\t\t\tconst { operator, getValue } = operators[type];\n\t\t\tif (defaultValue) {\n\t\t\t\tincludeQuery[includeTagsAndParamsOperator][includeParamsOperator][defaultValue.dbName] = {\n\t\t\t\t\t[operator]: getValue(value0, value1)\n\t\t\t\t};\n\t\t\t} else{\n\t\t\t\tif (!includeQuery[includeTagsAndParamsOperator].tags) {\n\t\t\t\t\tincludeQuery[includeTagsAndParamsOperator].tags = {\n\t\t\t\t\t\t[includeParamsOperator]: {}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tincludeQuery[includeTagsAndParamsOperator].tags[includeParamsOperator][param] = {\n\t\t\t\t\tnumericValue: {\n\t\t\t\t\t\t[operator]: getValue(value0, value1)\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tfor (let tag in include.tags) {\n\t\t\tincludeQuery[includeTagsAndParamsOperator].tags[includeTagsOperator][tag] = {\n\t\t\t\tboolValue: true\n\t\t\t};\n\t\t};\n\n\t\tconst query = {\n\t\t\t[Op.and]: {\n\t\t\t\tuserId: user.id,\n\t\t\t\t...includeQuery\n\t\t\t}\n\t\t};\n\n\t\treturn query;\n\t}", "getFullUserById(db, id) {\n let userNotFound = false;\n let user;\n let blogPosts = [];\n let comments = [];\n return usersService.getUserById(db, id)\n .then((result) => {\n if (!result) {\n userNotFound = true;\n return;\n }\n\n user = result;\n })\n .then(() => {\n if (userNotFound) {\n return;\n }\n\n return db.select('*').from('blog_posts').where('author_id', user.id);\n })\n .then((results) => {\n if (userNotFound) {\n return;\n }\n\n blogPosts = results;\n })\n .then(() => {\n if (userNotFound) {\n return;\n }\n\n return db.select('*').from('comments').where('creator_id', user.id);\n })\n .then((results) => {\n if (userNotFound) {\n return;\n }\n\n comments = results;\n return {\n ...user,\n blogPosts,\n comments\n };\n })\n }", "function getUserById(userId){\n return db.one(`\n SELECT * FROM users\n WHERE id = $1\n `, userId)\n .then(user => {\n return user;\n })\n .catch((e) => {\n console.log(e)\n })\n}", "static findAllRequestOfUser(userId) {\n return db.execute(`SELECT * FROM bookings WHERE itemId IN (SELECT id FROM items WHERE ownerId = '${userId}') ORDER BY id DESC;`);\n }", "getPlayerUsingId(id) {\r\n let sql_getPlayer = `SELECT A.id, A.first_name, A.last_name, A.middle_name, A.full_name, \r\n A.email_id, A.phone_no contact_no, B.team_name, C.id umpire_id, A.role_id\r\n FROM user_tb A \r\n LEFT JOIN team_tb B ON (A.team_id = B.id) \r\n LEFT JOIN umpire_tb C ON (A.id = C.user_id) \r\n WHERE A.id = ${id}`;\r\n let result = this.apdao.all(sql_getPlayer);\r\n return result;\r\n }", "getUserById(userId) { //singleton!\n\t\treturn this._getSingleObject(\n\t\t\t(\n\t\t\t\t'SELECT * FROM USERS u ' + \n\t\t\t\t'WHERE u.user_id = :id'\n\t\t\t), \n\t\t\t{\n\t\t\t\tid: userId\n\t\t\t}\n\t\t);\n\t}", "async getUserbyId(id) {\n try {\n const sql = mysql.format(\"SELECT id, username, email, register_date FROM User WHERE id=?\", [id]);\n const res = await query(sql);\n return res;\n } catch (error) {\n return error;\n }\n }", "function getUser() {\r\n let query = `query getAllUser {\r\n users {\r\n fullname\r\n email\r\n role\r\n authority {\r\n user {\r\n read\r\n create\r\n update\r\n delete\r\n }\r\n api {\r\n user\r\n blog\r\n commerce\r\n consult\r\n supply\r\n report\r\n }\r\n }\r\n }\r\n }`;\r\n\r\n fetch(address + ':3000/graphql', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json',\r\n },\r\n body: JSON.stringify({\r\n query,\r\n variables: {},\r\n })\r\n }).then(r => r.json()).then(function(data) {\r\n for(let i = 0; i < data.data.users.length; i++) {\r\n \r\n let fullname = data.data.users[i].fullname;\r\n let email = data.data.users[i].email;\r\n let role = data.data.users[i].role;\r\n\r\n $('#tableUser tbody').append('<tr class=\"tr_data\">'+\r\n '<td>'+(i+1)+'</td>'+\r\n '<td>'+fullname+'</td>'+\r\n '<td>'+email+'</td>'+\r\n '<td>'+role+'</td>'+\r\n '<td><button class=\"btn btn-warning\" id=\"update\" name =\"'+email+'\" onclick=\"manageUser(this.id, this.name)\">Update</button>'+\r\n '<button class=\"btn btn-danger\" id=\"delete\" name=\"'+email+'\" onclick=\"manageUser(this.id, this.name)\">Delete</button></td>'+\r\n '</tr>');\r\n }\r\n });\r\n}", "function getUserById(id) {\n return getUserByProperty('id', id);\n}", "getAll(req, res, next) {\n let userId = req.query.user_id ? req.query.user_id : null;\n let query = {};\n\n if (userId) {\n query = {\n [Op.or]: [{ fromId: userId }, { toId: userId }]\n };\n }\n\n ActivitiesService.getAll(query)\n .then(function (activities) {\n res.status(200).json(activities);\n }).catch(function (error) {\n });\n }", "function searchSwipes(userId) {\n console.log('id', userId)\n return new Promise((resolve, reject) => {\n const sql = \"SELECT * FROM [swipes] where userId = @userId\";\n const request = new Request(sql, (err, rowcount) => {\n if (err) {\n reject(err);\n console.log(err);\n } else if (rowcount == 0) {\n reject({ message: \"data not exist\" });\n }\n });\n\n if (userId) {\n request.addParameter(\"userId\", TYPES.Int, userId);\n }\n\n _rows = [];\n request.on(\"row\", (columns) => {\n const selectedUser = {};\n console.log('columns', columns.length);\n columns.map(({ value, metadata }) => {\n selectedUser[metadata.colName] = value;\n });\n _rows.push(selectedUser);\n });\n\n // We return the set of rows after the query is complete, instead of returing row by row\n request.on(\"doneInProc\", (rowCount, more, rows) => {\n resolve(_rows);\n });\n\n connection.execSql(request);\n });\n}", "fetchQuizzesPlayedByUserId ({ commit }, payload) {\n db.collection('quizzes')\n .where('playedBy', 'array-contains', payload.userId)\n .onSnapshot(snap => {\n commit('SAVE_QUIZZES_PLAYED_BY_USER', snap.docs.map(doc => {\n let result = doc.data();\n result.id = doc.id;\n return result;\n }));\n });\n }", "account(id) {\n let query = `\n query ($id: String!) {\n actor(id:$id) {\n id, name, address\n }\n }\n `\n return this.query(query, { id })\n }", "function get(id_user, timestamp) {\n let query = `select message.* from participant join message on\n participant.id_conversation = message.id_conversation where\n participant.id_user = ${id_user}`;\n if (timestamp != null) {\n query += ` and message.timestamp > '${timestamp}'`;\n }\n return executeQuery(query);\n}", "function findByUserId(id) {\n return db('comments')\n .where({ 'comments.user_id':id })\n}", "resolve(parentValue, args){ // this function is used to query our database and find the user we are looking for\n // where the user's id will be give in the variable args.\n return axios.get(`${JSON_SERVER}/users/${args.id}`)\n .then( response => response.data)\n .catch( console.error) //walk through users, find a user who's value matches args.id\n }", "function build_query(id, form, originalData, user) {\n let sql = '';\n // let now_string = \"(now() at time zone 'utc')\";\n let insert_str = ''; // Contains the string for the INSERT in the sql. Keys.\n let value_str = ''; // Contains the Parameterized string for the VALUES in the sql\n let values = []; // Array of values to insert into table\n\n // Inserting businessID first\n insert_str += 'business_id,';\n value_str += '$1,';\n values.push(id);\n\n // Create GEOM\n let geom = \"'SRID=26918;POINT(0 0)'\";\n if (form['LATITUDE_1'] && form['LONGITUDE_1']) {\n geom = `(ST_Transform(ST_SetSRID(ST_MakePoint($2, $3), 4326),26918))`;\n values.push(form['LONGITUDE_1']);\n values.push(form['LATITUDE_1']);\n }\n\n // For HSTORE fields in audit table\n let originalTableColumns = {};\n // Format the key to have the same name as the column names.\n for(const r in originalData){\n let key = column[r];\n if(!key) continue;\n originalTableColumns[key] = originalData[r];\n }\n originalTableColumns['alias'] = originalData['alias'];\n\n let row_data = `('${hstore.stringify(originalTableColumns)}'::hstore)`;\n let changed_fields = `('${hstore.stringify(form)}'::hstore - ${row_data}) - '{comment}'::text[]`;\n\n // Owner of submit\n form['by'] = user.email;\n form['by_id'] = user.id;\n form['last_modified_by'] = user.email;\n form['last_modified_by_id'] = user.id;\n\n let key_arr = Object.keys(form);\n let j = values.length + 1;\n for (let i = 0; i < key_arr.length; i++) {\n let k = key_arr[i];\n if (k === 'id') continue;\n if (form[k]) {\n insert_str += `\"${k}\",`;\n value_str += `$${j++},`;\n values.push(form[k]);\n }\n }\n insert_str = insert_str.slice(0, -1);\n value_str = value_str.slice(0, -1);\n\n sql += `\n INSERT INTO ${table.edit}(geom,row_data,changed_fields,${insert_str})\n VALUES (${geom},${row_data},${changed_fields},${value_str});\n `;\n return [sql, values];\n }", "function getUsers(query) {\n if ($scope.data.ACL.users.length) {\n var args = {\n options: {\n classUid: 'built_io_application_user',\n query: query\n }\n }\n return builtDataService.Objects.getAll(args)\n } else\n return $q.reject({});\n }", "function queryGen(req){\n\tlet q = {\n\t\tauthenticationNetworkId: req.user.network_id\n\t};\n\t\n\tlet categId = req.query.categoryId;\n\tif(categId){\n\t\tq.categoryId = categId;\n\t}\n\n\t\n\tlet minAmount = req.query.minAmount;\n\tif(minAmount){\n\t\tif(!q.amount) q.amount = {};\n\t\tq.amount[Op.gte] = minAmount;\n\t}\n\n\tlet maxAmount = req.query.maxAmount;\n\tif(maxAmount){\n\t\tif(!q.amount) q.amount = {};\n\t\tq.amount[Op.lte] = maxAmount;\n\t}\n\n\tlet tags = req.query.tags;\n\tif(tags){\n\t\tq.tags = tags\n\t}\n\n\t\n\tlet minDate = req.query.minDate;\n\tif(minDate){\n\t\tif(!q.date) q.date = {};\n\t\tq.date[Op.gte] = new Date(minDate);\n\t}\n\n\tlet maxDate = req.query.maxDate;\n\tif(maxDate){\n\t\tif(!q.date) q.date = {};\n\t\tq.date[Op.lte] = new Date(maxDate);\n\t}\n\n\tlet date = req.query.date;\n\tif(date){\n\t\tq.date = date;\n\t}\n\n\tlet expense = req.query.expense;\n\tif(expense){\n\t\tq.expense = expense;\n\t}\n\n\treturn q;\n}", "static getByUserId(id) {\n return db\n .manyOrNone('SELECT * FROM shopping_carts WHERE user_id = $1', [id])\n .then((shoppingCarts) => {\n if (shoppingCarts){\n return shoppingCarts.map((shoppingCart) => {\n return new this(shoppingCart);\n }); \n } \n throw new Error(` User ${id} not found`);\n });\n }", "async queryStudent(ctx, id) {\n const userKey = User.makeKey([id]);\n const user = await ctx.studentList.getUser(userKey);\n if (!user) {\n throw new Error('Can not found User = ' + userKey);\n }\n\n return user;\n }", "function buildQuery(intention, params) {\n \n const {userId, universeId, title, chatId, offset, atoms, content, name, description, previewType, previewContent, pseudo, email, passwordHash, ip, picture, url} = \n typeof params === 'object' && !Array.isArray(params) ? params : {};\n \n // define the maximum number of message to load\n const nbrChatMessages = 30;\n \n let sql, callback, paramaterized;\n \n switch (intention) {\n \n \n case 'readUniverses':\n \n sql = \n 'SELECT ' + \n 'id, name, description, picture, chat_id \"chatId\", rules ' +\n 'FROM ' + \n 'aquest_schema.universe';\n \n break;\n \n \n case 'readUniverse':\n \n sql = \n 'SELECT ' + \n 'id, name, description, picture, chat_id \"chatId\" ' +\n 'FROM ' +\n 'aquest_schema.universe ' +\n 'WHERE ' +\n 'id = $1';\n \n paramaterized = [params];\n callback = rows => rows[0] || {id: params, notFound: true};\n \n break;\n \n \n case 'readUniverseWithTopics':\n \n sql =\n 'SELECT ' + \n 'aquest_schema.concat_json_object(' +\n 'to_json(universe),' +\n `json_build_object('topics',` +\n 'array_agg(' + \n 'json_build_object(' +\n `'id',topics.id,` +\n `'title',topics.title,` +\n `'universeId',topics.universe_id,` +\n `'author',topics.user_id,` +\n `'timestamp',topics.updated_at,` +\n `'chatId',topics.chat_id` +\n ')' + \n ')' +\n ')' +\n ') as \"UniverseWithTopics\"' + \n 'FROM (' +\n 'SELECT ' + \n 'universe, topic.* ' +\n 'FROM' + \n '(SELECT universe.id, universe.name, universe.description, universe.picture, universe.chat_id \"chatId\" FROM aquest_schema.universe WHERE universe.id = $1) universe ' + \n 'LEFT JOIN aquest_schema.topic ON universe.id = topic.universe_id ' +\n ') topics GROUP BY universe';\n \n paramaterized = [params];\n callback = rows => rows[0].UniverseWithTopics;\n \n break;\n \n \n case 'readChatOffset':\n \n sql = \n 'SELECT ' +\n 'json_build_object(' + \n `'id', chat.id,` + \n `'name', chat.name,` + \n `'messages', array_agg(` + \n 'json_build_object(' + \n `'id', atommessage.id,` +\n `'userId', aquest_user.id,` + \n `'type', atommessage.type,` +\n `'content', atommessage.content,` +\n `'createdAt', atommessage.created_at` +\n ')' + \n ')' + \n ') as chat ' +\n 'FROM ' +\n 'aquest_schema.chat ' +\n `LEFT JOIN (SELECT * FROM (SELECT * from aquest_schema.atommessage ORDER BY id DESC OFFSET $2 LIMIT ${nbrChatMessages}) atommessagedesc ORDER BY id ASC) AS atommessage ON chat.id = atommessage.chat_id ` +\n 'LEFT JOIN aquest_schema.user aquest_user ON atommessage.user_id = aquest_user.id ' +\n 'WHERE chat.id = $1 GROUP BY chat.id';\n \n paramaterized = [chatId, offset];\n \n callback = rows => {\n const chat = rows[0] ? rows[0].chat : {\n id: chatId,\n notFound: true,\n };\n \n if (chat.messages && !chat.messages[0].content) chat.messages = [];\n \n return chat;\n };\n \n break;\n \n case 'readChat':\n \n sql = \n 'SELECT ' +\n 'json_build_object(' + \n `'id', chat.id,` + \n `'name', chat.name,` + \n `'firstMessageId', (SELECT id FROM aquest_schema.atommessage WHERE atommessage.chat_id = $1 ORDER BY id ASC LIMIT 1),` +\n `'messages', array_agg(` + \n 'json_build_object(' + \n `'id', atommessage.id,` +\n `'userId', aquest_user.id,` + \n `'type', atommessage.type,` +\n `'content', atommessage.content,` +\n `'createdAt', atommessage.created_at` +\n ')' + \n ')' +\n ') as chat ' +\n 'FROM ' +\n 'aquest_schema.chat ' +\n `LEFT JOIN (SELECT * FROM (SELECT * from aquest_schema.atommessage ORDER BY id DESC LIMIT ${nbrChatMessages}) atommessagedesc ORDER BY id ASC) AS atommessage ON chat.id = atommessage.chat_id ` +\n 'LEFT JOIN aquest_schema.user aquest_user ON atommessage.user_id = aquest_user.id ' +\n 'WHERE chat.id = $1 GROUP BY chat.id';\n \n paramaterized = [params];\n \n callback = rows => {\n const chat = rows[0] ? rows[0].chat : {\n id: chatId,\n notFound: true,\n };\n \n if (chat.messages && !chat.messages[0].content) chat.messages = [];\n \n return chat;\n };\n \n break;\n \n \n case 'readInventory':\n \n sql =\n 'SELECT ' + \n `id, title, universe_id \"universeId\", user_id \"userId\", preview_type \"previewType\", preview_content \"previewContent\", COALESCE(to_char(created_at, 'MM-DD-YYYY HH24:MI:SS'), '') \"createdAt\", chat_id \"chatId\" ` +\n 'FROM ' + \n 'aquest_schema.topic ' +\n 'WHERE ' + \n 'topic.universe_id = $1';\n \n paramaterized = [params];\n \n break; \n \n \n case 'readTopic':\n \n sql =\n 'SELECT json_build_object(' +\n `'id', topic.id,` +\n `'userId', topic.user_id,` +\n `'chatId', topic.chat_id,` +\n `'universeId', topic.universe_id,` +\n `'title', topic.title,` +\n `'previewContent', topic.preview_content,` +\n `'previewType', topic.preview_type,` +\n `'createdAt', COALESCE(to_char(topic.created_at, 'MM-DD-YYYY HH24:MI:SS'), ''),` +\n `'atoms', atomtopic.atoms` +\n ') as topic ' +\n 'FROM aquest_schema.topic ' +\n 'LEFT JOIN ' +\n '(SELECT ' +\n 'atomtopic.topic_id, ' +\n 'array_agg(' +\n 'json_build_object(' +\n `'type', atomtopic.type,` +\n `'content', atomtopic.content` +\n ') ' +\n 'ORDER BY atomtopic.position ' +\n ') as atoms ' +\n 'FROM aquest_schema.atomtopic ' +\n 'GROUP BY atomtopic.topic_id' +\n ') as atomtopic ' +\n 'ON topic.id = atomtopic.topic_id ' +\n 'WHERE topic.id = $1';\n \n paramaterized = [params];\n callback = rows => rows[0] ? rows[0].topic : {id: params, notFound: true};\n \n break;\n \n \n case 'readTopicAtoms':\n \n sql =\n 'SELECT ' +\n 'type, content ' +\n 'FROM ' +\n 'aquest_schema.atomtopic ' +\n 'WHERE ' +\n 'atomtopic.topic_id = $1 ' + \n 'ORDER BY ' + \n 'atomtopic.position';\n \n paramaterized = [params];\n \n break;\n \n \n case 'createMessage':\n // atomTopicId, content, ordered, deleted, topicId, atomId\n \n sql = \n 'INSERT INTO aquest_schema.atommessage ' +\n '(chat_id, user_id, type, content) ' +\n 'VALUES' +\n '($1, $2, $3, $4) ' +\n \"RETURNING json_build_object('id', id, 'chatId', chat_id, 'type', type, 'content', content) AS message\";\n \n paramaterized = [chatId, userId, 'text', JSON.stringify(content)];\n callback = rows => rows[0].message;\n \n break;\n \n \n case 'createUniverse':\n \n sql = \n 'INSERT INTO aquest_schema.universe ' +\n '(name, user_id, description, picture, creation_ip) ' +\n 'VALUES ' +\n '($1, $2, $3, $4, $5) ' +\n `RETURNING json_build_object('id', id, 'chatId', chat_id, 'name', name, 'description', description, 'picture', picture, 'rules', rules) AS universe`;\n \n paramaterized = [name, userId, description, picture, ip];\n callback = rows => rows[0].universe;\n \n break;\n \n \n case 'createTopic':\n \n sql = \n 'SELECT ' + \n 'aquest_schema.create_topic($1, $2, $3, $4, $5, $6) ' +\n 'AS topic';\n \n paramaterized = [userId, universeId, title, previewType, JSON.stringify(previewContent), JSON.stringify(atoms)];\n callback = rows => rows[0].topic;\n \n break;\n \n \n case 'createUser':\n \n sql = \n 'INSERT INTO aquest_schema.\"user\" ' +\n '(id, email, password_hash, creation_ip, picture) ' +\n 'VALUES ' +\n '($1, $2, $3, $4, $5)' +\n \"RETURNING json_build_object('id', id, 'email', email, 'picture', picture) AS user\";\n \n paramaterized = [pseudo, email, passwordHash, ip, picture];\n callback = rows => rows[0].user;\n \n break;\n \n \n case 'login':\n \n sql = \n 'SELECT ' +\n 'id, email, bio, first_name \"firstName\", last_name \"lastName\", picture, password_hash \"passwordHash\"' +\n 'FROM aquest_schema.\"user\" ' +\n `WHERE \"user\".id = '${email}' OR \"user\".email = '${email}' LIMIT 1`;\n \n callback = rows => rows[0];\n \n break;\n \n case 'createFile':\n sql = \n 'INSERT INTO aquest_schema.file ' +\n '(user_id, name, url, creation_ip) ' +\n 'VALUES ' +\n '($1, $2, $3, $4)';\n \n paramaterized = [userId, name, url, ip];\n callback = rows => rows[0];\n \n break;\n \n case 'randomRow':\n \n sql = `SELECT * FROM aquest_schema.${params} ORDER BY RANDOM() LIMIT 1`;\n \n callback = rows => rows[0];\n \n break;\n }\n \n return {sql, callback, paramaterized};\n }", "function getAll(id) {\n return db('people').where({'user_id': id});\n}", "users(parent, args, { db }, info) {\n\n // no query: return all users\n if (!args.query) {\n return db.users;\n }\n\n // query: search for matches of query string with the user name and return filtered array\n return db.users.filter(user => user.name.toLowerCase().includes(args.query.toLowerCase()));\n\n }", "async getUserById(id){\n let users = await db.query('SELECT id, name, email FROM users WHERE id = ?', id);\n\n return users[0];\n }", "getUserOrgs(userId) {\n return knex.select('org.id', 'org.name')\n .from('organization_users as ou')\n .innerJoin('organizations as org', 'ou.organization_id', 'org.id')\n .join('organization_packets as op', function() {\n this.on('op.organization_id', '=', 'org.id')\n .andOn(knex.raw('op.end_date is null'))\n .andOn(knex.raw('org.deleted_at is null'))\n })\n .where({user_id: userId})\n .andWhere(knex.raw('org.deleted_at is null'));\n }", "getUsersConversations(db, user_id) {\n return db\n .from('conversation AS con')\n .select(\n 'con.id',\n 'con.user_1',\n 'con.user_2',\n 'con.date_created',\n 'con.is_active',\n 'con.user_1_turn',\n 'con.user_2_turn',\n )\n .where({\n 'con.user_1': user_id,\n 'con.is_active': true\n })\n .orWhere({\n 'con.user_2': user_id,\n 'con.is_active': true\n })\n }", "static getById(userId) {\n const query = 'SELECT * FROM Members WHERE id = $1 LIMIT 1';\n return db.one(query, [userId]).then(data => {\n return new User(data);\n }).catch(err => {\n console.error(err);\n console.error(`Couldn\\'t get user ${userId}.`);\n return null;\n });\n }", "static getAll(userId) {\n const query = 'SELECT user_level FROM Members WHERE id = $1';\n return db.one(query, userId).then(() => {\n const query = 'SELECT * FROM MEMBERS WHERE id != $1';\n return db.any(query, userId);\n });\n }", "function getAllCommentsUserId(userId){\n db.many(`\n SELECT * FROM comments\n WHERE id = $1\n `, userId)\n .then((comments) =>{\n const user = getUserById(userId)\n user.then((theUser) =>{\n comments.forEach((comment)=>{\n console.log(`${theUser.id} made the comment ${comment.comment}`)\n })\n })\n })\n .catch((e)=>{\n console.log(e)\n })\n\n}", "getUserByID(userid, cb) {\n\t\tvar query = {\n\t\t\t_id: global.dbController.convertIdToObjectID(userid)\n\t\t}\n\t\tthis.getUserDetails(query, cb)\n\t}", "static getUserById(_id){\n return axios.get(`${baseUrl}${uniqUser}?_id=${_id}`)\n .then(function(res){\n return res\n }).catch((err) =>{\n throw(err)\n })\n }", "function getSurveyResultByUser(page, userId, surveyId){\n\tvar queryJson = {\n 'fields': [\n 'surveyId',\n 'userId'\n ],\n 'size': 1,\n 'query': {\n 'bool': {\n 'must': [\n { 'type': { 'value': RECORD_TYPES.SUBMIT } },\n { 'term': { 'surveyId': surveyId } },\n { 'term': { 'userId': userId } }\n ]\n }\n }\n };\n var result = doDBSearch(page, queryJson);\n log.info('getSurveyResultByUser {}', result);\n return result;\n}", "function getPostsByUserId(userId) {\n//1. Get the user\n//2. Get their posts\n db.many(`\n select * from posts\n where user_id = $1\n ;\n `, userId)\n .then(posts => {\n const userPromise = getUserById(userId);\n console.log(userPromise);\n userPromise.then(theUser => {\n // console.log(theUser);\n posts.forEach(post => {\n console.log(`${post.id}: ${post.url}`);\n })\n })\n})\n .catch(e => {\n console.log(e);\n })\n //and return it all together\n}", "queryUsers(params) {\n return axios.get('/user/query', {\n params: params\n }).then(ret => {\n return ret.data;\n });\n }", "function getUserById(userid) {\n return new Promise((fulfill, reject) => {\n if (!userid) {\n reject(\"user error\");\n }\n Promise.using(dbConn.get(), (conn) => {\n const query = `\n SELECT * FROM users\n WHERE id = ?\n `\n return conn.query(query, [userid]);\n })\n .then((result) => { \n const user = result[0];\n if (!user) {\n reject(\"could not find user\");\n }\n const apiResult = {id: user.id, username: user.username, firstname: user.firstname, lastname: user.lastname, email: user.email, admin: user.admin}\n fulfill(apiResult);\n })\n .catch((err) => {\n reject(\"User error\");\n })\n })\n}", "checkExistingQuery () {\n\t\t// allow faux users to create a user (even if their email matches)\n\t\tif (!this.attributes.email || (this.options && this.options.externalUserId)) return undefined;\n\n\t\t// look for matching email (case-insensitive)\n\t\treturn {\n\t\t\tquery: {\n\t\t\t\tsearchableEmail: this.attributes.email.toLowerCase()\n\t\t\t},\n\t\t\thint: Indexes.bySearchableEmail\n\t\t};\n\t}", "oneShop(_,args) {return queryOneShop(args.id)}", "async function searchWinesByUserId(user_id, searchText) {\n try {\n const MyWineSearch = await db.any(` select * from wines\n where (wine_name ILIKE '%$2#%' \n or wine_type ilike '%$2#%'\n or wine_store ilike '%$2#%'\n or comments ilike '%$2#%')\n and user_id=$1\n `, [user_id, searchText]);\n return MyWineSearch;\n } catch (err) {\n return [];\n }\n}", "function procesa() {\n\n var params = getSearchParameters();\n var id = params.id;\n myUser = {\n \"id\": id\n\n };\n llenaCasos();\n\n}", "function findUserById(userId) {\n return window.httpGet(`https://openfin.symphony.com/pod/v2/user/?uid=${userId}`);\n }", "getSongsByUser(userAuthAddress) {\n\t\tvar query = `\n\t\tSELECT * FROM songs\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tWHERE directory=\"data/users/${userAuthAddress}\"\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\tconsole.log(query)\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query]);\n\t}", "function getUserId( userName ) {\n\n // We're using SOQL here\n var queryParms = \"q=select%20Id,%20name,%20username%20from%20User%20where%20Alias='\" + encodeURI( userName ) + \"'\";\n console.log(queryParms);\n\n var request = http.request({\n 'endpoint': 'SalesForce',\n 'method': 'GET',\n 'path': '/services/data/v22.0/query/?' + queryParms,\n });\n\n console.log( 'Getting user \"' + userName + '\"' );\n\n var response = request.write();\n var userList = JSON.parse( response.body );\n\n if( userList.totalSize === 0 ){\n return null;\n }\n else\n return userList.records[0].Id;\n\n}", "function getItemByUserId(user_id) {\n return db(\"items\").where({ user_id });\n}", "getUser(userId) {\n userId = this.esc(userId); // escape userId\n return Promise.all([\n `SELECT user.userId, user.username, user.bio FROM user\n WHERE userId = '${userId}' LIMIT 1`,\n `SELECT entity_like.entityId FROM entity_like\n WHERE userId = '${userId}'`,\n `SELECT entity_comment.entityId, entity_comment.content FROM entity_comment\n WHERE userId = '${userId}'`,\n `SELECT user_subscription.targetId, user.username FROM\n user_subscription\n LEFT JOIN user ON user.userId = user_subscription.targetId\n WHERE user_subscription.userId = '${userId}'`,\n `SELECT COUNT(user_subscription.userId) AS subscribers FROM user_subscription\n WHERE user_subscription.targetId = '${userId}'`\n ].map(sql => {return db.query(sql)}))\n .then(rows => {\n // rows[0] = user data\n // rows[1] = likes\n // rows[2] = comments\n // rows[3] = subscriptions\n // rows[4] = subscribers\n\n var ret = rows[0][0]; // note, these are references here\n ret.likes = rows[1].map(like => {\n return like.entityId;\n });\n ret.comments = rows[2];\n ret.subscriptions = rows[3];\n ret.subscribers = rows[4][0].subscribers;\n return ret;\n });\n }", "function findInfoBy(filter) {\n console.log(filter);\n return db(\"users\")\n .select(\"id\", \"username\", \"name\")\n .where(filter)\n .first();\n}", "function createUserQuery(body) {\n return new User(body);\n}", "getPost(_, { id }, { authUser }) {\n const query = {\n where: { id }\n };\n\n if (!authUser) {\n query.where.published = true;\n }\n\n return db.post.findOne(query);\n }", "function userJoins(id, username, room, host){\n const user = {id, username, room, host};\n users.push(user);\n return user;\n}", "function getFullUserDetailsById(req, res) {\r\n var id = req.body.user_id;\r\n var group = req.body.user_group;\r\n var where = '';\r\n if (group && group != 'null' && group != '' && group != undefined) {\r\n where = ` where um.user_group = \"` + group + `\"`;\r\n }\r\n if (id && id != '' && id != undefined) {\r\n where = `where um.id = ` + id + ` and um.user_group IS NULL `;\r\n }\r\n if (id && id != '' && id != undefined && group && group != 'null' && group != '' && group != undefined) {\r\n where = `where um.user_group = \"` + group + `\" and um.id = ` + id;\r\n } else {\r\n where = `where um.user_group IS NULL and um.id = ` + id;\r\n }\r\n if (id && id != '' && id != undefined) {\r\n var sql = ` select \r\n um.*,\r\n em.*,\r\n if(sm.gender = 1, \"Male\", \"Female\") as gender,\r\n sm.address,\r\n if(um.modify_by IS NULL, concat_ws(' ', um2.first_name , um2.last_name), NULL) as create_by, \r\n if(um.modify_by IS NOT NULL, concat_ws(' ', um2.first_name , um2.last_name), NULL) as modify_by, \r\n if(um.modify_by IS NULL, if(um2.user_group IS NULL, 'Admin', um2.user_group), NULL) as creator_group, \r\n if(um.modify_by IS NOT NULL, if(um2.user_group IS NULL, 'Admin', um2.user_group), NULL) as modifier_group,\r\n if(um.modify_by IS NULL, ur.name, NULL) as creator_role, \r\n if(um.modify_by IS NOT NULL, ur.name, NULL) as modifier_role,\r\n urr.id as user_role_id,\r\n urr.name as user_role\r\n from user_master as um \r\n left join employee_master as em on em.id = um.user_group_id\r\n left join user_master as um2 on um2.id = IF(um.modify_by IS NULL, um.create_by, um.modify_by)\r\n left join staff_master as sm on sm.id = um.user_group_id\r\n left join user_role as ur on um2.user_role_id = ur.id \r\n left join user_role as urr on um.user_role_id = urr.id \r\n `+ where + ` group by um.id limit 1`;\r\n pool.getConnection(function (err1, con1) {\r\n if (!err1) {\r\n con1.query(sql, function (err, rows) {\r\n if (!err) {\r\n if (rows != '' && rows != null && rows) {\r\n var jsonObject = {};\r\n jsonObject[\"status\"] = \"1\";\r\n jsonObject[\"message\"] = \"User Details Found Successfully\";\r\n jsonObject[\"data\"] = rows[0];\r\n res.send(jsonObject);\r\n } else {\r\n var jsonObject = {};\r\n jsonObject[\"status\"] = \"0\";\r\n jsonObject[\"message\"] = \"No such user found \";\r\n jsonObject[\"data\"] = [];\r\n res.send(jsonObject);\r\n }\r\n } else {\r\n var jsonObject = {};\r\n jsonObject[\"status\"] = \"0\";\r\n jsonObject[\"message\"] = \"DB :\" + err;\r\n jsonObject[\"data\"] = [];\r\n res.send(jsonObject);\r\n }\r\n con1.release();\r\n });\r\n } else {\r\n var jsonObject = {};\r\n jsonObject[\"status\"] = \"0\";\r\n jsonObject[\"message\"] = \"CON :\" + err1;\r\n jsonObject[\"data\"] = [];\r\n res.send(jsonObject);\r\n }\r\n });\r\n } else {\r\n var jsonObject = {};\r\n jsonObject[\"status\"] = \"0\";\r\n jsonObject[\"message\"] = \"user_id is required\";\r\n jsonObject[\"data\"] = [];\r\n res.send(jsonObject);\r\n }\r\n}", "function user(query) {\r\n //return results a users\r\n return new Promise(async (resolve, reject) => {\r\n let results = User.getSearchResult(query);\r\n return resolve(await results);\r\n });\r\n}", "async query(query) {\n\n }", "function userId({id}) {\n return id;\n}", "function userId({id}) {\n return id;\n}", "function getUserRequest(userId) {\n return {\n type: GET_USER_REQUEST,\n payload: {\n userId,\n },\n };\n}", "getAllForUser(req, res) {\n let user_id = req.params.user_id \n let filters = {\n fromDate: req.query.fromDate || 0,\n toDate: req.query.toDate || new Date(32503680000000),\n minAmount: req.query.minAmount || 0,\n maxAmount: req.query.maxAmount || Infinity,\n }\n\n User.findOne({ '_id': user_id }, (err, user) => {\n if (err) throw err\n\n if (!user) {\n res.status(404).send({error: 'Invalid user.'})\n } else {\n Expense.find({ user_id: user._id })\n .where('date').gte(filters.fromDate).lte(filters.toDate)\n .where('amount').gte(filters.minAmount).lte(filters.maxAmount)\n .sort('-date')\n .exec((err, expenses) => {\n if (err) throw err\n res.send({ expenses: expenses })\n })\n }\n })\n .catch((err) => {\n res.status(500).send({error: err.message})\n })\n }", "async function getUserData(user_id) {\n try {\n var sql = `\n select us.*, s.name as service_name, h.helper_name, h.contact_number,\n hs.average_charges \n from user_services as us\n left join services as s \n on us.service_id = s.service_id\n left join helper as h\n on us.helper_id = h.helper_id\n left join helper_service as hs\n on us.helper_id = hs.helper_id\n where hs.helper_id = us.helper_id and \n hs.service_id = us.service_id and\n us.user_id = ?;`;\n\n return new Promise((resolve, reject) => {\n connectPool.query(sql, [user_id], (err, resp) => {\n if (err) {\n reject(err);\n } else {\n resolve(resp);\n }\n });\n });\n } finally {\n //if (connectPool && connectPool.end) connectPool.end();\n }\n}", "getByIdU (req, next, user_id) {\n\n\t\tlogger.debug({ method : 'getByIdU', point : logger.pt.start, params : { user_id : user_id } });\n\n\t\tprogramDao.getOne('byIdU', {\n\t\t\t\tprogram_id : req.params.program_id,\n\t\t\t\tuser_id : user_id\n\t\t\t})\n\t\t\t.then(function (program) {\n\t\t\t\treq.result = program;\n\n\t\t\t\tlogger.debug({ method : 'getByIdU', point : logger.pt.end });\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t.catch(function (err) {\n\t\t\t\tlogger.debug(err.message, { method : 'getByIdU', point : logger.pt.catch });\n\t\t\t\tnext(err);\n\t\t\t});\n\t}", "function queryUsers(uid) {\n firebase.query(result => {\n return true;\n }, \"/users\", {\n orderBy: {\n type: firebase.QueryOrderByType.CHILD,\n value: 'uid'\n },\n ranges: [\n {\n type: firebase.QueryRangeType.START_AT,\n value: uid\n },\n {\n type: firebase.QueryRangeType.END_AT,\n value: uid\n }\n ]\n });\n}", "function getAllCommentsWithUser(userId){\n db.many(`\n SELECT * FROM comments\n WHERE id = $1\n`, userId)\n.then((comments) =>{\n const user = getUserById(userId)\n user.then((theUser) =>{\n comments.forEach((comment)=>{\n console.log(`${theUser.name} made the comment ${comment.comment}`)\n })\n })\n})\n.catch((e)=>{\n console.log(e)\n})\n}", "async function getDoctorVisitByUserId(userId) {\r\n const [ results ] = await mysqlPool.query(\r\n 'SELECT * FROM doctorvisit WHERE userId=?',\r\n [userId]\r\n );\r\n\r\n return results;\r\n}", "get(cb,args = {}){\n\t\tvar argDef = {\n\t\t\tid:[\"int\",false],\n\t\t\temail:[\"varchar\",false]\n\t\t};\n\t\tvar byID = args.id ? 'and person.id = @id' : '';\n\t\tvar byEmail = args.email ? 'and person.email = @email' : '';\n\t\tvar queryText = `\n\t\t\tselect top 3\n\t\t\tperson.*,\n\t\t\tstuff(\n\t\t\t\t(\n\t\t\t\t\tselect ',' + cast(instrument.id as varchar(10))\n\t\t\t\t\tfrom instrument\n\t\t\t\t\tinner join person_instrument on person_instrument.instrument_id = instrument.id\n\t\t\t\t\t\tand person_instrument.active = 1\n\t\t\t\t\t\tand person_instrument.person_id = person.id\n\t\t\t\t\t\twhere instrument.active = 1\n\t\t\t\t\t\torder by instrument.id asc\n\t\t\t\t\t\tfor xml path('')\n\t\t\t\t)\n\t\t\t,1,1,'') as instrument_ids\n\t\t\tfrom person\n\t\t\twhere person.active = 1\n\n\t\t\t${byID}\n\t\t\t${byEmail}\n\t\t`;\n\n\t\tthis.query(cb,queryText,args,argDef);\n\t}", "function getUserData(id, type) {\n var queryUrl;\n switch (type) {\n case \"user\":\n queryUrl = \"/api/users/\" + id;\n break;\n case \"group\":\n queryUrl = \"/api/groups/\" + id;\n break;\n default:\n return;\n }\n $.get(queryUrl, function(data) {\n if (data) {\n console.log(data.GroupId || data.id);\n // If this user exists, prefill our cms forms with its data\n usernameInput.val(data.username);\n \n groupId = data.GroupId || data.id;\n // If we have a user with this id, set a flag for us to know to update the user\n // when we hit submit\n updating = true;\n }\n });\n }", "function getByUserCreated(userId) {\n return db('lists as l')\n // .join('twitter_users as tu', 'tu.twitter_id', \"l.twitter_id\")\n .where('l.twitter_id', userId)\n}", "searchUserName() {\n return \"select u.userName from users u where u.userName = ?;\";\n }", "getUser(id){\n //postDB(\"user/Get\", { \"use_id\" : id });\n return { \"name\" : \"steven\", \"img\" : '', \"share\" : false };\n }", "function genIntersectQuery(tag, i) {\n return 'SELECT \"user\" FROM \"tags-users\" WHERE tag = $' + (i + 1).toString();\n }", "getSaleUser(user){\n const query = Sale.findOne({ user }).exec();\n return query;\n }", "function findByUser(id) {\n return db(\"property\").where(\"user_id\", \"=\", id);\n}", "function getUserById(req, res) {\n\n var userId = req.query.userId;\n console.log(\"user id inside of user controler : \");\n console.log(userId);\n userModel.getUserById(userId, function(error,result) {\n res.json(result);\n });\n\n}", "selectOneQuery() {\n return `select * from ${this.tablename('selectOne')} where id = $1`;\n }", "getById(id) {\r\n return new SiteUser(this, `getById(${id})`);\r\n }", "function queryBuilder(){\n getValues();\n let tournament;\n if (tournyCond === 'anyT') tournament = \" any tournament \";\n else tournament = tournyCond + \" tournament(s) \";\n\n let player;\n if (nameCond === 'contains') player = \"a player whose name contains \" + playerInput + \" \";\n else if(nameCond === 'equalsname') player = playerInput + \" \";\n\n let rank;\n if (rankCond === 'either') rank = \"either the winner or runner-up \";\n else if (rankCond === 'winner') rank = \"the winner \";\n else if (rankCond === 'runner') rank = \"the runner-up \";\n\n let date;\n if (dateInputInt === 0) date = '';\n else{\n if (dateCond === 'equalsdate'){\n date = \"in the year \" + dateInput;\n }\n else if(dateCond === 'greaterthan'){\n date = \"after the year \" + dateInput;\n }\n else if (dateCond === 'lessthan'){\n date = \"before the year \" + dateInput;\n }\n }\n let gender = \"From the \" + $fileCondSelect.val() + \" game, \";\n let withName= \"select \" + tournament + date +\" where \" + player + \"was \" + rank;\n let anyName = \"select all winners and runners-up from \" + tournament + date;\n let text = [];\n text.push(gender);\n if (playerInput === '' || nameCond ==='none'){\n text.push(anyName);\n }\n else text.push(withName);\n $('#currentquery').html(text.join(\"\"))\n }", "function CustomQuery() {\n\n}", "function generate_query(form_id){\n\n\t\tvar objForm = document.getElementById(form_id);\n\t\tvar query \t= '';\n\n\t\tfor (i=0; i<objForm.elements.length; i++){\n\t\t\tif (document.getElementById(objForm.elements[i].name)) { /* check if the id is exist - for mozilla*/\n\t\t\t\tif (document.getElementById(objForm.elements[i].name).getAttribute('id') != '') { /* check if the id is exist - for IE */\n\t\t\t\t\tquery += (i > 0 ? \"&\" : \"\");\n \t\tquery += escape(objForm.elements[i].name) + \"=\" + escape(objForm.elements[i].value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn query;\n\t}", "function getAllUsersSports(user_id, callback) {\n\n console.log(\"searching sport with id in model : \" + user_id);\n\n var sql = 'SELECT * FROM sports WHERE user_id = $1::int';\n\n var params = [user_id];\n\n pool.query(sql, params , function(err, result) {\n\n if (err) {\n\n console.log(err);\n callback(err, \"Erro with DB\");\n }\n console.log(\"Found result: \" + JSON.stringify(result.rows));\n\n callback(null, result.rows);\n });\n}", "function findData(userId) {\n return new Promise ((resolve, reject) => {\n const query = \"SELECT id, task, done FROM items WHERE user_id =?\";\n db.query(query, [userId], (err, results, fields) => {\n if(!err) resolve(results);\n else reject(err);\n });\n });\n}" ]
[ "0.7212307", "0.6474261", "0.63711685", "0.62333405", "0.59662193", "0.5873114", "0.5858225", "0.5834849", "0.5798587", "0.5790747", "0.57841116", "0.5771733", "0.5754266", "0.5749882", "0.5739208", "0.57223105", "0.5703775", "0.5685125", "0.5683078", "0.56682956", "0.5656321", "0.5654019", "0.56514746", "0.5641145", "0.56340694", "0.55861115", "0.5576945", "0.5542892", "0.55131996", "0.55088323", "0.55069774", "0.5478237", "0.5471168", "0.54621965", "0.54618514", "0.5443712", "0.5429561", "0.54295224", "0.5422129", "0.5420127", "0.539592", "0.53913546", "0.53911006", "0.5387739", "0.53870285", "0.5380812", "0.5360627", "0.5354152", "0.5353151", "0.5350469", "0.53469425", "0.5345876", "0.53424996", "0.53282654", "0.53268826", "0.5323363", "0.53228277", "0.53115827", "0.53078866", "0.53028566", "0.5300242", "0.5299274", "0.5298456", "0.52978355", "0.5292167", "0.5276124", "0.5275742", "0.5274352", "0.52640206", "0.52593744", "0.52548665", "0.52517545", "0.5246743", "0.5242155", "0.5239507", "0.52289605", "0.52289605", "0.522726", "0.52271134", "0.5215163", "0.5213608", "0.52122754", "0.52089024", "0.52039045", "0.52030593", "0.5202837", "0.520082", "0.5194049", "0.51914126", "0.5191162", "0.5191095", "0.5189294", "0.51855916", "0.5181121", "0.5178875", "0.51785487", "0.51762664", "0.51749164", "0.5170071", "0.5164045" ]
0.731066
0
Initializes the CDN library downloader.
function init() { var destDirPath, projectItem = ProjectManager.getSelectedItem(); if (projectItem.isDirectory) { destDirPath = projectItem.fullPath; } else { destDirPath = ProjectManager.getProjectRoot().fullPath; } _showDialog().done(function (libObject) { if (libObject.action === "download") { _getLibraryContent(libObject.url).done(function (libContent) { var cleanMainFile = FileUtils.getBaseName(libObject.mainFile), libFile = FileSystem.getFileForPath(destDirPath + cleanMainFile); FileUtils.writeText(libFile, libContent, true).done(function () { var tag = Linker.getTagsFromFiles([libFile.fullPath]); Linker.insertTags(tag); ProjectManager.refreshFileTree(); }).fail(function () { console.log("Error writing file: " + libFile); }); }); } else if (libObject.action === "link") { var tag = Linker.getTagsFromUrls([libObject.url]); Linker.insertTags([tag]); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initDownload() {\n downloadStartTime = new Date().getTime();\n downloadImg(0);\n }", "function initDownload(){\n\tvar initUrl = URLUtil.getFeedUrl();\n\tconsole.log(initUrl)\n\tdownloadAllFeeds([initUrl]);\t\n}", "function init() {\n cacheDom();\n loadImage();\n }", "function init()\n{\n console.info(\"Init Avanza Fiddler, version 0.9.1\");\n // Tweak all links to external target.\n tweaklinks(document);\n // Fix order window\n fixordervindow(document);\n}", "function init() {\n cacheDom();\n loadImage();\n }", "function initBanners() {\n\t\n\tbannersPath = $('#banners-link a').attr('href');\t// get path to banners file\n\t$('#banners-link').remove(); \t\t\t\t\t\t// since js is on, remove banners link\t\n}", "function init() {\n return {\n loaders: [ new LocalLoader() ],\n fetch: function(dep_name, targetConfig) {\n var output;\n this.loaders.forEach(function(l) {\n if (!output && l.match(dep_name)) {\n output = l.load(dep_name, targetConfig);\n }\n });\n return output;\n }\n };\n}", "function initialize(instance) {\n var service = instance.lookup('service:asset-loader');\n service.pushManifest(_assetManifest.default);\n }", "function initialize(instance) {\n var service = instance.lookup('service:asset-loader');\n service.pushManifest(_assetManifest.default);\n }", "function init() {\n\n // ALSO REMEMBER TO LOAD MP3s RIGHT AWAY (you could also load MEIs as well)\n // TODO\n \n // Register event - call main() when page loaded\n \n document.addEventListener('DOMContentLoaded', initWhenPageLoaded);\n \n window.AudioLoader = AudioLoader; // TEMP FOR DEBUGGING\n }", "function init() {\n utils.setStatusBar(\"Bug Analysis Tool: Initializing\", \"Red\"); //Update the text and color of the status bar for Bug Analysis Tool button.\n utils.init(constants.download_uri);//Download the zip, uncompress the zip locally to a specific hidden directory (the directory is consistent with the address downloaded by the WebSVF Backend script), and then remove the zip.\n }", "function coreInitDependencyManager() {\n\n //require method to load js files aync \n $.require = function (file, callback) {\n if (file.indexOf('?') === -1)\n file = file + \"?version=\" + appConfig.app_version\n else\n file = file + \"&version=\" + appConfig.app_version\n\n\n $.getScript(file, function () {\n if (typeof callback != \"undefined\")\n callback(file);\n });\n }\n\n //require method to load js files \n $.requireSync = function (file, callback) {\n var loaded = false;\n var head = document.getElementsByTagName(\"head\")[0];\n var script = document.createElement('script');\n script.src = file;\n script.type = 'text/javascript';\n //real browsers\n script.onload = function () {\n loaded = true;\n };\n //Internet explorer\n script.onreadystatechange = function () {\n if (this.readyState == 'complete') {\n loaded = true;\n }\n }\n head.appendChild(script);\n\n while (!loaded) {\n $.loadJS(file); //Dirty wait. TODO add logic to skip after 5 seconds\n }\n\n if (typeof callback != \"undefined\")\n callback(file);\n\n }\n }", "initialize () {\n\n if (!this.initialized) {\n\n // only perform once\n this.initialized = true;\n\n // loads batches of assets\n this.bulkLoader = new BulkLoader();\n this.bulkLoader.on('LOAD_PROGRESS', this.on_LOAD_PROGRESS.bind(this));\n this.bulkLoader.on('LOAD_COMPLETE', this.on_LOAD_COMPLETE.bind(this));\n \n // set HTML to DOM\n this.parentEl.innerHTML = this.html;\n }\n }", "function init() \n{\n FlickrOAuth.setFlickrUpdateCb(function(s, m, d, o){flickrUpdate(s, m, d, o);});\n FlickrOAuth.setAuthenticateCb(function(status, oAuthData){authenticateCb(status, oAuthData);});\n // load the number of simultanious downloads from the prefs\n prefs = Services.prefs.getBranch(\"extensions.FlickrGetSet.\");\n try\n {\n simultaniousDownloads = prefs.getIntPref(\"simultaniousDownloads\");\n }\n catch (e)\n {\n logError(\"No simultaniousDownloads pref found\");\n }\n}", "connectedCallback() {\n super.connectedCallback();\n // Import cdn\n }", "function preInit() {\n // Make sure downloadDir ends with a trailing slash\n if (!downloadDir.endsWith(\"/\")) {\n downloadDir += \"/\";\n console.warn(\"The download directory for YouTubeDL does not contain a trailing slash. Please add it to remove this message.\");\n }\n\n // Create download directory for YTDL\n fs.stat(downloadDir, function (err, stats) {\n if (err === null) {\n // Directory exists - Do nothing\n }\n else if (err.code === \"ENOENT\") {\n // Directory doesn't exist - Create directory\n fs.mkdir(downloadDir);\n }\n else {\n // Unexpected error\n console.log(\"Unknown error occured: \" + err);\n throw err;\n }\n });\n}", "function _init() {\n }", "async _init() {\n if (!this._isInitialized) {\n\n this._account = await getDefaultAccount(this._web3)\n this._ipfs = ipfsAPI('localhost', '5002', {protocol: 'http'}) \n\n if (await isOpenCollabRepo(this._repoPath)) {\n this.isOpenCollabRepo = true\n this._contractAddress = await common.getContractAddress(this._repoPath)\n }\n else\n this.isOpenCollabRepo = false\n\n this._isInitialized = true\n }\n }", "function init() {\n\t\tbindClickEventsToBulbs();\n\t\tgetBulbsInfo();\n\t\tupdateBulbsStatus();\n\t \t\n initDigitalWatch();\n updateDate(0);\n\n bindEvents();\n }", "function init() {\n\n var responsiveImages = new ResponsiveImages();\n var nav = new cpoNav();\n\n // matches all anchor tags that contain lexus financial. we need to\n // replace these so they won't redirect to a broken page. we're \n // assuming there's only one right now.\n //\n $financing_anchor = $('.button-wrapper a[href*=\"lexusfinancial\"]');\n //LIM 3231 - Making copies of the original urls so that we can switch between\n //the mobile and the original urls depending on breakpoint.\n //\n $financing_anchor.each(function() {\n var urlClone = $(this).clone();\n financing_URLS.push(urlClone);\n });\n financing_correctURL = $financing_anchor.attr('href');\n pointbreak.addChangeListener(onBreakpointChange);\n onBreakpointChange();\n\n responsiveImages.update();\n\n initShareOverlay();\n initAnalytics();\n\n }", "async init() {\r\n await this.requestMetaMaskAccount();\r\n await this.downloadABI();\r\n await this.loadContract();\r\n }", "async initialize(config) { \n \n this.url = config.url;\n \n this.appendWidgetScript();\n }", "function init() {\r\n player.poster = posters[currentSource];\r\n player.src = sources[currentSource];\r\n player.width = 1920;\r\n player.height = 1080;\r\n player.load();\r\n progress.hide();\r\n progress.reset();\r\n }", "function init($nimbleLoader, settings){\n var loader = new LoadingHandlerGenerator($nimbleLoader, settings);\n $nimbleLoader.data(\"loader\", loader);\n }", "function init(){\n cacheDom();\n bindEvents();\n removeDropdownHoverability();\n }", "function Downloader() {\n\n var self = this;\n\n}", "function init() {\n var js = document.createElement('script');\n js.setAttribute('type', 'text/javascript');\n js.setAttribute('src', url);\n document.getElementsByTagName('head').item(0).appendChild(js);\n}", "function init() {\n\t\t\tif (!container) return;\n\t\t\trequestImages();\n\t\t\tbuildLayout();\n\t\t}", "function _init() {\n }", "function _init() {\n }", "function _init() {\n }", "init() {\n this.loadModules();\n this.cacheDOM();\n this.attachEvents();\n this.stickFooterToBottom();\n }", "function init() {\n initGalleryToolbar();\n initGalleryList();\n initGalleryListEvents();\n }", "function init() {\n autoScroll();\n countDown();\n fetchWeather();\n fetchDestinations();\n formValidation();\n }", "async _init() {\n // load the container from DOM, and check it\n const loaded = this._loadContainer(this._options.container);\n\n if (!loaded) return;\n\n // init html templates\n this._initContainer();\n this._initControls();\n this._renderControls();\n\n // init listeners\n this._initListeners();\n\n // first data load\n await this._fetchCards(this._maxDisplayedCards);\n this._loadCurrentPage();\n }", "function initializer() {\n\t// xhr.loadFoodItems(data.whenFoodItemsLoad, data.errorFunction);\n\txhr.loadFoodItems();\n}", "init() {\n this._cacheDOM()\n this._createObserver()\n this._observeFaders()\n }", "function _init() {\n\t\t\t// Trigger a few events so the bar looks good on startup.\n\t\t\t_timeHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tduration: api.jwGetDuration(),\n\t\t\t\tposition: 0\n\t\t\t});\n\t\t\t_bufferHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tbufferProgress: 0\n\t\t\t});\n\t\t\t_muteHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tmute: api.jwGetMute()\n\t\t\t});\n\t\t\t_stateHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tnewstate: jwplayer.api.events.state.IDLE\n\t\t\t});\n\t\t\t_volumeHandler({\n\t\t\t\tid: api.id,\n\t\t\t\tvolume: api.jwGetVolume()\n\t\t\t});\n\t\t}", "init()\n { \n // Navbar\n this.navbar = new Navbar('#header .navbar');\n\n // Modal\n this.modal = new Modal('#kp-modal');\n\n // Input autofill detection\n $('input').on('animationstart', onAnimationStart, false);\n\n // Dismiss notices\n $('.form-error button, .form-notice button').on('click',function(e){\n $(this).parent().fadeOut().remove();\n });\n\n // Initialize video players\n $('.kp-video').each(function(i,v){\n new Player(i,v);\n });\n\n // Initialize galleries\n $('.kp-gallery').each(function(i,v){\n new Gallery(i,v);\n });\n\n $('a#clip-download').on('click', this.onClipDownloadClick.bind(this) );\n\n }", "async init() {\n // FIXME: VideoLink appears after 1.5 seconds, it's too slow, find better way\n this.vidlink = null;\n this.video = await Player.untilVideoAppears();\n\n this.ads = new PlayerAds();\n this.events = new PlayerEvents(this.video);\n this.timeline = new PlayerTimeline(this.video);\n this.annotations = new PlayerAnnotations();\n\n this.rightControls = Player.findRightControls();\n this.controlsContainer = Player.findControlsContainer();\n\n Player.untilVideoLinkAppears().then((link) => { this.vidlink = link; });\n }", "function _init() {\n\t\tgetHeadlines();\n\t}", "static resetDownloader() {\r\n Utils.dlChains = [];\r\n Utils.dlCounter = 0;\r\n\r\n for (var prp in Utils.dlCallbacks) {\r\n delete Utils.dlCallbacks[prp];\r\n }\r\n\r\n for (var i1 = 0; i1 < this.concurrentDls; i1++) {\r\n Utils.dlChains.push(Promise.resolve(true));\r\n }\r\n }", "function init() {\n logger.info('init called');\n $.header.init();\n $.cart.init();\n}", "function init() {\n //console.log('Restyler - init()');\n if (!inited) {\n Observer.init(applyEl);\n Historian.init();\n\n inited = true;\n }\n }", "function init() {\r\n\r\n\t\t\t$root.addClass(o.loadingClass);\r\n\r\n\t\t\t//get the items number\r\n\t\t\titemNum = $ul.find('li').each(function(i) {\r\n\r\n\t\t\t\tslides[i] = {\r\n\t\t\t\t\tfirstBox: $(this).find(o.firstBoxSel),\r\n\t\t\t\t\tsecondBox: $(this).find(o.secondBoxSel)\r\n\t\t\t\t};\r\n\t\t\t\tif(i === 0) {\r\n\t\t\t\t\t$(this).find('img').pexetoOnImgLoaded({\r\n\t\t\t\t\t\tcallback: function() {\r\n\t\t\t\t\t\t\t$root.removeClass(o.loadingClass);\r\n\t\t\t\t\t\t\tshowSlide(0);\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}).length;\r\n\r\n\t\t\tif(itemNum<=1){\r\n\t\t\t\to.buttons=false;\r\n\t\t\t\to.arrows=false;\r\n\t\t\t\to.autoplay=false;\r\n\t\t\t}\r\n\r\n\t\t\t$ul.find('li img').pexetoOnImgLoaded({\r\n\t\t\t\tcallback: function() {\r\n\t\t\t\t\t//set the navigation buttons\r\n\t\t\t\t\tsetNavigation();\r\n\t\t\t\t\tbindEventHandlers();\r\n\r\n\t\t\t\t\t//the images are loaded, start the animation\r\n\t\t\t\t\tif(o.autoplay) {\r\n\t\t\t\t\t\tstartAnimation();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}", "function init() {\n setupThumbnailGallery(0);\n bindEvents();\n }", "init() {\n try {\n this.makeCommentsLinks();\n this.makeDescriptionLinks();\n } catch (ignore) {}\n }", "init() {\n try {\n this.makeCommentsLinks();\n this.makeDescriptionLinks();\n } catch (ignore) {}\n }", "function init() {\n\t\tmasonryConfig();\n\t\towlCarouselConfig();\n\t\tisotopeConfig();\n\t\tmagnificPopupConfig() \n\t\tcontactValidateConfig()\n\t\tparallaxEffect();\n\t\tinternalMenu();\n\t\tflipMenuInit()\n\t}", "function init() {\n $ss.cycle({\n height: '383px',\n next: '#next', \n prev: '#prev',\n\t\t\tpaused: function(cont, opts, byHover) {\n $pause.removeClass('control--pause').addClass('control--play');\n },\n resumed: function(cont, opts, byHover) {\n $pause.removeClass('control--play').addClass('control--pause');\n },\n before: function(curr, next, opts) {\n if(opts.addSlide) { // If function exists\n offset += limit;\n $.ajax({\n url: 'gallery/slideshow/images',\n type: 'POST',\n data: { limit: limit, offset: offset },\n dataType: 'json',\n success: function(data) {\n // If data then add the images\n if(data.length > 0) {\n for(var i = 0; i < data.length; i++) {\n opts.addSlide(data[i]);\n }\n }\n }\n });\n }\n }\n });\n }", "function initialize() {\n // publishReview();\n // reportingBar();\n addExpandAllComments()\n // reportEveryone()\n makeAllCommentsHideable()\n addStatusSelect();\n if (document.querySelector('#files') != null) {\n var filesCompleted = loadData()[getPullRequestId()][\"files\"];\n var fileHeaders = document.querySelectorAll('.file-header:not(.footer)')\n addCompleteAction(filesCompleted, fileHeaders);\n importFooters(fileHeaders)\n\n hideCompletedFiles(filesCompleted, fileHeaders);\n }\n}", "constructor() {\n super();\n this.baseURL = null;\n }", "constructor() {\n super();\n this.baseURL = null;\n }", "constructor() {\n super();\n this.baseURL = null;\n }", "constructor() {\n super();\n this.baseURL = null;\n }", "constructor() {\n super();\n this.baseURL = null;\n }", "function init() {\n }", "function init() {\n\t\tloadPosts();\n\t\tloadPages();\n\t\tloadCategories();\n\t\tloadTags();\n\t}", "function DependencyLoader() {\n\t\n\tvar loadedImages = [];\n\t\n\t/**\n\t * Loads the given paths.\n\t * \n\t * @param paths is one or more paths to load as a string or string[]\n\t * @param onDone(err) is invoked when the paths are loaded or fail\n\t * @param maxThreads specifies the maximum number of parallel fetch requests (default 10)\n\t */\n\tthis.load = function(paths, onDone, maxThreads) {\n\t\tmaxThreads = maxThreads || 10;\n\t\t\n\t\t// listify paths\n\t\tif (!isArray(paths)) {\n\t\t\tassertTrue(isString(paths));\n\t\t\tpaths = [paths];\n\t\t}\n\t\t\n\t\t// collect images and scripts that aren't loaded\n\t\tvar imagesToLoad = [];\n\t\tvar scriptsToLoad = [];\n\t\tfor (var i = 0; i < paths.length; i++) {\n\t\t\tvar path = paths[i];\n\t\t\tassertDefined(path);\n\t\t\tif (path.endsWith(\".png\") || path.endsWith(\".jpg\") || path.endsWith(\".gif\")) {\n\t\t\t\tif (!arrayContains(loadedImages, path)) imagesToLoad.push(path);\n\t\t\t} else {\n\t\t\t\tif (!loadjs.isDefined(path)) {\n\t\t\t\t\tscriptsToLoad.push(path);\n\t\t\t\t\tloadjs(path, path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// done if everything loaded\n\t\tif (!imagesToLoad.length && !scriptsToLoad.length) {\n\t\t\tif (onDone) onDone();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// simulate load time\n\t\tif (AppUtils.SIMULATED_LOAD_TIME) {\n\t\t\tsetTimeout(function() { loadAsync(); }, AppUtils.SIMULATED_LOAD_TIME);\n\t\t} else loadAsync();\n\t\t\n\t\t// executes functions to fetch scripts and images\n\t\tfunction loadAsync() {\n\t\t\tvar funcs = [getScriptsFunc(scriptsToLoad), getImagesFunc(imagesToLoad)];\n\t\t\tasync.parallelLimit(funcs, maxThreads, function(err, result) {\n\t\t\t\tif (onDone) onDone(err);\n\t\t\t});\n\t\t}\n\t\t\n\t\tfunction getScriptsFunc(paths) {\n\t\t\treturn function(onDone) {\n\t\t\t\tif (!paths.length) onDone();\n\t\t\t\telse {\n\t\t\t\t\tloadjs.ready(paths, {\n\t\t\t\t\t\tsuccess: onDone,\n\t\t\t\t\t\terror: function() { onDone(new Error(\"Failed to load dependencies: \" + paths)); }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction getImagesFunc(paths) {\n\t\t\treturn function(onDone) {\n\t\t\t\tgetImages(paths, function(err) {\n\t\t\t\t\tif (err) onDone(new Error(\"Failed to load images: \" + paths));\n\t\t\t\t\telse {\n\t\t\t\t\t\tloadedImages = loadedImages.concat(paths);\n\t\t\t\t\t\tonDone();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * Determines if the given paths are loaded.\n\t * \n\t * @param paths is one or more paths to check if loaded\n\t */\n\tthis.isLoaded = function(paths) {\n\t\t\n\t\t// listify paths\n\t\tif (!isArray(paths)) {\n\t\t\tassertTrue(isString(paths));\n\t\t\tpaths = [paths];\n\t\t}\n\t\t\n\t\t// check if each path is loaded\n\t\tfor (var i = 0; i < paths.length; i++) {\n\t\t\tif (!arrayContains(loadedImages, paths[i]) && !loadjs.isDefined(paths[i])) return false;\n\t\t}\n\t\t\n\t\t// all paths loaded\n\t\treturn true;\n\t}\n}", "function initialize() {\n\t\talertBinding();\n\t\tsetGalleryId();\n\t\tfileUploadInit();\n\t\tfileUploadBinding();\n\t\tloadGallery();\n\t}", "function init() {\n loadTheme();\n loadBorderRadius();\n loadBookmarksBar();\n loadStartPage();\n loadHomePage();\n loadSearchEngine();\n loadCache();\n loadWelcome();\n}", "function init() {\n\n }", "function init() {\n\n }", "constructor () {\n this.hdrCubeLoader = new HDRCubeTextureLoader();\n this.gltfLoader = new GLTFLoader();\n this.fbxLoader = new FBXLoader();\n this.jsonLoader = new JSONLoader();\n this.textureLoader = new TextureLoader();\n this.fontLoader = new FontLoader();\n this.isLoaded = false;\n }", "function init() {\n\t \t\n\t }", "function init () {\n request\n .get('http://www.citibikenyc.com/stations/json', function (error, response, body) {\n if (!error && response.statusCode === 200) {\n \n /** promisify the splitStations service so locateStations \n * happens upon splitStations completion\n */\n var splitStationsPromise = Promise.promisify(services.splitStations);\n \n // split stations and locate the stations\n splitStationsPromise(body)\n .then(services.locateStations())\n .catch(function (err) {\n console.error('Error splitting the stations: ', err);\n });\n }\n });\n }", "function init() {\n\t\t\tloading = true;\n\t\t\tnew Ajax.Request('xmlhttp.php', {\n\t\t\t\tparameters: {\n\t\t\t\t\taction: 'mentionme',\n\t\t\t\t\tmode: 'get_name_cache'\n\t\t\t\t},\n\t\t\t\tonSuccess: loadNameCache\n\t\t\t});\n\t\t}", "function _Initialise(){\r\n\t\t\r\n\t\tfunction __ready(){\r\n\t\t\t_PrecompileTemplates();\r\n\t\t\t_DefineJqueryPlugins();\r\n\t\t\t_CallReadyList();\r\n\t\t};\r\n\r\n\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\r\n\t\tif(_jQueryDetected){\r\n\t\t\tjQuery(document).ready(__ready);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.addEventListener(\"DOMContentLoaded\", __ready, false);\r\n\t\t}\r\n\t\t\r\n\t}", "function init() {\n\t\tcacheDOM();\n\t\tbindEvents();\n\t}", "function init() {\r\n }", "function Ctor() {\n this.isLoaded = false;\n }", "function Init() {\n loader = new createjs.LoadQueue(); // load container\n loader.on(\"complete\", Start); // call start when finished loading\n loader.loadManifest([\n { id: \"treesharksLogo\", src: \"../../Assets/images/TSIcon.svg\" }\n ]);\n }", "function init() { }", "function init() { }", "onload() {\n this.init();\n }", "function initResources(done) {\n\n try {\n\n // load styles\n loadCss(host + 'components/fontawesome/css/font-awesome.min.css');\n loadCss(host + 'components/owl-carousel/owl.carousel.css');\n loadCss(host + 'components/owl-carousel/owl.theme.css');\n loadCss(host + 'ibhs/styles/ibhs.css');\n\n // load scripts\n loadScript(host + 'components/modernizr/modernizr.min.js');\n loadScript(host + 'components/owl-carousel/owl.carousel.min.js');\n loadScript(host + 'components/jquery.media/jquery.media.js');\n loadScript(host + 'components/handlebars/handlebars-v3.0.0.js', function () {\n loadScript(host + 'ibhs/js/templates/compiled/file-browser-widget.html.js');\n loadScript(host + 'ibhs/js/templates/compiled/link-widget.html.js');\n loadScript(host + 'components/rivets/rivets.bundled.min.js', function () {\n loadScript(host + 'ibhs/js/ibhs.common.js', function () {\n loadScript(host + 'ibhs/js/ibhs.data.js', function () {\n loadScript(host + 'ibhs/js/ibhs.widget.link.js', function () {\n loadScript(host + 'ibhs/js/ibhs.widget.filebrowser.js', done);\n });\n });\n });\n\n });\n });\n } catch (e) {\n console.error('Exception initializing widget resources - ' + e.message);\n }// try-catch\n }", "function initLibs() {\n\t\tvar kjslib = universe.kjslib = _kJs_Initor();\n\t\tvar kxmllib = universe.kxmllib = _kXml_Initor();\n\t\tvar kanilib = universe.kanilib = _kAni_Initor();\n\t\tvar keventlib = universe.keventlib = _kEvent_Initor();\n\t\tvar kgraphlib = universe.kgraphlib = _kGraph_Initor();\n\t\tinitClasses\n\t\t\t(kjslib, \"kjsclasses\")\n\t\t\t(kxmllib, \"kxmlclasses\")\n\t\t\t(kanilib, \"kaniclasses\")\n\t\t\t(keventlib, \"keventclasses\")\n\t\t\t(kgraphlib, \"kgraphclasses\")\n\t\t;\n\t}", "function init() {\r\n\r\n }", "function init() {\n if (window._env === 'development') console.debug('INIT');\n initFilters();\n initCountrySearch();\n initTableHeader();\n initTableDownload();\n }", "async _initDecoder() {\n const workerSource = `\n ${decoderModuleSource}\n\n var _DracoDecoderModule = DracoDecoderModule\n DracoDecoderModule = (config) => {\n config.locateFile = () => new URL('${decoderWasmPath}', self.origin).href;\n return _DracoDecoderModule(config);\n };\n\n (${DRACOLoader.DRACOWorker}).call(self);\n `\n const workerSourceBlob = new Blob([ workerSource ])\n this.workerSourceURL = URL.createObjectURL(workerSourceBlob)\n }", "function init() {\n this.$ = require(\"jquery/dist/jquery\");\n this.jQuery = this.$;\n\n require(\"svg4everybody/dist/svg4everybody\")();\n require(\"retinajs/dist/retina\");\n\n require(\"bootstrap/dist/js/bootstrap.bundle\");\n\n\n\n $(document).ready(function () {\n require(\"./components/interractionObserver\")();\n });\n}", "_initSources() {\n // finally load every sources already in our plane html element\n // load plane sources\n let loaderSize = 0;\n if(this.autoloadSources) {\n const images = this.htmlElement.getElementsByTagName(\"img\");\n const videos = this.htmlElement.getElementsByTagName(\"video\");\n const canvases = this.htmlElement.getElementsByTagName(\"canvas\");\n\n // load images\n if(images.length) {\n this.loadImages(images);\n }\n\n // load videos\n if(videos.length) {\n this.loadVideos(videos);\n }\n\n // load canvases\n if(canvases.length) {\n this.loadCanvases(canvases);\n }\n\n loaderSize = images.length + videos.length + canvases.length;\n }\n\n this.loader._setLoaderSize(loaderSize);\n\n this._canDraw = true;\n }", "static init() {\n objectFitVideos();\n objectFitImages();\n new Dot;\n InitFullpage();\n initScreenVideo();\n customScroll();\n initMobMenu();\n }", "function init(){\t\n\t\tbase.toggle = new Toggle (base, key);\n\t\tbase.audio = new AudioPlayer(base, key);\n\t\tbase.videos = [];\n\t\t\n\t\tfor (var i = 0; i < videoList.length; i++) {\n\t\t\tvar video = new VideoPlayer(base, videoList[i])\n\t\t\tbase.videos.push( video );\n\t\t\tvideos.push( video );\n\t\t}\n\t}", "initialize() {\n this.settings = {};\n this.scripts = [];\n }", "function init() {\n $.get('https://images.wikia.nocookie.net/common/extensions/wikia/DesignSystem/node_modules/design-system/dist/svg/sprite.svg', function(d) {\n // Initialize icon system\n var $sprite = $(d.rootElement)\n .removeAttr('style')\n .attr({\n 'id': 'dev-wds-sprite',\n 'class': 'wds-hidden-svg',\n });\n // Populate registry\n $.each(prefix, function(t, p) {\n registry[t] = [].slice.call($sprite.children())\n .map(function(e) {\n return e.id;\n }).filter(function(i) {\n var r = new RegExp('^' + p);\n return r.test(i);\n });\n });\n iconset = registry.icon;\n // Restriction to valid assets\n $sprite.children([\n 'symbol[id^=\"wds-avatar-icon\"]',\n 'symbol#wds-player-icon-play'\n ].join(',')).remove();\n // Sprite embedding\n $sprite.prependTo(document.body);\n // Globally expose library\n window.dev.wds = {\n registry: registry,\n iconset: iconset,\n sizemap: sizemap,\n icon: icon,\n badge: badge,\n company: company,\n render: render\n };\n // Dispatch hook\n mw.hook('dev.wds').fire(window.dev.wds);\n });\n }", "function init(){\n\t\t//Add load listener\n\t\twindow.addEventListener('DOMContentLoaded',\tfunction() {\n\t\t\tfindElements();\n\t\t\taddScrollListeners();\n\t\t\tscrollInit();\n\n\t\t\tdocument.head.appendChild(animStyle);\n\n\t\t\t//Create a mutation observer to monitor changes in attributes and new values to make sure new/changed elements are animated properly\n\t\t\tobserver = new MutationObserver(domChanged);\n\t\t\tobserver.observe(document, { attributes: true, childList: true, subtree: true });\n\n\t\t\tconsole.log(\"JSA v. \" + version + \" initialized. Visit https://github.com/CamSOlson/jsa for documentation\");\n\n\t\t});\n\t}", "function init(){\n\n }", "function init() {\r\n\t\t\t// if there is an override stream, set it to the current stream so that it plays upon startup\r\n\t\t\tif (self.options.overrideStream) {\r\n\t\t\t\tsetCurrentStream(self.options.overrideStream);\r\n\t\t\t}\r\n\t\t\tif (self.options.config && self.options.config.length > 0) {\r\n\t\t\t\tloadConfiguration();\r\n\t\t\t} else {\r\n\t\t\t\tinitializePlayer();\r\n\t\t\t}\r\n\t\t}", "function init() {\n loadDependencies();\n attachEventHandlers();\n}", "function config_init(){\n\n var client = new XMLHttpRequest();\n client.onreadystatechange = config_read;\n client.open(\"GET\", dsn.config.url);\n client.send();\n}", "function init() {\n\n if ( ! Config.get( 'enabled' ) ) {\n return;\n }\n\n inventory = Inventory.getInventory();\n account = Config.get( 'account' );\n\n addEventListeners();\n loadLibrary();\n\n }", "async init () {\n this.bridge = await this._getBridge()\n this.lamps = await this._getLamps()\n this.modules = await this._loadModules()\n }", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}" ]
[ "0.61587715", "0.6120726", "0.5980616", "0.5955116", "0.5917145", "0.5842045", "0.58133143", "0.5719346", "0.5719346", "0.57077205", "0.57023996", "0.5697397", "0.56926703", "0.56912565", "0.5666983", "0.5617944", "0.5615616", "0.5610714", "0.5607033", "0.5600208", "0.5554744", "0.55351835", "0.55306214", "0.54936385", "0.54921275", "0.54840255", "0.54831976", "0.5475163", "0.54738045", "0.54738045", "0.54738045", "0.5452655", "0.5451488", "0.54473966", "0.54071707", "0.540237", "0.54011697", "0.53893375", "0.5384434", "0.5383688", "0.5376098", "0.5362318", "0.53516805", "0.5348767", "0.53369474", "0.53346956", "0.53331465", "0.53331465", "0.5312158", "0.5292368", "0.5287097", "0.52842677", "0.52842677", "0.52842677", "0.52842677", "0.52842677", "0.5264324", "0.5261074", "0.5259868", "0.52556086", "0.5251981", "0.525067", "0.525067", "0.5250135", "0.5246958", "0.52455014", "0.52425545", "0.5241061", "0.5239008", "0.5228883", "0.5219443", "0.52120835", "0.52117544", "0.52117544", "0.52059895", "0.5205948", "0.5203093", "0.5193712", "0.5189883", "0.51803046", "0.5179929", "0.5178325", "0.51751006", "0.51750827", "0.51695085", "0.5158578", "0.51575106", "0.5153911", "0.51537216", "0.51514786", "0.5150661", "0.5149417", "0.5143457", "0.51379967", "0.51379967", "0.51379967", "0.51379967", "0.51379967", "0.51379967", "0.51379967" ]
0.55664
20
let colors = [[96,168,98], [196,92,162], [180,148,62], [119,122,205], [203,90,76]];
function setup() { // http://datamx.io/dataset/salario-minimo-historico-1877-2019 loadTable('../../data/mx_salariominimo_1877-2019.csv', 'csv', 'header', gotData); createCanvas(windowWidth, windowHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeColors() {\n colors.push([\"rgb(205,230,245)\",\"rgb(141,167,190)\"])\n colors.push([\"rgb(24,169,153)\",\"rgb(72,67,73)\"])\n colors.push([\"rgb(24,169,153)\",\"rgb(242,244,243)\"])\n colors.push([\"rgb(237,242,244)\",\"rgb(43,45,66)\"])\n colors.push([\"rgb(192,248,209)\",\"rgb(189,207,181)\"])\n colors.push([\"rgb(141,177,171)\",\"rgb(88,119,146)\"])\n colors.push([\"rgb(80,81,104)\",\"rgb(179,192,164)\"])\n colors.push([\"rgb(34,34,34)\",\"rgb(99,159,171)\"])\n}", "function GetColorList() {\n // return ['#4e73df', '#1cc88a', '#36b9cc', '#e74a3b', '#e67e22', '#f6c23e', '#9b59b6', '#1abc9c', '#2ecc71', '#3498db'];\n return ['#1abc9c', '#2ecc71', '#3498db', '#9b59b6', '#34495e', '#16a085', '#27ae60', '#2980b9', '#8e44ad', '#2c3e50'];\n}", "function array2color(a) {return \"rgb(\" + a.join(\",\") + \")\";}", "function catColors(array, color){\n //your code here!\n}", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}", "function createColorArray (int) {\n\tCOLORS = [];\n\tlet xCOLORS = [];\n\tif (int === 10) {\n\t\tCOLORS = [ 'red', 'red', 'blue', 'blue', 'limegreen', 'limegreen', 'yellow', 'yellow', 'purple', 'purple' ];\n\t}\n\tif (int === 20) {\n\t\tCOLORS = [\n\t\t\t'red',\n\t\t\t'red',\n\t\t\t'blue',\n\t\t\t'blue',\n\t\t\t'limegreen',\n\t\t\t'limegreen',\n\t\t\t'yellow',\n\t\t\t'yellow',\n\t\t\t'purple',\n\t\t\t'purple',\n\t\t\t'orange',\n\t\t\t'orange',\n\t\t\t'aquamarine',\n\t\t\t'aquamarine',\n\t\t\t'black',\n\t\t\t'black',\n\t\t\t'white',\n\t\t\t'white',\n\t\t\t'gray',\n\t\t\t'gray'\n\t\t];\n\t}\n\tif (int === 30) {\n\t\tCOLORS = [\n\t\t\t'red',\n\t\t\t'red',\n\t\t\t'blue',\n\t\t\t'blue',\n\t\t\t'limegreen',\n\t\t\t'limegreen',\n\t\t\t'yellow',\n\t\t\t'yellow',\n\t\t\t'purple',\n\t\t\t'purple',\n\t\t\t'orange',\n\t\t\t'orange',\n\t\t\t'aquamarine',\n\t\t\t'aquamarine',\n\t\t\t'black',\n\t\t\t'black',\n\t\t\t'white',\n\t\t\t'white',\n\t\t\t'gray',\n\t\t\t'gray',\n\t\t\t'rgb(170, 139, 255)',\n\t\t\t'rgb(170, 139, 255)',\n\t\t\t'hotpink',\n\t\t\t'hotpink',\n\t\t\t'rgb(119, 74, 20)',\n\t\t\t'rgb(119, 74, 20)',\n\t\t\t'lightblue',\n\t\t\t'lightblue',\n\t\t\t'darkgreen',\n\t\t\t'darkgreen'\n\t\t];\n\t}\n\treturn COLORS;\n}", "function getColor(myArr) {\n \treturn colorData[myArr % 5];\n }", "function getColors(datalen) {\n const colorList =\n ['rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(192,192,192)',\n 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)', 'rgb(128,0,128)', 'rgb(0,128,128)',\n 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)', 'rgb(255,0,255)',\n 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)', 'rgb(128,0,128)',\n 'rgb(0,128,128)', 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)',\n 'rgb(255,0,255)', 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)',\n 'rgb(128,0,128)', 'rgb(0,128,128)', 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)',\n 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)',\n 'rgb(0,128,0)', 'rgb(128,0,128)', 'rgb(0,128,128)', 'rgb(0,0,128)',\n 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(192,192,192)',\n 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)', 'rgb(128,0,128)', 'rgb(0,128,128)',\n 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)', 'rgb(255,0,255)',\n 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)', 'rgb(128,0,128)',\n 'rgb(0,128,128)', 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)',\n 'rgb(255,0,255)', 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)',\n 'rgb(128,0,128)', 'rgb(0,128,128)', 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)',\n 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)',\n 'rgb(0,128,0)', 'rgb(128,0,128)', 'rgb(0,128,128)', 'rgb(0,0,128)'\n ];\n return colorList.slice(0, datalen);\n}", "function setColors() {\n var len = points.length / 3;\n for (var i = 0; i < len; i++) {\n colors.push(1.0);\n colors.push(0.0);\n colors.push(0.0);\n colors.push(1.0);\n }\n}", "function colorgenerator() {\n let colours = [],\n i;\n for (i = 0; i < 372; i++){\n colours[i] = 'hsl(' + i + ', 100%, 50%)';\n if (i > 359) {\n colours[i] = 'hsl(0, 100%, 100%)';\n }\n }\n colours = colours.toString();\n //console.log(colours);\n root.style.setProperty(\"--colours\", colours);\n}", "assignColor() {\n let name = arguments[arguments.length-1]; // color distribution\n for (let i = 0; i < name.length; ++i) {// for each color to be assigned\n let array = arguments[i * 2];\n let index = arguments[i * 2 + 1];\n array[index] = name[i];\n }\n }", "_toColorArray(colors) {\n const colorChunks = []\n let i = 0\n\n while (i < colors.length) {\n const chunk = {\n color: colors.slice(i, i + 3)\n }\n\n colorChunks.push(chunk)\n\n i += 3\n }\n\n return colorChunks\n }", "function setColors(rgbList, totalColors) {\n var color = \"\";\n for (let i = 0; i < totalColors; i++) {\n var curr = rgbList[i];\n color = \"rgb(\" + curr[0] + \", \" + curr[1] + \", \" + curr[2] + \")\";\n labelList[i].style.background = color;\n }\n if (totalColors == 3) {\n for (let i = 3; i < 6; i++) {\n labelList[i].classList.add(\".hidden\");\n }\n }\n}", "function generateColor(red, green, blue)\n{\n paintColor[0] = red;\n paintColor[1] = green;\n paintColor[2] = blue;\n}", "colors() {\n return ['#B1BCBC', '#3ACF80', '#70F2F2', '#B3F2C9', '#528C18', '#C3F25C']\n }", "getColor() {\n if (this.type == 'home' || this.type == 'goal') {\n return ['#B5FEB4', '#B5FEB4'];\n }\n\n else if (this.type == 'board') {\n return ['#F7F7FF', '#E6E6FF'];\n }\n\n else if (this.type == 'back'){\n return ['#B4B5FE', '#B4B5FE'];\n }\n }", "function randomColor() { return Array.from({ length: 3 }, () => Math.floor(Math.random() * 256)); }", "function getColors(data) {\n // returns an Array of n colors, \n // if less than 70, red else green.\n let colors = [];\n for (let i = 0; i < data.length; i++) {\n if (data[i] >= 70)\n colors.push(`hsla(140, 50%, 60%, 1)`);\n else\n colors.push(`hsla(0, 50%, 60%, 1)`);\n }\n return colors\n}", "function arrayToColors() {\n\tfor (var i = 0; i < circles.length; i++) {\n\t\tcircles[i].style.backgroundColor = arrayOfColors[i];\n\t}\n}", "function ColorList() {}", "function randomColor(colors) {\n return colors[Math.floor(Math.random() * colors.length)];\n}", "function arrayOfRgbColors() {\n let output = [];\n let arglength = arguments.length;\n if (arglength > 0) {\n let input = arguments;\n for (let i = 0; i < arglength; i++) {\n output.push(arguments[i]);\n }\n }\n return output;\n}", "function setColors(colorArr){ //removed \"[]\"\n let i = 0;\n let len = colorArr.length;\n for(i = 0; i < len; i++){\n colorArr[i] = {red: randomInt(255), green: randomInt(255), blue: randomInt(255)};\n //TODO we will need to add a function that makes sure that no two colors are the same.\n //Maybe use a while loop? (RON)\n }\n}", "function composeColor() {\n return [rand256(), rand256(), rand256()];\n}", "function color(){\n var random_colors = [\"#c2ff3d\",\"#ff3de8\",\"#3dc2ff\",\"#04e022\",\"#bc83e6\",\"#ebb328\",\"#ekb123\"];\n\n if(i > random_colors.length - 1){\n i = 0;\n }\n return random_colors[i++];\n}", "createColors(color, num) {\n //receive hex color from parent, return array of colors for gradient\n //num is # of generated color in return array\n let a = []\n let red = parseInt( color.substring(1, 3), 16)\n let green = parseInt(color.substring(3, 5), 16)\n let blue = parseInt(color.substring(5,7), 16)\n \n let k = 0.8 \n //from lighter colder to darker warmer\n // console.log(red, green, blue)\n for (i=0;i<num;i++) {\n let new_red = (Math.floor(red*k)).toString(16)\n let new_green = (Math.floor(green*k)).toString(16)\n let new_blue = (Math.floor(blue*k)).toString(16)\n let new_color = '#'+new_red+new_green+new_blue\n k += 0.1\n a.push(new_color)\n }\n return a\n\n }", "function grayColors(colorArray){\r\n var array = [];\r\n for (var i=0; i<colorArray.length; i+=3){\r\n array.push(0.5,0.5,0.5);\r\n }\r\n return array;\r\n}", "function getColorList(cnt) {\n let retval = [];\n // This one just makes a list of all magenta\n while(cnt--)\n retval.push(Color().rgb(228,94,101));\n return retval;\n }", "function getRandomColor(array) {\n var colorIndex = Math.floor(Math.random() * (colors.length)); // \n var randomColor = array[colorIndex]; // 2\n \n return randomColor; // 3\n}", "function mkColorArray(num, color) {\n // Color array for #222c3c: Use #db7f67 (coolors red in the palette)\n // Alternatively a little bit darker c8745e\n let c = d3.hsl(color === undefined ? '#c8745e' : color);\n let r = [];\n for (i = 0; i < num; i++) {\n r.push(c + \"\");\n c.h += (360 / num);\n }\n return r;\n}", "function mapColors(data) {\n let strValue = [];\n for (let i = 0; i < data.length; i ++){\n strValue.push(String(JSON.stringify(data[i]))); // particolare tipo di hashing \n }\n oScale.domain(strValue);\n}", "function getWinningColor(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function clrs(i, j) {\n clr_list = [\n [0, 0, 0],\n [255, 255, 255],\n [204, 82, 82],\n [204, 163, 82],\n [163, 204, 82],\n [82, 204, 82],\n [82, 204, 163],\n [82, 163, 204],\n [82, 82, 204],\n [163, 82, 204],\n [204, 82, 163],\n [204, 82, 82]\n ];\n var tmp = clr_list[i];\n var foo = d3.rgb(tmp[0], tmp[1], tmp[2])\n return d3.rgb(tmp[0], tmp[1], tmp[2]).darker(2.5).brighter(j * 5);\n}", "function getGreenAndRedColors(largestValueInDataSet) {\n var colorDomain = [\n -1*largestValueInDataSet,\n -.9*largestValueInDataSet,\n -.8*largestValueInDataSet,\n -.7*largestValueInDataSet,\n -.6*largestValueInDataSet,\n -.5*largestValueInDataSet,\n -.4*largestValueInDataSet,\n -.3*largestValueInDataSet,\n -.2*largestValueInDataSet, \n -.1*largestValueInDataSet, \n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ff1919\",\n \"#ff3232\",\n \"#ff4c4c\",\n \"#ff6666\",\n \"#ff7f7f\",\n \"#ff9999\",\n \"#ffb2b2\",\n \"#ffcccc\",\n \"#ffe5e5\",\n \"#d0d6cd\",\n \"#bdc9be\",\n \"#aabdaf\",\n \"#97b0a0\",\n \"#84a491\",\n \"#719782\",\n \"#5e8b73\",\n \"#4b7e64\",\n \"#387255\",\n \"#256546\",\n \"#125937\",\n \"#004d28\",\n \"#004524\"\n ];\n return [colorDomain, colorRange];\n}", "function obtenerColores() { //amarillo, naranja,lavanda , rosa, gris, marron, violeta\r\n return [\"#ff0000\",\"#00ff00\",\"#0000ff\",\"#ffff00\",\"#FF8000\",\"#8000FF\",\"#FF8080\",\"#808080\",\"#800000\",\"#800080\"];\r\n}", "function arrRandomColor(){\r\n var red = Math.floor(Math.random() * 256); // random number for red\r\n var green = Math.floor(Math.random() * 256); // random number for green\r\n var blue = Math.floor(Math.random() * 256); // random number for blue;\r\n return \"rgb(\" +red + \", \" + green+ \", \" + blue+ \")\";\r\n}", "set_colors()\r\n {\r\n /* colors */\r\n let colors = [\r\n Color.of( 0.9,0.9,0.9,1 ), /*white*/\r\n Color.of( 1,0,0,1 ), /*red*/\r\n Color.of( 1,0.647,0,1 ), /*orange*/\r\n Color.of( 1,1,0,1 ), /*yellow*/\r\n Color.of( 0,1,0,1 ), /*green*/\r\n Color.of( 0,0,1,1 ), /*blue*/\r\n Color.of( 1,0,1,1 ), /*purple*/\r\n Color.of( 0.588,0.294,0,1 ) /*brown*/\r\n ]\r\n\r\n this.boxColors = Array();\r\n for (let i = 0; i < 8; i++ ) {\r\n let randomIndex = Math.floor(Math.random() * colors.length);\r\n this.boxColors.push(colors[randomIndex]);\r\n colors[randomIndex] = colors[colors.length-1];\r\n colors.pop();\r\n }\r\n\r\n }", "generateColors(itemCount) {\r\n let colors = [];\r\n let number = Math.round(360 / itemCount);\r\n //this loop splits the colour spectrum evenly and gives each\r\n //div a colour so that when in order, they resemble the colour spectrum\r\n for (let i = 0; i < itemCount; i++) {\r\n let color = chroma(\"#ff0000\");\r\n colors.push(color.set(\"hsl.h\", i * number));\r\n }\r\n return colors;\r\n }", "colorsPie() {\n this.colorArray=[\"#CA6A63\", \"#A4C2C5\", \"#CE808E\", \"#C8D3A8\", \"#200E62\", \"#469343\", \"#6C1EE1\", \"#5de35e\", \"#ec9576\", \"#fa173a\", \"#6c7160\", \"#bc0d79\", \"#8fbab4\", \"#1d61d6\", \"#656234\", \"#2d04df\", \"#d16881\", \"#f9b799\", \"#595875\", \"#35644e\"];\n }", "function getRandomColors() {\n // Search thru colors array for random color\n let myRandomColor = colors[Math.floor(Math.random() * colors.length)];\n // Returns #+value.\n return myRandomColor;\n }", "function getRandomColor() {\n return arrayOfColors[Math.floor(Math.random()*arrayOfColors.length)];\n}", "function reddify(rgbArr){ //todo3 //needs to take in an array parameter\n rgbArr[RED] = 255 //use array with this\n }", "function getTowColor(d) {\n \n // [,,,,,,,,,,]\n // ['#a50026','#d73027','#f46d43','#fdae61','#fee08b','#ffffbf','#d9ef8b','#a6d96a','#66bd63','#1a9850','#006837']\n let color = '';\n if (d < 1) {\n color = '#006837';\n } else if (d < 2) {\n color ='#1a9850';\n } else if (d < 3) {\n color = '#66bd63';\n } else if (d < 4) {\n color = '#a6d96a';\n } else if (d < 6) {\n color = '#d9ef8b';\n } else if (d < 8) {\n color = '#ffffbf';\n } else if (d < 11) {\n color = '#fee08b';\n } else if (d < 15) {\n color = '#fdae61';\n } else if (d < 21) {\n color = '#f46d43';\n } else if (d < 31) {\n color = '#d73027';\n } else {\n color = '#a50026';\n }\n\n return color\n}", "function rgb(color){\n return [color[0]/255, color[1]/255, color[2]/255];\n}", "function changeEveryColorToRed(colors) {\n}", "function randomColor () {\n let color = []\n for (let i=0; i<3; i++)\n color.push(Math.floor(Math.random(i) * 256));\n return color;\n}", "function getRandomColors(totalColors) {\n var masterList = [];\n for (let i = 0; i < totalColors; i++) {\n var rgbList = [];\n for (let j = 0; j < 3; j++) {\n rgbList.push(Math.floor(Math.random() * Math.floor(256)));\n }\n masterList.push(rgbList);\n }\n\n return masterList;\n}", "function chooseColors() {\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function getColor(colors) {\n var colorCode = []; // color letters, e.g. WU\n var colorText = []; // color text, e.g. White\n var colorListCode = ['W','U','B','R','G'];\n var colorListText = ['White','Blue','Black','Red','Green','Multi'];\n if (colors.length == 0) {\n // colors.length is empty for colorless cards\n colorCode = 'CL';\n colorText = 'Colorless';\n } else {\n for (var i = 0; i < colorListCode.length; i++) {\n if (colors.indexOf(colorListCode[i]) > -1) {\n // will always write color codes in WUBRG order (defined by colorListCode)\n colorCode += colorListCode[i];\n colorText = colorListText[i];\n }\n }\n }\n if (colors.length > 1) {\n // multicolor cards have more than 1 color\n // write 'Multi' instead of each color\n colorText = colorListText[5];\n }\n return [colorCode, colorText];\n}", "function getColors(list) {\n return list.map(function (obj) {\n return obj.color;\n });\n }", "function getRandomColors() {\n let rand = Math.floor(Math.random() * colors.length);\n return colors[rand];\n}", "function produceColors(lst) {\r\n\tvar red, green, blue;\r\n\tvar i = 0;\r\n\twhile ( i < 60){\r\n\t\tblue = Math.random();\r\n\t\tred = Math.random();\r\n\t\tgreen = Math.random();\r\n\t\tlst.push(vec4(red,green,blue,1.0));\r\n\t\ti++;\r\n\t}\r\n\treturn lst;\r\n}", "function buildColorSelection(){\n let colorSelection = [];\n for(let colors = 0; colors < 8; colors++){\n colorSelection.push(generateRandomColor());\n }\n return colorSelection\n}", "function colorList(R, G, B) {\n // shapeCol = color(H, S, 100);\n shapeCol = color(\"white\");\n goldCol = color(\"white\");\n // userTypedColor = color(\"green\");\n // txtCol = color(\"beige\");\n introTxtCol = color(\"beige\");\n circleCol = color(\"beige\");\n circleCol.setAlpha(200);\n introTxtCol2 = color(37, 5, 245);\n bkCol = color(0, 0, 17);\n}", "function GetColorHoverList() {\n return ['#1edab5', '#47d583', '#51a7e0', '#a971c0', '#405a74', '#1abe9e', '#2dca6f', '#3293d2', '#9e56bd', '#384f66'];\n}", "function redGreen(data) {\n for (var i = 0; i < data.length; i += 1) {}\n}", "getColor(x, y) {\n const distanceToNearestCircle = this.getDistance(x, y);\n\n const rgbaArray = this.getColorFromDistanceFromNearestCircle(distanceToNearestCircle);\n\n return rgbaArray;\n }", "function color (i){\n\tif (i===0){\n\t\treturn \"rgb(1, 95, 102)\";\n\t} else if (i===1) {\n\t\treturn \"rgb(45, 241, 255)\";\n\t} else if (i===2) {\n\t\treturn \"rgb(34, 86, 150)\";\n\t} else if (i===3) {\n\t\treturn \"rgb(0, 132, 88)\";\n\t} else if (i===4) {\n\t\treturn \"rgb(56, 255, 188)\";\n\t} else if (i===5) {\n\t\treturn \"rgb(77, 168, 137)\";\n\t} else {\n\t\treturn \"rgb(1, 95, 102)\";\n\t}\n}", "function getRedColors(largestValueInDataSet) {\n var colorDomain = [\n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ffe5e5\",\n \"#ffcccc\",\n \"#ffb2b2\",\n \"#ff9999\",\n \"#ff7f7f\",\n \"#ff6666\",\n \"#ff4c4c\",\n \"#ff3232\",\n \"#ff1919\",\n \"#e51616\",\n \"#ce1313\"\n ];\n return [colorDomain, colorRange];\n}", "function colorArray(len)\n{\n var colorArray = [];\n for(var i = 0; i < len; i++)\n {\n colorArray[i] = colors[i%colors.length];\n }\n return colorArray;\n}", "function randomColor(){\n return colors[Math.floor(Math.random() * colors.length)]\n}", "function llenarColores(){\n\n\t\tvar colores = [];\n\t\tfor(i=0;i<numColores;i++)\n\t\t\t{\n\t\t\t\tcolores[i] = colorRandom();\n\t\t\t}\n\t\treturn colores;\n}", "function fillColorArray() {\n return randomColor({\n count: 100\n });\n }", "function getColor(){\n //var colors = [ \"rgba(237, 106, 90, 1)\", \"rgba(247, 244, 205, 1)\", \"rgba(155, 193, 188, 1)\", \"rgba(92, 164, 169, 1)\", \"rgba(230, 235, 224, 1)\"];\n var colors = cscheme;\n\n //generates random n to select a color from the array above\n //if new color (colors[n]) is equal to last color selected, it loops again to not repeat colors\n do{\n n = Math.floor(Math.random() * colors.length);\n }while( colors[n] === color );\n\n return colors[n];\n }", "function getColors(len){\r\n\tfor(var i=0 ; i<len ; i++ )\r\n\t{\r\n\t\tcolorArr[i]=generateColor();\r\n\t}\r\n}", "function ColourList(Colours, i) {\n var colour = Colours[i];\n\n return \"rgb(\"+colour[0]+\",\"+colour[1]+\",\"+colour[2]+\")\";\n} // end function", "function color() {\n var colors = ['red', 'indigo', 'blue', 'green', 'darkgreen', 'maroon',\n 'brown', 'tomato', 'darkblue', 'violet', 'orange', 'pink'\n ];\n return colors[Math.floor(Math.random() * 8)];\n}", "randomColor(){\n return colors[Math.floor(Math.random() * colors.length)];\n }", "function pickColor(colors){\r\n\tvar random = Math.floor(Math.random() * colors.length);\r\n\treturn colors[random];\r\n}", "function getColor() {\n const colorNode = document.getElementsByClassName(\"selected\")[0];\n rgbString = colorNode.style.backgroundColor;\n return rgbString\n .substr(4, rgbString.length - 5)\n .replace(\" \", \"\")\n .split(\",\");\n}", "function _getColors() {\n return [\n '#000000',\n '#AA0000',\n '#BB5500',\n '#DDDD00',\n '#00AA00'\n ];\n }", "function getPickingColor(index) {\n return [(index + 1) % 256, Math.floor((index + 1) / 256) % 256, Math.floor((index + 1) / 256 / 256) % 256];\n}", "function rcol() {\n colors = ['#f5f2e6','#040204','#306dc9','#D1AE45','#b53012'];\n index = int(random(0,colors.length));\n print(index);\n return color(colors[index]);\n}", "function getGreenColors(largestValueInDataSet) {\n var colorDomain = [\n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#d0d6cd\",\n \"#bdc9be\",\n \"#aabdaf\",\n \"#97b0a0\",\n \"#84a491\",\n \"#719782\",\n \"#5e8b73\",\n \"#4b7e64\",\n \"#387255\",\n \"#256546\",\n \"#125937\",\n \"#004d28\",\n \"#004524\",\n \"#003e20\"\n ];\n return [colorDomain, colorRange];\n}", "function updateColorArray () {\n // IF USER IN IN MIDDLE OF COLOR ARRAY\n // REMOVE ALL ELEMENTS BEYOND THEIR POSITION\n var l = colors.length - 1;\n if (colorsIndex < l) {\n colors.splice(colorsIndex + 1, l - colorsIndex);\n }\n\n // ADD NEW COLOR TO ARRAY\n colors.push([r, g, b]);\n colorsIndex++;\n}", "function mapColorToPalette(red,green,blue){\n var color,diffR,diffG,diffB,diffDistance,mappedColor;\n var distance=250000;\n for(var i=0;i<palette.length;i++){\n color=palette[i];\n diffR=( color.r - red );\n diffG=( color.g - green );\n diffB=( color.b - blue );\n diffDistance = diffR*diffR + diffG*diffG + diffB*diffB;\n if( diffDistance < distance ){\n distance=diffDistance;\n mappedColor=palette[i];\n };\n }\n return(mappedColor);\n }", "function idsToColor(_ids) {\r\n\r\n let colors = [];\r\n for(let i = 0; i < _ids.length; i++) {\r\n let id = \"\" + _ids[i];\r\n\r\n let r = parseInt(id.substr(1, 3));\r\n let g = parseInt(id.substr(4, 3));\r\n let b = parseInt(id.substr(7, 3));\r\n let color = {r: r, g: g, b:b}\r\n colors.push(color);\r\n }\r\n return colors;\r\n}", "convertColorRange (colorRange) {\r\n\t\tswitch (colorRange) {\r\n\t\t\tcase 'red':\r\n\t\t\t\treturn ['#fee5d9', '#fcae91', '#fb6a4a', '#de2d26', '#a50f15'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'orange':\r\n\t\t\t\treturn ['#feedde', '#fdbe85', '#fd8d3c', '#e6550d', '#a63603'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'blue':\r\n\t\t\t\treturn ['#eff3ff', '#bdd7e7', '#6baed6', '#3182bd', '#08519c'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'green':\r\n\t\t\t\treturn ['#edf8e9', '#bae4b3', '#74c476', '#31a354', '#006d2c'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'grey':\r\n\t\t\t\treturn ['#f7f7f7', '#cccccc', '#969696', '#636363', '#252525'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'purple':\r\n\t\t\t\treturn ['#f2f0f7', '#cbc9e2', '#9e9ac8', '#756bb1', '#54278f'];\r\n\t\t\tdefault:\r\n\t\t\t\treturn ['#fee5d9', '#fcae91', '#fb6a4a', '#de2d26', '#a50f15'];\r\n\t\t}\r\n\t}", "function rgb(color){\n return [color[0]/255, color[1]/255, color[2]/255];\n }", "function generateRandomColour(){\n\n var colour=[];\n\n for(var i=0;i<3;i++){\n colour.push(Math.floor(Math.random() * 255));\n }\n\n\n return `rgb(${colour[0]},${colour[1]},${colour[2]},0.8)`;\n\n\n}", "function color_holds(a, b) {\n let color = d3.scaleLinear().domain([1,total_threshold.length])\n .interpolate(d3.interpolateHcl)\n .range([d3.rgb(a), d3.rgb(b)]);\n return total_threshold.map(t=>color(total_threshold.indexOf(t)));\n}", "function ColorIntensityPalette() {\n this.positive = [255, 0, 0];\n this.neutral = [200, 200, 200];\n this.negative = [0, 93, 144];\n\n this.rgb = function(color) {\n rgb = \"rgb(\" + \n color[0] + \",\" +\n color[1] + \",\" +\n color[2] + \")\";\n return rgb;\n }\n\n this.str = function(intensity) {\n if (intensity > 0) {\n var top_color = this.positive;\n } else {\n var top_color = this.negative;\n intensity = -intensity;\n }\n\n s = \"rgb(\";\n for (var i=0; i<3; i++) {\n diff = top_color[i] - this.neutral[i];\n s += Math.floor(this.neutral[i] + diff*intensity);\n if (i < 2) {\n s += \",\"\n }\n }\n s += \")\"\n return s;\n }\n}", "static CheckColors4(colors, count) {\n // Check if color3 was used\n if (colors.length === count * 3) {\n const colors4 = [];\n for (let index = 0; index < colors.length; index += 3) {\n const newIndex = (index / 3) * 4;\n colors4[newIndex] = colors[index];\n colors4[newIndex + 1] = colors[index + 1];\n colors4[newIndex + 2] = colors[index + 2];\n colors4[newIndex + 3] = 1.0;\n }\n return colors4;\n }\n return colors;\n }", "function randColor() {\n var color = [];\n var r = randNumber(255, 1);\n var g = randNumber(255, 13);\n var b = randNumber(255, 36);\n\n color.push(r, g, b);\n\n return color.join(\",\");\n}", "constructor(coloring = []){\n this._coloring = coloring;\n }", "function setColor (arr); {\n\n}// CODE HERE", "function searchRGB() {\n let i = colorPicked;\n let rgbValues = i.split(\"(\")[1].split(\")\")[0].split(\", \");\n return rgbValues;\n}", "function searchRGB() {\n let i = colorPicked;\n let rgbValues = i.split(\"(\")[1].split(\")\")[0].split(\", \");\n return rgbValues;\n}", "populateGridColorArrays() {\n //for every column..\n for (let i = 0; i < this.colNum; i++) {\n\n // //Generate colors based on a split complementry palette\n // if (i % 2 == 0) {\n // this.hVal = 19;\n // this.sVal = 91;\n // this.bVal = 95;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // } else if (i % 3 == 0) {\n // this.hVal = 59;\n // this.sVal = 96;\n // this.bVal = 87;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }else{\n // this.hVal = 240;\n // this.sVal = 57;\n // this.bVal = 89;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }\n\n // //Generate colors based on a triad palette\n // if (i % 2 == 0) {\n // this.hVal = 19;\n // this.sVal = 91;\n // this.bVal = 100;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // } else if (i % 3 == 0) {\n // this.hVal = 173;\n // this.sVal = 96;\n // this.bVal = 40;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }else{\n // this.hVal = 259;\n // this.sVal = 82;\n // this.bVal = 90;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }\n\n //Generate colors based on a analogus palette\n\n //based on the row number push one of three possible colors into the right hand side color array\n if (i % 3 === 0) {\n this.hVal = 261;\n this.sVal = 75;\n this.bVal = 91;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else if (i % 2 === 0) {\n this.hVal = 231;\n this.sVal = 90;\n this.bVal = 89;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else {\n this.hVal = 202;\n this.sVal = 90;\n this.bVal = 89;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n }\n\n //based on the row number push one of two possible colors (white or black) into the left hand side color array\n //two possible colors linearly interpolate to three possible colors creating and asnyschronus relation between the left and right hand sides\n if (i % 2 == 0) {\n this.hVal = 0;\n this.sVal = 0;\n this.bVal = 20;\n this.colorsLeft[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else {\n this.hVal = 0;\n this.sVal = 0;\n this.bVal = 85;\n this.colorsLeft[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n }\n }\n\n }", "getColor(i) {\n switch(i) {\n case 1:\n return 'blue';\n case 2:\n return 'red';\n case 3:\n return 'yellow';\n default:\n return 'grey';\n }\n }", "function colorGeneration () {\n\tvar rgb = []; \n\tfor (var i=0; i<3;i++){\n\t\trgb[i] = Math.floor(Math.random() * 256); // gera numeros aleatorios entre 0 e 255\n\t}\n\treturn rgb; \n}", "function containsPurple(arr){\n for(let color of arr){\n if (color === 'purple' || color === 'magenta'){\n return true;\n }\n }\n return false\n}", "get_listcolor(p) {\n\n // if there is only one color in the scheme\n if (this.num_colors == 1)\n return this.colors[0];\n\n // if the p is at the ends just return the color\n if (p >= 1.0)\n return this.colors[this.num_colors-1];\n else if (p <= 0.0)\n return this.colors[0];\n\n // get the two colors that will be part of the gradient\n let i = Math.floor(p * (this.num_colors - 1));\n let c_a = this.colors[i];\n let c_b = this.colors[i+1];\n\n // tween between the two colors\n let w = 1 / (this.num_colors-1);\n let cp = (p % w) / w;\n\n let nr = c_a[0] + (c_b[0] - c_a[0]) * cp;\n let ng = c_a[1] + (c_b[1] - c_a[1]) * cp;\n let nb = c_a[2] + (c_b[2] - c_a[2]) * cp;\n\n // return\n return [nr, ng, nb];\n }", "function randomColorz() {\n var tempColor =[\n random (255),\n random (255),\n random (255)\n ];\n \n return tempColor;\n }", "getColor(cnt) {\n const colors = this.get('colors');\n const cutoffs = this.get('cutoffs');\n if (cnt > cutoffs[4]) return colors[4];\n if (cnt > cutoffs[3]) return colors[3];\n if (cnt > cutoffs[2]) return colors[2];\n if (cnt >= cutoffs[1]) return colors[1];\n return colors[0];\n // return cnt > cutoffs[4] ? colors[4] :\n // cnt > cutoffs[3] ? colors[3] :\n // cnt > cutoffs[2] ? colors[2] :\n // cnt >= cutoffs[1] ? colors[1] :\n // colors[0];\n }", "function htmlColorNames(arr) {\n var arr=[1,2,'LavenderBlush', 'PaleTurquoise', 'FireBrick']\n // Only change code below this line\n let ree= arr.splice(0,2,'DarkSalmon','BlanchedAlmond');\n // Only change code above this line\n return ree,arr;\n }", "function getBlueColors(largestValueInDataSet) {\n var colorDomain = [\n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ebecf3\",\n \"#d8d9e7\",\n \"#c4c6dc\",\n \"#b1b4d0\",\n \"#9ea1c5\",\n \"#8a8eb9\",\n \"#777cad\",\n \"#6369a2\",\n \"#505696\",\n \"#484d87\",\n \"#404579\"\n ];\n return [colorDomain, colorRange];\n}", "function getColorSet(){\n\tvar colorSet = [\n\t\"#05668D\",\n\t\"#028090\",\n\t\"#00A896\",\n\t\"#02C39A\",\n\t\"#FF5733\"\n\t];\n\n\tvar selectColor = colorSet[Math.floor(Math.random() * 5)];\n\t//console.log(selectColor);\n\treturn selectColor;\n}", "function obtenerColores2() {\r\n return [\"#000000\",\"#00ff00\",\"#0000ff\",\"#ffff00\",\"#FF8000\",\"#8000FF\",\"#FF8080\",\"#808080\",\"#800000\",\"#800080\",\r\n \t\t\"#000000\",\"#00ff00\",\"#0000ff\",\"#ffff00\",\"#FF8000\",\"#8000FF\",\"#FF8080\",\"#808080\",\"#800000\",\"#800080\",\r\n \t\t\"#000000\",\"#00ff00\",\"#0000ff\",\"#ffff00\",\"#FF8000\",\"#8000FF\",\"#FF8080\",\"#808080\",\"#800000\",\"#800080\",\r\n \t\t\"#000000\",\"#00ff00\",\"#0000ff\",\"#ffff00\",\"#FF8000\",\"#8000FF\",\"#FF8080\",\"#808080\",\"#800000\",\"#800080\",\r\n \t\t\"#000000\",\"#00ff00\",\"#0000ff\",\"#ffff00\",\"#FF8000\",\"#8000FF\",\"#FF8080\",\"#808080\",\"#800000\",\"#800080\"];\r\n}", "getRandomColor() {\n return [Math.random()*this.particleColorMult[0]+this.particleColorMin[0],\n Math.random()*this.particleColorMult[1]+this.particleColorMin[1],\n Math.random()*this.particleColorMult[2]+this.particleColorMin[2], 1.0];\n }", "function colorFigures(colors, current_position) {\n\n\tvar chosen_color;\n\t//console.log(current_position);\n\tvar left = current_position.indexOf(\"left\");\n\tvar right = current_position.indexOf(\"right\");\n\tvar center = current_position.indexOf(\"center\");\n\n\tif (left >= 0) {\n\n\t\tchosen_color = colors[0];\n\n\t} else if (right >= 0) {\n\n\t\tchosen_color = colors[1];\n\n\t} else if (center >= 0) {\n\n\t\tchosen_color = colors[2];\n\n\t}\n\n\treturn chosen_color;\n\n}" ]
[ "0.72900283", "0.72145736", "0.71249884", "0.7089931", "0.70095515", "0.68770665", "0.6848165", "0.6838774", "0.6803002", "0.67866945", "0.67469114", "0.6743884", "0.67289686", "0.671771", "0.67100936", "0.6707575", "0.6706507", "0.6685481", "0.6633589", "0.6629389", "0.6628537", "0.6627789", "0.66256666", "0.66212314", "0.6610876", "0.6594013", "0.6586084", "0.6569518", "0.656598", "0.65575904", "0.65544", "0.6532647", "0.6527499", "0.65248835", "0.65118986", "0.65066767", "0.6504512", "0.6503994", "0.6502683", "0.6502095", "0.6499818", "0.6492435", "0.6489142", "0.647693", "0.64650327", "0.64647776", "0.64581937", "0.64529824", "0.6451066", "0.6449397", "0.6446037", "0.64338195", "0.64312017", "0.64170915", "0.64132565", "0.64043444", "0.6382301", "0.6380555", "0.637597", "0.637128", "0.6369795", "0.6355266", "0.63508046", "0.63479406", "0.63390803", "0.63384557", "0.63280374", "0.63258934", "0.6322122", "0.6321716", "0.63086325", "0.63065255", "0.6304454", "0.6301731", "0.62975657", "0.62964445", "0.62944406", "0.6290178", "0.6284614", "0.6276013", "0.6275192", "0.6270069", "0.6265495", "0.62649065", "0.6262988", "0.62587315", "0.6255194", "0.6255194", "0.62531155", "0.6249665", "0.6248286", "0.62474585", "0.6246427", "0.62459314", "0.6237289", "0.623468", "0.6222063", "0.62185335", "0.62152684", "0.62150645", "0.6202796" ]
0.0
-1
The snowfall This function adds snow to the DOM and apply's some random styling
function addSnow() { // Creating the snow element const snow = document.createElement('span'); // Setting random positions to the snow on the x-axis const left = Math.round(Math.random() * window.innerWidth); snow.style.left = left + 'px'; // Setting random sizes to the snow const radius = Math.round(Math.random() * 15 + 5); snow.style.width = radius + 'px'; snow.style.height = radius + 'px'; // Setting a random delay on the fall animation in the css // so all snow elements won't start falling at the same time snow.style.animationDelay = Math.random() * 10 + 's'; // Appending the snow to the DOM document.body.appendChild(snow); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSnow() { // shoud possibly be an object / constructo function\n var snow = document.createElement(\"div\");\n var _ = document.createTextNode(\".\");\n var main = document.getElementById(\"snowArea\"); // .createElement(\"div\");\n snow.appendChild(_);\n snow.classList.add(\"snow\");\n snow.style.cssText = \"background-color:blue;width:15px;border-radius:100%;\";\n snow.style.left = Math.random() * width + \"px\";\n snow.style.animationDuration = fallSpeed + \"s\";\n main.appendChild(snow);\n console.log(\"Created snow\");\n //console.log(\"Width: \" + width + \" FallSpeed: \" + fallSpeed + \" Rate: \" + rate);\n /* if (snow.style.top > 500 + \"px\") {\n\n }\n */\n}", "function createSnow() {\n for (i = 1; i < nbDrop; i++) {\n var dropLeft = randRange(0, 400);\n var dropTop = randRange(-1800, 1800);\n mobile1.append('div')\n .attr('class', \"snow\")\n .attr('id', \"snow\" + i);\n mobile1.select('#snow' + i)\n .style('left', dropLeft + 'px')\n .style('top', dropTop + 'px');\n }\n }", "function generateSnowflakes() {\n\n // get our snowflake element from the DOM and store it\n var originalSnowflake = document.querySelector(\".snowflake\");\n\n // access our snowflake element's parent container\n var body = originalSnowflake.parentNode;\n body.style.display = \"block\";\n\n // get our browser's size\n browserWidth = document.documentElement.clientWidth;\n browserHeight = document.documentElement.clientHeight;\n\n // create each individual snowflake\n for (var i = 0; i < numberOfSnowflakes; i++) {\n\n // clone our original snowflake and add it to body\n var snowflakeClone = originalSnowflake.cloneNode(true);\n body.appendChild(snowflakeClone);\n\n // set our snowflake's initial position and related properties\n var initialXPos = getPosition(50, browserWidth);\n var initialYPos = getPosition(50, browserHeight);\n var speed = 5 + Math.random() * 40;\n\n // create our Snowflake object\n var snowflakeObject = new Snowflake(snowflakeClone,\n speed,\n initialXPos,\n initialYPos);\n snowflakes.push(snowflakeObject);\n }\n\n // remove the original snowflake because we no longer need it visible\n body.removeChild(originalSnowflake);\n\n moveSnowflakes();\n }", "function addSnow(){\n var snow = jQuery('<div></div');\n snow.css({\n position: 'absolute',\n zIndex: 1,\n top: topContainer.offset().top + topContainer.outerHeight() - 6,\n display: 'none',\n width: '100%',\n height: 55,\n backgroundImage: 'url(\"/images/christmas/snow.png\")',\n backgroundRepeat: 'none',\n backgroundPosition: 'center top'\n });\n\n body.append(snow);\n\n snow.fadeIn(300);\n }", "function easterEggSnowy() {\n YAHOO.util.Get.script(\"http://cdn.easteregg.in/outcomes/snowy/snow.min.js\", {\n onSuccess: function() {\n var $snowyStyle = document.createElement(\"link\")\n , $snowFlurry = document.createElement('div')\n , $head = document.getElementsByTagName('head')[0]\n , $body = document.getElementsByTagName('body')[0];\n $snowyStyle.rel = 'stylesheet';\n $snowyStyle.href = 'http://cdn.easteregg.in/outcomes/snowy/ddg-snowy.css';\n $snowyStyle.type = 'text/css';\n $snowyStyle.media = 'screen';\n $snowFlurry.id = 'snow_flurry';\n $snowFlurry.innerHTML = '&nbsp;';\n // Add the stylesheet to the &lt;head&gt; element\n $head.appendChild($snowyStyle);\n // Prepend the &lt;canvas&gt; snowflakes to the &lt;body&gt; element\n $body.insertBefore($snowFlurry, $body.firstChild);\n }\n });\n}", "function letItSnow() {\n // Calling the addSnow function in a loop to add 50 snow elements\n for (let i = 0; i < 50; i++) {\n addSnow();\n }\n}", "function snow() {\n for (i = 0; i < flakes.length; i += 1) {\n flakes[i].update();\n }\n\n snowTimeout = requestAnimationFrame(function () { snow() });\n }", "function addSnowflakes(_event) {\n for (let i = 0; i < clickAmount; i++) {\n let x = random(_event.offsetX - 100, _event.offsetX + 100);\n let y = random(_event.offsetY - 100, _event.offsetY + 100);\n createSnowflake(x, y);\n }\n }", "function generateSnow(){\n var r = Math.random();\n if(r < 0.5)\n return new TreeImage('images/snowflakesmall.png', \n Math.random()*WIDTH, Math.random()*HEIGHT, \"snow\", \n 3 + Math.random() * speed_variance);\n else if (r < 0.9)\n return new TreeImage('images/snowflakemed.png', \n Math.random()*WIDTH, Math.random()*HEIGHT, \"snow\",\n 2 + Math.random() * speed_variance);\n else\n return new TreeImage('images/snowflakelarge.png',\n Math.random()*WIDTH, Math.random()*HEIGHT, \"snow\",\n 1 + Math.random() * speed_variance);\n}", "function floatySnow() {\n setCond({\n amp: 250,\n speedMin: .1,\n speedMax: 1,\n spinMin: .001,\n spinMax: .005,\n sizeMin: .1,\n sizeMax: .2,\n scaleMin: 1,\n scaleMax: 10,\n alphaMin: .7,\n alphaMax: .9,\n grow: false,\n numShapes: 100,\n direction: \"Down\",\n shape: \"Pill\",\n words: \"\",\n bounce: false,\n bgColor: '#7CD3D8', // blue greyish sky\n colors: ['#FFFFFF'] // white snow\n });\n}", "function snow(){\n\n}", "function animateParticles(snow) {\n var verts = snow.geometry.vertices;\n for(var i = 0; i < verts.length; i++) {\n var vert = verts[i];\n if (vert.y < -200) {\n vert.y = Math.random() * 400 - 200;\n }\n vert.y = vert.y - (10 * delta);\n }\n snow.rotation.y -= .1 * delta;\n }", "function drawWaterfall(){\n\t\t\n\t\t}", "function renderBalloons() {\n var strHTML = '';\n for (var i = 0; i < gBalloons.length; i++) {\n strHTML += `<div \n style=\"background-color: ${getRandomColor()}; left: ${i * 100}px;\" onmouseover=\"speedUp(${i})\" onclick=\"blowUp(this)\" class=\"balloon\"></div>`;\n }\n var elSky = document.querySelector('.sky');\n elSky.innerHTML = strHTML;\n}", "function ThemeSnow() {\n const [isSnow, setSnow] = React.useState(false);\n React.useEffect(() => {\n let s = setTimeout(() => {\n setSnow(true);\n }, 10000);\n\n return () => {\n clearTimeout(s);\n };\n }, []);\n const renderSnows = React.useCallback(() => {\n return [...Array(21)].map((snow, index) => {\n return (\n <img\n style={{ animationName: index % 2 !== 0 ? \"bounce\" : \"bounce2\", animationDelay: \"4s\" }}\n className={`ball${index}`}\n\n key={index}\n src={\"https://tix.vn/app/assets/img/noel/2018/snowflake_1.png\"}\n alt=\"snow\"\n />\n );\n });\n }, []);\n\n const renderSnows1 = React.useCallback(() => {\n return [...Array(21)].map((snow, index) => {\n return (\n <img\n style={{ animationName: index % 2 !== 0 ? \"bounce\" : \"bounce2\" }}\n className={`balls${index}`}\n key={index}\n alt=\"snow2\"\n\n src={\"https://tix.vn/app/assets/img/noel/2018/snowflake_1.png\"}\n />\n );\n });\n }, []);\n\n const renderSnows2 = React.useCallback(() => {\n return [...Array(21)].map((snow, index) => {\n return (\n <img\n style={{ animationName: index % 2 !== 0 ? \"bounce\" : \"bounce2\" }}\n className={`ball${index}`}\n key={index}\n alt=\"snow\"\n\n src={\"https://tix.vn/app/assets/img/noel/2018/snowflake_1.png\"}\n />\n );\n });\n }, []);\n return (\n <div p={0} className=\"snows\">\n {renderSnows()}\n {isSnow && renderSnows1()}\n {isSnow && renderSnows2()}\n </div>\n );\n}", "function snowflake() {\n // initialize coordinates\n this.posX = 0;\n this.posY = random(-50, 0);\n this.initialangle = random(0, 2 * PI);\n this.size = random(2, 5);\n\n // radius of snowflake spiral\n // chosen so the snowflakes are uniformly spread out in area\n this.radius = sqrt(random(pow(width / 2, 2)));\n\n this.update = function(time) {\n // x position follows a circle\n let w = 0; // angular speed Changed the speed to 0\n let angle = w * time + this.initialangle;\n this.posX = width / 2 + this.radius * sin(angle);\n\n // different size snowflakes fall at slightly different y speeds\n this.posY += pow(this.size, 0.5);\n\n // delete snowflake if past end of screen\n if (this.posY > height) {\n let index = snowflakes.indexOf(this);\n snowflakes.splice(index, 1);\n }\n }\n\n this.display = function() {\n ellipse(this.posX, this.posY, this.size);\n }\n}", "function snowflake() {\n // initialize coordinates\n this.posX = 0;\n this.posY = random(-50, 0);\n this.initialangle = random(0, 2 * PI);\n this.size = random(2, 5);\n\n // radius of snowflake spiral\n // chosen so the snowflakes are uniformly spread out in area\n this.radius = sqrt(random(pow(width / 2, 2)));\n\n this.update = function(time) {\n // x position follows a circle\n let w = 0.6; // angular speed\n let angle = w * time + this.initialangle;\n this.posX = width / 2 + this.radius * sin(angle);\n\n // different size snowflakes fall at slightly different y speeds\n this.posY += pow(this.size, 0.5);\n\n // delete snowflake if past end of screen\n if (this.posY > height) {\n let index = snowflakes.indexOf(this);\n snowflakes.splice(index, 1);\n }\n };\n\n this.display = function() {\n ellipse(this.posX, this.posY, this.size);\n };\n}", "function D3PedalMap_brake_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-xp8anw-style\";\n\tstyle.textContent = \".svelte-xp8anw .line{stroke-width:2;fill:none}.svelte-xp8anw .axis path{stroke:black}.svelte-xp8anw .text{font-size:12px}.svelte-xp8anw .title-text{font-size:12px}.svelte-xp8anw .grid line{stroke:lightgrey;stroke-opacity:0.7;shape-rendering:crispEdges}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "function letItSnow(){\n\n var i, x, y, flakeElem;\n var fallingStep = snowFallSpeed;\n flake.y += fallingStep;\n\n var flakeElem = find(flake.id);\n\n if(flakeElem){\n flakeElem.style.top = flake.y+\"px\";\n\n // When the flake hits the groundLevel, it will be sent back up\n var groundLevel = getWindowHeight()-100; // from the roof!\n\n // TEACHER COMMENT: monsterMouthLevel was so low that the flake never\n // end up there (was turned up before that)! The values need\n // some modifications yet.\n var monsterMouthLevel = groundLevel-250;\n var monsterMouthLeft = monster1.x+10;\t// Left part of mouth.\n var monsterMouthRight = monster1.x+130;\t// Right part of mouth.\n\n // Random x value for the \"new\" flake:\n var random_x = Math.floor((Math.random() * getWindowWidth()));\n\n // Test first if flake is inside the mouth:\n if(flake.x > monsterMouthLeft &&\n flake.x < monsterMouthRight &&\n flake.y > monsterMouthLevel){\n\n sendFlakeUp(random_x, flakeElem);\n\n // Adds a point:\n addaPoint();\n\n // TEACHER COMMENT: Must call the function here!\n swallow(monster1.id);\n\n } else if(flake.y > groundLevel){\n sendFlakeUp(random_x, flakeElem);\n }\n\n // Recursive call:\n timer = setTimeout(\"letItSnow()\",40);\n }\n}", "function snow ()\n{\n\t//positions snow's x-coordinate from 0 to the width of the canvas\n\t\n\tthis.x = Math.random() * canvas.width; //sets the x to a random location\n\tthis.y = Math.random() * canvas.height; //sets the y to a random location\n\tthis.x = canvas.width/2; //sets the x to the center of the screen\n\tthis.y = canvas.height/2; //sets the y to the center of the screend\n\tthis.radius = Math.random() * 10 + 5;\n\tthis.vx = Math.random() * 10 + 5;\n\tthis.vy = Math.random() * 10 + 5;\n\n\tthis.vx = Math.random() * 20 - 10; //to move left and right \n\tthis.vy = Math.random() * 20 - 10; //to move up and down\n\n\t\t//draw a circle on the canvas\n\t\tthis.draw = function ()\n\n\t\t{\n\n\t\tcontext.fillStyle = \"aaaacc\"; //sets the color\n\t\tcontext.beginPath(); //starts a shape\n\n\t\t//creates the geometry for a circle\n\t\tcontext.arc(this.x, this.y, this.radius, this.radius, 0, 360 * Math.PI/180, false);\n\n\t\tcontext.fill(); //colors in the geometry\n\n\t\t}\n\n\t\t\n\t\t//move the snow\n\t\tthis.move = function ()\n\n\t\t{\n\n\t\t//add velocity y to y position\n\t\tthis.vy += gravity; //to apply gravity\n\t\tthis.x += this.vx; //to move things on the x-axis\n\t\tthis.y += this.vy; //to move things on the y-axis\n\n\t\tthis.y += Math.random() * 10 - 5; //to move randomly in different directions\n\t\tthis.x += Math.random() * 10 - 5; \n\n\t\t//check to see if snow is off the screen\n\n\t\t\tif(this.y > canvas.height)\n\t\t\t{\n\t\t\tthis.y = Math.random() * 1000 - 75; //puts snow back at top of screen\n\t\t\tthis.x = Math.random() * 1000 - 75;\n\n\t\t\t}\n\t\t}\n}", "function setUpWeather() {\n stage2Cloud1.style.opacity = \"0\";\n stage2Cloud2.style.opacity = \"0\";\n stage2Cloud3.style.opacity = \"0\";\n stage3Cloud1.style.opacity = \"0\";\n stage3Cloud2.style.opacity = \"0\";\n stage3Cloud3.style.opacity = \"0\";\n ice.style.opacity = \"0\";\n}", "function createRain() {\n\n\tfor( i=1;i<nbDrop;i++) {\n\tvar dropLeft = randRange(0,2000); //range for right side\n\tvar dropTop = randRange(-1000,1400); //how fast the drops fall\n\n\nvar dropDiv = document.createElement('div');\ndropDiv.className = 'drop';\ndropDiv.id = 'drop' + i;\ndocument.querySelector('.rain').appendChild(dropDiv);\n\n\t$('#drop'+i).css('left',dropLeft);\n\t$('#drop'+i).css('top',dropTop);\n\t}\n\n}", "function updateSnowflakes() {\n for (let i = 0; i < snowflakes.length; i++) {\n // Die Schneeflocken fallen von oben nach unten, also muss der Y-Wert steigen\n snowflakes[i].y++;\n // Die Position unserer Schneeflocke definiert gleichzeitig den Mittelpunkt unseres Kreises\n // der die Schneeflocke graphisch dastellt. Würden wir also nur testen ob (y > height), dann\n // würde die Schneeflocke am unteren Rand verschwinden, wenn sie noch halb im Bild ist ...\n if (snowflakes[i].y > context.canvas.height + radius) {\n // ... und umgekehrt würde sie am oberen Bildrand mit einem Schlag halbgemalt auftauchen,\n // würden wir (y = 0) setzen. So werden die Schneeflocken erst nach oben verschoben, wenn\n // komplett aus dem Bild verschwunden sind und soweit nach oben versetzt, dass sie nach und\n // nach ins Bild rutschen.\n snowflakes[i].y = 0 - radius;\n }\n }\n }", "function newSwimmer() {\n let s = document.createElement('img');\n s.classList.add('swimmer');\n s.classList.add('back');\n if(metaphor==\"gymbags\")\n s.setAttribute('src', '/images/swimmer-with-bag.png');\n else\n s.setAttribute('src', '/images/swimmer.png');\n scene.appendChild(s);\n\n s.posX = xEntry - 50 + 70*Math.random();\n s.posY = 170 + Math.random() * heightPool;\n\n s.animate([\n { transform: 'translateX(' + 0 + 'px) translateY(' + s.posY + 'px)' },\n { transform: 'translateX(' + s.posX + 'px) translateY(' + s.posY + 'px)' }\n ],{ \n duration: 1000 / speed,\n easing: \"ease-out\",\n fill: \"forwards\"\n });\n\n return s;\n}", "function seeFarm(){\n //clear the document and set the background image\n document.body.innerHTML = \"\";\n\n var sun = createDiv();\n sun.id = \"sun\";\n\n var sunRays = createDiv();\n sunRays.id = \"rings\";\n sun.appendChild(sunRays);\n\n var sunRay1 = createDiv();\n sunRay1.classList.add(\"sunRay\");\n sunRays.appendChild(sunRay1);\n\n var sunRay2 = createDiv();\n sunRay2.classList.add(\"sunRay\");\n sunRays.appendChild(sunRay2);\n\n var sunRay3 = createDiv();\n sunRay3.classList.add(\"sunRay\");\n sunRays.appendChild(sunRay3);\n\n\n var farmerImage = createImage(\"images/farmer.png\");\n farmerImage.id = \"farmerPrize\";\n\n var barnImage = createImage(\"images/barn.png\");\n barnImage.id = \"barnPrize\";\n\n var chickenImage = createImage(\"images/chicken.png\");\n chickenImage.id = \"chickenPrize\";\n\n var pigImage = createImage(\"images/pig.png\");\n pigImage.id = \"pigPrize\";\n\n var goatImage = createImage(\"images/goat.png\");\n goatImage.id = \"goatPrize\";\n\n var cowImage = createImage(\"images/cow.png\");\n cowImage.id = \"cowPrize\";\n\n var donkeyImage = createImage(\"images/donkey.png\");\n donkeyImage.id = \"donkeyPrize\";\n\n var duckImage = createImage(\"images/duck.png\");\n duckImage.id = \"duckPrize\";\n\n var chickImage = createImage(\"images/chick.png\");\n chickImage.id = \"chickPrize\";\n\n var sheepImage = createImage(\"images/sheep.png\");\n sheepImage.id = \"sheepPrize\";\n\n var chicken2Image = createImage(\"images/chicken2.png\");\n chicken2Image.id = \"chicken2Prize\";\n\n var goat2Image = createImage(\"images/goat2.png\");\n goat2Image.id = \"goat2Prize\";\n\n var tree = createImage(\"images/tree.png\");\n tree.id = \"tree\";\n\n //create button to go back to home page\n var backToHomeButton = createButton(\"Back to Home Page\");\n backToHomeButton.id = \"backHomePrizeButton\";\n backToHomeButton.onclick = chooseLevel;\n}", "function appendToCanvas(flakes) {\n\n var g = svg.selectAll()\n .data(flakes)\n .enter()\n .append('g')\n .classed('new snowflake', true)\n .style('fill-opacity', function(d) {\n return (d.radius - minRadius) / (maxRadius - minRadius)\n })\n .attr('T', 0)\n .attr('transform', function(d) {\n var y = d.y = d.y - d.radius * 2\n return 'translate(' + d.x + ',' + y + ') ' + 'scale(' + (d.radius * 2 / snowflakeBorder) + ',' + (d.radius * 2 / snowflakeBorder) + ') '\n })\n .attr('cx', function(d) {\n return d.x\n })\n .attr('cy', function(d) {\n return d.y\n })\n .attr('r', function(d) {\n return d.radius\n })\n .attr('id', function(d) {\n return d.id\n })\n\n g.append('path')\n .attr('d', snowflake)\n\n g.transition()\n .ease('linear')\n .duration(2000)\n .attr('T', 1)\n .attr('transform', function(d) {\n if (d.y != h - d.radius) {\n var mov = (Math.random() * (d.x + snowflakeHorizontalMoveMax - d.x + snowflakeHorizontalMoveMax)) + (d.x - snowflakeHorizontalMoveMax)\n d.x = Math.max(2 * d.radius, Math.min(w - 2 * d.radius, mov))\n }\n d.y = d.y + d.fall\n return 'translate(' + d.x + ',' + d.y + ') ' + 'scale(' + (d.radius * 2 / snowflakeBorder) + ',' + (d.radius * 2 / snowflakeBorder) + ') '\n })\n .each('end', function(d) {\n if (!d3.select(this).classed('near-end')) {\n d3.select(this).classed('moving', true)\n }\n d3.select(this).classed('new', false)\n transition()\n })\n\n}", "function D3PedalMap_clutch_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-xp8anw-style\";\n\tstyle.textContent = \".svelte-xp8anw .line{stroke-width:2;fill:none}.svelte-xp8anw .axis path{stroke:black}.svelte-xp8anw .text{font-size:12px}.svelte-xp8anw .title-text{font-size:12px}.svelte-xp8anw .grid line{stroke:lightgrey;stroke-opacity:0.7;shape-rendering:crispEdges}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "function draw() {\n var width = 80;\n var height = 80;\n var top = 0;\n var left = Math.round(Math.random() * (windowWidth - width));\n var newFire1 = $('<div>');\n newFire1.addClass('fires').css({\n 'width': width,\n 'height': height,\n 'background': 'url(\"assets/fireball3.gif\")',\n 'background-size': 'cover',\n 'display': 'inline-block',\n 'left': left,\n 'position': 'absolute',\n 'top': top,\n 'z-index': '-1'\n });\n sky.append(newFire1);\n fall(newFire1);\n\n // draw pokemon randomly\n var rand = Math.round(Math.random() * 10);\n var pokemonSelector = Math.round(Math.random() * 11);\n var pokemonPic = pokemons[pokemonSelector];\n if (rand === 7) {\n var pokemonHelper = $('<div>');\n left = Math.round(Math.random() * (windowWidth - width));\n pokemonHelper.addClass('helpers').css({\n 'width': width,\n 'height': height,\n 'background': pokemonPic,\n 'background-size': 'cover',\n 'display': 'inline-block',\n 'left': left,\n 'top': top,\n 'position': 'absolute',\n 'z-index': '-1'\n });\n sky.append(pokemonHelper);\n fall(pokemonHelper);\n }\n\n }", "function createFlower() {\n const flowerContainer = document.getElementById(\"flower-container\");\n\n // Create the stem element\n const stem = document.createElement(\"div\");\n stem.classList.add(\"stem\");\n\n // Create the flower center element\n const flowerCenter = document.createElement(\"div\");\n flowerCenter.classList.add(\"flower-center\");\n\n // Append the stem and flower center to the flower container\n flowerContainer.appendChild(stem);\n flowerContainer.appendChild(flowerCenter);\n\n // Create the petal elements\n for (let i = 0; i < 4; i++) {\n const petal = document.createElement(\"div\");\n petal.classList.add(\"petal\");\n flowerContainer.appendChild(petal);\n }\n}", "function createFlower() {\n const flowerContainer = document.getElementById(\"flower-container\");\n\n // Create the stem element\n const stem = document.createElement(\"div\");\n stem.classList.add(\"stem\");\n\n // Create the flower center element\n const flowerCenter = document.createElement(\"div\");\n flowerCenter.classList.add(\"flower-center\");\n\n // Append the stem and flower center to the flower container\n flowerContainer.appendChild(stem);\n flowerContainer.appendChild(flowerCenter);\n\n // Create the petal elements\n for (let i = 0; i < 4; i++) {\n const petal = document.createElement(\"div\");\n petal.classList.add(\"petal\");\n flowerContainer.appendChild(petal);\n }\n}", "function createRain() {\n for (i = 1; i < nbDrop; i++) {\n var dropLeft = randRange(0, 400);\n var dropTop = randRange(-1800, 1800);\n mobile1.append('div')\n .attr('class', \"drop\")\n .attr('id', \"drop\" + i);\n mobile1.select('#drop' + i)\n .style('left', dropLeft + 'px')\n .style('top', dropTop + 'px');\n }\n }", "function drawSun() {\n L10_Super.crc2.beginPath();\n L10_Super.crc2.arc(Math.random() * width + 100, height / 4, 100, 0, 2 * Math.PI);\n L10_Super.crc2.fillStyle = \"#FFFF66\";\n L10_Super.crc2.fill();\n L10_Super.crc2.closePath();\n }", "function fireSnowball() {\n if(!GAME_PAUSED){\n\n var snowballDivStr = \"<div id='r-\" + snowballIdx + \"' class='snowball'><img src='img/snowball.png'/></div>\";\n // Add the snowball to the screen\n gwhGame.append(snowballDivStr);\n // Create and snowball handle based on newest index\n var curSnowball = $('#r-'+snowballIdx);\n let curImg = $('#r-'+snowballIdx + ' img');\n snowballIdx++; // update the index to maintain uniqueness next time\n\n curSnowball.css('top', SNOWMAN_OBJ.snowmanStyle.top);\n var rxPos = SNOWMAN_OBJ.snowmanStyle.left + snowman.width()/4; // In order to center the snowball, shift by half the div size (recall: origin [0,0] is top-left of div)\n curSnowball.css('left', rxPos+\"px\");\n\tcurSnowball.css('fontSize', SNOWBALL_DURABILITY * 10); \n curSnowball.css('height', SNOWBALL_SIZE + \"px\");\n curSnowball.css('width', SNOWBALL_SIZE + \"px\");\n curImg.css('height', SNOWBALL_SIZE + \"px\");\n curImg.css('width', SNOWBALL_SIZE + \"px\");\n\n\n // Create movement update handler\n setInterval( function() {\n curSnowball.css('top', parseInt(curSnowball.css('top'))-SNOWBALL_SPEED);\n // Check to see if the snowball has left the game/viewing window\n if (parseInt(curSnowball.css('top')) < 0) {\n //curSnowball.hide();\n curSnowball.remove();\n }\n }, OBJECT_REFRESH_RATE);\n SNOWBALL_TIMER = 0;\n\n }\n\n}", "function imagesLoaded(e) {\n stats = new Stats();\n stats.domElement.style.position = 'absolute';\n stats.domElement.style.left = '0px';\n stats.domElement.style.top = '0px';\n document.body.appendChild( stats.domElement );\n var ss = new createjs.SpriteSheet({images:[af[STARS]],frames: {width:30, height:22, count:4, regX: 0, regY:0}, animations:{blink:[0,3]}});\n for ( var c = 0; c < 100; c++ ) {\n if ( Math.random() < 0.2 ) {\n var star = new createjs.Sprite(ss);\n star.spriteSheet.getAnimation('blink').speed = 1/((Math.random()*3+3)|0);\n star.gotoAndPlay('blink');\n if( Math.random() < 0.5 ) star.advance();\n } else {\n star = new createjs.Bitmap(af[STAR]);\n if ( Math.random() < 0.66 ) {\n star.sourceRect = new createjs.Rectangle(0,0,star.image.width/2,star.image.height/2);\n } else if ( Math.random() < 0.33 ) {\n star.sourceRect = new createjs.Rectangle(0,0,star.image.width/2,star.image.height);\n }\n }\n star.x = Math.random()*canvas.width;\n star.y = Math.random()*canvas.height;\n star.regX = 25;\n star.regY = 25;\n star.velY = Math.random()*1.5+1;\n star.rotVel = Math.random()*4-2;\n star.scaleX = star.scaleY = Math.random()*.5+.5;\n star.rotation = Math.random() * 360;\n stage.addChild(star);\n stars.push(star);\n }\n shelter = new createjs.Bitmap(af[SHELTER]);\n shelter.x = canvas.width/2;\n shelter.y = canvas.height/1.5;\n shelter.regX = shelter.image.width / 2;\n shelter.regY = shelter.image.height / 2;\n stage.addChild(shelter);\n\n // set the Ticker to 30fps \n createjs.Ticker.setFPS(30); \n createjs.Ticker.addEventListener('tick', this.onTick.bind(this)); \n}", "function drawSnowflake(level, sides, cvs) {\n if (level == 0) drawpoly(sides, 2 * Math.PI / sides, cvs);\n else\n for (var i = 0; i <= sides - 1; i++)//overall structure is square, so draw 3 time\n {\n Resize(1.0 / 2.65);\n drawSnowflake(level - 1, sides, cvs);\n Move(1);\n Move(2);\n Turn(2 * Math.PI / sides);\n Resize(2.65);\n }\n }", "start() {\n document.body.appendChild(this.container);\n\n if (this.isRaining) {\n return this.stop();\n }\n\n this.isRaining = true;\n\n this.startCreationLoop();\n this.animate();\n }", "function addStyles(newElem){\n// Random Width and Height ==============\n\tlet elWidth = randomInt(window.innerWidth/10, window.innerWidth/4)+'px';\n\tlet elHeight = randomInt(window.innerHeight/6, window.innerHeight/3)+'px';\n// Random Width and Height ==================\n\n// Random Opacity ====================\n\tlet elOpacity = Math.random();\n\tif(elOpacity < 0.3){\n\t\telOpacity = elOpacity+0.6;\n\t}else if (elOpacity < 0.5) {\n\t\telOpacity = elOpacity+0.3;\n\t}\n// Random Opacity ====================\n\n\n// Random Position ====================\n\tlet elLeft_01 = randomInt(0, window.innerWidth);\n\tlet elTop_01 = randomInt(0, window.innerHeight);\n\n\tif(elLeft_01 > window.innerWidth - 200){\n\t\telLeft_01 = elLeft_01 - 200;\n\t}\n\tif(elTop_01 > window.innerHeight - 200){\n\t\telTop_01 = elTop_01 - 200;\n\n\t}\n\tlet elLeft = elLeft_01 + 'px';\n\tlet elTop = elTop_01 + 'px';\n// Random Position ====================\n\n\n//adding Styles ========================\n\tnewElem.style.width = `${elWidth}`;\n\tnewElem.style.height = `${elHeight}`;\n\n\n\tnewElem.style.left = `${elLeft}`;\n\tnewElem.style.top = `${elTop}`;\n\n\tnewElem.style.opacity = `${elOpacity}`;\n\n\tsetBg(newElem);\n}", "function D3PedalMap_throttle_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-xp8anw-style\";\n\tstyle.textContent = \".svelte-xp8anw .line{stroke-width:2;fill:none}.svelte-xp8anw .axis path{stroke:black}.svelte-xp8anw .text{font-size:12px}.svelte-xp8anw .title-text{font-size:12px}.svelte-xp8anw .grid line{stroke:lightgrey;stroke-opacity:0.7;shape-rendering:crispEdges}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "function createRain() {\n for( let i = 1; i<nbDrop; i++) {\n let dropLeft = randRange(0,1600);\n let dropTop = randRange(-1000,1400);\n\n $('#rain').append('<div class=\"drop\" id=\"drop' + i + '\"></div>');\n $('#drop' + i).css('left', dropLeft).css('top', dropTop);\n }\n}", "function snowBackBuffer() {\n if (backBuffer != null) {\n var width = backBuffer.getWidth();\n var height = backBuffer.getHeight();\n for (var iY = 0; iY < height; iY++) {\n for (var iX = 0; iX < width; iX++) {\n var randomValue = Math.min(Math.floor(Math.random() * 255.0));\n\n backBuffer.setRGB(iX, iY, PALETTE_GRAY_STANDARD[randomValue]);\n }\n }\n }\n }", "function blink(){\n // Setup of a random selektor\n let startID = Math.floor((Math.random() * 100) + 1);\n // Selekting random star\n let selection = document.querySelector( \"#\" + setStargazer[\"generateItemClass\"] + \"-\"+ startID);\n // Adding blink-classs to selektion\n selection.classList.add(setStargazer[\"setMorphClass\"]);\n setTimeout(function(){ \n // Removing Blink-class after timeout\n selection.classList.remove(setStargazer[\"setMorphClass\"]);\n }, setStargazer[\"setMorphSpeed\"]/2);\n }", "function createSmoke(){\r\n for(z = 0; z < 15; z ++){\r\n smoke = new createjs.Shape();\r\n smoke.graphics.beginFill(createjs.Graphics.getRGB(225, 225, 225)).drawCircle(0, 0, 10 * Math.random() + 50).closePath();\r\n smoke.alpha = 0.5 * Math.random();\r\n smoke.x = 20 + (600 * Math.random());\r\n smoke.y = 660 + (40 * Math.random());\r\n smoke.scaleX = smoke.scaleY = scaleY = (50 * Math.random() + 20) / 100;\r\n mainContainer.addChild(smoke);\r\n smokeList.push(smoke);\r\n }\r\n}", "function makeWhiteBalls() {\n if (player.whiteballs > 0) {\n let temp = player.whiteballs;\n let div = document.createElement(\"div\");\n div.classList.add(\"whiteballs\");\n div.x = Math.floor(Math.random() * 710);\n if (div.x < 0) div.x = 100;\n div.y = 0.5625;\n div.speed = Math.ceil(Math.random() * 1) + 3;\n container.appendChild(div);\n div.style.left = div.y + \"px\";\n div.style.top = div.x + \"px\";\n }\n}", "function createRain() {\r\n for (i = 0; i < nbDrop; i++) {\r\n \r\n var dropLeft = randRange(0, 2500);\r\n var dropTop = randRange(-1000, 1000);\r\n $('.rain').append('<div class=\"drop\" id=\"drop'+ i +'\"></div>');\r\n $('#drop' + i).css('left', dropLeft);\r\n $('#drop' + i).css('top', dropTop); \r\n }\r\n }", "function drawDailyEvent() {\n var daily_event_list = ['thinking', 'talking', 'jumping'];\n $.each(daily_event_list, function(index, value) {\n var daily_event_id = value.replace(/\\s+/g, '_').toLowerCase();\n $('.daily_render_part').prepend('<div class=\"col-xs-4 daily-image\" id=\"'+ daily_event_id +'\"></div>');\n $('#'+ daily_event_id).append('<img class=\"img-responsive\" src=\"images/logo/yadl-background.png\" >');\n $('#'+ daily_event_id).append('<p>' + value + '</p>');\n $('#'+ daily_event_id).append('<center class=\"overlay\"></center>');\n $('#'+ daily_event_id + ' .overlay').append('<img src=\"images/logo/yadl-blue-check.png\">');\n });\n}", "function add_css(){var style=element(\"style\");style.id=\"svelte-r8gx3p-style\";style.textContent=\"div.svelte-r8gx3p{display:flex;justify-content:center;align-items:center;font-size:inherit;font-family:inherit;padding:0.3em;border-radius:40px;transition:background 150ms ease-in-out}div.svelte-r8gx3p:hover{background:#eeeeee;cursor:pointer}.bn-notify-dark-mode-close-background.svelte-r8gx3p:hover{background:#00222c}\";append(document.head,style)}", "function main() {\n renderPopCities();\n //inital render at defualt \"-\" ticks\n renderJumbo();\n var dash = \"-\";\n for (var i = 0; i < cards.length; i++) {\n var card = cards[i]; // access array of jquery div obj on DOM\n card.empty(); //empty current content\n // add updated content based on new forecast returned data \n var header = $(\"<div>\");\n header.attr(\"class\", \"card-header\");\n header.text(dash);\n var icon = $(\"<img>\");\n icon.attr(\"src\", \"#\");\n var body = $(\"<div>\");\n body.attr(\"class\", \"card-body\");\n var card_temp = $(\"<p>\");\n card_temp.attr(\"class\", \"card-text\");\n card_temp.text(dash)\n var card_humid = $(\"<p>\");\n card_humid.attr(\"class\", \"card-text\");\n card_humid.text(dash);\n //attach card data to card\n body.append(card_temp);\n body.append(card_humid);\n\n card.append(header);\n card.append(icon);\n card.append(body);\n\n cards[i].append(card);\n }\n\n }", "checkWeatherText() {\n\n if ( this.state.description === \"Sunny\" || this.state.description === \"Clear\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, rgb(249, 245, 148) 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 1');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 0');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 0');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 0');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'display: none');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'display: none');\n } else if ( this.state.description === \"Partly cloudy\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, rgb(249, 245, 148) 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 1');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 1');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 0');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'display: none');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'display: none');\n } else if ( this.state.description === \"Cloudy\" || this.state.description === \"Overcast\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, #ebebeb 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 0');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 1');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 1');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'display: none');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'display: none');\n } else if ( this.state.description === \"Patchy rain possible\" || this.state.description === \"Patchy light drizzle\"\n || this.state.description === \"Light drizzle\" || this.state.description === \"Patchy light rain\"\n || this.state.description === \"Light rain\" || this.state.description === \"Patchy light drizzle\"\n || this.state.description === \"Moderate rain at times\" || this.state.description === \"Moderate rain\"\n || this.state.description === \"Heavy rain at times\" || this.state.description === \"Heavy rain\"\n || this.state.description === \"Torrential rain shower\" || this.state.description === \"Patchy light rain with thunder\"\n || this.state.description === \"Moderate or heavy rain with thunder\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, lightblue 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 0');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 1');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 1');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'display: none');\n document.documentElement.style.setProperty('--precipitation', 'lightblue');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'opacity: 1');\n } else if ( this.state.description === \"Patchy snow possible\" || this.state.description === \"Blowing snow\"\n || this.state.description === \"Blizzard\" || this.state.description === \"Patchy light snow\"\n || this.state.description === \"Light snow\" || this.state.description === \"Patchy moderate snow\"\n || this.state.description === \"Moderate snow\" || this.state.description === \"Patchy heavy snow\"\n || this.state.description === \"Heavy snow\" || this.state.description === \"Light snow showers\"\n || this.state.description === \"Moderate or heavy snow showers\" || this.state.description === \"atchy light snow with thunder\"\n || this.state.description === \"Moderate or heavy snow with thunder\" ) {\n var root = document.getElementById('root');\n root.setAttribute('style', 'background: linear-gradient(0deg, \t#E8E8E8 50%, #fff 50%)');\n var sun = document.getElementById('sun');\n sun.setAttribute('style', 'opacity: 0');\n var cloud1 = document.getElementById('cloud1');\n cloud1.setAttribute('style', 'opacity: 1');\n var cloud2 = document.getElementById('cloud2');\n cloud2.setAttribute('style', 'opacity: 1');\n var rain = document.getElementById('rain');\n rain.setAttribute('style', 'display: none');\n var snow = document.getElementById('snow');\n snow.setAttribute('style', 'opacity: 1');\n document.documentElement.style.setProperty('--precipitation', '\t#DCDCDC');\n }\n }", "function generateStones(){\n if (frameCount%50===0){\n // creating sprites of Stones\n var stone= createSprite(1200,120,40,10);\n // craeting the stones in random locations based on the values randomly\n stone.x=random(50,450);\n stone.addImage(stoneImg);\n stone.scale=0.5;\n stone.velocityY= 5;\n stone.lifetime=250;\n stonesGroup.add(stone);\n }}", "function moveSnowflakes() {\n\n if (enableAnimations) {\n for (var i = 0; i < snowflakes.length; i++) {\n var snowflake = snowflakes[i];\n snowflake.update();\n } \n }\n\n // Reset the position of all the snowflakes to a new value\n if (resetPosition) {\n browserWidth = document.documentElement.clientWidth;\n browserHeight = document.documentElement.clientHeight;\n\n for (var i = 0; i < snowflakes.length; i++) {\n var snowflake = snowflakes[i];\n\n snowflake.xPos = getPosition(50, browserWidth);\n snowflake.yPos = getPosition(50, browserHeight);\n }\n\n resetPosition = false;\n }\n\n requestAnimationFrame(moveSnowflakes);\n }", "function D3BulletGraph_brake_raw_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-k336j4-style\";\n\tstyle.textContent = \".svelte-k336j4 .bullet .marker{stroke:#000;stroke-width:2px}.svelte-k336j4 .bullet .tick line{stroke:#666;stroke-width:0.5px}.svelte-k336j4 .bullet .measure.s0{fill:lightsteelblue}.svelte-k336j4 .bullet .measure.s1{fill:steelblue}.svelte-k336j4 .bullet .marker.s0{stroke:blue}.svelte-k336j4 .bullet .marker.s1{stroke:red}.svelte-k336j4 .bullet .marker.s2{stroke:green}.svelte-k336j4 .bullet .marker.s3{stroke:orange}.svelte-k336j4 .bullet .title{font-weight:bold}.svelte-k336j4 .bullet .subtitle{fill:#999}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "buildSkeletons () {\n for (let sketch of this.sketches) {\n let tempAxis = this.axis.clone();\n let sculpture = new KineticSculpture(tempAxis,sketch);\n sculpture.buildSkeleton(10,this.n);\n this.sculptures.push(sculpture);\n }\n }", "function makeNight(){\n bgColor = \"#191970\";\n grassColor= \"#006400\";\n}", "function createCanvas(){\n //select the canvas element\n var ctx = document.getElementById('canvas').getContext('2d');\n var cW = ctx.canvas.width, cH = ctx.canvas.height;\n //the collection of particles\n var particles = [];\n //creates function factory to create click handlers to switch between elements\n function maker(target){\n $('#'+ target.name).on('click', function(){\n //console.log('snow');\n if(target.name!==particle.name){\n particle.name = target.name;\n for (var key in particle){\n //console.log('they key is ', target.obj[key])\n //console.log('the key is ', snow[key]);\n particle[key] = target[key];\n particles = [];\n precipitates();\n }\n }\n });\n $(\"#\" + target.name).mouseup(function(){\n $(this).blur();\n });\n }\n //create a button for every element\n for (var i=0; i<elements.length; i++){\n maker(elements[i]);\n }\n //function to add particles to the particle array\n function addParticle(){\n var x = Math.floor(Math.random() * cW)+1;\n var y = Math.floor(Math.random() * cH)+1;\n var size = Math.floor(Math.random() * 5)/particle.size+1;;\n particles.push({'x':x,'y':y,'size':size});\n }\n //function to draw the particles\n function precipitates(){\n var particleLimit = 1000;\n while(particles.length<particleLimit){\n addParticle();\n }\n //draw the particles\n for (var i = 0; i < particles.length; i++ ){\n //set the color and the opacity\n ctx.fillStyle = 'rgba(255,255,255,'+ particle.opacity+')';\n ctx.beginPath();\n //x position of the particle is a function of wind speed, the y position is a function of the particle speed\n ctx.arc(particles[i].x+=wind.speed, particles[i].y+=particles[i].size*particle.speed, particles[i].size, 0, Math.PI*2, false);\n ctx.fill();\n //implement edge wrapping\n if(particles[i].x > cW|| particles[i].y >cH){\n //reset the particles y position;\n yMoves = Math.floor(particles[i].y/(particles[i].size*particle.speed))+1;\n particles[i].x = particles[i].x-yMoves*wind.speed;\n particles[i].y=0;\n\n }\n }\n }\n //function to draw the animation\n function animate(){\n ctx.save();\n ctx.clearRect(0, 0, cW, cH);\n ctx.drawImage(background,0,0);\n precipitates();\n ctx.restore();\n }\n var animateInterval = setInterval(animate, 30);\n var paused = false;\n //create button to pause the animation\n $('#pause').on('click', function(){\n //paused = true;\n if(paused){\n $('#pause').text('Pause');\n paused = false;\n for (var i=0; i<elements.length; i++){\n maker(elements[i]);\n }\n animateInterval = setInterval(animate, 30);\n } else {\n $('#pause').text('Resume');\n paused = true;\n console.log('paused')\n clearInterval(animateInterval);\n function turnOff(target){\n $(target).off();\n }\n for (var i=0; i<elements.length; i++){\n var target = '#'+elements[i].name;\n console.log('the target is ', target);\n turnOff(target);\n }\n }\n $(\"#pause\").mouseup(function(){\n $(this).blur();\n });\n });\n}", "function createRandomFlower() {\n const flowerContainer = document.getElementById(\"flower-container\");\n\n // Create a new flower element\n const flower = document.createElement(\"div\");\n flower.classList.add(\"flower\");\n const position = getRandomPosition();\n flower.style.left = position.x + \"px\";\n flower.style.top = position.y + \"px\";\n\n // Append the flower element to the flower container\n flowerContainer.appendChild(flower);\n }", "function spikesComing() {\n // This will work only when game is not paused or over.\n if (checkGamePause === false) {\n containerG.append(\"<div id='spike\" + spikeCount + \"' class='spike'></div>\");\n var spikeCreated = $(\"#spike\" + spikeCount);\n scale =1;\n if(availableHeight<1000)\n {\n scale = 0.7;\n }\n spikeCreated.css(\"transform\",\"scale(\"+scale+\")\");\n spikeCreated.moveTo(180).speed(spikeSpeed).css(\"top\", \"-5px\");\n spikeCreated.css(\"left\", random(spikeCreated.width(), containerG.width() - spikeCreated.width()) + \"px\");\n\n spikeCount++;\n }\n }", "function updateSnowf(val) {\n contextSnowf.clearRect(0, 0, canvasSnowf.width, canvasSnowf.height);\n dta.resetVals();\n constrSnowf(dta, val, dist);\n drawSnowf(dta);\n document.getElementById(\"n\").innerHTML = val;\n}", "function createFlake(x,y){\n\n var i;\n\n // Creates a new snowFlake object with location and id:\n flake=new snowFlake(x,y, \"snowFlake\"+1);\n\n // Creates an img element for the flake and appends it to body:\n var flakeElem = document.createElement(\"img\");\n\n // Creates and sets an src attribute to the flakeElem:\n var src = document.createAttribute(\"src\");\n src.value = \"images/snowFlake.png\";\n flakeElem.setAttributeNode(src);\n\n // Creates and sets a class attribute value:\n var class_attr = document.createAttribute(\"class\");\n class_attr.value = \"snowFlake\";\n flakeElem.setAttributeNode(class_attr);\n\n // Creates and sets a id attribute value:\n var id_attr = document.createAttribute(\"id\");\n id_attr.value = flake.id;\n flakeElem.setAttributeNode(id_attr);\n\n // Sets the position:\n flakeElem.style.left = x+\"px\";\n flakeElem.style.top = y+\"px\";\n\n document.body.appendChild(flakeElem);\n\n}", "function changeCSS() {\n //find the fortune we wanna mess with\n var fortune = document.getElementById(\"fortune-output\");\n\n //Random color #1\n var red1 = Math.floor(Math.random() * 255);\n var grn1 = Math.floor(Math.random() * 255);\n var blu1 = Math.floor(Math.random() * 255);\n\n //Random color #2\n var red2 = Math.floor(Math.random() * 255);\n var grn2 = Math.floor(Math.random() * 255);\n var blu2 = Math.floor(Math.random() * 255);\n\n //Random fontSize\n var fontSize = Math.floor(Math.random() * 50) + 10;\n\n\n //Change color, textShadow, and font size of fortune\n fortune.style.color = \"rgb(\" +red1+ \",\" +grn1+ \",\" +blu1+ \")\";\n fortune.style.textShadow = \"3px 3px 3px rgb(\"+red2+\",\"+grn2+\",\"+blu2+\")\";\n fortune.style.fontSize = fontSize+\"px\";\n}", "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-10bst2e-style\";\n\tstyle.textContent = \".svelte-10bst2e.svelte-10bst2e{user-select:none}h1.svelte-10bst2e.svelte-10bst2e{text-align:center;padding-bottom:1rem}.puzzle.svelte-10bst2e.svelte-10bst2e{font-family:system-ui;width:max(375px, 50vmin);margin:auto;padding-top:3rem;padding-bottom:3rem}.grid.svelte-10bst2e.svelte-10bst2e{width:max(375px, 50vmin);height:max(375px, 50vmin);display:grid;grid-template-rows:repeat(4, 1fr);grid-template-columns:repeat(4, 1fr);grid-gap:5px;margin:auto}.grid.svelte-10bst2e>.item.svelte-10bst2e{border-radius:7px;background-color:blanchedalmond;display:flex;justify-content:center;align-items:center;font-size:2rem}.item.hidden.svelte-10bst2e.svelte-10bst2e{opacity:0}.history.svelte-10bst2e.svelte-10bst2e{display:flex;justify-content:center;flex-wrap:wrap;padding-top:2rem;padding-bottom:2rem}.history.svelte-10bst2e>.item.svelte-10bst2e{padding:4px;font-size:2rem}.history.svelte-10bst2e>.item[flag='0'].svelte-10bst2e{color:rgb(211, 211, 211)}.history.svelte-10bst2e>.item[flag='1'].svelte-10bst2e{color:rgb(63, 203, 141)}.button.svelte-10bst2e.svelte-10bst2e{padding:1rem 2rem;border:none;border-radius:8px;background-color:#e8e9e4}\";\n\tappend(document.head, style);\n}", "function Snowflake(element, speed, xPos, yPos) {\n // set initial snowflake properties\n this.element = element;\n this.speed = speed;\n this.xPos = xPos;\n this.yPos = yPos;\n this.scale = 1;\n\n // declare variables used for snowflake's motion\n this.counter = 0;\n this.sign = Math.random() < 0.5 ? 1 : -1;\n\n // setting an initial opacity and size for our snowflake\n this.element.style.opacity = (.1 + Math.random()) / 3;\n }", "function D3BulletGraph_brake_hid_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-vxw4wy-style\";\n\tstyle.textContent = \".svelte-vxw4wy .bullet .marker{stroke:#000;stroke-width:2px}.svelte-vxw4wy .bullet .tick line{stroke:#666;stroke-width:0.5px}.svelte-vxw4wy .bullet .measure.s0{fill:lightsteelblue}.svelte-vxw4wy .bullet .measure.s1{fill:steelblue}.svelte-vxw4wy .bullet .marker.s0{opacity:0}.svelte-vxw4wy .bullet .marker.s1{opacity:0}.svelte-vxw4wy .bullet .marker.s2{opacity:0}.svelte-vxw4wy .bullet .marker.s3{opacity:0}.svelte-vxw4wy .bullet .title{font-weight:bold}.svelte-vxw4wy .bullet .subtitle{fill:#999}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "async _knightEffect() {\n await this._addMouseEvent();\n\n let playPos = this.profile.player.location();\n this.box = new Konva.Circle({\n x: playPos.x,\n y: playPos.y,\n fill: \"rgba(32, 0, 0, .25)\",\n stroke: \"rgba(0,0,0, .4)\",\n radius: 20,\n offset: {\n x: -70,\n y: -80\n }\n })\n\n this.animationReady = true;\n\n this._knightUpdateBoxPosition();\n this.animated(false);\n }", "function generateNight(numStars) {\n push();\n fill('#fabd2f');\n for (var i = 0; i < numStars; i++) {\n star(Math.random() * 1000, Math.random() * 500, 5, 15, 5);\n }\n pop();\n\n}", "function onLoad() {\n var hours = (new Date).getHours();\n\n if (hours < 6 || hours >= 20) {\n // Apply dark mode!\n var titles = document.getElementsByClassName('project-title');\n\n for (var i = 0; i < titles.length; ++i) {\n titles[i].style.color = '#cfcfcf';\n }\n\n document.getElementById('name-box-opague')\n .style\n .background = '#111111';\n\n var shadow = document.getElementById('name-box-shadow');\n\n shadow.style.filter = 'brightness(0.07)';\n shadow.style.height = '3em'; // needed for some reason\n\n document.body.style.background = '#111111';\n document.body.style.color = '#cfcfcf';\n }\n}", "function flash() {\n for (var i = 0; i < 81; i++) {\n let red = (Math.floor(Math.random() * 256)).toString();\n let green = (Math.floor(Math.random() * 256)).toString();\n let blue = (Math.floor(Math.random() * 256)).toString();\n body.children[i].style.backgroundColor = \"rgb(\" + red + \", \" + green + \", \" + blue + \")\"\n }\n}", "function animateWeather(weather) {\n\n function makeCloud(type, num) {\n if (type === 'Norm') {\n let newDiv = $('<div>');\n newDiv.attr('id', 'cloud' + num);\n for (i = 1; i < 4; i++) {\n let newLayer = $('<div>');\n newLayer.addClass('layer' + i);\n newDiv.append(newLayer);\n }\n return newDiv;\n } else if (type === 'Rain') {\n let newDiv = $('<div>');\n newDiv.attr('id', 'rainCloud' + num);\n for (i = 1; i < 4; i++) {\n let newLayer = $('<div>');\n newLayer.addClass('rainLayer' + i);\n newDiv.append(newLayer);\n }\n return newDiv;\n } else if (type === 'Snow') {\n let newDiv = $('<div>');\n newDiv.attr('id', 'snowCloud' + num);\n for (i = 1; i < 4; i++) {\n let newLayer = $('<div>');\n newLayer.addClass('layer' + i);\n newDiv.append(newLayer);\n }\n return newDiv;\n }\n }\n $('.hill').css('background-color', 'green');\n $('#canvas').empty();\n console.log(weather);\n if (weather == \"Clouds\" || weather == \"Clear\") {\n $('body').css('background', 'lightblue');\n let newSun = $('<div>');\n newSun.attr('id', 'sun');\n $('#canvas').append(newSun);\n let newCloud = makeCloud('Norm', '1');\n $('#canvas').append(newCloud);\n if (weather == 'Clouds') {\n let newCloud = makeCloud('Norm', '2');\n $('#canvas').append(newCloud);\n }\n } else if (weather == \"Rain\" || weather == \"Drizzle\" || weather == \"Thunderstorm\") {\n $('body').css('background', 'linear-gradient(to bottom, #202020, #111119)');\n let rainCloud = makeCloud('Rain', '1');\n $('#canvas').append(rainCloud);\n let positions = ['12%', '13%', '14%', '15%', '16%', '17%', '18%', '19%'];\n let speeds = [0, 1, 2, 3, 4, 5];\n for (var i = 0; i < 5; i++) {\n let randNum = Math.floor(Math.random() * positions.length);\n let newDrop = $('<div>');\n newDrop.addClass('rainDrop');\n newDrop.css('left', positions[randNum]);\n positions.splice(randNum, 1);\n let rand = Math.floor(Math.random() * speeds.length);\n speeds.splice(rand, 1);\n newDrop.css('animation', `drop 0.${2+rand}s linear infinite`);\n $('#canvas').append(newDrop);\n };\n if (weather == \"Thunderstorm\" || weather == \"Rain\") {\n let rainCloud = makeCloud('Rain', '2');\n $('#canvas').append(rainCloud);\n let positions = ['20%', '13%', '14%', '15%', '16%', '17%', '18%', '19%'];\n let speeds = [0, 1, 2, 3, 4, 5];\n for (var i = 0; i < 5; i++) {\n let randNum = Math.floor(Math.random() * positions.length);\n let newDrop = $('<div>');\n newDrop.addClass('rainDrop');\n newDrop.css('right', positions[randNum]);\n positions.splice(randNum, 1);\n let rand = Math.floor(Math.random() * speeds.length);\n newDrop.css('animation', `drop 0.${2+speeds[rand]}s linear infinite`);\n speeds.splice(rand, 1);\n $('#canvas').append(newDrop);\n };\n }\n } else if (weather == \"Snow\") {\n $('body').css('background', 'linear-gradient(315deg, #b8c6db 0%, #f5f7fa 74%)');\n let snowCloud = makeCloud('Snow', '1');\n $('#canvas').append(snowCloud);\n let positions = ['20%', '21%', '22%', '23%', '16%', '17%', '18%', '19%'];\n let speeds = [0, 1, 2, 3, 4];\n for (var i = 0; i < 4; i++) {\n let randNum = Math.floor(Math.random() * positions.length);\n let newSnow = $('<div>');\n newSnow.addClass('snow');\n newSnow.css('right', positions[randNum]);\n positions.splice(randNum, 1);\n let rand = Math.floor(Math.random() * speeds.length);\n newSnow.css('animation', `snowFall ${5+speeds[rand]}s linear infinite`);\n speeds.splice(rand, 1);\n $('#canvas').append(newSnow);\n };\n }\n}", "function getSwatches() {\n $(\"#starting-swatches\").children().remove();\n for (var i = 0; i < customSpectrum.length; i++) {\n // console.log(customSpectrum[i]);\n $(\"#starting-swatches\").append('<div class=\"starting-swatch\" id=\"' + i + '\" style=\"background:' + customSpectrum[i] + ';\"><span>' + customSpectrum[i] + '</span><svg viewBox=\"0 0 30 30\" class=\"ico-close\"><use xlink:href=\"#ico-close\"></use></svg></div>')\n }\n\n rainbow.setSpectrum.apply(null, customSpectrum);\n }", "function update() {\n // useful variables\n var schoolOfFish = $(\"#multiColoredFish\");\n\n var canvasWidth = app.canvas.width;\n var canvasHeight = app.canvas.height;\n var groundY = ground.y;\n backgroundBox.x = backgroundBox.x - 5;\n if(backgroundBox.x < -100) {\n backgroundBox.x = canvasWidth;\n }\n var currentSchoolPosition = schoolOfFish.offset();\n\n var upDownRandom = Math.random();\n if (upDownRandom > 0.75) {\n //prefer fish to swim down since we start it up high\n upDownRandom = -upDownRandom;\n }\n\n if ((currentSchoolPosition.top > canvasHeight) || (currentSchoolPosition.left > canvasWidth)) {\n //reset needed\n console.log('reset')\n schoolOfFish.offset({top:-5, left:-5})\n } else {\n //move normally.\n schoolOfFish.offset({top:200, left:(currentSchoolPosition.left + 0.5)})\n }\n\n\n for(var i=0;i < garbage.length;i++) {\n var thisBuilding = garbage[i];\n thisBuilding.x -= Math.random() * 3.5;\n if (thisBuilding.x < 0){\n thisBuilding.x = canvasWidth;\n }\n }\n }", "function generateSky() {\n this.display = function() {\n fill(\"#8ad5ec\");\n rect(0,0,width,height);\n for (var i = 0; i < clouds.length; i++){\n clouds[i].display();\n //console.log(clouds[i].xPos);\n if (clouds[i].check() === false) {\n curCloud ++;\n if (curCloud == 5) {\n curCloud = 0;\n }\n clouds[i] = new cloud(random(width, (width*2) - (width*.667)) + cloudCounter, random(height- (groundHeight * 2)));\n }\n }\n }\n}", "function addSunFlower() { ////////////////////////////////// //////////////////////////////////添加植物\n\t\t\tvar sunFlower = new lib.TwinSunflower(); // constructs a new plant\n\t\t\toverlayContainer.addChild(sunFlower); // adds the plant\n\t\t\tsunFlower.buttonMode = true; // makes the mouse change shape when over the plant//////////////////////////////////////改变鼠标样式\n\t\t\tsunFlower.x = 78;\n\t\t\tsunFlower.y = 9;\n\t\t\tsunFlower.addEventListener(\"click\", onSunFlowerClicked); // listener to be triggered once the plant is clicked\n\t\t}", "function initBalls() {\n container.css({'position':'relative'});\n for (i=0;i<ballCount;i++) {\n var newBall = $('<b />').appendTo(container),\n size = rand(ballMinSize,ballMaxSize);\n newBall.css({\n 'position':'absolute',\n 'width': '5em',\n 'height': '5em',\n 'background-image': 'url(img/' + rand(0, 47, true) + '.png)',\n 'background-position': 'contain',\n 'background-repeat': 'no-repeat',\n 'display': 'inline-block',\n 'vertical-align': 'middle',\n // 'opacity': rand(.1,.8),\n // 'background-color': 'rgb('+rand(0,255,true)+','+rand(0,255,true)+','+rand(0,255,true)+')',\n 'top': rand(0,container.height()-size),\n 'left': rand(0,container.width()-size)\n }).attr({\n 'data-dX':rand(-10,10),\n 'data-dY':rand(1,10)\n });\n }\n}", "function D3BulletGraph_clutch_hid_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-vxw4wy-style\";\n\tstyle.textContent = \".svelte-vxw4wy .bullet .marker{stroke:#000;stroke-width:2px}.svelte-vxw4wy .bullet .tick line{stroke:#666;stroke-width:0.5px}.svelte-vxw4wy .bullet .measure.s0{fill:lightsteelblue}.svelte-vxw4wy .bullet .measure.s1{fill:steelblue}.svelte-vxw4wy .bullet .marker.s0{opacity:0}.svelte-vxw4wy .bullet .marker.s1{opacity:0}.svelte-vxw4wy .bullet .marker.s2{opacity:0}.svelte-vxw4wy .bullet .marker.s3{opacity:0}.svelte-vxw4wy .bullet .title{font-weight:bold}.svelte-vxw4wy .bullet .subtitle{fill:#999}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "function D3BulletGraph_clutch_raw_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-k336j4-style\";\n\tstyle.textContent = \".svelte-k336j4 .bullet .marker{stroke:#000;stroke-width:2px}.svelte-k336j4 .bullet .tick line{stroke:#666;stroke-width:0.5px}.svelte-k336j4 .bullet .measure.s0{fill:lightsteelblue}.svelte-k336j4 .bullet .measure.s1{fill:steelblue}.svelte-k336j4 .bullet .marker.s0{stroke:blue}.svelte-k336j4 .bullet .marker.s1{stroke:red}.svelte-k336j4 .bullet .marker.s2{stroke:green}.svelte-k336j4 .bullet .marker.s3{stroke:orange}.svelte-k336j4 .bullet .title{font-weight:bold}.svelte-k336j4 .bullet .subtitle{fill:#999}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "function generateSpikes(){\n if (frameCount%100===0){\n //creating sprites of each spike\n var spike= createSprite(1250,115,40,10);\n // 955 used to increase the permissible area of canvas where the spikes can occur instead of 155\n spike.x= Math.round(random(45,955));\n spike.addImage(spikeImg);\n spike.scale=0.7;\n spike.velocityY= 5;\n spike.lifetime=2000;\n spikesGroup.add(spike);\n \n }\n}", "function add_css$k() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1z105v1-style\";\n\tstyle.textContent = \".wrapper.svelte-1z105v1{height:var(--size);width:var(--size);border-radius:100%;animation:svelte-1z105v1-moonStretchDelay var(--duration) 0s infinite linear;animation-fill-mode:forwards;position:relative}.circle-one.svelte-1z105v1{top:var(--moonSize);background-color:var(--color);width:calc(var(--size) / 7);height:calc(var(--size) / 7);border-radius:100%;animation:svelte-1z105v1-moonStretchDelay var(--duration) 0s infinite linear;animation-fill-mode:forwards;opacity:0.8;position:absolute}.circle-two.svelte-1z105v1{opacity:0.1;border:calc(var(--size) / 7) solid var(--color);height:var(--size);width:var(--size);border-radius:100%;box-sizing:border-box}@keyframes svelte-1z105v1-moonStretchDelay{100%{transform:rotate(360deg)}}\";\n\tappend(document.head, style);\n}", "function drawAll() {\n ctx.clearRect(0, 0, 800, 500);\n for (var j = 0; j < lgt; j++) {\n shape[j].draw();\n\n }\n for (var k = 0; k < COUNT; k++) {\n snowflakes[k].update();\n\n }\n\n\n}", "function createRain() {\n\n for (i = 1; i < nbDrop; i++) {\n var dropLeft = randRange(0, 1600);\n var dropTop = randRange(-1000, 1400);\n\n $('.rain').append('<div class=\"drop\" id=\"drop' + i + '\"></div>');\n $('#drop' + i).css('left', dropLeft);\n $('#drop' + i).css('top', dropTop);\n }\n\n}", "function createNewDivs(numDivs) {\n for (i=0;i<numDivs;i++) {\n const newDiv = document.createElement('div');\n container.appendChild(newDiv); \n newDiv.classList.add(\"newDiv\");\n newDiv.style.height = `${800/Math.sqrt(numDivs)}px`;\n newDiv.style.width = `${800/Math.sqrt(numDivs)}px`;\n if (black === true) {\n newDiv.addEventListener('mouseover', draw);\n } else {\n newDiv.addEventListener('mouseover', drawRainbow);\n }\n }\n}", "function createSword(){\n if (World.frameCount % 150 == 0) {\n var sword = createSprite(Math.round(random(50, 350),40, 10, 10));\n sword.addImage(swordImg);\n sword.scale=0.1;\n sword.velocityY = 3;\n sword.lifetime = 150;\n swordGroup.add(sword);\n }\n}", "glitch() {\n gsap.killTweensOf(this.DOM.imgStack);\n\n gsap.timeline()\n .set(this.DOM.imgStack, {\n opacity: 0.2\n }, 0.04)\n .set(this.DOM.stackImages, {\n x: () => `+=${gsap.utils.random(-15,15)}%`,\n y: () => `+=${gsap.utils.random(-15,15)}%`,\n opacity: () => gsap.utils.random(1,10)/10\n }, 0.08)\n .set(this.DOM.imgStack, {\n opacity: 0.4\n }, '+=0.04')\n .set(this.DOM.stackImages, {\n y: () => `+=${gsap.utils.random(-8,8)}%`,\n rotation: () => gsap.utils.random(-2,2),\n opacity: () => gsap.utils.random(1,10)/10,\n scale: () => gsap.utils.random(75,95)/100\n }, '+=0.06')\n .set(this.DOM.imgStack, {\n opacity: 1\n }, '+=0.06')\n .set(this.DOM.stackImages, {\n x: (_, t) => t.dataset.tx,\n y: (_, t) => t.dataset.ty,\n rotation: (_, t) => t.dataset.r,\n opacity: 1,\n scale: 1\n }, '+=0.06')\n }", "insertCss() { }", "function prepareSkeletonScreen() {\n\t $(\"<style>\")\n\t .prop(\"type\", \"text/css\")\n\t .html(\"\\\n @keyframes aniVertical {\\\n 0% {\\\n opacity: 0.3;\\\n }\\\n 50% {\\\n opacity: 1;\\\n }\\\n 100% {\\\n opacity: 0.3;\\\n }\\\n }\\\n .loading {\\\n height: 30px;\\\n border-radius: 20px;\\\n background-color: #E2E2E2;\\\n animation: aniVertical 3s ease;\\\n animation-iteration-count: infinite;\\\n animation-fill-mode: forwards;\\\n opacity: 0;\\\n }\\\n .content-loading {\\\n height: 20px;\\\n margin-top:20px;\\\n background-color: #E2E2E2;\\\n border-radius: 10px;\\\n animation: aniVertical 5s ease;\\\n animation-iteration-count: infinite;\\\n animation-fill-mode: forwards;\\\n opacity: 0;\\\n }\")\n\t .appendTo(\"head\");\n\n\t $('.froala-editor#title').html('');\n\t $('.froala-editor#content').html('');\n\t $('.commentsSearchResults').html('');\n\n\t //$('.froala-editor#title').addClass('loading');\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:100%;'></div>\");\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:70%;'></div>\");\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:80%;'></div>\");\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:60%;'></div>\");\n\t $('.froala-editor#content').append(\"<div class='content-loading' style='width:90%;'></div>\");\n\t $('.commentsSearchResults').addClass('loading col-xs-12 col-xs-offset-0 col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2');\n\t}", "function bubbles() {\n $.each($(\".particletext.bubbles\"), function(){\n var bubblecount = ($(this).width()/50)*10;\n for(var i = 0; i <= bubblecount; i++) {\n var size = ($.rnd(40,80)/10);\n $(this).append('<span class=\"particle\" style=\"top:' + $.rnd(20,80) + '%; left:' + $.rnd(0,95) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + ($.rnd(0,30)/10) + 's;\"></span>');\n }\n });\n }", "function setDarkMode()\n{\n for(let i=0 ; i< category.length; i++){\n category[i].style.background = \"mintcream\";\n }\n body.style.background = \"#0d1117\";\n \n for(let i=0 ; i< blog.length; i++){\n blog[i].style.background = \"#0d1117\";\n blog[i].style.boxShadow =\"0px 0px 5px 1px rgb(254 254 254 / 80%)\";\n }\n \n for(let i=0 ; i< event_.length; i++){\n event_[i].style.background = \"#0d1117\";\n event_[i].style.boxShadow =\"0px 0px 5px 1px rgb(254 254 254 / 80%)\";\n }\n\n box.style.background=\"black\";\n\n for(let i=0 ; i< textWhite.length; i++){\n textWhite[i].classList.add(\"whiteColorText\");\n }\n\n for(let i=0 ; i< social.length; i++){\n social[i].classList.add(\"links\");\n }\n \n \n}", "function D3BulletGraph_throttle_raw_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-k336j4-style\";\n\tstyle.textContent = \".svelte-k336j4 .bullet .marker{stroke:#000;stroke-width:2px}.svelte-k336j4 .bullet .tick line{stroke:#666;stroke-width:0.5px}.svelte-k336j4 .bullet .measure.s0{fill:lightsteelblue}.svelte-k336j4 .bullet .measure.s1{fill:steelblue}.svelte-k336j4 .bullet .marker.s0{stroke:blue}.svelte-k336j4 .bullet .marker.s1{stroke:red}.svelte-k336j4 .bullet .marker.s2{stroke:green}.svelte-k336j4 .bullet .marker.s3{stroke:orange}.svelte-k336j4 .bullet .title{font-weight:bold}.svelte-k336j4 .bullet .subtitle{fill:#999}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "function sprinkler(){\r\n sprinklerrate++;\r\n if (sprinklerrate >= sprinkly) {\r\n sprinklerrate = 0;\r\n spread = Math.floor(Math.random() * 20)-10\r\n moleclickicons.push({x: 250, y: 125,t: 0,spread: spread})\r\n }\r\n }", "function add_css$2() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-yxps3a-style\";\n\tstyle.textContent = \".wrapper.svelte-yxps3a{width:var(--size);height:var(--size);display:flex;justify-content:center;align-items:center;line-height:0;box-sizing:border-box}.inner.svelte-yxps3a{transform:scale(calc(var(--floatSize) / 52))}.ball-container.svelte-yxps3a{animation:svelte-yxps3a-ballTwo var(--duration) infinite;width:44px;height:44px;flex-shrink:0;position:relative}.single-ball.svelte-yxps3a{width:44px;height:44px;position:absolute}.ball.svelte-yxps3a{width:20px;height:20px;border-radius:50%;position:absolute;animation:svelte-yxps3a-ballOne var(--duration) infinite ease}.ball-top-left.svelte-yxps3a{background-color:var(--ballTopLeftColor);top:0;left:0}.ball-top-right.svelte-yxps3a{background-color:var(--ballTopRightColor);top:0;left:24px}.ball-bottom-left.svelte-yxps3a{background-color:var(--ballBottomLeftColor);top:24px;left:0}.ball-bottom-right.svelte-yxps3a{background-color:var(--ballBottomRightColor);top:24px;left:24px}@keyframes svelte-yxps3a-ballOne{0%{position:absolute}50%{top:12px;left:12px;position:absolute;opacity:0.5}100%{position:absolute}}@keyframes svelte-yxps3a-ballTwo{0%{transform:rotate(0deg) scale(1)}50%{transform:rotate(360deg) scale(1.3)}100%{transform:rotate(720deg) scale(1)}}\";\n\tappend(document.head, style);\n}", "updateStyle(elem) {\n console.info(\"Updating style: applying rainbow.\");\n const shadowRoot = elem.shadowRoot;\n shadowRoot.querySelector('style').textContent += rainbow; \n }", "function add_css$i() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-vhggjq-style\";\n\tstyle.textContent = \".wrapper.svelte-vhggjq{position:relative;display:flex;justify-content:center;align-items:center;width:var(--size);height:var(--size)}.shadow.svelte-vhggjq{color:var(--color);font-size:var(--size);overflow:hidden;width:var(--size);height:var(--size);border-radius:50%;margin:28px auto;position:relative;transform:translateZ(0);animation:svelte-vhggjq-load var(--duration) infinite ease, svelte-vhggjq-round var(--duration) infinite ease}@keyframes svelte-vhggjq-load{0%{box-shadow:0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em,\\r\\n 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em}5%,95%{box-shadow:0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em,\\r\\n 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em}10%,59%{box-shadow:0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em,\\r\\n -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em,\\r\\n -0.297em -0.775em 0 -0.477em}20%{box-shadow:0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em,\\r\\n -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em,\\r\\n -0.749em -0.34em 0 -0.477em}38%{box-shadow:0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em,\\r\\n -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em,\\r\\n -0.82em -0.09em 0 -0.477em}100%{box-shadow:0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em,\\r\\n 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em}}@keyframes svelte-vhggjq-round{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}\";\n\tappend(document.head, style);\n}", "async function renderDog(options) {\n\tconst styleElement = document.createElement(\"style\");\n\tstyleElement.textContent = `\n\t\t#dog {\n\t\t\tposition: relative;\n\t\t\tbox-shadow: 70px 10px 0 0 rgba(198,134,66,1), 80px 10px 0 0 rgba(198,134,66,1), 100px 10px 0 0 rgba(198,134,66,1), 70px 20px 0 0 rgba(198,134,66,1), 80px 20px 0 0 rgba(198,134,66,1), 90px 20px 0 0 rgba(198,134,66,1), 100px 20px 0 0 rgba(198,134,66,1), 110px 20px 0 0 rgba(198,134,66,1), 80px 30px 0 0 rgba(198,134,66,1), 90px 30px 0 0 #000000, 100px 30px 0 0 rgba(198,134,66,1), 110px 30px 0 0 rgba(198,134,66,1), 120px 30px 0 0 rgba(198,134,66,1), 130px 30px 0 0 #000000, 80px 40px 0 0 rgba(198,134,66,1), 90px 40px 0 0 rgba(198,134,66,1), 100px 40px 0 0 rgba(201,189,189,1), 110px 40px 0 0 rgba(201,189,189,1), 120px 40px 0 0 rgba(201,189,189,1), 130px 40px 0 0 rgba(201,189,189,1), 80px 50px 0 0 rgba(198,134,66,1), 90px 50px 0 0 rgba(201,189,189,1), 100px 50px 0 0 rgba(201,189,189,1), 110px 50px 0 0 rgba(201,189,189,1), 120px 50px 0 0 rgba(201,189,189,1), 80px 60px 0 0 rgba(198,134,66,1), 90px 60px 0 0 rgba(201,189,189,1), 100px 60px 0 0 rgba(201,189,189,1), 110px 60px 0 0 rgba(198,134,66,1), 80px 70px 0 0 rgba(198,134,66,1), 90px 70px 0 0 rgba(201,189,189,1), 100px 70px 0 0 rgba(201,189,189,1), 110px 70px 0 0 rgba(198,134,66,1), 80px 80px 0 0 rgba(198,134,66,1), 90px 80px 0 0 rgba(201,189,189,1), 100px 80px 0 0 rgba(201,189,189,1), 110px 80px 0 0 rgba(198,134,66,1), 80px 90px 0 0 rgba(198,134,66,1), 90px 90px 0 0 rgba(201,189,189,1), 100px 90px 0 0 rgba(201,189,189,1), 110px 90px 0 0 rgba(198,134,66,1), 70px 100px 0 0 rgba(198,134,66,1), 80px 100px 0 0 rgba(198,134,66,1), 90px 100px 0 0 rgba(201,189,189,1), 100px 100px 0 0 rgba(201,189,189,1), 110px 100px 0 0 rgba(198,134,66,1), 70px 110px 0 0 rgba(198,134,66,1), 80px 110px 0 0 rgba(198,134,66,1), 90px 110px 0 0 rgba(201,189,189,1), 100px 110px 0 0 rgba(201,189,189,1), 110px 110px 0 0 rgba(198,134,66,1), 60px 120px 0 0 rgba(198,134,66,1), 70px 120px 0 0 rgba(198,134,66,1), 80px 120px 0 0 rgba(198,134,66,1), 90px 120px 0 0 rgba(201,189,189,1), 100px 120px 0 0 rgba(201,189,189,1), 110px 120px 0 0 rgba(198,134,66,1), 120px 120px 0 0 rgba(198,134,66,1), 130px 120px 0 0 rgba(143,140,140,1), 140px 120px 0 0 rgba(143,140,140,1), 150px 120px 0 0 rgba(143,140,140,1), 30px 130px 0 0 rgba(143,140,140,1), 40px 130px 0 0 rgba(143,140,140,1), 50px 130px 0 0 rgba(143,140,140,1), 60px 130px 0 0 rgba(198,134,66,1), 70px 130px 0 0 rgba(198,134,66,1), 80px 130px 0 0 rgba(198,134,66,1), 90px 130px 0 0 rgba(201,189,189,1), 100px 130px 0 0 rgba(201,189,189,1), 110px 130px 0 0 rgba(198,134,66,1), 120px 130px 0 0 rgba(198,134,66,1), 130px 130px 0 0 rgba(232,232,232,1), 140px 130px 0 0 rgba(232,232,232,1), 150px 130px 0 0 rgba(232,232,232,1), 160px 130px 0 0 rgba(143,140,140,1), 20px 140px 0 0 rgba(143,140,140,1), 30px 140px 0 0 rgba(232,232,232,1), 40px 140px 0 0 rgba(232,232,232,1), 50px 140px 0 0 rgba(198,134,66,1), 60px 140px 0 0 rgba(232,232,232,1), 70px 140px 0 0 rgba(198,134,66,1), 80px 140px 0 0 rgba(232,232,232,1), 90px 140px 0 0 rgba(232,232,232,1), 100px 140px 0 0 rgba(232,232,232,1), 110px 140px 0 0 rgba(198,134,66,1), 120px 140px 0 0 rgba(232,232,232,1), 130px 140px 0 0 rgba(198,134,66,1), 140px 140px 0 0 rgba(201,189,189,1), 150px 140px 0 0 rgba(232,232,232,1), 160px 140px 0 0 rgba(232,232,232,1), 170px 140px 0 0 rgba(143,140,140,1), 10px 150px 0 0 rgba(143,140,140,1), 20px 150px 0 0 rgba(232,232,232,1), 30px 150px 0 0 rgba(232,232,232,1), 40px 150px 0 0 rgba(232,232,232,1), 50px 150px 0 0 rgba(201,189,189,1), 60px 150px 0 0 rgba(232,232,232,1), 70px 150px 0 0 rgba(201,189,189,1), 80px 150px 0 0 rgba(232,232,232,1), 90px 150px 0 0 rgba(232,232,232,1), 100px 150px 0 0 rgba(232,232,232,1), 110px 150px 0 0 rgba(201,189,189,1), 120px 150px 0 0 rgba(232,232,232,1), 130px 150px 0 0 rgba(232,232,232,1), 140px 150px 0 0 rgba(232,232,232,1), 150px 150px 0 0 rgba(232,232,232,1), 160px 150px 0 0 rgba(143,140,140,1), 170px 150px 0 0 rgba(143,140,140,1), 10px 160px 0 0 rgba(143,140,140,1), 20px 160px 0 0 rgba(232,232,232,1), 30px 160px 0 0 rgba(232,232,232,1), 40px 160px 0 0 rgba(232,232,232,1), 50px 160px 0 0 rgba(232,232,232,1), 60px 160px 0 0 rgba(232,232,232,1), 70px 160px 0 0 rgba(232,232,232,1), 80px 160px 0 0 rgba(232,232,232,1), 90px 160px 0 0 rgba(232,232,232,1), 100px 160px 0 0 rgba(232,232,232,1), 110px 160px 0 0 rgba(232,232,232,1), 120px 160px 0 0 rgba(232,232,232,1), 130px 160px 0 0 rgba(232,232,232,1), 140px 160px 0 0 rgba(143,140,140,1), 150px 160px 0 0 rgba(143,140,140,1), 160px 160px 0 0 rgba(232,232,232,1), 170px 160px 0 0 rgba(143,140,140,1), 10px 170px 0 0 rgba(143,140,140,1), 20px 170px 0 0 rgba(232,232,232,1), 30px 170px 0 0 rgba(232,232,232,1), 40px 170px 0 0 rgba(232,232,232,1), 50px 170px 0 0 rgba(232,232,232,1), 60px 170px 0 0 rgba(232,232,232,1), 70px 170px 0 0 rgba(232,232,232,1), 80px 170px 0 0 rgba(232,232,232,1), 90px 170px 0 0 rgba(232,232,232,1), 100px 170px 0 0 rgba(232,232,232,1), 110px 170px 0 0 rgba(232,232,232,1), 120px 170px 0 0 rgba(232,232,232,1), 130px 170px 0 0 rgba(232,232,232,1), 140px 170px 0 0 rgba(232,232,232,1), 150px 170px 0 0 rgba(232,232,232,1), 160px 170px 0 0 rgba(232,232,232,1), 170px 170px 0 0 rgba(143,140,140,1), 10px 180px 0 0 rgba(143,140,140,1), 20px 180px 0 0 rgba(232,232,232,1), 30px 180px 0 0 rgba(232,232,232,1), 40px 180px 0 0 rgba(232,232,232,1), 50px 180px 0 0 rgba(143,140,140,1), 60px 180px 0 0 rgba(232,232,232,1), 70px 180px 0 0 rgba(232,232,232,1), 80px 180px 0 0 rgba(232,232,232,1), 90px 180px 0 0 rgba(232,232,232,1), 100px 180px 0 0 rgba(232,232,232,1), 110px 180px 0 0 rgba(232,232,232,1), 120px 180px 0 0 rgba(232,232,232,1), 130px 180px 0 0 rgba(232,232,232,1), 140px 180px 0 0 rgba(232,232,232,1), 150px 180px 0 0 rgba(232,232,232,1), 160px 180px 0 0 rgba(143,140,140,1), 20px 190px 0 0 rgba(143,140,140,1), 30px 190px 0 0 rgba(143,140,140,1), 40px 190px 0 0 rgba(143,140,140,1), 50px 190px 0 0 rgba(232,232,232,1), 60px 190px 0 0 rgba(232,232,232,1), 70px 190px 0 0 rgba(232,232,232,1), 80px 190px 0 0 rgba(232,232,232,1), 90px 190px 0 0 rgba(232,232,232,1), 100px 190px 0 0 rgba(232,232,232,1), 110px 190px 0 0 rgba(232,232,232,1), 120px 190px 0 0 rgba(232,232,232,1), 130px 190px 0 0 rgba(232,232,232,1), 140px 190px 0 0 rgba(232,232,232,1), 150px 190px 0 0 rgba(232,232,232,1), 160px 190px 0 0 rgba(232,232,232,1), 170px 190px 0 0 rgba(143,140,140,1), 20px 200px 0 0 rgba(143,140,140,1), 30px 200px 0 0 rgba(232,232,232,1), 40px 200px 0 0 rgba(232,232,232,1), 50px 200px 0 0 rgba(232,232,232,1), 60px 200px 0 0 rgba(232,232,232,1), 70px 200px 0 0 rgba(232,232,232,1), 80px 200px 0 0 rgba(232,232,232,1), 90px 200px 0 0 rgba(232,232,232,1), 100px 200px 0 0 rgba(232,232,232,1), 110px 200px 0 0 rgba(232,232,232,1), 120px 200px 0 0 rgba(232,232,232,1), 130px 200px 0 0 rgba(232,232,232,1), 140px 200px 0 0 rgba(232,232,232,1), 150px 200px 0 0 rgba(232,232,232,1), 160px 200px 0 0 rgba(232,232,232,1), 170px 200px 0 0 rgba(143,140,140,1), 30px 210px 0 0 rgba(143,140,140,1), 40px 210px 0 0 rgba(232,232,232,1), 50px 210px 0 0 rgba(232,232,232,1), 60px 210px 0 0 rgba(232,232,232,1), 70px 210px 0 0 rgba(232,232,232,1), 80px 210px 0 0 rgba(143,140,140,1), 90px 210px 0 0 rgba(232,232,232,1), 100px 210px 0 0 rgba(232,232,232,1), 110px 210px 0 0 rgba(232,232,232,1), 120px 210px 0 0 rgba(232,232,232,1), 130px 210px 0 0 rgba(232,232,232,1), 140px 210px 0 0 rgba(232,232,232,1), 150px 210px 0 0 rgba(232,232,232,1), 160px 210px 0 0 rgba(232,232,232,1), 170px 210px 0 0 rgba(143,140,140,1), 30px 220px 0 0 rgba(143,140,140,1), 40px 220px 0 0 rgba(232,232,232,1), 50px 220px 0 0 rgba(232,232,232,1), 60px 220px 0 0 rgba(232,232,232,1), 70px 220px 0 0 rgba(232,232,232,1), 80px 220px 0 0 rgba(143,140,140,1), 90px 220px 0 0 rgba(232,232,232,1), 100px 220px 0 0 rgba(232,232,232,1), 110px 220px 0 0 rgba(232,232,232,1), 120px 220px 0 0 rgba(232,232,232,1), 130px 220px 0 0 rgba(143,140,140,1), 140px 220px 0 0 rgba(232,232,232,1), 150px 220px 0 0 rgba(232,232,232,1), 160px 220px 0 0 rgba(232,232,232,1), 170px 220px 0 0 rgba(143,140,140,1), 40px 230px 0 0 rgba(143,140,140,1), 50px 230px 0 0 rgba(232,232,232,1), 60px 230px 0 0 rgba(232,232,232,1), 70px 230px 0 0 rgba(232,232,232,1), 80px 230px 0 0 rgba(232,232,232,1), 90px 230px 0 0 rgba(143,140,140,1), 100px 230px 0 0 rgba(143,140,140,1), 110px 230px 0 0 rgba(143,140,140,1), 120px 230px 0 0 rgba(143,140,140,1), 130px 230px 0 0 rgba(232,232,232,1), 140px 230px 0 0 rgba(232,232,232,1), 150px 230px 0 0 rgba(232,232,232,1), 160px 230px 0 0 rgba(232,232,232,1), 170px 230px 0 0 rgba(143,140,140,1), 50px 240px 0 0 rgba(143,140,140,1), 60px 240px 0 0 rgba(143,140,140,1), 70px 240px 0 0 rgba(143,140,140,1), 80px 240px 0 0 rgba(143,140,140,1), 90px 240px 0 0 rgba(232,232,232,1), 100px 240px 0 0 rgba(232,232,232,1), 110px 240px 0 0 rgba(232,232,232,1), 120px 240px 0 0 rgba(232,232,232,1), 130px 240px 0 0 rgba(232,232,232,1), 140px 240px 0 0 rgba(232,232,232,1), 150px 240px 0 0 rgba(143,140,140,1), 160px 240px 0 0 rgba(143,140,140,1), 90px 250px 0 0 rgba(143,140,140,1), 100px 250px 0 0 rgba(143,140,140,1), 110px 250px 0 0 rgba(143,140,140,1), 120px 250px 0 0 rgba(143,140,140,1), 130px 250px 0 0 rgba(143,140,140,1), 140px 250px 0 0 rgba(143,140,140,1);\n\t\t\theight: 10.5px;\n\t\t\twidth: 10.5px;\n\t\t\tmargin-top: 0px;\n\t\t\tmargin-bottom: 300px;\n\t\t\tmargin-left: -10px;\n\t\t}\n\t`;\n\tdocument.head.appendChild(styleElement);\n}", "_addFruit(){\n const fruit = document.createElement(\"div\");\n fruit.classList.add(\"box\");\n fruit.classList.add(\"box-fruit\"); \n fruit.id=\"fruit-id\"\n this._assignRandomCords();\n fruit.style.top=this._fruit[0].row*this._boxSize+\"px\";\n fruit.style.left=this._fruit[0].col*this._boxSize+\"px\";\n this._screen.append(fruit);\n }", "function flicker () {\n\tfor (let i = 0; i < allStars.length; i++) {\n\t\tlet animDuration = Math.floor(Math.random() * 8);\n\t\tif (i%20 == 0) {\n\t\t\t//allStars[i].style.animation = \"flicker \"+animDuration+\"s infinite\";\n\t\t}\n\t}\n}", "function swatch()\n{\n\tvar divs = document.getElementsByTagName(\"*\");\n\tvar count = 0;\n\tfor(var i = 0; i < divs.length; i++)\n\t{\n\t\tif(divs[i].className.indexOf(\"swatch\") != -1)\n\t\t{\n\t\t\tvar colorTitle;\n\t\t\tswitch(count)\n\t\t\t{\n\t\t\t/* count corresponds to ordering position on page */\n\t\t\tcase 0:\n\t\t\t\tcolorTitle = 'black';\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tcolorTitle = 'navyblue';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tcolorTitle = 'blue';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tcolorTitle = 'green';\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tcolorTitle = 'brown';\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tcolorTitle = 'white';\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tcolorTitle = 'orange';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcolorTitle = 'blue';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdivs[i].title = colorTitle;\n\t\t\tdivs[i].onclick = setcolor;\n\t\t\tcount++;\n\t\t}\n\t}\n}", "function ws_kenburns(d,l,m){var e=jQuery;var g=e(this);var f=document.createElement(\"canvas\").getContext;var i=e(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).addClass(\"ws_effect ws_kenburns\").appendTo(m);var o=d.paths||[{from:[0,0,1],to:[0,0,1.2]},{from:[0,0,1.2],to:[0,0,1]},{from:[1,0,1],to:[1,0,1.2]},{from:[0,1,1.2],to:[0,1,1]},{from:[1,1,1],to:[1,1,1.2]},{from:[0.5,1,1],to:[0.5,1,1.3]},{from:[1,0.5,1.2],to:[1,0.5,1]},{from:[1,0.5,1],to:[1,0.5,1.2]},{from:[0,0.5,1.2],to:[0,0.5,1]},{from:[1,0.5,1.2],to:[1,0.5,1]},{from:[0.5,0.5,1],to:[0.5,0.5,1.2]},{from:[0.5,0.5,1.3],to:[0.5,0.5,1]},{from:[0.5,1,1],to:[0.5,0,1.15]}];function c(h){return o[h?Math.floor(Math.random()*(f?o.length:Math.min(5,o.length))):0]}var k=d.width,p=d.height;var j,b;var a,r;function n(){a=e('<div style=\"width:100%;height:100%\"></div>').css({\"z-index\":8,position:\"absolute\",left:0,top:0}).appendTo(i)}n();function s(w,t,h){var u={width:100*w[2]+\"%\"};u[t?\"right\":\"left\"]=-100*(w[2]-1)*(t?(1-w[0]):w[0])+\"%\";u[h?\"bottom\":\"top\"]=-100*(w[2]-1)*(h?(1-w[1]):w[1])+\"%\";if(!f){for(var v in u){if(/\\%/.test(u[v])){u[v]=(/right|left|width/.test(v)?k:p)*parseFloat(u[v])/100+\"px\"}}}return u}function q(w,z,A){var t=e(w);t={width:t.width(),height:t.height(),marginTop:t.css(\"marginTop\"),marginLeft:t.css(\"marginLeft\")};if(f){if(b){b.stop(1)}b=j}if(r){r.remove()}r=a;n();if(A){a.hide();r.stop(true,true)}if(f){var y,x;var u,h;u=e('<canvas width=\"'+k+'\" height=\"'+p+'\"/>');u.css({position:\"absolute\",left:0,top:0}).css(t).appendTo(a);y=u.get(0).getContext(\"2d\");h=u.clone().appendTo(a);x=h.get(0).getContext(\"2d\");j=wowAnimate(function(B){var D=[z.from[0]*(1-B)+B*z.to[0],z.from[1]*(1-B)+B*z.to[1],z.from[2]*(1-B)+B*z.to[2]];x.drawImage(w,-k*(D[2]-1)*D[0],-p*(D[2]-1)*D[1],k*D[2],p*D[2]);y.clearRect(0,0,k,p);var C=y;y=x;x=C},0,1,d.duration+d.delay*2)}else{k=t.width;p=t.height;var v=e('<img src=\"'+w.src+'\"/>').css({position:\"absolute\",left:\"auto\",right:\"auto\",top:\"auto\",bottom:\"auto\"}).appendTo(a).css(s(z.from,z.from[0]>0.5,z.from[1]>0.5)).animate(s(z.to,z.from[0]>0.5,z.from[1]>0.5),{easing:\"linear\",queue:false,duration:(1.5*d.duration+d.delay)})}if(A){a.fadeIn(d.duration)}}if(d.effect.length==1){e(function(){l.each(function(h){e(this).css({visibility:\"hidden\"});if(h==d.startSlide){q(this,c(h),0)}})})}this.go=function(h,t){setTimeout(function(){g.trigger(\"effectEnd\")},d.duration);q(l.get(h),c(h),1)}}", "function ws_kenburns(d,l,m){var e=jQuery;var g=e(this);var f=document.createElement(\"canvas\").getContext;var i=e(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).addClass(\"ws_effect ws_kenburns\").appendTo(m);var o=d.paths||[{from:[0,0,1],to:[0,0,1.2]},{from:[0,0,1.2],to:[0,0,1]},{from:[1,0,1],to:[1,0,1.2]},{from:[0,1,1.2],to:[0,1,1]},{from:[1,1,1],to:[1,1,1.2]},{from:[0.5,1,1],to:[0.5,1,1.3]},{from:[1,0.5,1.2],to:[1,0.5,1]},{from:[1,0.5,1],to:[1,0.5,1.2]},{from:[0,0.5,1.2],to:[0,0.5,1]},{from:[1,0.5,1.2],to:[1,0.5,1]},{from:[0.5,0.5,1],to:[0.5,0.5,1.2]},{from:[0.5,0.5,1.3],to:[0.5,0.5,1]},{from:[0.5,1,1],to:[0.5,0,1.15]}];function c(h){return o[h?Math.floor(Math.random()*(f?o.length:Math.min(5,o.length))):0]}var k=d.width,p=d.height;var j,b;var a,r;function n(){a=e('<div style=\"width:100%;height:100%\"></div>').css({\"z-index\":8,position:\"absolute\",left:0,top:0}).appendTo(i)}n();function s(w,t,h){var u={width:100*w[2]+\"%\"};u[t?\"right\":\"left\"]=-100*(w[2]-1)*(t?(1-w[0]):w[0])+\"%\";u[h?\"bottom\":\"top\"]=-100*(w[2]-1)*(h?(1-w[1]):w[1])+\"%\";if(!f){for(var v in u){if(/\\%/.test(u[v])){u[v]=(/right|left|width/.test(v)?k:p)*parseFloat(u[v])/100+\"px\"}}}return u}function q(w,z,A){var t=e(w);t={width:t.width(),height:t.height(),marginTop:t.css(\"marginTop\"),marginLeft:t.css(\"marginLeft\")};if(f){if(b){b.stop(1)}b=j}if(r){r.remove()}r=a;n();if(A){a.hide();r.stop(true,true)}if(f){var y,x;var u,h;u=e('<canvas width=\"'+k+'\" height=\"'+p+'\"/>');u.css({position:\"absolute\",left:0,top:0}).css(t).appendTo(a);y=u.get(0).getContext(\"2d\");h=u.clone().appendTo(a);x=h.get(0).getContext(\"2d\");j=wowAnimate(function(B){var D=[z.from[0]*(1-B)+B*z.to[0],z.from[1]*(1-B)+B*z.to[1],z.from[2]*(1-B)+B*z.to[2]];x.drawImage(w,-k*(D[2]-1)*D[0],-p*(D[2]-1)*D[1],k*D[2],p*D[2]);y.clearRect(0,0,k,p);var C=y;y=x;x=C},0,1,d.duration+d.delay*2)}else{k=t.width;p=t.height;var v=e('<img src=\"'+w.src+'\"/>').css({position:\"absolute\",left:\"auto\",right:\"auto\",top:\"auto\",bottom:\"auto\"}).appendTo(a).css(s(z.from,z.from[0]>0.5,z.from[1]>0.5)).animate(s(z.to,z.from[0]>0.5,z.from[1]>0.5),{easing:\"linear\",queue:false,duration:(1.5*d.duration+d.delay)})}if(A){a.fadeIn(d.duration)}}if(d.effect.length==1){e(function(){l.each(function(h){e(this).css({visibility:\"hidden\"});if(h==d.startSlide){q(this,c(h),0)}})})}this.go=function(h,t){setTimeout(function(){g.trigger(\"effectEnd\")},d.duration);q(l.get(h),c(h),1)}}", "function setup() {\n if (enableAnimations) {\n window.addEventListener(\"DOMContentLoaded\", generateSnowflakes, false);\n window.addEventListener(\"resize\", setResetFlag, false);\n }\n }", "function makeDay(){\n bgColor = '#87ceeb';\n grassColor= \"#7cfc00\";\n}", "function moveFlower() {\n const flowerContainer = document.getElementById(\"flower-container\");\n const flower = document.getElementById(\"flower\");\n\n const position = getRandomPosition();\n\n flower.style.left = `${position.x}px`;\n flower.style.top = `${position.y}px`;\n\n flowerContainer.appendChild(flower);\n}", "function renderAndUpdate(christmasSnow) {\n return function() {\n christmasSnow.render();\n christmasSnow.update();\n }\n }" ]
[ "0.7632841", "0.754819", "0.7506265", "0.7359253", "0.7127745", "0.67426664", "0.6549764", "0.6423981", "0.6388537", "0.6336541", "0.63323164", "0.62478966", "0.61484957", "0.6058834", "0.6011207", "0.59943867", "0.59890306", "0.5971632", "0.593542", "0.58539915", "0.58454865", "0.58352804", "0.5817383", "0.5812162", "0.580871", "0.5790963", "0.5788115", "0.57670397", "0.5753884", "0.5753884", "0.5748711", "0.5742393", "0.5736926", "0.5735855", "0.57299346", "0.5721628", "0.5720753", "0.57042944", "0.5702786", "0.56961465", "0.56951374", "0.56900245", "0.56860214", "0.5671132", "0.5670661", "0.5663283", "0.5653458", "0.5650191", "0.5638996", "0.56351256", "0.5633088", "0.5628976", "0.56273556", "0.56192344", "0.56098455", "0.55892444", "0.5576695", "0.5576222", "0.5566212", "0.5564614", "0.55639124", "0.5562202", "0.55620325", "0.55534023", "0.55509764", "0.5545001", "0.55441976", "0.5535635", "0.5529439", "0.55272925", "0.5514912", "0.5508847", "0.55070305", "0.55064344", "0.5497599", "0.5492954", "0.54865295", "0.54803276", "0.54717183", "0.5470597", "0.5470321", "0.5467247", "0.5464279", "0.5461095", "0.5460752", "0.54551214", "0.54524916", "0.5451795", "0.5444912", "0.5440048", "0.5435982", "0.5426815", "0.5424993", "0.5419399", "0.5417085", "0.5417085", "0.5416296", "0.5408458", "0.54071015", "0.5406167" ]
0.8026701
0
The onclick function which is on the the snowflake icon
function letItSnow() { // Calling the addSnow function in a loop to add 50 snow elements for (let i = 0; i < 50; i++) { addSnow(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onClick({x,y,object}) {\n console.log(\"Clicked icon:\",object);\n }", "onClick() {\n }", "function onClick() {\n}", "onclick(){}", "handleJDotterClick() {}", "function onClick(e) {\n }", "function Click() {\n}", "function onBrowserActionClick() {\n info(\"event: browser action icon was clicked\");\n click($(_ID_STATUS));\n}", "function onClick(e) {\n \t\t// console.log(this);\n\t\t}", "function on_click(e) {\n cloud.on_click(e.clientX, e.clientY);\n}", "static get CLICK() {\n return \"click\";\n }", "function handleClick(event)\n{\n}", "handleClick() {}", "function ClickGastarFeitico() {\n AtualizaGeral();\n}", "onImageClick() {\n console.log('Clicked Image')\n }", "function imgClick(event) {\n\n}", "function SymbolClickHandler(theIndex)\r\n{\r\n\t// Determine what type of action to take\r\n\t// based on value in gaiBtnActionType array\r\n\t\r\n\tswitch( gaiBtnActionType[theIndex] )\r\n\t{\r\n\t\tcase 0: // MMC_TASK_ACTION_ID:\r\n\t\t\tExecuteCommandID( gaszBtnActionClsid[theIndex], gaiBtnActionID[theIndex], 0 );\r\n\t\t\tbreak;\r\n\r\n\t\tcase 1: // MMC_TASK_ACTION_LINK:\r\n\t\t//\tdocument.location( gaszBtnActionURL[theIndex] );\r\n\t\t\twindow.navigate( gaszBtnActionURL[theIndex] );\r\n\t\t\tbreak;\r\n\r\n\t\tcase 2: // MMC_TASK_ACTION_SCRIPT:\r\n\t\t\t// Determine whether the language is (JSCRIPT | JAVASCRIPT) or (VBSCRIPT | VBS)\r\n\t\t\t// Convert toUpperCase\r\n\t\t\tvar szLanguage = gaszBtnActionScriptLanguage[theIndex].toUpperCase();\r\n\t\t\t\t\t\t\r\n\t\t\tswitch( szLanguage )\r\n\t\t\t{\r\n\t\t\t\tcase 'JSCRIPT':\r\n\t\t\t\tcase 'JAVASCRIPT':\r\n\t\t\t\t\t// Pass a script string to the JSObject to be evaluated and executed\r\n\t\t\t\t\t// through the eval method (this can be a semi-colon delimited complex expression)\r\n\t\t\t\t\teval( gaszBtnActionScript[theIndex] );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VBSCRIPT':\r\n\t\t\t\tcase 'VBS':\r\n\t\t\t\t\t// Use the window.execScript method to execute a simple or complex VBScript expression\r\n\t\t\t\t\twindow.execScript( gaszBtnActionScript[theIndex], szLanguage );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\talert( 'Unrecognized scripting language.' );\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\talert( 'Unrecognized task.' );\r\n\t\t\tbreak;\r\n\t}\r\n}", "clickIcon() {\n const icon = window.document.getElementById('icon');\n if(icon.className === \"far fa-arrow-alt-circle-left fa-2x\"){\n icon.className = \"far fa-arrow-alt-circle-right fa-2x\";\n } else {\n icon.className = \"far fa-arrow-alt-circle-left fa-2x\";\n }\n return this.props.toggle();\n }", "onClick(functionName) {\n return functionName;\n }", "@action\n click() {\n this.args['on-click']?.();\n }", "click_extra() {\r\n }", "getIcon() {\n return \"document-cook\";\n }", "function symbolClick() {\n var symbol = $(this).text();\n updateFormula(function(text) {\n return text + symbol;\n });\n }", "function onClickFunc() {\n console.log('clicked')\n}", "clickFunction(event) {\n try {\n const targets = event.composedPath();\n for (let target of targets) {\n if (this.checkIfElementIsActionMenuIcon(target)) {\n return;\n }\n }\n }\n catch (err) {\n if (this.checkIfElementIsActionMenuIcon(event.target)) {\n return;\n }\n }\n this.rowActionMenuOpened = null;\n }", "function onClick(event, value) {\n\t\t\tif (event === \"toggle\") {\n\t\t\t\t// UISelectionEvent\n\t\t\t\tregistry.callback({ type: \"selection\", icon: value });\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event === \"select\" || event === \"deselect\") {\n\t\t\t\t// UISelectionEvent\n\t\t\t\tregistry.callback({\n\t\t\t\t\ttype: \"selection\",\n\t\t\t\t\ticon: value,\n\t\t\t\t\tselected: event === \"select\"\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tregistry.router.action(event, value);\n\t\t}", "function click(el){\n \n \n}", "onClick(element) {\n\t\taction(`You have clicked on element ${element.name}`).call();\n\t}", "function click_on() {\n console.log('called click function');\n}", "function onClickHandeler(emoji) {\n var emojiVar = emojiDictionary[emoji];\n emojiFun(emojiVar);\n }", "function estourar(e) {\n let idJs = e.id;\n\n document.getElementById(idJs).setAttribute(\"onclick\", \"\");\n document.getElementById(idJs).style.background = \"url('imagens/pow1.png')\"\n \n pontuacao(-1);\n}", "function handleClick(){\n console.log(\"clicked\");\n}", "function outterClick() {\n\n}", "function onClick(link){\n \n}", "click() { }", "function icon(str, click) {\n return '<span class=\"glyphicon glyphicon-'+str+'\"'\n + (typeof click != \"undefined\" ? ' onclick=\"'+click+'\" style=\"cursor:pointer\"':'')\n +'></span>';\n}", "_handleAtomClick(alist, event) {\n\n if (alist.length == 0) {\n return;\n }\n\n let clicked = alist[0].image;\n\n let modifiers = [CrystVis.LEFT_CLICK, CrystVis.MIDDLE_CLICK, CrystVis.RIGHT_CLICK][event.button];\n\n modifiers += event.shiftKey * CrystVis.SHIFT_BUTTON;\n modifiers += (event.ctrlKey || event.metaKey) * CrystVis.CTRL_BUTTON;\n modifiers += event.altKey * CrystVis.ALT_BUTTON;\n\n var callback = this._atom_click_events[modifiers];\n\n if (callback)\n callback(clicked, event);\n\n }", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function actionOnClick(){\n score = 0;\n health = 100;\n reach = 0;\n day = 1;\n game.state.start('brushing');\n\n console.log('click');\n\n }", "onClick(e){\n console.log(\"onclick\")\n }", "function checkClicked() {\n \n}", "function _click(d){\n \n }", "function savedStopPointOnClick(ev, row)\n{\n\tlet info = storage.getStopPoints();\n\tsetCurrentStopPointInfo( { name: \"\", info: info } );\n\tresetSavedStopPointFrame();\n\tresetSearchFrame();\n\tdisplayStopPointInfo(info, true);\n\tstopPointOnClick(ev, row);\n}", "function doClick(e) {\n options.onClick(e);\n }", "clicked() {\n this.get('onOpen')();\n }", "onClick() {\n // Verifica se existe a função para processar o click e a invoca\n if(this.handleClick) {\n this.handleClick(this);\n }\n }", "onParcelClick() {\n console.log('u clicked the lil parcel')\n }", "function clickOnGameButton(event)\n{\n // Hier coderen we alles wat moet worden gedaan zodra een speler op de game button clicked\n // @TODO: Click event van de game button programmeren. Wat moet er allemaal gebeuren na een klik?\n}", "function mouseClicked() {\n\t\n\n\t\t// if (osc.getType() == 'square') {\n\t\t// \tosc.setType('sine')\n\t\t// } else {\n\t\t// \tosc.setType('square')\n\t\t//}\n\t\t\n\t\n}", "handleClick( event ){ }", "function onClickHandler(selectedIcon) {\n onSelect(selectedIcon);\n }", "function makeItClickable(){\n\n }", "function onClick() {\n\t\tconsole.log('123');\n\t}", "function doOnClickLocation(Attribute, ToolTip, ImgUrl, ImgWidth, ImgHeight) {\n postToIframeMethed('onClickLocation', [Attribute, ToolTip, ImgUrl, ImgWidth, ImgHeight])\n}", "onClickEstimate() {\r\n \r\n }", "function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }", "metodoClick(){\n console.log(\"diste click\")\n }", "_evtClick(event) { }", "function gameIcon(clicked_id) {\n playerMove = clicked_id;\n //return playerMove;\n getWinner(playerMove);\n}", "function downloadJsuTip(event){\n Tip ('Click to Go to the Page of <b>JSU FREE Download</b>'); \t\n}", "clicked(x, y) {}", "function node_onClick(e,d,i) {\n // console.log(\"You have just clicked on \" + d.values[0].CAND_NAME);\n}", "function genericOnClick(info, tab) {\n //console.log(\"info: \" + JSON.stringify(info));\n //console.log(\"tab: \" + JSON.stringify(tab));\n}", "function onBTN1Toggle()\n{\n var icon;\n\n // Modification de l'icône du bouton pour inverser l'affichage de la query SQL. \n icon = document.querySelector('#btn-one i');\n\n icon.classList.toggle('fa-sort-up');\n icon.classList.toggle('fa-sort-down');\n}", "function onClick(event) {\n alert('i was clicked')\n}", "function clicked(d,i) {\n\n}", "function clicked(d,i) {\n\n}", "clickTrigger() {\n $(this.rootElement)\n .$('[data-id=\"button-icon-element\"]')\n .click();\n }", "function handTitleClick() {\n console.log('title was clicked!');\n}", "function ansClicked (eventData) {\n\tlet buttonInformation = eventData;\n\tlet ansClicked = buttonInformation.target.textContent;\n\tinsertDisplay(ansClicked);\n\t\n}", "_click(e) {\n const type = this.cel.getAttribute('data-type');\n\n this[type](e);\n }", "handleIconClicked() {\n\t\tlet mode = 'human'\n\t\tif (this.props.mode === 'human') {\n\t\t\tmode = 'computer';\n\t\t}\n\t\tthis.props.changeMode(mode);\n\t}", "function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}", "function instruction(){\n alert(\"Click on the button to see what is available\")\n}", "function node_onClick(e,d,i) {\n console.log(\"You have just clicked on \" + d.values[0].CAND_NAME);\n}", "function favoriteClickHandler(){\n\t\n\t/**\n\t * Capture analytics event for favorite button click for reporting purposes\n\t */\n\tTi.Analytics.featureEvent('app.briefcase.favoritebtn.clicked');\n\n\t/**\n\t * update the state variable for the button\n\t */\n\tfavoriteStatus = !favoriteStatus;\n\t\n\t/**\n\t * set the icon variable to the proper reference based on the state\n\t */\n\tvar icon = !favoriteStatus ? 'icon-star-empty' : 'icon-star';\n\t$.favoriteBtn.setIcon(icon);\n}", "function whatToDoOnClick() {\n alert(\"You Did it!\")\n}", "handleToggleClick() {\n this.buttonClicked = !this.buttonClicked; //set to true if false, false if true.\n this.cssClass = this.buttonClicked ? 'slds-button slds-button_outline-brand' : 'slds-button slds-button_neutral';\n this.iconName = this.buttonClicked ? 'utility:check' : '';\n }", "function _clickBidang(e)\r\n{\r\n\tvar arr = findObjectByKey(_nopjson, 'nop', e.layer.feature.properties.nop);\r\n\tviewDetailBidang(e.layer.feature,arr);\r\n}", "function new_toogle_button(classButton, textButton){\n\nreturn \"<span class=\\\"padding\\\" style=\\\"cursor:pointer;\\\" onclick=\\\"\"+classButton+\"()\\\" >&nbsp;&nbsp;&nbsp;&nbsp;\"+textButton+\"&nbsp;<img src=\\\"/pics/sort_btn_gray_on.gif\\\" class=\\\"\"+classButton+\"\\\"/></span>\";\n}", "function do_click() {\n alert('you clicked');\n}", "function sunClicked(event) { //////////////////////////////////////////////////点击太阳\n\t\t\tvar targett = event.target;\n\t\t\tvar sunToRemove = targett.parent; // defines which sun we need to remove\n\t\t\tsunToRemove.removeEventListener(\"click\", sunClicked); // removes the CLICK listener\n\t\t\tmoney += 50; // makes the player earn money (5)\n\t\t\tupdateMoney(); //////////////////////////////////////////////////更新钱// updates money text\n\t\t\tsunContainer.removeChild(sunToRemove); // removes the sun\n\t\t\tsun_ClickContainer.addChild(sunToRemove); ///////收集被点击的太阳, 让太阳沿左上角移动\n\t\t}", "function click() {\n\tconsole.log('click')\n}", "function setClickActionNE(functionName) {\n\t\tthis.onClicked = eval(functionName);\n\t}", "function ClickMe(e) {\n if (userjwt) {\n if (e.target.getAttribute('src') === 'https://img.icons8.com/android/24/ffffff/star.png') {\n e.target.setAttribute('src', 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png');\n } else if (e.target.getAttribute('src') === 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png') {\n e.target.setAttribute('src', 'https://img.icons8.com/android/24/ffffff/star.png');\n }\n }\n }", "function evtRoutine1( sender, parms )\n {\n var fld = this.FLD.D1_MAIN, ref = this.REF, rtn = Lansa.evtRoutine( this, COM_OWNER, \"#AppBar.IconClick\", 45 );\n\n //\n // EVTROUTINE Handling(#AppBar.IconClick)\n //\n rtn.Line( 45 );\n {\n\n //\n // #AppDrawer.ToggleDrawer\n //\n rtn.Line( 47 );\n ref.APPDRAWER.mthTOGGLEDRAWER();\n\n //\n // #std_textl := '1425'\n //\n rtn.Line( 48 );\n fld.STD_TEXTL.set( \"1425\" );\n\n }\n\n //\n // ENDROUTINE\n //\n rtn.Line( 50 );\n rtn.end();\n }", "function clickme(){\n\n\t\talert('Hey, you clicked me!');\n\t}", "menuButtonClicked() {}", "function novel_addOnClick(el, value)\n{\n el.onclick = function(e) { novel_menuJump.apply(window, [value, e]); return false;};\n}", "showInfoPopup() {\n return(\n <div>\n <button onClick={this.toggleHelpPopup.bind(this)} style={{'border':'transparent','background-color': 'transparent'}}>\n <i class=\"fa fa-question-circle-o fa-4x\" style={{'color':'white'}}></i> \n <div><font color=\"white\">Help</font></div>\n </button>\n </div>\n )\n }", "function onClickMarker(title, attributes) {\n\tvar attributes = eval(\"(\" + attributes + \")\");\n\tView.getOpenerView().siteId = attributes.values['bl.site_id'];\n\tView.getOpenerView().blId = title\n\tView.getOpenerView().openDialog('ab-msds-rpt-drawing.axvw', null, false, null, null, 1200, 600);\n}", "function onClickMarker(title, attributes) {\n\tvar attributes = eval(\"(\" + attributes + \")\");\n\tView.getOpenerView().siteId = attributes.values['bl.site_id'];\n\tView.getOpenerView().blId = title\n\tView.getOpenerView().openDialog('ab-msds-rpt-drawing.axvw', null, false, null, null, 1200, 600);\n}", "function plopPflanzeWC1(){\n document.getElementById('bildIconPflanzeWC').style.display=\"block\"\n console.log(\"es muesste aufploppen\")\n}", "featureClickEventCallback(event) {\r\n\r\n }", "function bwClick(itemId) {\n $(itemId).click();\n}", "function clickImage (data){\n\t\t\n\t\t/*click function on each image*/\n\t\tdelegate(\"body\",\"click\",\".clickMe\",(event) => {\n\t\t\t\n\t\t\tevent.preventDefault();\n\t\t\tvar dataCaptionId=getKeyFromClosestElement(event.delegateTarget);\n\t\t\tvar dataCaption = data.caption;\n\t\t\tdataCaption = dataCaption.replace(/\\s+/g, \"\");\n\t\t\t\n\t\t\t//match the id and render pop up with the data\n\t\t\tif (dataCaption == dataCaptionId){\n\t\t\t\trenderPopup(data, container) \n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t}", "function btnChange_onclick() {\n debugger;\n if (TR_Type == \"2\") {\n TR_Type = \"1\";\n btnChange.innerHTML = '<span class=\"glyphicon\"> <img class=\"img-fluid\" src=\"/img/testimonial/t1.png\" alt=\"\" style=\"border-radius: 4.25rem;box-shadow: 0 5px 15px rgb(255 165 0 / 75%);\" ></span><span > <<< </span>الذهب الي حجز الاطفال';\n }\n else {\n TR_Type = \"2\";\n btnChange.innerHTML = '<span class=\"glyphicon\"> <img class=\"img-fluid\" src=\"/img/testimonial/t2.png\" alt=\"\" style=\"border-radius: 4.25rem;box-shadow: 0 5px 15px rgb(255 165 0 / 75%);\" ></span><span > <<< </span>الذهب الي حجز الرجال';\n }\n Display();\n }", "function onClick( event ) {\n for( var i = 0; i < _buttons.length; i++ ) {\n var button = _buttons[i];\n \n if( button.contains( event.layerX, event.layerY ) ) {\n actionPerformed( button.getActionCommand() );\n return;\n }\n }\n \n if( event.which == 1 ) {\n location.href = linkHref;\n }\n }", "function formatClickHandler(e, name) {\n if (name==='blocks') {\n setIcon({\n blocks: <BlockViewLightIcon />,\n list: <ListViewDarkIcon />,\n color1: '#484F56',\n color2: 'inherit',\n });\n } else {\n setIcon({\n blocks: <BlockViewDarkIcon />,\n list: <ListViewLightIcon />,\n color1: 'inherit',\n color2: '#484F56',\n });\n }\n formattingHandler(name);\n }", "function customNotificationOnClick() {\n if (variable.onClick) {\n initiateCallback('onClick', variable, scope, options.data);\n } else {\n wmToaster.hide();\n }\n }" ]
[ "0.7116801", "0.6899422", "0.68865144", "0.68220514", "0.6755415", "0.67301244", "0.6519582", "0.6447334", "0.6281522", "0.62723565", "0.6269966", "0.6255333", "0.6250979", "0.624553", "0.6218259", "0.6215519", "0.6208778", "0.61409074", "0.6130031", "0.6117342", "0.6114941", "0.61101466", "0.610723", "0.6086142", "0.608317", "0.60606176", "0.6046366", "0.6045222", "0.60367346", "0.6030681", "0.6029956", "0.6024335", "0.6012577", "0.60012877", "0.599558", "0.5993979", "0.5991052", "0.5990886", "0.5990886", "0.59830314", "0.5979402", "0.59642124", "0.59637326", "0.59587556", "0.59445685", "0.59439844", "0.5942023", "0.5938776", "0.5932348", "0.5929252", "0.5918054", "0.5908308", "0.5903228", "0.5898624", "0.5892487", "0.58919483", "0.5890876", "0.58605725", "0.58567697", "0.58444244", "0.58352834", "0.58350456", "0.58344847", "0.5828376", "0.58255017", "0.58133745", "0.5812539", "0.5812539", "0.58123255", "0.58100706", "0.58047134", "0.5804637", "0.5802975", "0.579942", "0.5798102", "0.5789057", "0.5779059", "0.57756805", "0.5773132", "0.5772343", "0.5765094", "0.5748241", "0.5744135", "0.57422173", "0.5740917", "0.57378346", "0.5737379", "0.5736587", "0.5729766", "0.57271594", "0.572511", "0.5725062", "0.5725062", "0.5721098", "0.5717047", "0.5714512", "0.5705857", "0.5705491", "0.5704867", "0.57047033", "0.5703901" ]
0.0
-1
li list element ul unordered list
function StudentList({students}) { function renderStudents(){ return students.map((student, i)=>{ var studentData = [student.firstName, student.lastName, student.svnNumber].join(" "); return <li key = {i}>{studentData}</li> }) }; return ( <div> <ul> {renderStudents()} </ul> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalizeList(dom) {\n for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {\n let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null\n if (name && listTags.hasOwnProperty(name) && prevItem) {\n prevItem.appendChild(child)\n child = prevItem\n } else if (name == \"li\") {\n prevItem = child\n } else if (name) {\n prevItem = null\n }\n }\n }", "function list(elem, type) {\n var count = 1,\n result = \"\\n\",\n children = elem.getElementsByTagName(\"li\");\n\n for (var i = 0; i < children.length; ++i) {\n // add the list item\n if (type == 'ordered') {\n result += count + \". \";\n count++;\n } else {\n result += \"- \";\n }\n\n // add the child elements\n result += parseChildren(children[i]) + \"\\n\";\n }\n \n return result + \"\\n\";\n}", "function showUnorderedList(){\n const people = ['Crhis','Anne','Colin','Terri','Phil','Lola','Sam','Kay',\n 'Bruce'];\n const aqui = document.querySelector('.unorderedList');\n const unorderedList = document.createElement('ul');\n aqui.appendChild(unorderedList);\n const dentro = document.querySelector('ul');\n for (let i=0; i<people.length;i++){\n const cosa = document.createElement('li');\n cosa.textContent= people[i];\n dentro.appendChild(cosa);\n }\n}", "function xWalkUL(oUL,data,fn)\r\n{\r\n var r, ul, li = xFirstChild(oUL);\r\n while (li) {\r\n ul = xFirstChild(li,'ul');\r\n r = fn(oUL,li,ul,data);\r\n if (ul) {\r\n if (!r || !xWalkUL(ul,data,fn)) {return 0;};\r\n }\r\n li = xNextSib(li);\r\n }\r\n return 1;\r\n}", "function aa() {\n var ObjUl = $('<ul></ul>');\n var j;\n for (i = 0; i < tree.length; i++) {\n for (j = 0; j < tree.length ; j++)\n {\n if (tree[i].parentID == tree[j].id)\n break;\n }\n if(j==(tree.length))\n {\n \n var Objli = $('<li></li>');\n var Obja = $('<a></a>');\n\n ObjUl.addClass(\"ui-menu-item\");\n ObjUl.attr(\"role\", \"menuitem\");\n ObjUl.attr(\"id\", tree[i].id);\n \n Obja.addClass(\"ui-all\");\n Obja.text(tree[i].title);\n Objli.append(Obja);\n\n ObjUl.append(Objli);\n $('#list').append(ObjUl);\n }\n }\n var a= document.getElementById(\"1\");\n ff(a);\n \n}", "function processList(ul) {\n if (!ul.childNodes || ul.childNodes.length == 0) { return; }\n // Iterate LIs\n var childNodesLength = ul.childNodes.length;\n for (var itemi = 0; itemi < childNodesLength; itemi++) {\n var item = ul.childNodes[itemi];\n if (item.nodeName == \"LI\") {\n // Iterate things in this LI\n var subLists = false;\n var itemChildNodesLength = item.childNodes.length;\n for (var sitemi = 0; sitemi < itemChildNodesLength; sitemi++) {\n var sitem = item.childNodes[sitemi];\n if (sitem.nodeName == \"UL\") {\n subLists = true;\n processList(sitem);\n }\n }\n var s = document.createElement(\"SPAN\");\n var t = '\\u00A0'; // &nbsp;\n s.className = nodeLinkClass;\n if (subLists) {\n // This LI has UL's in it, so it's a +/- node\n if (item.className == null || item.className == \"\") {\n item.className = nodeClosedClass;\n }\n // If it's just text, make the text work as the link also\n if (item.firstChild.nodeName == \"#text\") {\n t = t + item.firstChild.nodeValue;\n item.removeChild(item.firstChild);\n }\n s.onclick = treeNodeOnclick;\n }\n else {\n // No sublists, so it's just a bullet node\n item.className = nodeBulletClass;\n s.onclick = retFalse;\n }\n s.appendChild(document.createTextNode(t));\n item.insertBefore(s, item.firstChild);\n }\n }\n }", "constructor(name, el, list) {\n super(name, el, \"\"); //no need to pass template you will remove and change. Use \"\"\n this._list = list;\n this.ordered = false; // another API for setting orderd or unordered\n this._refresh(\"ul\");\n }", "function CreateItemList(Structure) {\n var Structure = (typeof(Structure) != \"undefined\") ? Structure : $(\"#\" + MenuName + \"_container > ul > li\");\n var ULElement = document.createElement(\"ul\");\n Structure.each(function (Index) {\n var LiElement = document.createElement(\"li\");\n var AElement = null;\n LiElement.className = \"ellipsis\";\n // Clone the original a element\n AElement = $(this).children(\"a\").clone().appendTo($(LiElement));\n if ($(this).children(\"ul\").length) {\n AElement.html('<span class=\"branch\">' + AElement.html() + '</span>');\n } else {\n AElement.html('<font class=\"leaf\">' + AElement.html() + '</font>');\n }\n // Add a paragraph for ellipsis to work.\n AElement.html('<p class=\"xtd_menu_ellipsis\">' + AElement.html() + '</p>');\n if ($(this).children(\"ul\").length) {\n // Recursive call for the child elements.\n var NewUL = CreateItemList($(this).children(\"ul\").children(\"li\"));\n NewUL.style.display = \"none\";\n LiElement.appendChild(NewUL);\n }\n ULElement.appendChild(LiElement);\n });\n return ULElement;\n }", "function processList(ul) {\n if (!ul.childNodes || ul.childNodes.length==0) { return; }\n // Iterate LIs\n var childNodesLength = ul.childNodes.length;\n for (var itemi=0;itemi<childNodesLength;itemi++) {\n var item = ul.childNodes[itemi];\n item = $(item);\n if (item.nodeName == \"LI\") {\n // Iterate things in this LI\n var subLists = false;\n var itemChildNodesLength = item.childNodes.length;\n for (var sitemi=0;sitemi<itemChildNodesLength;sitemi++) {\n var sitem = item.childNodes[sitemi];\n if (sitem.nodeName==\"UL\") {\n subLists = true;\n processList(sitem);\n }\n }\n var s= document.createElement(\"SPAN\");\n var t= '\\u00A0'; // &nbsp;\n s.className = nodeLinkClass;\n if (subLists) {\n // This LI has UL's in it, so it's a +/- node\n //if (item.className==null || item.className==\"\") {\n if (!item.hasClass(nodeClosedClass)) {\n item.addClass(nodeClosedClass);\n }\n // If it's just text, make the text work as the link also\n if (item.firstChild.nodeName==\"#text\") {\n t = t+item.firstChild.nodeValue;\n item.removeChild(item.firstChild);\n }\n s.onclick = treeNodeOnclick;\n }\n else {\n // No sublists, so it's just a bullet node\n item.addClass(nodeBulletClass);\n s.onclick = retFalse;\n }\n s.appendChild(document.createTextNode(t));\n item.insertBefore(s,item.firstChild);\n }\n }\n}", "function normalizeList(dom) {\n for (var child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {\n var name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null\n if (name && listTags.hasOwnProperty(name) && prevItem) {\n prevItem.appendChild(child)\n child = prevItem\n } else if (name == \"li\") {\n prevItem = child\n } else if (name) {\n prevItem = null\n }\n }\n}", "function normalizeList(dom) {\n for (var child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {\n var name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null\n if (name && listTags.hasOwnProperty(name) && prevItem) {\n prevItem.appendChild(child)\n child = prevItem\n } else if (name == \"li\") {\n prevItem = child\n } else if (name) {\n prevItem = null\n }\n }\n}", "function ajouteMoiUnli(){\n var li = document.createElement(\"li\")\n var ul = document.getElementById(\"simploniens\")\n var my_ul = ul.appendChild(li);\n return my_ul;\n}", "function addList()\n {\n var element = $('<ul/>',{\n 'class': 'mt-ul'\n });\n component.prepend(element);\n list = component.find(element);\n }", "function _sub_render(ul, item){\n\tvar li = jQuery('<li>');\n\tli.append('<a alt=\"'+ item.name +'\" title=\"'+ item.name +'\">' +\n\t\t '<span class=\"autocomplete-main-item\">' +\n\t\t item.label +\n\t\t '</span>' + \n\t\t '&nbsp;' + \n\t\t '<span class=\"autocomplete-tag-item\">' +\n\t\t item.tag +\n\t\t '</span>' + \n\t\t '</a>');\n\tli.appendTo(ul);\n\treturn li;\n }", "function walk_list(ul, level)\n {\n var result = [];\n ul.children('li').each(function(i,e){\n var state, li = $(e), sublist = li.children('ul');\n var node = {\n id: dom2id(li),\n classes: String(li.attr('class')).split(' '),\n virtual: li.hasClass('virtual'),\n level: level,\n html: li.children().first().get(0).outerHTML,\n text: li.children().first().text(),\n children: walk_list(sublist, level+1)\n }\n\n if (sublist.length) {\n node.childlistclass = sublist.attr('class');\n }\n if (node.children.length) {\n if (node.collapsed === undefined)\n node.collapsed = sublist.css('display') == 'none';\n\n // apply saved state\n state = get_state(node.id, node.collapsed);\n if (state !== undefined) {\n node.collapsed = state;\n sublist[(state?'hide':'show')]();\n }\n\n if (!li.children('div.treetoggle').length)\n $('<div class=\"treetoggle '+(node.collapsed ? 'collapsed' : 'expanded') + '\">&nbsp;</div>').appendTo(li);\n\n li.attr('aria-expanded', node.collapsed ? 'false' : 'true');\n }\n if (li.hasClass('selected')) {\n li.attr('aria-selected', 'true');\n selection = node.id;\n }\n\n li.data('id', node.id);\n\n // declare list item as treeitem\n li.attr('role', 'treeitem').attr('aria-level', node.level+1);\n\n // allow virtual nodes to receive focus\n if (node.virtual) {\n li.children('a:first').attr('tabindex', '0');\n }\n\n result.push(node);\n indexbyid[node.id] = node;\n });\n\n ul.attr('role', level == 0 ? 'tree' : 'group');\n\n return result;\n }", "function createListElement() {\n\tvar listelement = document.createElement(\"li\");\n\t\tlistelement.appendChild(document.createTextNode(input.value));\n\t\tunorderedelement.appendChild(listelement);\n\t\tinput.value = \"\";\n}", "function listoKurimas() {\n divuiAte();\n pridedamVerteIMasyva();\n var divListui = document.createElement('div'); // sukuriam diva listui\n // divui id\n divListui.id = \"divoId\";\n // pridedam sukurta diva i body\n document.getElementsByTagName('body')[0].appendChild(divListui);\n // sukuriam ul taga\n var ulDivui = document.createElement('ul');\n // idedam ul i diva\n divListui.appendChild(ulDivui);\n // sukuriam for loopa kad pridetu i ul masyvo \n // elementus kaip li\n var kiekListeYraLi = komentaruMasyvas.length;\n \n\n //////////////////////////////////////////////////////////////////////////\n // cia GAL su get element by tag name pasigauti sukurta ul ir appendint kuriamus li \n // i ji?\n for (var i = 0; i < kiekListeYraLi; ++i) {\n var listoElementas = document.createElement('li');\n listoElementas.innerHTML = komentaruMasyvas[i];\n ulDivui.appendChild(listoElementas);\n\n };\n document.getElementById('divasIsHtmlSkriptoVietai').appendChild(divListui);\n\n}", "function getUl(el, level) {\n var $row = $(el).closest('.row')\n , nest_level = arguments[1] || $row.data('ul-level');\n if (nest_level == 2) return $row.find('> ul ul');\n return $row.find('> ul');\n}", "produce() {\n var listElem = [],\n uniqueKey = [];\n this.list.forEach(item => {\n var elem = <RenderElement elemkey={item.key} text={item.text} type={item.type} inlineStyleRanges={item.inlineStyleRanges}/>\n uniqueKey.push(item.key)\n listElem.push(elem)\n })\n return (this.list[0].type == \"unordered-list-item\" ? <ul key={uniqueKey.join(\"|\")}>{listElem}</ul> : <ol key={uniqueKey.join(\"|\")}>{listElem}</ol>)\n }", "function tag_list( type )\r\n{\r\n\tvar listitem = \"init\";\r\n\tvar thelist = \"\";\r\n\t\r\n\topentag = ( type == 'ordered' ) ? '[listo]' : '[list]';\r\n\tclosetag = ( type == 'ordered' ) ? '[/listo]' : '[/list]';\r\n\t\r\n\twhile ((listitem != \"\") && (listitem != null))\r\n\t{\r\n\t\tlistitem = prompt(list_prompt, \"\");\r\n\t\t\r\n\t\tif ((listitem != \"\") && (listitem != null))\r\n\t\t{\r\n\t\t\tthelist = thelist + \"[li]\" + listitem + \"[/li]\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tif ( thelist != \"\" )\r\n\t{\r\n\t\tthelist = opentag + thelist + closetag;\r\n\t\tinsert_text(thelist, \"\");\r\n\t}\r\n}", "function List( element ) {\n\tthis.element = element;\n}", "function addToList( value, word ){\n\t\n\tvar speed = 500,\n\t\tuls = [];\n\t\n\tif( value === 'sustantivo'){\n\t\tuls.push('#sustantivos ul');\n\t}\n\tif( (value === 'verbo') || (value === 'verbo conjugado') ){\n\t\tuls.push('#verbos ul');\n\t}\n\n\tif( value === 'adjetivo' ){\n\t\tuls.push('#adjetivos ul');\n\t}\n\n\tif( value === 'artículo' ){\n\t\tuls.push('#articulos ul');\n\t}\n\n\tif( value === 'adverbio' ){\n\t\tuls.push('#adverbios ul');\n\t}\n\n\tif( value === 'preposición' ){\n\t\tuls.push('#preposiciones ul');\n\t}\n\n\tif( value === 'conjunción' ){\n\t\tuls.push('#conjunciones ul');\n\t}\n\tif( value === 'pronombre' ){\n\t\tuls.push('#pronombres ul');\n\t}\n\tif( value === null ){\n\t\tuls.push('#indeterminadas ul');\n\t}\n\n\tuls.forEach(function(ul){\n\t\tul = $(ul);\n\t\tif (!ul.find('li').filter(function(){\n\t\t\treturn $(this).text() === word;\n\t\t}).length){\n\t\t\t$('<li>',{\n\t\t\t\ttext: word\n\t\t\t}).appendTo(ul)\n\t\t\t .hide()\n\t\t\t .fadeIn(speed);\n\t\t}\n\t});\n\t\n}", "_processUList() {\n const that = this,\n menuItemsGroupOpeningTagRegex = new RegExp(/<li>(.(?!<\\/li>)|\\n)*?<ul>/),\n menuItemsGroupClosingTagRegex = new RegExp(/<\\/ul>(.|\\n)*?<\\/li>/);\n let innerHTML = that.$.mainContainer.firstElementChild.innerHTML;\n\n innerHTML = innerHTML.replace(/\\r?\\n|\\r/g, '');\n innerHTML = innerHTML.replace(/<li(.|\\n)*?>/g, '<li>');\n innerHTML = innerHTML.replace(/<li><\\/li>/g, '<li> </li>');\n innerHTML = innerHTML.replace(/<ul(.|\\n)*?>/g, '<ul>');\n\n while (menuItemsGroupOpeningTagRegex.test(innerHTML)) {\n const match = menuItemsGroupOpeningTagRegex.exec(innerHTML),\n content = '<jqx-' + that._element + '-items-group>' + match[0].slice(4, match[0].length - 4);\n\n innerHTML = innerHTML.replace(match[0], content);\n }\n\n while (menuItemsGroupClosingTagRegex.test(innerHTML)) {\n const match = menuItemsGroupClosingTagRegex.exec(innerHTML),\n content = '</jqx-' + that._element + '-items-group>';\n\n innerHTML = innerHTML.replace(match[0], content);\n }\n\n innerHTML = innerHTML.replace(/li>/g, 'jqx-' + that._element + '-item>');\n\n that.$.mainContainer.innerHTML = innerHTML;\n }", "function appendListToDOM($li) {\n var $ul = $('ul.collection');\n $li.appendTo($ul);\n deleteListItem();\n editDiscussion();\n}", "function createListHTML(list, container) {\n container.innerHTML = \"\"; //first, clean up any existing LI elements\n for (var i = 0; i < 6; i++) {\n\n container.innerHTML = container.innerHTML + \"<li class=\\\"up\\\" data-index='\" + list[i][\"id\"] + \"'>\" + \"<span>\" + list[i][\"text\"] + \"</span>\" + \"</li>\";\n\n\n //OR shorter version: container.innerHTML += \"<li class=\"upper\" data-index='\" + list[i][\"\"id\"\"] + \"'>\" + list[i][\"text\"] + \"</li>\";\n }\n }", "function _make$Li( contents ){\n return $([\n '<li><a href=\"javascript:void(0);\">', contents, '</a></li>'\n ].join( '' ));\n }", "function asLI(x) { return toType('jquery', x).closest('li') }", "function makeUl( parentDomElem, parentMenu ) {\n\n var ulElem = document.createElement(\"ul\");\n parentDomElem.appendChild(ulElem);\n\n var children = parentMenu.children;\n\n for (var i=0; i<children.length; i++) {\n var liElem = document.createElement(\"li\");\n var divElem = document.createElement(\"div\");\n divElem.appendChild(document.createTextNode( children[i].title ));\n ulElem.appendChild( liElem );\n liElem.appendChild( divElem );\n\n if ( children[i].children.length > 0 ) {\n makeUl( liElem, children[i] );\n divElem.addEventListener( \"click\", that.hide.bind( that ) );\n } else {\n divElem.addEventListener( \"click\", emitMenuSelect.bind( that, children[i] ) );\n divElem.className = \"interactive_marker_menuentry\";\n }\n }\n\n }", "function unorderedItems(node) {\n var self = this;\n var bullet = self.options.bullet;\n var fn = self.visitors.listItem;\n var children = node.children;\n var length = children.length;\n var index = -1;\n var values = [];\n\n while (++index < length) {\n values[index] = fn.call(self, children[index], node, index, bullet);\n }\n\n return values.join('\\n');\n}", "function populateLiElements(input, list, ul) {\n var html = \"\";\n var selectedClass = \"selected\";\n list.forEach(function(element) {\n var index = element.indexOf(input);\n var pre = element.substring(0, index);\n var post = element.substring(index + input.length);\n html = html + '<li class=\"' + selectedClass + '\" element=\"' + element + '\"><p>' + pre + '<span>' + input + '</span>' + post + '</p></li>';\n selectedClass = \"\";\n });\n ul.innerHTML = html;\n}", "function Ul({ children, style, className, ...rest }) {\n const classes = classNames('ul', className);\n return (\n <ul {...rest} className={classes} style={style}>\n {children}\n </ul>\n );\n}", "function getCharacterListUl() {\n return document.querySelector(\"ul.character-list\");\n}", "function checkAndFixUl($this, options){\n\t\tvar children = $this.childNodes;\n\t\t\n\t\tif(!$this.hasAttribute(\"id\")){\n\t\t\tconsole.log(\"NOTE: one of your <ul>-elements seem to be missing an id\");\n\t\t}\n\t\t\n\t\tif(!$this.hasAttribute(\"class\")){\n\t\t\tconsole.log(\"WARNING: one of your <ul>-elements seem to be missing an class, setting class navigation\");\n\t\t\t$this.setAttribute(\"class\", \"navigation\");\n\t\t}else if($this.getAttribute(\"class\") != \"navigation\"){\n\t\t\tconsole.log(\"WARNING: one of your <ul>-elements seems to be having the wrong class, setting class navigation\");\n\t\t\t$this.setAttribute(\"class\", \"navigation\");\n\t\t}\n\t\t\n\t\tif(children.length <= 0){\n\t\t\tconsole.log(\"WARNING: one of your <ul>-elements seem to be missing children\");\n\t\t}\n\t\t\n\t\tfor(var kid in children){\n\t\t\tif(children[kid].nodeName == \"LI\"){\n\t\t\t\tcheckAndFixLi(children[kid], options);\n\t\t\t} else if(children[kid].nodeName == \"#text\" || children[kid].nodeName == undefined || children[kid].nodeName == \"BR\"){\n\t\t\t\t// console.log(\"one child of <ul> is not an <li>: \" + children[kid].nodeName + \" \" + children[kid].nextElementSibling);\n\t\t\t} else{\n\t\t\t\tconsole.log(\"NOTE: one of your <ul>-elements contain an child-element that is not an accepted element-type: \" + children[kid].nodeName);\n\t\t\t}\n\t\t}\n\t}", "function appendToUl(ul, item) {\n ul.append(liTemplate(item.id, item.name, item.details));\n}", "function createULandLI(template) {\n\n template = template.trim();\n var arr = template.match(/[^ ]+/g);\n\n for (var i = 0, len = arr.length; i < len; i++) {\n\n var visited = false;\n\n if (arr[i].indexOf(\"</\") > -1) {\n\n if (i === len - 1) {\n arr[i] = arr[i] + \"</li></ul>\";\n visited = true;\n }\n else {\n arr[i] = arr[i] + \"</li>\";\n visited = true;\n }\n }\n\n if (!visited && arr[i].indexOf(\"<\") > -1) {\n if (i === 0) {\n arr[i] = \"<ul><li>\" + arr[i];\n }\n else {\n arr[i] = \"<li>\" + arr[i];\n }\n }\n }\n\n return arr.join(\" \");\n }", "function createListElement() {\n // Create element & text\n var newElement = document.createElement(\"li\");\n var newText = document.createTextNode(input.value);\n // Add text to element\n newElement.appendChild(newText);\n // Update DOM\n ul.appendChild(newElement);\n // Clear input box\n input.value = \"\";\n}", "list() {\n console.log(\"Our special menu for children:\");\n for (var index = 0; index < this.items.length; index++) {\n var element = this.items[index];\n console.log(element);\n }\n }", "function listUnit( val ){ \n\t\treturn $('<li class=\"listbuilder-entry\"><span class=\"listbuilder-entry-text\">'+val+'</span><a href=\"#\" class=\"listbuilder-entry-remove\" title=\"Remove '+val+' from the list.\" role=\"button\"></a></li>')\n\t\t\t.hover(\n\t\t\t\tfunction(){ $(this).addClass('listbuilder-entry-hover'); }, \n\t\t\t\tfunction(){ $(this).removeClass('listbuilder-entry-hover'); }\n\t\t\t)\n\t\t\t.attr('unselectable', 'on')\n\t\t\t.css('MozUserSelect', 'none');\n\t}", "function rederHike(list){\nconst listElement = document,quarySelelor('#hikes');\nlist.foreach(('hike}')) => {\n const newLi = document.createElement('li');\n newLi = rederOne\n})\n}", "function carrusel(previous, next,sthis, parent ){\n\n\tvar elemnet = sthis;\n\tvar elParent = elemnet.getParent().getPrevious();\n\tvar contentUl = elParent.getElement('ul');\n\tvar allLi = elParent.getElements('li');\n\tvar li = elParent.getElement('li');\n\tvar cantEl = allLi.length;\n\tvar left = li.getSize().x;\n\tvar c = 0;\n\n\tallLi.each(function(el,i){\n\t\n\t\tif(elemnet.hasClass(next)){\n\t\t\t\tif(i == 0){\n\t\n\t\t\t\t\tvar liFirstChild = elParent.getElement('li:first-child');\n\t\t\t\t\tvar li = liFirstChild.clone().cloneEvents(liFirstChild);\n\t\t\t\t\tli.inject(contentUl);\n\t\t\t\t\tli.setStyles({'left':left * cantEl,'opacity':0});\n\t\t\t\t\tli.setStyle('opacity',1);\n\t\t\t\t\tel.tween('left',left);\n\t\t\t\t\tliFirstChild.dispose();\n\t\t\t\t}else{\n\t\t\t\t\tvar left1 = left * c;\n\t\t\t\t\tel.tween('left',left1);\n\t\t\t\t\tc = c + 1;\n\t\t\t\t}\n\t\t}else{\n\t\t\t\n\t\t\t\tif(i == 0){\n\t\t\t\t\tvar liLastChild = elParent.getElement('li:last-child');\n\t\t\t\t\tvar li = liLastChild.clone().cloneEvents(liLastChild);\n\t\t\t\t\tli.inject(contentUl,'top');\n\t\t\t\t\tli.setStyles({'left':left * -1});\n\t\t\t\t\tliLastChild.dispose();\n\t\t\t\t\tel.tween('left',left);\n\t\t\t\t\tli.tween('left',0);\n\t\t\t\t\tc = c + 1;\n\t\t\t\t}else{\n\t\t\t\t\tc = c + 1;\n\t\t\t\t\tvar left1 = left * c;\n\t\t\t\t\tel.tween('left',left1);\n\t\t\t\t}\n\t\t\t}\n\t});\t\n}", "function openList(text, id) {\n var str = indent\n var str = indent + '<ul>\\n';\n indent += ' ';\n str += addList(text, id);\n return str;\n }", "getListContents(el) {\n let parent = el.parentNode;\n let text = parent.innerHTML;\n text = text.replace(/<li>/gi, \"\");\n text = text.replace(\"</li>\", \"\");\n return text;\n }", "function renderProducts(products){\n\n const tagUl=document.querySelector(\".products ul\");\n\n for(const prodctName of products){\n\n const liTag=document.createElement('li')\n\n liTag.appendChild(creatInsideLists(prodctName));\n\n tagUl.appendChild(liTag)\n\n }\n\n\n}", "function replaceHtmlLI( li ){\n\n var listType = li.parentElement.tagName,\n markup = listType.test(/ul/i) ? \"*\" : listType.test(/ol/i) ? \"#\" : \"*\",\n depth = getAncestors(li, \"ul,ol\").length;\n\n if(( li = li.firstChild )){\n replaceTextContent(li, /.*/, \"\\n\" + markup.repeat(depth) + \" \"+ \"$&\");\n }\n}", "function navigation() {\n\t\n\t/* @TODO: reverse li und stelle angemeldet als nach oben */\n\t//$$('#account ul').insert( $$('#account ul li').reverse() );\n}", "function listItem( node ) {\n\t\treturn node.type == CKEDITOR.NODE_ELEMENT && node.is( 'li' );\n\t}", "function ISSUE_ELEMENT_LIST$static_(){IssuesPanelBase.ISSUE_ELEMENT_LIST=( IssuesPanelBase.ISSUE_BLOCK.createElement(\"list\"));}", "function mapTOCUL2Viewer(ul,depth)\n{\t// 7/26/18 Map CA's simple ul/li outline into viewer's expandable TOC.\n\tlet txt='';\n\tul.children().each(function( )\n\t{\n\t\tif ($(this).is('UL'))\n\t\t{\n\t\t\t// 11/16/21 Initially expand all subtopics\n\t\t\ttxt+='<li><label class=\"nav-toggle nav-header toggle-icon\" for=\"cl-hamburger\"><a href=\"#\" class=\"nav-toggle-icon glyphicon glyphicon-minus visited\" title=\"button to open and close sub menus\" aria-label=\"Button to open and close sub menus.\"><p class=\"toc-title\">'+text+'</p></a></label><ul class=\"nav nav-list slider-left\" \\\n\t\t\t\txstyle=\"display: none;\">'+mapTOCUL2Viewer($(this),depth+1)+'</ul></li>\\n';\n\t\t}\n\t\telse\n\t\tif (!$(this).next().is('UL'))\n\t\t{\n\t\t\ttext=$(this).text();\n\t\t\tlet href=$('A',this).attr('HREF');\n\t\t\tif (depth>0)\n\t\t\t\ttxt+='<li><a href=\"'+href+'\" class=\"toc-link visited\" title=\"link to lesson\">'+text+'</a></li>\\n';\n\t\t\telse\n\t\t\t\ttxt+='<li><label class=\"nav-toggle-no-sub level-indent-no-sub\"><a class=\"toc-link visited\" href=\"'+escape(href)+'\"><p class=\"toc-title no-sub\">'+text+'</p></a></label></li>\\n';\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttext=$(this).text();\n\t\t}\n\n\t});\n\tif (depth==0)\n\t{\t// Add special pages.\n\t\ttxt='<li><label class=\"nav-toggle-no-sub level-indent-no-sub\"><a class=\"toc-link visited toc-visited\" href=\"'+pageABOUT+'\"><p class=\"toc-title no-sub\">About this Lesson</p></a></label></li>\\n'+txt\n\t\t\t+'<li><label class=\"nav-toggle-no-sub level-indent-no-sub\"><a class=\"toc-link visited\" href=\"'+pageLessonCompleted+'\"><p class=\"toc-title no-sub\">Complete the lesson</p></a></label></li>\\n';\n\t}\n\treturn txt;\n}", "get liAndLinkHTML(){\n return `<li><a href=\"#\" data-id=\"${this.id}\">${this.name}</a></li>`\n }", "function menuList() {\n let img = document.querySelector(\".img\");\n let hide = document.querySelector('.disable');\n let cont = document.querySelector('.container');\n\n let foodMenu = document.querySelector('.food-menu');\n const ul = document.createElement('ul');\n\n // console.log(ul);\n\n // ul.setAttribute('id', 'menu-list');\n\n for (var i in MenuData['menu']) {\n // i.addEventListener=('click' , () => setVisiblity(false));\n if (typeof (MenuData)['menu'][i] == \"object\") {\n // MenuData['menu'][i]='none';\n const li = document.createElement('li');\n\n li.appendChild(ul);\n\n li.innerHTML = i;\n // console.log(i);\n // console.log(li);\n \n ul.appendChild(li);\n\n\n const childul = document.createElement('ul');\n // console.log(childul);\n // ul.setAttribute('id','childUL');\n\n for (var j in MenuData['menu'][i]) {\n if (typeof MenuData['menu'][i][j] == \"object\") {\n const li = document.createElement('li');\n \n\n li.innerHTML = j;\n\n childul.appendChild(li);\n // console.log(childul);\n\n const grandchild = document.createElement('ul');\n // ul.setAttribute('id', 'grandul');\n for (var k in MenuData['menu'][i][j]) {\n const li = document.createElement('li');\n li.setAttribute('id', 'push');\n li.innerHTML = k;\n grandchild.appendChild(li);\n }\n li.appendChild(grandchild);\n }\n else {\n const li = document.createElement('li');\n li.setAttribute('id', 'push');\n \n\n // console.log(li);\n li.innerHTML = j;\n childul.appendChild(li);\n }\n }\n li.appendChild(childul);\n }\n else {\n const li = document.createElement('li');\n li.setAttribute('id', 'push');\n\n \n var button = document.createElement(\"button\");\n button.innerHTML = \"Add Order\";\n\n li.innerHTML = i;\n ul.appendChild(li);\n }\n }\n foodMenu.appendChild(ul);\n}", "function renderRepositoriesOnHtml(repositories) {\n\n //const listElement = document.createElement('ul') //create new <ul>\n const listElement = document.getElementById('ulist')//get Existing <ul> from html\n listElement.innerHTML = \"\"//empty list content\n\n let lineElement //news <li>\n let textElementLine //text for <li>\n\n repositories.forEach(TextLine => {\n lineElement = document.createElement('li') //create new <li>\n textElementLine = document.createTextNode(TextLine) //create new text for <li>\n \n lineElement.appendChild(textElementLine)//append text -> <li>\n listElement.appendChild(lineElement) // append <li> -> <ul> \n // document.body.appendChild(listElement) //append <li to document.body if created new <ul>\n });\n}", "function insertListItem(listRootElement, itemToInsert, listType, doc) {\n if (!listType) {\n return;\n }\n // Get item level from 'data-aria-level' attribute\n var itemLevel = parseInt(itemToInsert.getAttribute('data-aria-level'));\n var curListLevel = listRootElement; // Level iterator to find the correct place for the current element.\n // if the itemLevel is 1 it means the level iterator is at the correct place.\n while (itemLevel > 1) {\n if (!curListLevel.firstChild) {\n // If the current level is empty, create empty list within the current level\n // then move the level iterator into the next level.\n curListLevel.append(doc.createElement(listType));\n curListLevel = curListLevel.firstElementChild;\n }\n else {\n // If the current level is not empty, the last item in the needs to be a UL or OL\n // and the level iterator should move to the UL/OL at the last position.\n var lastChild = curListLevel.lastElementChild;\n var lastChildTag = roosterjs_editor_dom_1.getTagOfNode(lastChild);\n if (lastChildTag == constants_1.UNORDERED_LIST_TAG_NAME || lastChildTag == constants_1.ORDERED_LIST_TAG_NAME) {\n // If the last child is a list(UL/OL), then move the level iterator to last child.\n curListLevel = lastChild;\n }\n else {\n // If the last child is not a list, then append a new list to the level\n // and move the level iterator to the new level.\n curListLevel.append(doc.createElement(listType));\n curListLevel = curListLevel.lastElementChild;\n }\n }\n itemLevel--;\n }\n // Once the level iterator is at the right place, then append the list item in the level.\n curListLevel.appendChild(itemToInsert);\n}", "function list(str) {\n return str.replace(/(?:(?:(?:^|\\n)[\\*#].*)+)/g, function (m) {\n var type = m.match(/(^|\\n)#/) ? 'OL' : 'UL';\n // strip first layer of list\n m = m.replace(/(^|\\n)[\\*#][ ]{0,1}/g, \"$1\");\n m = list(m);\n return '<' + type + '><li>' + m.replace(/^\\n/, '').split(/\\n/).join('</li><li>') + '</li></' + type + '>';\n });\n }", "function currentItems() {\n children = []\n for (let i = 1; i < $(\"ul.items\").children().length + 1; i++) {\n children.push($(\"ul.items li:nth-child(\" + i + \")\").find(\"h2\").text())\n }\n $(\"ul.items\").empty()\n JsontoHTMLSort(children)\n }", "function makeUL(topName) {\n var result = '<ul>';//starting point\n for (var k in topName) {\n result = result + '<li>' + topName[k] + '</li>';//adding each node\n result = result + makeUL(findChildren(topName[k], parents, children));//recursion\n//console.log(childs);\n\n }\n result = result + '</ul>';\n return result;\n}", "function createLiUl() {\n if (!validateLiUl()) {\n let form = document.forms['formUl'];\n let countLiUl = form.countLiUl.value;\n let typeLiUl = form.typeLiUl.value;\n area.value += '<ul style=\"list-style-type: ' + typeLiUl + ';\">';\n for (let i = 1; i <= countLiUl; i++) {\n area.value += '<li>' + `item ` + i;\n }\n area.value += '</li>';\n }\n}", "function ListItem() {}", "function ListItem() {}", "function ListItem() {}", "function UserBlogMenuItem() {\n\t$('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<li><a href=\"/wiki/Special:MyBlog\">Ваш блог</a></li>');\n}", "createULelements(data) {\n // condLog(\"createULelements : \", data.tabs);\n let theUL = \"<ul class='profile-tabs'>\";\n let theDIVs = \"\";\n for (let tab in data.tabs) {\n // condLog(\"createULelements - TAB:\", tab, data.tabs[tab].name);\n let tabName = data.tabs[tab].name;\n theUL += '<li id=\"' + tabName + '-tab\">' + data.tabs[tab].label + \"</li>\";\n theDIVs += '<div id=\"' + tabName + '-panel\"></div>';\n }\n theUL += \"</ul>\";\n // condLog(\"createULelements - THE List: \", theUL);\n // condLog(\"createULelements - THE DIVs: \", theDIVs);\n return theUL + theDIVs;\n }", "function usunListeKafelkow() {\n // jest tylko 1 ul (elt 0) w dokumencie\n let listaKafelkow = document.getElementsByTagName(\"ul\")[0];\n listaKafelkow.remove();\n}", "function qll_module_erepmenu()\r\n{\r\n\tvar menu= new Array();\r\n\tvar ul = new Array();\r\n\r\n\tmenu[0]=document.getElementById('menu');\r\n\tfor(i=1;i<=6;i++)\r\n\t\tmenu[i]=document.getElementById('menu'+i);\r\n\t\r\n//\tmenu[1].innerHTML=menu[1].innerHTML + '<ul></ul>';\r\n\tmenu[2].innerHTML=menu[2].innerHTML + '<ul></ul>';\r\n\tmenu[3].innerHTML=menu[3].innerHTML + '<ul></ul>';\r\n\tmenu[6].innerHTML=menu[6].innerHTML + '<ul></ul>';\r\n\t\r\n\tfor(i=1;i<=6;i++)\r\n\t\tul[i]=menu[i].getElementsByTagName(\"ul\")[0];\r\n\t\r\n\tif(qll_opt['module:erepmenu:design'])\r\n\t{\r\n\t\r\n\t\t//object.setAttribute('class','new_feature_small');\r\n\t\t\t\r\n\t//\tmenu[2].getElementsByTagName(\"a\")[0].href = \"http://economy.erepublik.com/en/time-management\";\r\n\t\t\r\n\t\t/*aux = ul[2].removeChild(ul[2].getElementsByTagName(\"li\")[6]);\t// adverts\r\n\t\tul[6].appendChild(aux);\r\n\t\t\r\n\t\t*/\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://economy.erepublik.com/en/work\">' + \"Work\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://economy.erepublik.com/en/train\">' + \"Training grounds\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/my-places/newspaper\">' + \"Newspaper\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/economy/inventory\">' + \"Inventory\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/my-places/organizations\">' + \"Organizations\" + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://economy.erepublik.com/en/company/create\">' + qll_lang[97] + '</a>';\r\n\t\tul[2].appendChild(object);\r\n\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/military/campaigns\">' + qll_lang[69] + '</a>';\r\n\t\tul[3].appendChild(object);\r\n\t\t//ul[4].insertBefore(object,ul[4].getElementsByTagName(\"li\")[3])\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/loyalty/program\">' + \"Loyalty program\" + '</a>';\r\n\t\tul[6].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='<a href=\"http://www.erepublik.com/en/gold-bonus/1\">' + \"Gold bonus\" + '</a>';\r\n\t\tul[6].appendChild(object);\r\n\t\t\r\n\t}\r\n}", "function checkCurrentNavigation(element) {\n var parents = element.parents(\"ul\");\n console.log(parents);\n $(parents).each(function() {\n var parent_text = cleanText($(this).parent(\"li\").children(':first-child').text());\n li_array.push(parent_text);\n });\n }", "function addListListItem( listname ) {\n var element = $( \"#list\" ).clone();\n element.prop( \"id\", \"\" );\n\n element.find( \".list-name\" ).text(listname);\n var link = \"https://groups.mit.edu/webmoira/list/\" +\n encodeURIComponent(listname);\n element.find( \"a.webmoira-link\" ).attr(\"href\", link);\n\n element.find( \".subscribe\" ).click(function( event ) {\n event.preventDefault();\n var button = $( this );\n handleLoginButton(button, SUBSCRIBE_ACTION, function() {\n button.text( SUBSCRIBE_ONGOING );\n subscribe( listname, function() {\n element.remove();\n addListListItem( randomList() );\n });\n });\n \n });\n\n element.removeClass( \"hidden\" );\n $( \"#list\" ).after( element );\n }", "function addToList() {\n // Getting the input value by .value\n const gettingValue = inputElement.value;\n\n\n // Creating the <li> list items by createElement method\n const listItem = document.createElement('li');\n\n\n // Setting the innerText value to to what we get in the input \n listItem.innerText = gettingValue;\n\n\n // Setting Listitem <li> to be a child og <ul> \n listElement.appendChild(listItem);\n\n\n // Adding empty string to the inputElement. \n // It's clear the input value for adding the new value to the <li>\n \n // Her skal vi sette inputElement.value til ''\n\n\n\n}", "function hideUlUnderLi( li )\r\n{\r\n var as = li.getElementsByTagName('a');\r\n for ( var i=0; i<as.length; i++ )\r\n {\r\n as.item(i).className=\"\";\r\n }\r\n var uls = li.getElementsByTagName('ul');\r\n for ( var i=0; i<uls.length; i++ )\r\n {\r\n uls.item(i).style['visibility'] = 'hidden';\r\n }\r\n}", "function hideAllOthersUls( currentLi )\r\n{\r\n var lis = currentLi.parentNode;\r\n for ( var i=0; i<lis.childNodes.length; i++ )\r\n {\r\n if ( lis.childNodes[i].nodeName=='LI' && lis.childNodes[i].id != currentLi.id )\r\n {\r\n hideUlUnderLi( lis.childNodes[i] );\r\n }\r\n }\r\n}", "function makeUl(parentDomElem, parentMenu) {\n\n var ulElem = document.createElement('ul');\n parentDomElem.appendChild(ulElem);\n\n var children = parentMenu.children;\n\n for ( var i = 0; i < children.length; i++) {\n var liElem = document.createElement('li');\n var divElem = document.createElement('div');\n divElem.appendChild(document.createTextNode(children[i].title));\n ulElem.appendChild(liElem);\n liElem.appendChild(divElem);\n\n if (children[i].children.length > 0) {\n makeUl(liElem, children[i]);\n divElem.addEventListener('click', that.hide.bind(that));\n divElem.addEventListener('touchstart', that.hide.bind(that));\n } else {\n divElem.addEventListener('click', emitMenuSelect.bind(that, children[i]));\n divElem.addEventListener('touchstart', emitMenuSelect.bind(that, children[i]));\n divElem.className = 'default-interactive-marker-menu-entry';\n }\n }\n\n }", "function makeUL(){ \n let myUL = document.createElement('ul');\n\n document.body.appendChild(myUL);\n //at this point you should the ul in the body\n //insert function to creat LI here\n\n for (let i = 0; i < bookTitles.length; i++){\n\n let myLI = document.createElement('li'); //creates <li> element\n myLI.appendChild(document.createTextNode(bookTitles[i])); //adds content to <li> element\n myLI.setAttribute(\"id\", bookNames[i]);\n myUL.appendChild(myLI); //adds <li> element to <ul> element\n } \n}", "_appendLis () {\n let i = this.currentCount;\n while ((i < this.maxCount + this.currentCount) && (i < this.data.length)) {\n let li = document.createElement('li');\n li.dataset.index = i;\n\n let divWrap = this._addDiv(['wrap']);\n\n let divThumb = this._addDiv(['thumb']);\n let thumbnail = this._addElement('img', this.data[i].thumb_url)();\n divThumb.append(thumbnail);\n\n let divTitle = this._addDiv(['title'], this.data[i].title);\n let divPrice = this._addDiv(['price'], this.data[i].price_formatted);\n\n let divKeywords = this._addDiv(['keywords'], this.data[i].keywords);\n\n divWrap.append(divThumb, divTitle, divPrice);\n li.append(divWrap, divKeywords);\n\n this.ul.append(li);\n\n i++;\n }\n\n this.currentCount = i;\n }", "function addToList (value) {\n // Créé un element 'li'\n const li = document.createElement('li')\n // Créé du text \n const text = document.createTextNode(value)\n // ajoute du text a notre 'li'\n li.appendChild(text)\n // ajoute un le 'li' à notre list\n list.appendChild(li)\n}", "function removeListItem() {\n li.parentNode.removeChild(li);\n }", "function deleteListItem(element){\n element.parentNode.remove(\"li\"); \n}", "function AddNestedFieldDropdownComponent_ul_4_div_1_div_1_li_1_Template(rf, ctx) { if (rf & 1) {\n ɵɵelement(0, \"li\", 10);\n} }", "function createUL() {\n const ul = document.createElement(\"ul\");\n ul.className = \"list-group\";\n document.body.appendChild(ul); // Usually \"query selector\" if not <body> || <head> \n\n let arrNum = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\n arrNum.forEach(function (item, index) {\n if (item % 2 === 0) {\n const li = document.createElement(`li`);\n li.className = \"list-group-item\";\n li.appendChild(document.createTextNode(`Index ${index}: \"Item: ${item} square = ${item*item}!\"`));\n document.querySelector(\"ul\").appendChild(li)\n if (item % 4 === 0) {\n li.className = \"list-group-item-warning list-group-item-action tab-pane\"\n } else {\n li.className = \"list-group-item-info\"\n }\n }\n })\n}", "function makeUl(parentDomElem, parentMenu) {\n\n var ulElem = document.createElement('ul');\n parentDomElem.appendChild(ulElem);\n\n var children = parentMenu.children;\n\n for ( var i = 0; i < children.length; i++) {\n var liElem = document.createElement('li');\n var divElem = document.createElement('div');\n divElem.appendChild(document.createTextNode(children[i].title));\n ulElem.appendChild(liElem);\n liElem.appendChild(divElem);\n\n if (children[i].children.length > 0) {\n makeUl(liElem, children[i]);\n divElem.addEventListener('click', that.hide.bind(that));\n divElem.addEventListener('touchstart', that.hide.bind(that));\n } else {\n divElem.addEventListener('click', emitMenuSelect.bind(that, children[i]));\n divElem.addEventListener('touchstart', emitMenuSelect.bind(that, children[i]));\n divElem.className = 'default-interactive-marker-menu-entry';\n }\n }\n\n }", "function closingEndList(tmpPrev, tmpCur) {\n\t\tlet nbLevel = 0;\n\t\tnbLevel = tmpPrev - tmpCur;\n\t\tfor (let i = 0; i < nbLevel; i++) {\n\t\t\thtmlResult += '</ul>\\n</li>\\n';\n\t\t}\n\t}", "function addNewItemsUL(){\n var Ul1 = document.querySelector(\"ul\")\n var li = document.createElement(\"li\")\n var textNode = document.createTextNode(\"New Item\")\n\n li.appendChild(textNode)\n Ul1.appendChild(li)\n cl(document.querySelector(\"ul\").innerHTML);\n}", "function addListItem(data) {\r\n let ul = document.getElementById(\"storylist\");\r\n let li = document.createElement(\"li\");\r\n let titleH = document.createElement(\"h3\");\r\n titleH.innerHTML = '<a href=\"' + data.url + '\" + title=\"Click this link to view the full story\">' + data.title + '</a>';\r\n titleH.classList.add('listItem');\r\n li.appendChild(titleH);\r\n if (data.by != undefined) {\r\n let byP = document.createElement(\"p\");\r\n byP.innerHTML = \"<b>posted by:</b> \" + data.by + \" <b>on:</b> \" + getTimeString(data.time);\r\n li.appendChild(byP);\r\n }\r\n ul.appendChild(li);\r\n }", "function removeListItem() {\n\t\t\t\t$(this).parent().remove();\n\t\t\t}", "function createList(ul_el_id, list_arr) {\n var cont = document.getElementById(ul_el_id);\n cont.innerHTML = '';\n list_arr.forEach(function(val) {\n var span_el = document.createElement('span');\n span_el.className = 'dragico';\n var li_el = document.createElement('li');\n li_el.appendChild(span_el);\n li_el.setAttribute('data-id', val);\n li_el.innerHTML += val;\n cont.appendChild(li_el);\n });\n}", "function html_list_of(arb) {\n return arb.smap((x) => {\n let output = [];\n output.push(\"<ul>\");\n for (let i = 0; i < x.length; i += 1) {\n output.push(\"<li>\");\n output.push(x[i]);\n output.push(\"</li>\");\n }\n output.push(\"</ul>\");\n return output.join(\" \");\n });\n}", "function addListAfterClick() {\n\n\t\tcreateListElement();\n}", "function ListItem() { }", "function createListElement(elementList, appendTo) {\n //content\n for (let index = 0; index < elementList.length; index++) {\n const result = elementList[index];\n //lists\n let list_gam = document.createElement(\"LI\")\n let list_nogam = document.createElement(\"LI\")\n let canton_name = document.createTextNode(result.canton)\n if (result.gam === true) {\n list_gam.setAttribute(\"style\", \"color:orange\");\n list_gam.appendChild(canton_name)\n document.getElementById(appendTo).appendChild(list_gam)\n } else {\n list_nogam.appendChild(canton_name)\n document.getElementById(appendTo).appendChild(list_nogam)\n }\n }\n}", "function settleUl(elems){\n var ul = document.createElement(\"ul\");\n elems.forEach(function(el){\n var li = document.createElement(\"li\");\n var newItem = document.createTextNode(el);\n li.appendChild(newItem);\n ul.appendChild(li);\n });\n\n return ul.outerHTML;\n}", "function buildLi(item, par) {\n var newLi = document.createElement('li');\n var liAnchor = document.createElement('a');\n if (par) {\n newLi.className = 'parent';\n }\n liAnchor.href = '#';\n liAnchor.target = '_top';\n liAnchor.textContent = item.title;\n newLi.appendChild(liAnchor);\n return newLi;\n }", "function prepareLI() {\n var nod = $(this);\n if (tree.options.undraggable) {\n nod.mousedown(preventDefault);\n } else {\n nod.draggable(draggableOptions());\n nod[0].undraggable = nod.hasClass(\"undraggable\");\n }\n var a = $(this.getElementsByTagName(\"a\")[0]);\n if (tree.options.unclickable) {\n nod.addClass(\"unclickable\");\n a.click(preventDefault);\n } else {\n a.click(obj.events.click);\n }\n\n if (tree.options.oninsert) {\n tree.options.oninsert.call(new node(nod), a);\n }\n }", "function makeUL(array) {\n var list = document.createElement('ol')\n list.setAttribute('id', 'loc-list')\n for (var i = array.length - 1; i >= 0; i--) {\n var item = document.createElement('li')\n item.appendChild(document.createTextNode(array[i]))\n list.appendChild(item)\n }\n return list\n }", "function buildList(url) {\n item = document.createElement('li');\n item.innerHTML = '<a href=\"'+url+'\" target=\"_blank\" class=\"track\">' + url + '</a>';\n result.htmlList.appendChild(item);\n }", "function addToTheSecond(content){\n let selectingLists = document.getElementsByTagName(\"ul\")\n let secondList = selectingLists[1]\n let newLiItem = document.createElement(\"li\")\n secondList.insertAdjacentElement(\"beforeend\", newLiItem)\n newLiItem.innerText = \"Here we have the fourth new element in this list!\"\n }", "function tagLists (myclass, listtype) {\n $( \"p.\" + myclass ).wrap(\"<li class='\" + myclass + \"'></li>\");\n\n $( \"li.\" + myclass ).wrap(\"<\" + listtype + \" class='\" + myclass + \"'></\" + listtype + \">\");\n\n $(listtype + \".\" + myclass).each(function () {\n var that = this.previousSibling;\n var thisclass = $(this).attr('class');\n var previousclass = $(that).attr('class');\n if ((that && that.nodeType === 1 && that.tagName === this.tagName && typeof $(that).attr('class') !== 'undefined' && thisclass === previousclass)) {\n var mytag = this.tagName.toString();\n var el = $(\"<\" + mytag + \"/>\").addClass(\"temp\");\n $(this).after(el);\n var node = $(\".temp\");\n while (that.firstChild) {\n node.append(that.firstChild);\n }\n while (this.firstChild) {\n node.append(this.firstChild);\n }\n $(that).remove();\n $(this).remove();\n }\n $(\".temp\").addClass(thisclass).removeClass(\"temp\");\n });\n}", "function createUnorderedList(itemJson){\n\n var unorderedList = document.querySelector(\"#productLine\");\n var unorderedListItem = generateListItem(itemJson);\n unorderedList.appendChild(unorderedListItem);\n\n}", "function appendToList(c) {\n var listEl = $(\"<li>\" + c.toUpperCase() + \"</li>\");\n $(listEl).attr(\"class\", \"list-group-item\");\n $(listEl).attr(\"data-value\", c.toUpperCase());\n $(\".list-group\").append(listEl);\n console.log(listEl);\n\n\n}", "function retrieveChildData(aa, ul) {\n ul.children('li').each(function () {\n var node = $(this).children('div.tree-node');\n var nodedata = getNode(target, node[0]);\n var sub = $(this).children('ul');\n if (sub.length) {\n nodedata.children = [];\n retrieveChildData(nodedata.children, sub);\n// getData(nodedata.children, sub);\n }\n aa.push(nodedata);\n });\n }", "function ChangeOrderNoForList(listnode)\n{\n var i = 1;\n $(listnode).children(\"li\").each(function () {\n var id = $(this).attr(\"data-id\");\n ChangeOrderNoForOneElement(id, i);\n i++;\n console.log($(this).attr(\"data-id\"));\n console.log(i);\n });\n\n console.log($(listnode).children(\"li\"));\n}", "function tabs(){\n\t\tvar ul = document.createElement(\"ul\");\n\n\t\t//setting materialize's classes to 'ul' tag\n\t\tul.setAttribute(\"class\", \"tabs tabs-transparent\");\n\n\t\t//for each element inside 'clothingItems' do...\n\t\tclothingItems.forEach((item)=>{\n\n\t\t\t//creating 'a' and 'li' tags\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tvar a = document.createElement(\"a\");\n\n\t\t\t//setting 'tab' class(materialize) and \"href\", to 'li' and 'a' elements \n\t\t\tli.setAttribute(\"class\", \"tab\");\n\t\t\ta.setAttribute(\"href\", \"#\"+item.toLowerCase());\n\n\t\t\t//defining which is parent element and which is child element\n\t\t\ta.innerHTML = item;\n\t\t\tli.appendChild(a);\n\t\t\tul.appendChild(li);\n\t\t\tproductTab.appendChild(ul);\n\t\t});\n\t}", "function loadVillainChoices(listElem) {\r\n\r\n listElem.empty();\r\n for (var i = 0;\r\n (i < villains.length); i++) {\r\n var li = $(\"<li>\");\r\n $(li).addClass(\"list-group-item\");\r\n $(li).addClass(\"character-choice\");\r\n $(li).text(villains[i].name);\r\n $(li).attr(\"data-name\", villains[i].name);\r\n listElem.append(li)\r\n }\r\n}", "function dltSingle(currentLi) {\n currentLi.parentNode.parentNode.removeChild(currentLi.parentNode);\n}", "function decorateList(list, nonRecursive) {\n if ($(list)) {\n if (typeof(nonRecursive) == 'undefined') {\n var items = $(list).select('li')\n }\n else {\n var items = $(list).childElements();\n }\n decorateGeneric(items, ['odd', 'even', 'last']);\n }\n}" ]
[ "0.63991344", "0.63866127", "0.6310928", "0.6248032", "0.6240962", "0.62173426", "0.6197212", "0.61554277", "0.6136265", "0.61175907", "0.61175907", "0.61164314", "0.60909325", "0.6089951", "0.6049871", "0.60284925", "0.59704155", "0.59695816", "0.59684134", "0.5961793", "0.5922168", "0.59210324", "0.59056276", "0.59034216", "0.5859864", "0.5851517", "0.5838725", "0.58131844", "0.58003145", "0.57959914", "0.5786549", "0.5783346", "0.57743824", "0.57655996", "0.5756496", "0.5756417", "0.5693307", "0.5685481", "0.56693286", "0.56667465", "0.56628644", "0.5644762", "0.5641172", "0.56386435", "0.5632318", "0.5616435", "0.56157404", "0.56139785", "0.56064653", "0.5605983", "0.5595256", "0.5594198", "0.5590825", "0.55905116", "0.5589688", "0.558207", "0.55816793", "0.55816793", "0.55816793", "0.557617", "0.55732286", "0.55720466", "0.55647546", "0.5560964", "0.5552842", "0.5551789", "0.5551725", "0.55451983", "0.5537523", "0.5521574", "0.5518327", "0.5517058", "0.55166554", "0.5516188", "0.5508975", "0.5507955", "0.5505724", "0.55030936", "0.54975295", "0.54952127", "0.5485268", "0.5470708", "0.54705256", "0.54682136", "0.54669845", "0.54594535", "0.54560494", "0.5455414", "0.5451626", "0.5451194", "0.54354954", "0.5434495", "0.5433432", "0.54260004", "0.5412641", "0.540763", "0.54075885", "0.5399971", "0.5398967", "0.53938484", "0.53865343" ]
0.0
-1
takes the json from cardtext.js as a parameter and returns an array of black cards
getBlackCards(json){ var blackCardsRaw = json.blackCards; var blackCardsRefined = []; for(var card of blackCardsRaw){ if(card.pick == 1){ blackCardsRefined.push(card.text); } } return blackCardsRefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getWhiteCards(json){\n return json.whiteCards;\n }", "function getCards(data){\n\tvar cards = data.items.MTG.cards;\n\tfor(c in cards){\n\t\tvar name = cards[c].split(\"-\")[0];\n\t\tvar span = $(\"<span>\"+name+\"</span><br>\");\n\t\t$(\"#mtg-list\").append(span);\n\t}\n\treturn null;\n}", "function createCards(cards) {\n let type;\n return cards.map((cardConfig) => {\n const tempCards = [];\n if (cardConfig[2]) {\n type = cardConfig[2];\n }\n for (let i = 0; i < cardConfig[0]; i++) {\n tempCards.push({text: cardConfig[1], type})\n }\n return tempCards;\n }).flat().map( function(item, index){\n const el = document.createElement('div');\n el.setAttribute('text', item.text);\n el.setAttribute('type', item.type);\n el.innerHTML = `\n<p>\n ${item.type}\n</p>\n<p>\n ${item.text}\n</p>\n`;\n el.classList.add('card');\n document.body.appendChild(el);\n addListeners(el);\n el.setAttribute('deck', 'origin');\n return el;\n });\n}", "function createCards(jsonObj){\n var x = 1\n var jsonCards = jsonObj['cards'];\n for(var i = 0; i < jsonCards.length; i++){\n cards[i] = new Card(jsonCards[i].name, jsonCards[i].value, jsonCards[i].id, jsonCards[i].image);\n console.log(cards[i]);\n }\n}", "function getCards() {\n // Array to hold Suites\n var suites = ['Diamonds', 'Spades', 'Hearts', 'Clubs'];\n // Array to hold non-numeric card faces \n var faceCards = ['J', 'Q', 'K', 'A'];\n\n // Array to hold Cards\n var cards = [];\n\n // Loop for each Suite\n var currentCardIndex = 0;\n for (var suite in suites) {\n // Loop for numeric cards\n for (var i = 2; i <= 10; i++) {\n cards.push(createCard(i, suites[suite], currentCardIndex));\n currentCardIndex++;\n }\n // Loop for non-numeric cards\n for (var face in faceCards) {\n cards.push(createCard(faceCards[face], suites[suite], currentCardIndex));\n currentCardIndex++;\n }\n currentCardIndex = 0;\n}\n\n // Return Array of Card Objects\n return cards;\n}", "loadCards(){\n let cards = require(\"C:\\\\Users\\\\Tony\\\\Desktop\\\\Programming\\\\Yugiosu\\\\Yugiosu - Python (Discord)\\\\yugiosu discord bot\\\\cogs\\\\Yugiosu\\\\cards.json\");\n for(let card of cards){\n this.cards[card[\"id\"]] = new Card(card['id'], card[\"name\"], card[\"cardtype\"], card[\"copies\"], card[\"description\"], card[\"properties\"]);\n }\n }", "function cardArray(cardString){\n if (cardString){\n return cardString.replace(/[\\,\\[\\]]/g,'').trim().split(' ')\n }\n else return null\n}", "function convertDeckCard(card) {\n if (Array.isArray(card)) {\n return card.map(convertDeckCard);\n }\n if (card.cardID) {\n return card;\n }\n return {\n tags: [],\n colors: card.details.colors,\n cardID: card.details._id,\n cmc: card.details.cmc || 0,\n type_line: card.details.type,\n };\n}", "function loadCards() {\n\tfs.readFile(cardsFile, 'utf8', function(err, contents) {\n\t\tif (err) {\n\t\t\treturn console.log('Failed to read card tokens from disk: ' + err);\n\t\t}\n\t\ttry {\n\t\t\tcards = contents ? JSON.parse(contents) : {};\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log('Failed to parse card tokens data: ' + err);\n\t\t}\n\t});\n}", "async function getCards() {\n const response = await fetch(`/api/pokemon/${pokemon_name}`);\n const cards = response.json();\n return cards;\n }", "function getCardInfo(cardName) {\n // qurery ScryFall API, must use exact card name\n var scryfallAPI = \"https://api.scryfall.com/cards/named?exact=\";\n var cardJSON = UrlFetchApp.fetch(scryfallAPI.concat(cardName));\n // parse the JSON file\n var cardInfo = JSON.parse(cardJSON);\n // support for dual face cards\n // if dual face mush all the oracle text together\n if (cardInfo.card_faces) {\n cardInfo.oracle_text = cardInfo.card_faces[0].oracle_text.concat('\\n',cardInfo.card_faces[1].oracle_text);\n }\n return cardInfo;\n}", "function cardloading() {\n // is Ajax method to retrieve the Json file\n $.ajax({\n url: 'results.json'\n , type: 'get'\n , dataType: 'JSON'\n , cache: false\n , error: function (data) {\n console.log(data);\n }\n , success: function (data) {\n // upon successfully retrieving the json file loop through the data dynamically generate cards on the index page\n $.each(data, function (index, value) {\n console.log(Object.keys(value));\n console.log(index);\n console.log(value);\n console.log(value.id);\n console.log(value.name);\n var id = value.id;\n var webtype = value.webtype;\n //\t\t\t\t\tvar gender = value.gender;\n $('#profile').append('<div class=\"person\" id=\"p' + id + '\"></div>');\n $('#p' + id).append(`\n\t\t\t\t\t\t<h3> ${id} </h3>\n//\t\t\t\t\t\t<div class=\"profileImage\">\n//\t\t\t\t\t\t\t<img src=\"img/${id}.jpg\">\n//\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<h4>Webtype: ${webtype}</h4>\n//\t\t\t\t\t\t<p>Gender: ${gender}</p>\n\t\t\t\t\t`);\n });\n }\n });\n }", "function App() {\n const cardArr = [\n {\n \"id\": 1,\n \"nameRU\": \"«Роллинг Стоунз» в изгнании\",\n \"nameEN\": \"Stones in Exile\",\n \"director\": \"Стивен Кайак \",\n \"country\": \"США\", \"year\": \"2010\",\n \"duration\": 61,\n \"description\": \"В конце 1960-х группа «Роллинг Стоунз», несмотря на все свои мегахиты и сверхуспешные концертные туры, была разорена. Виной всему — бездарный менеджмент и драконовское налогообложение в Британии. Тогда музыканты приняли не самое простое для себя решение: летом 1971 года после выхода альбома «Stiсky Fingers» они отправились на юг Франции записывать новую пластинку. Именно там, на Лазурном Берегу, в арендованном Китом Ричардсом подвале виллы Неллькот родился сборник «Exile on Main St.», который стал лучшим альбомом легендарной группы.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=UXcqcdYABFw\",\n \"created_at\": \"2020-11-23T14:12:21.376Z\",\n \"updated_at\": \"2020-11-23T14:12:21.376Z\",\n \"image\": {\n \"id\": 1, \"name\": \"stones-in-exile\",\n \"alternativeText\": \"\",\n \"caption\": \"\",\n \"width\": 512,\n \"height\": 279,\n \"formats\": {\n \"thumbnail\": { \"hash\": \"thumbnail_stones_in_exile_b2f1b8f4b7\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 245, \"height\": 134, \"size\": 8.79, \"path\": null, \"url\": \"/uploads/thumbnail_stones_in_exile_b2f1b8f4b7.jpeg\" },\n \"small\": { \"hash\": \"small_stones_in_exile_b2f1b8f4b7\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 500, \"height\": 272, \"size\": 25.68, \"path\": null, \"url\": \"/uploads/small_stones_in_exile_b2f1b8f4b7.jpeg\" }\n },\n \"hash\": \"stones_in_exile_b2f1b8f4b7\",\n \"ext\": \".jpeg\",\n \"mime\": \"image/jpeg\",\n \"size\": 25.53,\n \"url\": \"/uploads/stones_in_exile_b2f1b8f4b7.jpeg\",\n \"previewUrl\": null,\n \"provider\": \"local\",\n \"provider_metadata\": null,\n \"created_at\": \"2020-11-23T14:11:57.313Z\",\n \"updated_at\": \"2020-11-23T14:11:57.313Z\"\n }\n },\n {\n \"id\": 2,\n \"nameRU\": \"All Tomorrow's Parties\",\n \"nameEN\": \"All Tomorrow's Parties\",\n \"director\": \" Джонатан Кауэтт\",\n \"country\": \"Великобритания\", \"year\": \"2009\",\n \"duration\": 82,\n \"description\": \"Хроники британского фестиваля, который первым нарушил монополию «Гластонбери», «Ридинга» и прочих пивных сборищ в чистом поле — и с тех пор прослыл одним из самых независимых и принципиальных. ATP из года в год проходит на базе отдыха в английской глуши, где артисты и их поклонники живут в одинаковых номерах, не бывает коммерческих спонсоров, программу составляют приглашенные кураторы (в разное время ими были Ник Кейв, Belle & Sebastian, Sonic Youth и даже Мэтт Грейнинг). И, главное, где не любят вздорных людей — основатель фестиваля Барри Хоган однажды сказал, что никогда больше не станет иметь дело с группой Killing Joke, «потому что они му...аки». Эта демократичность сказалась и на фильме: часть съемок сделана адептами фестиваля на мобильный телефон.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=D5fBhbEJxEU\",\n \"created_at\": \"2020-11-23T14:15:19.238Z\",\n \"updated_at\": \"2020-11-23T14:15:19.238Z\",\n \"image\": { \"id\": 2, \"name\": \"all-tommoros-parties\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 699, \"height\": 266, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 245, \"height\": 93, \"size\": 10.33, \"path\": null, \"url\": \"/uploads/thumbnail_all_tommoros_parties_33a125248d.jpeg\" }, \"small\": { \"hash\": \"small_all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 500, \"height\": 190, \"size\": 35.24, \"path\": null, \"url\": \"/uploads/small_all_tommoros_parties_33a125248d.jpeg\" } }, \"hash\": \"all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 67.06, \"url\": \"/uploads/all_tommoros_parties_33a125248d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:14:08.595Z\", \"updated_at\": \"2020-11-23T14:14:08.595Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n }];\n\n\n const [savedMoviesArr, setSavedMoviesArr] = React.useState([{\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n }])\n\n const history = useHistory();\n\n function handleBack() {\n history.goBack();\n }\n\n function handleCardLike(card) {\n // Проверяем, есть ли уже лайк на этой карточке\n // const isLiked = card.likes.some(i => i._id === currentUser._id);\n\n // // Отправляем запрос в API и получаем обновлённые данные карточки\n // api.changeLikeCardStatus(card._id, isLiked)\n // .then((newCard) => {\n // setCards((cards) =>\n // cards.map((c) =>\n // c._id === card._id ? newCard : c\n // )\n // )\n // })\n setSavedMoviesArr(savedMoviesArr.some(function (el) { return el.id === card.id }) ? [...savedMoviesArr] : [card, ...savedMoviesArr]);\n console.log(savedMoviesArr)\n };\n\n function handleCardDelete(card) {\n setSavedMoviesArr(savedMoviesArr.filter(function (el) { return el.id !== card.id }));\n }\n\n return (\n <>\n {/* <CurrentUserContext.Provider value={currentUser}> */}\n <Switch>\n {/* <ProtectedRoute */}\n <Route\n exact path=\"/\"\n // loggedIn={loggedIn}\n // component={Main}\n >\n <Main />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n <Route\n path=\"/movies\"\n // loggedIn={loggedIn}\n // component={Movies}\n >\n <Header />\n <Movies\n isSaved={false}\n cardArr={cardArr}\n onCardLike={handleCardLike}\n savedMovies={savedMoviesArr}\n />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n <Route\n path=\"/saved-movies\"\n // loggedIn={loggedIn}\n // component={SavedMovies}\n >\n <Header />\n <SavedMovies\n isSaved={true}\n savedCardArr={savedMoviesArr}\n onCardDelete={handleCardDelete}\n />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n {/* <Route\n path=\"/profile\"\n // loggedIn={loggedIn}\n component={Profile}\n /> */}\n <Route path=\"/profile\">\n <Header />\n <Profile\n // onRegister={handleRegister} \n name='Alex'\n email='[email protected]'\n />\n </Route>\n <Route path=\"/signup\">\n <Register\n // onRegister={handleRegister} \n />\n </Route>\n <Route path=\"/signin\">\n <Login\n // onLogin={handleLogin} data={newUserData} \n />\n </Route>\n <Route path=\"/signin\">\n <Login\n // onLogin={handleLogin} data={newUserData} \n />\n </Route>\n <Route path=\"*\">\n <NotFound\n onBack={handleBack}\n />\n </Route>\n <Route>\n {/* {loggedIn ? <Redirect exact to=\"/\" /> : <Redirect to=\"/signin\" />} */}\n </Route>\n </Switch>\n {/* </CurrentUserContext.Provider> */}\n </>\n );\n}", "static getCards() {\n\t\t//Cards\n\t\tvar cards = [];\n\t\t//Get cards from the card box\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"cardbox\").children));\n\t\t//Get cards from the three mason columns\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol1\").children));\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol2\").children));\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol3\").children));\n\t\t//Get cards from the holding box\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"inactivecards\").children));\n\t\t//Return the cards\n\t\treturn cards;\n\t}", "function filterCardData(data) {\n\tvar final = [];\n\n\tfor (var i = 0; i < data.length; i++) {\n\t\tvar curr = data[i];\n\t\tvar temp = {\n\t\t\tartists: curr.artists,\n\t\t\tid: curr.id,\n\t\t\tname: curr.name,\n\t\t\tpreview_url: curr.preview_url,\n\t\t\tseconds: (curr.duration_ms / 1000)\n\t\t};\n\t\tfinal.append(temp);\n\t}\n\n\treturn final;\n}", "function getCardData( deckBrewId, callback )\n{\n http.get('http://api.deckbrew.com/mtg/cards/'+deckBrewId, (response) => {\n var data = '';\n response.on('data', function(chunk) {\n data += chunk;\n });\n response.on('end', function() {\n callback( JSON.parse(data) );\n });\n })\n .on('error', function(e) {\n console.log(\"Got error: \" + e.message);\n });\n}", "function getCardsData() {\n const cards = JSON.parse(localStorage.getItem('cards'));\n return cards === null\n ? [\n {\n question: 'What must a variable begin with?',\n answer: 'A letter, $ or _',\n },\n {\n question: 'What is a variable?',\n answer: 'Container for a piece of data',\n },\n {\n question: 'Example of Case Sensitive Variable',\n answer: 'thisIsAVariable',\n },\n ]\n : cards;\n }", "function readJSON() {\r\n\r\n $.getJSON(\"resources/damageTypes.json\", function (json) {\r\n var i = 1;\r\n for (const key of Object.keys(json)) {\r\n damageCards(json[key], i++);\r\n }\r\n });\r\n\r\n}", "function getAllCards(set, channelID, verbose = false) {\n // Read which cards are already saved\n let fileName = getFilename(set, channelID);\n let savedCardlist = JSON.parse(\"[]\");\n fs.exists(fileName, (exists) => {\n if (!exists) {\n // If data file doesn't exist yet, make an empty one\n fs.writeFile(fileName, \"[]\", (err) => {\n if (err) console.log(getDate() + err);\n console.log(getDate() + \"Successfully written to file \" + fileName + \".\");\n });\n }\n else {\n // If data file does exist, try to read it\n try {\n fs.readFile(fileName, function(err, buf) {\n if (err) console.log(getDate() + err);\n savedCardlist = JSON.parse(buf);\n console.log(getDate() + \"Successfully read file \" + fileName + \".\");\n });\n }\n catch(error) {\n console.log(getDate() + \"Something went wrong with parsing data from existing saved file.\");\n console.log(getDate() + error);\n return;\n }\n }\n\n if (verbose) {\n bot.sendMessage({\n to: channelID,\n message: 'Trying to get newly spoiled cards from set with code ' + set + '...',\n });\n }\n\n // Make a request to the Scryfall api\n const https = require('https');\n https.get('https://api.scryfall.com/cards/search?order=spoiled&q=e%3A' + set + '&unique=prints', (resp) => {\n let data = '';\n\n // A chunk of data has been received.\n resp.on('data', (chunk) => {\n data += chunk;\n });\n\n // The whole response has been received.\n resp.on('end', () => {\n try {\n // Parse the data in the response\n cardlist = JSON.parse(data);\n }\n catch(error) {\n console.log(getDate() + \"Something went wrong with parsing data from Scryfall.\");\n console.log(getDate() + error);\n return;\n }\n var newCardlist = [];\n if (cardlist.object == 'list' && cardlist.total_cards > 0) {\n // For every card: check if it's already save, otherwise at it to the new list\n cardlist.data.forEach(function(card) {\n cardId = card.id;\n\n if (!savedCardlist.some(c => c == cardId)) {\n newCardlist.push(card);\n savedCardlist.push(cardId);\n }\n });\n\n // If new list is empty, no new cards were found\n if (newCardlist.length <= 0) {\n console.log(getDate() + 'No new cards were found with set code ' + set);\n if (verbose) {\n bot.sendMessage({\n to: channelID,\n message: 'No new cards were found with set code ' + set + '.',\n });\n }\n }\n else {\n // If new list wasn't empty, send one of the new cards to the channel every second\n console.log(getDate() + newCardlist.length + ' new cards were found with set code ' + set);\n var interval = setInterval(function(cards) {\n if (cards.length <= 0) {\n console.log(getDate() + 'Done with sending cards to channel.');\n clearInterval(interval);\n }\n else {\n // Get all relevant data from the card\n let card = cards.pop();\n cardName = card.name;\n console.log(getDate() + 'Sending ' + cardName + ' to channel.');\n cardImageUrl = card.image_uris.normal;\n cardText = card.oracle_text;\n cardCost = card.mana_cost.replace(new RegExp('[{}]','g'), '');\n cardType = card.type_line;\n cardRarity = card.rarity;\n cardFlavourText = card.flavor_text;\n\n // Construct the discord message\n var message = '**' + cardName + '** - ' + cardCost + '\\n' \n + cardType + ' (' + cardRarity + ')\\n' \n + cardText + '\\n';\n if (cardFlavourText != undefined) {\n message = message + '_' + cardFlavourText + '_\\n';\n }\n message = message + cardImageUrl;\n\n bot.sendMessage({\n to: channelID,\n message: message,\n });\n }\n }, 1000, newCardlist);\n\n try {\n // Save the updated list of saved cards to the datafile\n let savedCardlistJSON = JSON.stringify(savedCardlist);\n fs.writeFile(fileName, savedCardlistJSON, function(err) {\n if (err) console.log(getDate() + err);\n console.log(getDate() + 'New card list has succesfully been saved!');\n });\n }\n catch(error) {\n console.log(getDate() + \"Something went wrong with saving new data.\");\n console.log(getDate() + error);\n return;\n }\n }\n }\n else {\n bot.sendMessage({\n to: channelID,\n message: 'Did not find any card with set code ' + set + '.',\n });\n }\n });\n\n }).on(\"error\", (err) => {\n console.log(getDate() + \"Error: \" + err.message);\n bot.sendMessage({\n to: channelID,\n message: 'Error trying to get cards with set code ' + set + './n' +\n 'Check the console for more details.',\n });\n });\n });\n}", "function getCard() {\n\tlet json = {};\n\n\tlet deck = createDeck();\n\tlet random = Math.floor(Math.random() * deck.length);\n\n\tlet fileName = \"development/\" + deck[random];\n\tlet info = fs.readFileSync(fileName, 'utf8');\n\tlet lines = info.split(\"\\n\");\n\n\tjson[\"name\"] = lines[0];\n\tjson[\"description\"] = lines[2];\n\n\treturn json;\n}", "function atualizaCards(){\n\t$.getJSON('mq.json', function(data){\n changeStatus('.card',false);\n\t\tfor(i=0; i < data.length; i++){\n for(j=0; j < data[i].problemas.length; j++){\n var erro = data[i].problemas[j].erro;\n console.log(erro);\n if (erro.search(\"ATMWEB\") > -1 ){\n changeStatus(\".seguranca\",true);\n }\n if(erro.search(\"9201\") > -1){\n changeStatus(\".integrado2\",true);\n }\n if(erro.search(\"9204\") > -1){\n changeStatus(\".integrado\",true);\n }\n if(erro.search(\"SIMUISO\") > -1){\n changeStatus(\".sistemico\",true);\n }\n }\n\t\t}\n\t});\n}", "function indexPull() {\n $.get(\"http://10.1.254.102/Smoelenboek-3.0/PHP_JSON.php\", function(data, status){\n \n //Iterate through the JSON array for all entries\n for (x in data) {\n createAddresCardFromArray(data,x);\n }\n });\n }", "function hideCards() {\n\tlet cards = document.getElementsByClassName(\"text\");\n\tfor (var i = 0; i < cards.length; i++) {\n\t\tcards[i].style.display = \"none\";\n\t}\n}", "static createListFromJson(jsonObj)\n\t{\n\t\tvar answer = [];\n\t\tfor (var publicationIndex = 0; publicationIndex < jsonObj.length; publicationIndex++)\n\t\t{\n\t\t\tanswer.push(PublicationCard.createFromJson(jsonObj[publicationIndex]));\n\t\t}\n\t\treturn answer;\n\t}", "function getBuffs(response, whichCard) {\n qs(whichCard + \" .buffs\").innerHTML = \"\";\n for (let i=0; i<response.buffs.length; i++) {\n let buff = document.createElement(\"div\");\n buff.classList.add(\"buff\") ;\n buff.classList.add(response.buffs[i]);\n qs(whichCard + \" .buffs\").appendChild(buff);\n }\n \n for (let i=0; i<response.debuffs.length; i++) {\n let debuff = document.createElement(\"div\");\n debuff.classList.add(\"debuff\") ;\n debuff.classList.add(response.debuffs[i]);\n qs(whichCard + \" .buffs\").appendChild(debuff);\n }\n }", "getAllPossible(category){\n let res = [];\n for (let item of json.jsonArray){\n if(item.key === category){\n for(let character of item.value){\n res.push(character);\n }\n }\n }\n return res;\n }", "function getCardsData() {\n const cards = JSON.parse(localStorage.getItem('cards')); // parse string to array\n return cards === null ? [] : cards; // return empty array if it's equal null - else return cards => shorter ver. of if\n}", "function getCardsData() {\n const cards = JSON.parse(localStorage.getItem('cards'))\n return cards === null ? [] : cards\n}", "getCardData(cardId) { \n var result = this.deck.filter(card => {\n return card.cardId === cardId;\n });\n return result[0];\n }", "function buildCards(data) {\n // Perform POST call to send params and get back results\n postCall('http://api.fitstew.com/api/gymSearchAdvanced/',data, function(obj) {\n // Loop through each result and create card\n if(!obj.status) {\n\t\t $.each( obj, function( key, value ) {\n\t\t $('#partnerBlock').html('<div class=\"box\"><div class=\"gtitle\" data-gid=\"' + value.id + '\" data-addr=\"' + value.address + ', ' + value.city +', ' + value.state + ' ' + value.zipcode + '\" data-email=\"' + value.email + '\" data-phone=\"' + value.phone + '\" data-facebook=\"' + value.facebook + '\" data-twitter=\"' + value.twitter + '\" data-monday=\"' + value.monday + '\" data-tuesday=\"' + value.tuesday + '\" data-wednesday=\"' + value.wednesday + '\" data-thursday=\"' + value.thursday + '\" data-friday=\"' + value.friday + '\" data-saturday=\"' + value.saturday + '\" data-sunday=\"' + value.sunday + '\">' + value.name + '</div><div class=\"glogo\"><img src=\"' + value.image + '\"></div><div class=\"gdistance\">' + value.distance + '</div><div class=\"gmatches\">' + value.matched + '</div></div>');\n\t\t \n\t\t });\n\t\t // Call attachedCards function\n\t\t attachCards();\n\t } else {\n\t\t $('#partnerBlock').html('<div class=\"searchError\">No Results Found</div>');\n\t }\n\t });\n }", "function getCardsData() {\n const cards= JSON.parse(localStorage.getItem('cards'));\n // if cards is null return an empty array else cards \n return cards === null ? [] : cards;\n }", "function generateCards(results) {\n\n var resultsDiv = document.querySelector('#card-append')\n resultsDiv.textContent = \"\";\n\n let generatedCards= '';\n //every time we are looping through the results, create a card using the format in the HTML\n results.map(result => {\n console.log(result)\n generatedCards +=\n `\n<div class=\"card column is-one-quarter\">\n <div class=\"card-image\">\n <figure class=\"image is-4by3\">\n \n <img src= \"${result.recipe.image}\" alt=\"Placeholder image\">\n </figure>\n </div>\n <div class=\"card-content\">\n <div class=\"media\">\n <div class=\"media-left\">\n </div>\n <div class=\"media-content\">\n <p class=\"title is-4\">${result.recipe.label}</p>\n </div>\n </div>\n \n <div class=\"calories\">\n <strong> Cuisine Type: </strong>${result.recipe.cuisineType}\n <br>\n <strong> Calories: </strong>${result.recipe.calories.toFixed(0)}\n <br>\n \n <a class=\"view-btn\" target=\"_blank\" href=\"${result.recipe.url}\">View Recipe</a> \n </div>\n </div>\n </div>\n`\n})\nsearchRecipe.innerHTML = generatedCards;\n}", "function createCards(data) {\n document.getElementById(\"card-container\").innerHTML = \"\";\n\n // Loop over the data to create HTML div elements\n for (let i = 0; i < data.length; i++) {\n let num = i;\n let card = document.createElement(\"div\");\n let cardLabel = document.createElement(\"h3\");\n let cardBody = document.createElement(\"p\");\n let cardCode = document.createElement(\"strong\");\n\n // Add the content to each HTML element based on the data\n cardLabel.innerHTML = data[i].label;\n cardBody.innerHTML = data[i].name;\n cardCode.innerHTML = data[i].plusCode;\n\n // Some Fizz / Buzz Fun\n if (num % 3 == 0 && num % 5 == 0) {\n cardBody.className = \"light-red\";\n } else if (num % 3 == 0) {\n cardBody.className = \"light-blue\";\n } else if (num % 5 == 0) {\n cardBody.className = \"medium-green\";\n } else {\n cardBody.className = \"charcoal\";\n }\n\n // Assemble the card elements here\n card.appendChild(cardLabel);\n card.appendChild(cardBody);\n card.appendChild(cardCode);\n\n card.className = \"card\";\n\n // Attach each card to the card container grid here\n document.getElementById(\"card-container\").appendChild(card);\n }\n }", "function displayCharacterCards(postResponse) {\r\n // first empty any append html so get ready to display charcaters\r\n clearCards();\r\n //$('.characters-container').empty();\r\n\r\n postResponse.forEach( (character, index) => {\r\n // define the html to append for each character \r\n var htmlToAppend = \r\n \"<div class=\\\"character-info\\\">\" +\r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"id-\" + index + \"\\\">Id:</label>\" + \r\n \"</div>\" + \r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"name-\" + index + \"\\\">Name:</label>\" + \r\n \"</div>\" + \r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"occupation-\" + index + \"\\\">Occupation:</label>\" + \r\n \"</div>\" + \r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"debt-\" + index + \"\\\">Debt:</label>\" + \r\n \"</div>\" + \r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"weapon-\" + index + \"\\\">Weapon:</label>\" + \r\n \"</div>\" +\r\n \"</div>\";\r\n\r\n $('.characters-container').append(htmlToAppend);\r\n \r\n // append values of each character\r\n appendCharacterElements(character, index);\r\n \r\n }, this);\r\n}", "function strToCards(s) {\n let result = [];\n let card = {};\n for (let i = 0; i < s.length; i++) {\n if (i % 2 == 0) {\n card.value = Number(s[i]);\n card.rendered = s[i].replace('T', '10');\n if (isNaN(card.value)) {\n card.value = CARD_VALUE[s[i]];\n }else{\n card.value--;\n }\n } else {\n card.suit = s[i];\n card.rendered += SUIT[s[i]];\n result.push(card);\n card = {};\n }\n }\n return result;\n}", "async function getCards() {\n await connectDB();\n let cards = [];\n let cardLinks = await mongoClient.db(\"memory\").collection(\"cards\").find().toArray();\n for (const i of cardLinks) {\n cards.push(linkToCard(i.link, null));\n }\n return cards;\n }", "function lolCards(data){ \n document.getElementById(\"root\").innerHTML= \"\";\n let all = [];\n for(let i = 0; i < data.length; i++){\n all.push(`<div class=\"col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12\">\n <div class=\"card\" style=\"width: 18rem;\">\n <img src=\"${data[i].splash}\" id=\"img\" class=\"img-fluid\" alt=\"splashChampion\">\n <div class=\"card-body\">\n <h3 class=\"card-title\">${data[i].name}</h3>\n <p class=\"card-subtitle\">${data[i].title}</p>\n <p class=\"card-subtitle1\">${data[i].tags.join(\" \")}</p>\n </div>\n <button type=\"button\" class=\"buttonChamp btn2 btn-outline-dark\">More information</button>\n </div>\n </div>`);\n }\n return all;\n}", "function extractCardData(cardData)\n{\n let arr = [];\n for(let j = 0; j < 3; j++)\n arr.push(cardData[j].card_idx);\n return arr;\n}", "function generate_bingo_card(){\n var bingo_card = test_result;\n var result_card = bingo_card.slice(0,15);\n return result_card;\n}", "getCardFromMatchingText(matchingText, object, currentTasklist) {\n // if object is a card\n if (object === \"card\") {\n // return card with matchingText as it's name \n return this.allData.data.currentProject.taskLists.find(taskList => taskList.name === currentTasklist).cards.find(card => card.name === matchingText);\n }\n // if object is a comment \n else if (object === \"comment\") {\n // return card which the following is true: card.comment.description === matchingText \n return this.allData.data.currentProject.taskLists.find(taskList => taskList.name === currentTasklist).cards.find(card => card.comments.find(comment => comment.description === matchingText));\n } else if (object === \"tag\") {\n return this.allData.data.currentProject.taskLists.find(taskList => taskList.name === currentTasklist).cards.find(card => card.tags.find(tag => tag.name === matchingText));\n } else {\n console.log(\"Something's wrong, getCardFromMatchingText() was called and didn't return a card\");\n }\n }", "function populateReviewCards(){\n \n var reviewCards = '';\n\n $.getJSON('reviews/reviewlist',function(data){\n\n $.each(data,function(){\n \n reviewCards += '<article class=\"card\">';\n reviewCards += '<header><h3>' + this.title + \"</h3></header>\";\n reviewCards += '<img src='+ this.image + \"><hr>\";\n reviewCards += '<body><p>' + this.review + \"</p></body><footer>\";\n reviewCards += '<div class=\"flex full four-500\">';\n reviewCards += '<div><h4>Milk: '+ this.milk_stars +'/5</h4></div>';\n reviewCards += '<div><h4>Tea: '+ this.tea_stars +'/5</h4></div>';\n reviewCards += '<div><h4>Aftertaste: '+ this.aftertaste_stars +'/5</h4></div>';\n reviewCards += '<div><h4>Overall: '+ this.overall_stars +'/5</h4></div></div>';\n reviewCards += '<p>Posted on: '+this.date+' | Last Edited: '+this.datem+'</p></footer>';\n reviewCards += '</article>';\n \n });\n\n $('#cards').html(reviewCards);\n });\n}", "function randomCards() {\n let randomIndex = Math.floor(Math.random() * 13);\n return BlackJack['cards'][randomIndex];\n\n}", "function newRndCard() {\n $.getJSON('https://api.scryfall.com/cards/random?q=-type%3Aland+legal%3Alegacy+not%3Atoken+not%3Asplit+not%3Atransform', function (data) {\n saveCard(data);\n })\n }", "list () {\n return Object.keys(this.cards);\n }", "function scrapeCard(element, $) {\n element = $(element);\n var card = {};\n\n //Get the card images\n var $images = element.find(\".scan.left\");\n card.smallImg = $images.find(\"img\").attr(\"src\");\n card.largeImg = $images.find(\"a\").attr(\"href\");\n\n var $card = element.find(\".card\");\n\n //Get the title and set name from the title bar\n var titleArray = $card.find(\"h2.entry-title\").text().match(/(.+) \\((.+)\\)/);\n card.name = titleArray[1];\n card.set = titleArray[2];\n\n //Get the type\n var $p = $card.find(\".tabs-wrap [id^=text-]>p\");\n readCardParagraphs($p, card, $);\n\n return card;\n}", "function listBasicCards() {\r\n fs.readFile(\"./basicCard.txt\", \"utf-8\", function(error, data) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n\r\n console.log(data);\r\n })\r\n}", "function getAllCardTypes() {\n var allCardTypes = [];\n for (var _i = 0, CARD_SYMBOLS_1 = CARD_SYMBOLS; _i < CARD_SYMBOLS_1.length; _i++) {\n var symbol = CARD_SYMBOLS_1[_i];\n for (var _a = 0, CARD_NAMES_1 = CARD_NAMES; _a < CARD_NAMES_1.length; _a++) {\n var name_1 = CARD_NAMES_1[_a];\n allCardTypes.push({\n symbol: symbol,\n name: name_1,\n color: CARD_COLORS[Math.floor(Math.random() * CARD_COLORS.length)]\n });\n }\n }\n // console.log(`All card types: `); Überprüfen von was erstellt wird\n // console.log(allCardTypes);\n return allCardTypes;\n}", "function setArr() {\n\n\n//set array to equal to parse json file \n\tarray = JSON.parse (this.responseText)\n\n//called outputCards with array passed into it\n\toutputCards(array);\n}", "function getCards() {\n var cards = [];\n var keys = Object.keys(data);\n // Condition that allows user to filter ingredients by categories or search for them\n if (keys !== 0) {\n keys.forEach((ingredient) => {\n if (\n (filter === \"Filter by Group...\" ||\n filter.includes(data[ingredient][\"categories\"])) &&\n (search === \"\" ||\n ingredient.toLowerCase().includes(search.toLowerCase()))\n ) {\n cards.push(\n <Col key={ingredient} lg={6} style={{ paddingBottom: \"25px\" }}>\n <IngredientCard\n ingredient={data[ingredient]}\n setDetails={setDetails}\n details={details}\n />\n </Col>\n );\n }\n });\n return cards;\n }\n }", "function createDeck() {\n\treturn {\n\t\t\"shareCode\": 20,\n\t\t\"image\": \"\",\n\t\t\"created\": new Date(),\n\t\t\"title\": \"\",\n\t\t\"anki\": false,\n\t\t\"ankiDate\": \"\",\n\n\t\t\"cards\": []\n\t};\n}", "function listClozeCards() {\r\n fs.readFile(\"./clozeCard.txt\", \"utf-8\", function(error, data) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n\r\n console.log(data);\r\n })\r\n}", "getEnrolledCards() {\r\n return this.context.enrollService\r\n .GetEnrollmentData(this.context.getUser(), core.Credential.SmartCard)\r\n .then(data => JSON.parse(core.Utf8.fromBase64Url(data)));\r\n }", "function filterIsCard(array) {\n return array.filter(function(item) {\n return item.type === 'card';\n });\n }", "function Deck() {\n this.names = [2, 3, 4, 5, 6, 7, 8, 9, 10, \"J\", \"Q\", \"K\", \"A\"];\n this.suits = [\"♠\", \"♣\", \"♥\", \"♦\"];\n\n let cards = [];\n\n for (let s = 0; s < this.suits.length; s++) {\n for (let n = 0; n < this.names.length; n++) {\n cards.push(new Card(this.names[n], this.suits[s]));\n }\n }\n\n return cards;\n}", "function init(cardData) {\n var regexpCards = \"(\";\n cards = $.csv.toObjects(cardData);\n cards.forEach(function(card, idx, arr) {\n add(card[\"name\"], card[\"type\"], card[\"elixir\"]);\n regexpCards += card[\"name\"] + '|';\n });\n regexpCards += 'hint)';\n var regexp = new RegExp(regexpCards);\n\n // Preset the Opponent cards list to all Unknown\n for (i = 0; i < 8; i++) {\n add(\"Unknown\", \"Unknown\", 0);\n }\n\n // Let's define our first command. First the text we expect, and then the function it should call\n /*\n var annyangCommands = {\n 'show tps report': function() {\n $('#tpsreport').animate({bottom: '-100px'});\n }\n };\n */\n annyangCommands = {\n ':card': {\n 'regexp': regexp,\n 'callback': function(spokenText) {\n var idCard = document.getElementById(spokenText.toLowerCase());\n //if (!idCard) idCard = document.getElementById(spokenText.toLowerCase() + 's');\n //console.log(idCard);\n if (spokenText.toLowerCase() == \"hint\") {\n giveAdvice();\n } else if (idCard) {\n // When speech matches a card, auto-click it & play a feedback beep\n idCard.click();\n snd.play();\n }\n }\n }\n }\n\n if (annyang) {\n annyang.debug();\n annyang.addCommands(annyangCommands);\n // BUGBUG: Disabling voice recognition during testing\n //annyang.start();\n }\n\n // Each card determines if it should be hidden or not based on the filter\n // TODO: This works, but we should really keep an array of the cards and manage them\n $(\".card\").on('filterChanged', function() {\n filter = document.getElementById(\"filter\").value.toLowerCase();\n //console.log(filter);\n /*\n name = this.name.toLowerCase().split(\" \",2);\n filter = filter.toLowerCase().split(\" \",2);\n\n filterWords = filter.count();\n */\n //var regex = new RegExp(\"\\\\b\" + filter.split(\" \")[1]);\n name = this.name.toLowerCase();\n var regexStr = \"\";\n //console.log(filter.split(\" \"));\n filter.split(\" \").forEach(function(word, idx, arr) {\n regexStr == \"\" ? regexStr += '^' + word : regexStr += '\\\\S*\\\\s+' + word;\n });\n var regex = new RegExp(regexStr);\n //console.log(regex);\n if (this.getAttribute(\"alreadyClicked\") == \"YES\") {\n this.style.visibility = \"visible\";\n } else {\n if (regex.test(name)) {\n // if (name.indexOf(filter) == 0 || regex.test(name)) {\n // if (this.name.toLowerCase().indexOf(filter.toLowerCase()) != -1) {\n this.style.visibility = \"visible\";\n } else {\n this.style.visibility = \"hidden\";\n }\n }\n });\n\n // Trigger the card filtering events, and also handle hitting Enter to save the card.\n $(\"#filter\").keyup(function(e) {\n $(\".card\").trigger('filterChanged');\n if (e.which == 13) {\n var cardsVisible = 0;\n var button;\n $(\"#cards > .card\").each(function(idx) {\n if (this.style.visibility == \"visible\") {\n button = this;\n cardsVisible++;\n }\n });\n if (cardsVisible == 1) {\n button.click();\n }\n }\n });\n }", "function createCard(data) {\n var html = data.map(item => `\n <div class=\"card\">\n <div class=\"image\">\n <img src=\"${item.image}\" alt=\"product\"/>\n </div>\n <div class=\"info\">\n <span>${item.name}</span>\n <p>${item.description}</p>\n <p>De: R$${item.oldPrice},00</p>\n <p>Por: R$${item.price},00</p>\n <p>ou ${item.installments.count}x de \n R$${item.installments.value.toFixed(2).replace(\".\", \",\")}</p>\n <input class=\"btn\" type=\"button\" value=\"Comprar\"/>\n </div>\n </div>`\n ).join(\"\");\n document.querySelector(\"#cards\").innerHTML += html;\n}", "function ClueCards () {\n\tvar cards = new Object();\n\t\n\t// People\n\tcards[cardName.Scarllet] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Plum] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Peacock] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Green] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Mustard] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.White] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\t\n\t// Weapons\n\tcards[cardName.Candlestick] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Dagger] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Lead_Pipe] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Revolver] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Rope] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Wrench] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\t\n\t// Rooms\n\tcards[cardName.Courtyard] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Game_Room] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Study] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Dining_Room] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Garage] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Living_Room] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Kitchen] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Bedroom] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Bathroom] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\t\n\treturn cards;\n}", "renderCards(cards) {\n return cards.map((card, i) => <Card key={i} payload={card.structValue} />);\n }", "function fillCards(response) {\n // Check how many items are in the array returned\n // do a loop to fill four cards with items 1-4 of the array (item zero is the main card)\n if (response.drinks.length > 4) {\n for (var i = 1; i < 5; i++) {\n var cardID = \"card-\" + i;\n $(\"#\" + cardID).find(\"img\").attr(\"src\", response.drinks[i].strDrinkThumb);\n $(\"#\" + cardID).find(\".card-title\").text(response.drinks[i].strDrink);\n $(\"#\" + cardID).find(\"p\").text(response.drinks[i].strCategory);\n $(\"#\" + cardID).find(\".card-action\").attr(\"href\", \"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=\" + response.drinks[i].strDrink);\n }\n }\n // if there are less than 5 items in the array, fill the remaining cards with random content.\n else {\n for (var i = 1; i < response.drinks.length; i++) {\n var cardID = \"card-\" + i;\n $(\"#\" + cardID).find(\"img\").attr(\"src\", response.drinks[i].strDrinkThumb);\n $(\"#\" + cardID).find(\".card-title\").text(response.drinks[i].strDrink);\n $(\"#\" + cardID).find(\".card-content\").text(response.drinks[i].strCategory);\n $(\"#\" + cardID).find(\".card-action\").attr(\"href\", \"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=\" + response.drinks[i].strDrink);\n }\n\n for (var i = 5; i > response.drinks.length; i--) {\n let cardID = \"card-\" + (i - 1); // if we use var the for loop will finish before the first ajax call comes back, so all the ajax calls will use card-1. \"let\" prevents this.\n var randomURL = \"https://www.thecocktaildb.com/api/json/v1/1/random.php\";\n $.getJSON(randomURL, function (randomCock) {\n $(\"#\" + cardID).find(\"img\").attr(\"src\", randomCock.drinks[0].strDrinkThumb);\n $(\"#\" + cardID).find(\".card-title\").text(randomCock.drinks[0].strDrink);\n $(\"#\" + cardID).find(\".card-content\").text(randomCock.drinks[0].strCategory);\n $(\"#\" + cardID).find(\".card-action\").attr(\"href\", \"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=\" + randomCock.drinks[0].strDrink);\n });\n\n }\n }\n\n\n\n\n}", "function displayCBCAnalyzesElements() {\n $.get(`/patients/${patient_id}/analyzes?json=True`, (res) => {\n var cbc_analyzes_list = JSON.parse(res);\n\n let accordion = $(\"#patient_analyzes_list #accordion\").html('')\n\n cbc_analyzes_list.forEach((cbc) => {\n createCBCCard(patient_id, \"cbc\", cbc).appendTo(accordion)\n });\n })\n .fail((err) => {\n console.log(err);\n });\n }", "function displayCBCAnalyzesElements() {\n $.get(`/patients/${patient_id}/analyzes?json=True`, (res) => {\n var cbc_analyzes_list = JSON.parse(res);\n\n let accordion = $(\"#patient_analyzes_list #accordion\").html('')\n\n cbc_analyzes_list.forEach((cbc) => {\n createCBCCard(patient_id, \"cbc\", cbc).appendTo(accordion)\n });\n })\n .fail((err) => {\n console.log(err);\n });\n }", "function getAll_Books()\n{\n //Apaga a area de apresentação\n document.getElementById('apresentacao')? document.getElementById('apresentacao').remove():document.getElementById('apresentacao');\n\n var cardList = getCardList();\n cardList.innerHTML = \"\";\n\n $.ajax({url: \"https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=bGVCvDfP5bmC942U18tq5XYB2YbG0Qpo\", method: \"GET\"})\n .done(function(response) \n { \n if(response.status == \"OK\")\n {\n for (let dado of response.results.books )\n { \n cardList.appendChild(\n createCard(\n \"\", \n dado.rank,\n dado.description,\n \"\",\n dado.book_image\n )\n )\n };\n }\n }) \n}", "static loadCards() {\n // get languages array from api\n fetch(\"http://localhost:3000/languages\")\n .then(function (response) {\n return response.json();\n })\n .then(function (languages) {\n // save the language object as global variable\n\n compileCards(languages);\n });\n }", "function getCardsOnPage() {\n const [ cardSectionSelector, cardDigitsSelector ] = setCardSectionSelectors();\n\n const cards = document.querySelectorAll(cardSectionSelector);\n const cardDigits = [];\n cards.forEach((card) => {\n const cardLastFour = card.querySelector(cardDigitsSelector).textContent;\n cardDigits.push( formatCardDigits(cardLastFour) );\n })\n\n\tchrome.runtime.sendMessage({\n\t\taction: \"getCardsOnPage\",\n\t\tnumbers: cardDigits\n\t});\n}", "function LoadDeckFromFile(path)\n{\n\tlet loaded = JSON.parse(ReadFile(path)).deck;\n\tlet deck = [];\n\t\n\tfor(let i = 0, n = loaded.length; i < n; i++)\n\t{\n\t\tdeck.push(new Card(loaded[i].suit, loaded[i].type));\n\t}\n\t\n\treturn deck;\n}", "function getCards(event) {\n event.preventDefault();\n let inputVal = input.value;\n spinner.style.display = 'block';\n // URL variables för flexibilitet\n let fetchedURL = \"https://www.flickr.com/services/rest/?method=flickr.photos.search\";\n fetchedURL += \"&api_key=\" + apiKey;\n fetchedURL += \"&tags=\" + inputVal;\n fetchedURL += \"&per_page=12\"\n fetchedURL += \"&format=json\";\n fetchedURL += \"&nojsoncallback=1\";\n\n // Skapa en Array som ska vi pusha alla fotorna i\n let cardsArray = [];\n // Skapar en fetch\n fetch(fetchedURL).then(\n function(response) {\n\n // Errorhantering3\n if (inputVal == '') {\n throw 'Search term can not be empty';\n } else {\n if (response.status === 100) {\n throw 'The API key passed was not valid or has expired';\n } else if (response.status === 105) {\n throw 'The requested service is temporarily unavailable'\n } else if (response.status === 106) {\n throw 'The requested operation failed due to a temporary issue.'\n } else if (response.status === 111) {\n throw 'The requested response format was not found'\n } else if (response.status === 112) {\n throw 'The requested method was not found'\n } else if (response.status === 114) {\n throw 'The SOAP envelope send in the request could not be parsed.'\n } else if (response.status === 115) {\n throw 'The XML-RPC request document could not be parsed.'\n } else if (response.status === 116) {\n throw 'One or more arguments contained a URL that has been used for absure on Flickr.'\n } else if (response.status >= 200 && response.status <= 299) {\n return response.json();\n }\n };\n\n }\n ).then(data => {\n // Skapar en for-loop\n for (let i = 0; i < data.photos.photo.length; i++) {\n let id = data.photos.photo[i].id;\n let server = data.photos.photo[i].server;\n let secret = data.photos.photo[i].secret;\n let cardImageSrc = `http://live.staticflickr.com/${server}/${id}_${secret}_q.jpg`;\n // Skapa Card object\n card = new Card(id, cardImageSrc);\n // Pushar in bilderna i arrayn\n cardsArray.push(card);\n }\n\n\n\n // Välja 12 sticker av fotona och dubblar dem och ligga dem i DOM\n let pickedCards = cardsArray.splice(0, 12);\n // Duplicate Fotona\n let dupelicateCardsArr = pickedCards.reduce(function(res, current) {\n return res.concat([current, current]);\n }, []);\n\n //Randomiz arrayen\n let randomizedCards = dupelicateCardsArr.sort(() => Math.random() - 0.5);\n\n // generate korter från arrayen\n spinner.style.display = 'none';\n generateCards(randomizedCards);\n cards = document.querySelectorAll('.card');\n addEventListenerAll();\n startTimer();\n })\n .catch((err) => alert(err));\n}", "generateCards() {\n var cards = [];\n var suits = ['spades', 'clubs', 'diamonds', 'hearts'];\n var values = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'jack', 'queen', 'king', 'ace'];\n\n // Maps out the objects for each card\n suits.map((_suit) => {\n return values.map((_value) => {\n return cards.push({ suit: _suit, value: _value, showBack: true });\n });\n });\n\n // Returns the newly created and shuffled deck\n return this.shuffleCards(cards);\n }", "static async getAllCards() {\n const cards = await db.query(`SELECT * FROM cards`);\n return cards.rows;\n }", "async function findData() {\r\n try {\r\n\r\n\r\n const res = await fetch(\"https://thronesapi.com/api/v2/characters\");\r\n\r\n const data = await res.json();\r\n\r\n // Method 1 to dispaly content 1 by one using math random\r\n\r\n let jarvis = data[Math.floor((Math.random() * 50) + 1)];\r\n\r\n document.querySelector(\"#output\").innerHTML=jarvis.title;\r\n document.querySelector(\"#output1\").innerHTML=jarvis.family;\r\n document.querySelector(\"#output2\").innerHTML=jarvis.fullName;\r\n document.querySelector(\"#output3\").src= jarvis.imageUrl;\r\n\r\n \r\n // Method 2 is commented as below to display all content in one shot\r\n\r\n\r\n\r\n // for (let i = 1; i < data.length; i++) \r\n // {\r\n // const card = document.querySelector(\".card\");\r\n\r\n // // using template literal displaying content in DOM\r\n // const container = document.createElement(\"div\");\r\n // container.innerHTML = `\r\n // <img src=\"${data[i].imageUrl}\"> <br>\r\n // <span>Title :${data[i].title}</span> <br>\r\n // <span>Family :${data[i].family}</span><br>\r\n // <span>Full Name :${data[i].fullName}</span><br>\r\n \r\n // <hr>`;\r\n // // appended the container \r\n // card.append(container);\r\n // }\r\n \r\n } catch (err) {\r\n console.log(err, \"unable to get data\");\r\n }\r\n}", "function fetchManga(){\n fetch('https://api.jikan.moe/v3/top/manga/1/bypopularity')\n .then(response => response.json()) \n .then(function(data){\n console.log(data)\n \n let i = 0\n while (i < 40){\n con2.innerHTML += (\"<div class='card' id='\"+ data.top[i].mal_id +\"' title='manga'><img src='\" + data.top[i].image_url+\"'><h5 class='aTitle'>\"+ data.top[i].title +\"</h5><p class='desc'>\"+ data.top[i].score +\"</p></div>\")\n i ++\n }\n });\n }", "prepareCard(){\n const ba = new Array()\n const d = new Date()\n ba.push(0xE2)\n ba.push(this.getHigh(d.getFullYear()))\n ba.push(this.getLower(d.getFullYear()))\n ba.push(d.getMonth())\n ba.push(d.getDate())\n ba.push(d.getHours())\n ba.push(d.getMinutes())\n ba.push(d.getSeconds())\n ba.push(this.getHigh(d.getMilliseconds()))\n ba.push(this.getLower(d.getMilliseconds()))\n ba.push(Math.round(Math.random()*255))\n ba.push(Math.round(Math.random()*255))\n console.log('prepare card',ba)\n return ba\n }", "getCards(params) {\n return Resource.get(this).resource('Store:getCardsInInventory', params).then(cards => {\n // Reset cards\n this.displayData.cards.electronic = [];\n this.displayData.cards.physical = [];\n // Split the cards into electronic and physical\n cards.map(card => {\n if (card.type === 'electronic') {\n this.displayData.cards.electronic.push(card);\n } else {\n this.displayData.cards.physical.push(card);\n }\n });\n });\n }", "function getSummaryCardsModel() {\n\tvar model = [];\n\tvar icons = [\"fa-info\",\"fa-signal\",\"fa-exclamation\",\"fa-thumbs-up\",\"fa-tag\"];\n\tvar text = [\"Maharashtra\",\"Tamil Nadu\",\"New Delhi\",\"Uttar Pradesh\",\"Karanataka\"];\n\tvar mDimensions = [\"space\",\"time\"];\n\tvar colors = [\"#FFF\", \"rgb(102, 204, 221)\",\"rgb(255, 187, 34)\",\"rgb(187, 229, 53)\",\"rgb(181, 197, 197)\",\"rgb(245, 101, 69)\"];\n\tfor (var i = 0; i < 20; i++) {\n\t\tvar data = {\n\t\t\t\"id\" : \"card-summary-\"+guid(),\n\t\t\t\"cardtype\" : \"summary-card\",\n\t\t\t\"icon\" : randomElement(icons),\n\t\t\t\"heading\" : Math.floor((Math.random()*9999)),\n\t\t\t\"text\" : randomElement(text),\n\t\t\t\"color\" : randomElement(colors),\n\t\t\t\"orderindex\" : i,\n\t\t\t\"query\" : {\"country\": \"India\"} ,\n\t\t\t\"dimension\" : randomElement(mDimensions)\n\t\t};\n\t\tmodel.push(data);\n\t}\n\treturn model;\n}", "function loadCards(e){\n e.preventDefault();\n let xhrLoadCbh = new window.XMLHttpRequest();\n xhrLoadCbh.open(\"GET\", \"/cards/page\");\n xhrLoadCbh.setRequestHeader(\"Content-Type\", \"application/json\");\n xhrLoadCbh.send(JSON.stringify(null));\n xhrLoadCbh.onload = function() {\n let res = JSON.parse(xhrLoadCbh.response);\n if (xhrLoadCbh.readyState == 4 && xhrLoadCbh.status == \"200\"){\n document.getElementById(\"panel1\").innerHTML=res.panel1;\n } else {\n console.error(res);\n }\n }\n}", "function getCurrentCards(sort)\n{\n\t//Retrieve the current set of cards\n\tvar json = $('input[name=\"cards\"]').val();\n\tvar cards = ((json.length > 0) ? $.parseJSON(json) : []);\n\t\n\t//If requested, sort by type and name\n\tif (sort === true) {\n\t\tcards = CardDefinitions.sortCards(cards);\n\t}\n\t\n\treturn cards;\n}", "static getCardsByNumber() {\n\t\t//Get the cards\n\t\tvar cards = CardManager.getCards();\n\t\t//Result\n\t\tvar result = [];\n\t\t//Iterate\n\t\tfor(var i = 0; i < cards.length; i++) {\n\t\t\t//Check the card number\n\t\t\tif(cards[i].getAttribute(\"number\") == result.length) {\n\t\t\t\t//Add the card to the array\n\t\t\t\tresult.push(cards[i]);\n\t\t\t\t//Reset the counter and continue\n\t\t\t\ti = -1; continue;\n\t\t\t}\n\t\t}\n\t\t//Finished\n\t\treturn result;\n\t}", "function drawCards(filteredCharacters) {\n\n\tconst searchOutput = document.querySelector('.cards');\n\tlet output = '';\n\t//* Se recorre el arreglo y se genera una tarjeta por cada elemento\n\tfilteredCharacters.forEach(champion => {\n\n\t\toutput += `\n\t\t<div class=\"container\">\n\t\t\t<div class=\"card\">\n\t\t\t\t<h1>${champion.name}</h1>\n\t\t\t\t<img src=\"${champion.img}\" width=\"90px\" height=\"90px\"> <br>\n\t\t\t\t<p class=\"title\">Stats:</p>\n\t\t\t\t<p>Attack: ${champion.info.attack}</p>\n\t\t\t\t<p>Defense: ${champion.info.defense}</p>\n\t\t\t\t<p>Magic: ${champion.info.magic}</p>\n\t\t\t\t<p>Difficulty: ${champion.info.difficulty}</p> <br>\n\t\t\t\t<!-- Trigger/Open The Modal -->\n\t\t\t\t<p><button class=\"more\" id=\"${champion.name}\">More</button></p>\n\t\t\t</div>\n\t\t\t<!-- The Modal -->\n\t\t\t<div id=\"${champion.name}myModal\" class=\"modal\">\n\t\t\t\t<!-- Modal content -->\n\t\t\t\t<div class=\"row modal-content\">\n\t\t\t\t\t<span class=\"close\" id=\"${champion.name}Close\">&times;</span>\n\t\t\t\t\t<div class=\"column\">\n\t\t\t\t\t\t<h2><p> ${champion.name} <p></h2><br/>\n\t\t\t\t\t\t<p><img src=\"${champion.splash}\" width=\"100%\" height=\"100%\"></p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"column\">\n\t\t\t\t\t\t<p>hp: ${champion.stats.hp}</p>\n\t\t\t\t\t\t<p>hpperlevel: ${champion.stats.hpperlevel}</p>\n\t\t\t\t\t\t<p>mp: ${champion.stats.mp}</p>\n\t\t\t\t\t\t<p>mpperlevel: ${champion.stats.mpperlevel}</p>\n\t\t\t\t\t\t<p>movespeed: ${champion.stats.movespeed}</p>\n\t\t\t\t\t\t<p>armor: ${champion.stats.armor}</p>\n\t\t\t\t\t\t<p>armorperlevel: ${champion.stats.armorperlevel}</p>\n\t\t\t\t\t\t<p>spellblock: ${champion.stats.spellblock}</p>\n\t\t\t\t\t\t<p>spellblockperlevel: ${champion.stats.spellblockperlevel}</p>\n\t\t\t\t\t\t<p>attackrange: ${champion.stats.attackrange}</p>\n\t\t\t\t\t\t<p>hpregen: ${champion.stats.hpregen}</p>\n\t\t\t\t\t\t<p>hpregenperlevel: ${champion.stats.hpregenperlevel}</p>\n\t\t\t\t\t\t<p>mpregen: ${champion.stats.mpregen}</p>\n\t\t\t\t\t\t<p>mpregenperlevel: ${champion.stats.mpregenperlevel}</p>\n\t\t\t\t\t\t<p>attackdamage: ${champion.stats.attackdamage}</p>\n\t\t\t\t\t\t<p>attackdamageperlevel: ${champion.stats.attackdamageperlevel}</p>\n\t\t\t\t\t\t<p>attackspeedoffset: ${champion.stats.attackspeedoffset}</p>\n\t\t\t\t\t\t<p>attackspeedperlevel: ${champion.stats.attackspeedperlevel}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t`;\n\t\treiniciar.style.display = \"block\";\n\t\tordenar.style.display = \"block\";\n\t});\n\n\n\tsearchOutput.innerHTML = output;\n\n\tlet buttonsMore = document.querySelectorAll(\".more\");\n\tconsole.log(buttonsMore);\n\n\tbuttonsMore.forEach(button => {\n\t\tbutton.addEventListener(\"click\", function () {\n\n\t\t\t// Get the modal\n\t\t\tvar modal = document.getElementById(button.id + \"myModal\");\n\t\t\tconsole.log(\"modal\", modal);\n\n\t\t\n\n\t\t\t// Get the <span> element that closes the modal\n\t\t\tvar span = document.getElementById(button.id + \"Close\");\n\t\t\tconsole.log(span);\n\n\t\t\t// When the user clicks on the button, open the modal \n\n\t\t\tmodal.style.display = \"block\";\n\n\t\t\t// When the user clicks on <span> (x), close the modal\n\t\t\tspan.onclick = function () {\n\t\t\t\tmodal.style.display = \"none\";\n\t\t\t};\n\n\t\t\t// When the user clicks anywhere outside of the modal, close it\n\t\t\twindow.onclick = function (event) {\n\t\t\t\tif (event.target == modal) {\n\t\t\t\t\tmodal.style.display = \"none\";\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t});\n}", "function $renderCards(cards){\r\n\t// Number of top cards to display\r\n\tlet counter = STORE.displayedCards;\r\n\tlet topCards = [];\r\n\t// Empty the container in case we refresh\r\n\t$('#clash-cards').empty();\r\n\t// Loop through the array of cards to render applicable data\r\n\tcards.forEach(card => {\r\n\t\t// If the counter hits 0, stop displaying cards\r\n\t\tif(counter > 0){\r\n\t\t\ttopCards.push(card.id);\r\n\t\t\t// Basic DOM object we create and appending info to it\r\n\t\t\tlet $card = $(`<div class=\"card\" data-id=\"${card.id}\">`);\r\n\t\t\t$card.append(`<p class=\"name\">${card.name}</p>`);\r\n\t\t\t$card.append(`<img class=\"app-card\" src=\"${card.cardImg}\" alt=\"${card.name}\">`);\r\n\t\t\t$card.append(`<p class=\"percent\">Win-Rate: <span class=\"perc\">${card.winPerc}%</span></p>`);\r\n\t\t\t$card.append(`<p class=\"use-rate\">Use-Rate: <span class=\"usage\">${card.useRate}%</span></p>`);\r\n\t\t\t// Render the card to the DOM\r\n\t\t\t$('#clash-cards').append($card);\r\n\t\t\t// Remove one from the counter (if 0, stop rendering)\r\n\t\t\tcounter--;\r\n\t\t}\r\n\t})\r\n\treturn topCards;\r\n}", "initCards() {\n let allCards = [\n { value: \"A\", matched: false},\n { value: \"A\", matched: false},\n { value: \"B\", matched: false},\n { value: \"B\", matched: false},\n { value: \"C\", matched: false},\n { value: \"C\", matched: false},\n { value: \"D\", matched: false},\n { value: \"D\", matched: false},\n { value: \"E\", matched: false},\n { value: \"E\", matched: false},\n { value: \"F\", matched: false},\n { value: \"F\", matched: false},\n { value: \"G\", matched: false},\n { value: \"G\", matched: false},\n { value: \"H\", matched: false},\n { value: \"H\", matched: false}\n ];\n this.shuffle(allCards);\n return allCards;\n }", "'board.getCards' (boardId) {\n let userId = this.userId\n let board = Boards.findOne({\"_id\": boardId});\n if (board) {\n // Check user's permission:\n let userRole = boardUtils.getUserRole(userId, board)\n if(canPerform(userRole, ACCESS_CARD)){\n let cards = []\n board.boardList.map((list) => {\n // noinspection JSAnnotator\n let theList = Meteor.call('getList',list._id)\n theList.listCard.map((card) => {\n cards.push(card)\n })\n })\n return cards\n } else\n throw new Meteor.Error(403, \"You do not have permission to access the cards\")\n } else {\n throw new Meteor.Error(404, 'Board not found')\n }\n }", "function drawCards(data) {\n getJSON(drawApi + data.deck_id + \"/?count=4\", function (cardData) {\n console.log(cardData);\n console.log(cardData.cards[0]);\n //creating score arrays // but parses NaN if a face card...\n playerScore = playerScore.concat(parseInt(cardData.cards[0].value));\n playerScore = playerScore.concat(parseInt(cardData.cards[1].value));\n houseScore = houseScore.concat(parseInt(cardData.cards[2].value));\n houseScore = houseScore.concat(parseInt(cardData.cards[3].value));\n //totals the score arrays\n playerScoreTotal = playerScore.reduce(function(prev, curr){\n return prev + curr;\n });\n houseScoreTotal = houseScore.reduce(function(prev, curr){\n return prev + curr;\n });\n\n\n //Lucas inspired code below for dealing with face values. Doesnt quite work right now. Just makes playerScoreTotal === 20\n //if(cardData.cards[0].value === \"King\" || \"Queen\" || \"Jack\") {\n //playerScoreTotal += 10;\n //}\n //if(cardData.cards[1].value === \"King\" || \"Queen\" || \"Jack\") {\n //playerScoreTotal += 10;\n //}\n ////End Lucas inspiration\n appendPlayerCard(cardData);\n appendDealerCard(cardData);\n });\n }", "renderCards(cards) {\n return cards.map((card, i) => <Card key={i} payload={card.structValue} />);\n }", "function createCardlist(){\n var arr = [];\n for (var i = 1; i<=52; i++)\n {\n var face = i%13;\n switch(face){\n case 1:\n face = \"Ace\";\n break;\n case 11:\n face = \"Jack\";\n break;\n case 12:\n face = \"Queen\";\n break;\n case 0:\n face = \"King\";\n break;\n default:\n face = face.toString();\n break;\n }\n\n var suit;\n switch(Math.floor(i/13)) {\n case 0:\n suit = \"Spade\";\n break;\n case 1:\n suit = \"Diamond\";\n break;\n case 2:\n suit = \"Heart\";\n break;\n case 3:\n suit = \"Club\";\n break;\n default:\n break;\n }\n arr[i-1] = face + \" of \" + suit;\n }\n return arr;\n}", "function newCard(json){\n\t// Insert Card\n\tdocument.getElementById(\"frame\").innerHTML += json.body;\n\t\n\t// Init drawer if the canvas is present\n\tif (document.getElementById(\"canvas\") != null)\n\t\tinitDrawer();\n\t\t\n\tif (document.getElementsByClassName(\"jscolor\") != null)\n\t\tinitJSColor();\n\t\n\t// Theme and animate if we need to swap cards\n\tlet cards = document.getElementsByClassName(\"card\");\n\tif (cards.length == 2){\n\t\tpopulatePage(json, cards[1]);\n\t\ttheme(cards[1]);\n\t\t\n\t\tif ($(cards[1]).find(\"#timer\")[0] != null)\n\t\t\tstartTimer(60, null);\n\t\t\n\t\ttransitionCards(cards);\n\t} else {\n\t\tpopulatePage(json, cards[0]);\n\t\t\n\t\tif ($(cards[0]).find(\"#timer\")[0] != null)\n\t\t\tcontinueTimer();\n\t\t\n\t\ttheme(cards[0]);\n\t}\n}", "function subject(card) {\n let subs = [];\n for (let i = 0; i < card.length; i++) {\n subs.push(card[i].subject);\n }\n return subs;\n}", "function readMyCards() {\n // Get my cards\n var cards = document.getElementsByClassName('you-player')[0];\n var card1 = cards.getElementsByClassName('card')[0],\n card2 = cards.getElementsByClassName('card')[1];\n\n // Convert each of my cards to string\n var card1String = face[card1.children[0].innerText] + ' of ' + suit[card1.children[1].innerText];\n var card2String = face[card2.children[0].innerText] + ' of ' + suit[card2.children[1].innerText];\n\n return 'Cards in hand are ' + card1String + ' and ' + card2String;\n}", "function makeCards(array) {\n // cards =[];\n fullDeck = [];\n for(let i = 0; i < array.length; i++) {\n fullDeck.push(array[i]);\n }\n //doubles the creation of each card image creating the full deck\n fullDeck = [...fullDeck, ...fullDeck];\n }", "function processData(data) {\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n console.log(data[key].Title);\n\n var title = data[key].Title,\n desc = data[key].Description,\n image = data[key].Image,\n cat = data[key].Category,\n link = data[key].Link;\n\n // If category is new, push to array\n if(catsArray.indexOf(cat) === -1){\n catsArray.push(cat);\n }\n\n // Send data to cards function\n createCards(title,desc,image,cat,link);\n }\n }\n // for (let i = 0; i < data.length; i++) {\n // console.log(data[i]);\n // // Store data as variables\n // var title = data[i].Title,\n // desc = data[i].Description,\n // image = data[i].Image,\n // cat = data[i].Category,\n // link = data[i].Link;\n //\n // // If category is new, push to array\n // if(catsArray.indexOf(cat) === -1){\n // catsArray.push(cat);\n // }\n //\n // // Send data to cards function\n // createCards(title,desc,image,cat,link);\n // };\n\n // Send array to filter function\n createFilter();\n\n // Match colors to categories\n matchColor();\n\n}", "function populateCards(cardType){\n\t$.getJSON( \"/\" + cardType, function( json ) {\t\n\t\tuserCards = [];\n\t\t$.each(json, function(i, entry){\n\t\t\tuserCards.push(entry);\n\t\t\tuserCardHtml = constructCardHtml(entry, cardType);\n\t\t\t$(\"#\" + cardType + \"Cards\").append(userCardHtml);\n\t\t})\n\t\t\n\t\tuserCardsMap.set(cardType, userCards);\n\t});\n}", "function CreateCardDeck()\n{\n var cardDeck = [];\n var suits = [\"hearts\",\"clubs\",\"spades\",\"diamonds\"];\n var cardValue = [\"ace\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"jack\",\"queen\",\"king\"];\n\n for(var i=0;i<suits.length;i++)\n {\n for(var j=0;j<cardValue.length;j++)\n {\n var newCard = {\n suit: suits[i],\n value: cardValue[j]\n };\n cardDeck.push(newCard);\n }\n }\n return cardDeck;\n}", "function _getAllCards(elem){\n return xtag.queryChildren(elem, \"x-card\");\n }", "function flashcardCreator() {\n let str = document.querySelector(\"#flashcardWords\").value;\n let cells = str.split(\"\\n\").map(function (el) {\n return el.split(\" - \");\n });\n\n let inputs = document.querySelectorAll(\"form input\");\n\n let inputsValues = [];\n\n for (let i = 0; i < inputs.length; i++) {\n inputsValues.push(inputs[i].value);\n }\n\n let headings = inputsValues;\n\n let out = cells.map(function (el) {\n let obj = {};\n obj.cardID = 1;\n for (var i = 0; i < el.length; i++) {\n if (el.length == 2) {\n obj[headings[i]] = isNaN(Number(el[i])) ? el[i] : +el[i];\n obj.empty = \"\";\n } else {\n obj[headings[i]] = isNaN(Number(el[i])) ? el[i] : +el[i];\n }\n }\n return obj;\n });\n\n for (let i = 0; i < out.length; i++) {\n out[i].cardID = storedFlashCards.length + 1 + i;\n out[i].youtube = \"\";\n out[i].ok = 0;\n out[i].repeat = 0;\n }\n\n storedFlashCards = storedFlashCards.concat(out);\n}", "function createCards(globals) {\n var BACKGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Card_backs_grid_blue.svg';\n var SORTED_BACKGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Card_backs_grid_red.svg';\n var FOREGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Ornamental_deck_';\n //var cardNumbers = ['Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2', 'Ace', 'King', 'Queen'];\t\n\t//var values = [13,12,11,10,9,8,7,6,5,4,3,2,1];\n var cardNumbers = ['2', '3','4','5','6','7','8','9','10','Jack','Queen','King', 'Ace'];\t\n\tvar values = [1,2,3,4,5,6,7,8,9,10,11,12,13];\n \n\tvar cardSuits = ['spades', 'clubs', 'diamonds', 'hearts', 'spades', 'clubs', 'diamonds', 'hearts', 'spades', 'clubs', 'diamonds', 'diamonds', 'spades', 'clubs', 'diamonds', 'hearts'];\n\n // Randomized array of cards\n var cardArray = [];\n // Maps card number to actual card struct\n var cards = {};\n\n // Populate cards and cardArray with card objects\n for (var i = 0; i < globals.NUM_CARDS; i++) {\n var newCard = {};\n newCard.num = i;\n newCard.flipped = false;\n newCard.sorted = false;\n newCard.normalBack = BACKGROUND;\n newCard.sortedBack = SORTED_BACKGROUND;\n\t\tnewCard.value = values[i];\n \n\t\tnewCard.frontFace = FOREGROUND + cardNumbers[i] + '_of_' + cardSuits[i] + '.svg';\n newCard.rightPivot = globals.NUM_CARDS;\n\t\tnewCard.leftPivot = -1;\n\t\t\n\t\tcardArray.push(newCard);\n cards[i] = newCard;\n\t\t\n }\n\n // Randomize ordering of cardArray\n var currentIndex, temporaryValue, randomIndex;\n currentIndex = cardArray.length;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = cardArray[currentIndex];\n cardArray[currentIndex] = cardArray[randomIndex];\n cardArray[randomIndex] = temporaryValue;\n }\n\n // Set zIndex and xPos values based on randomized positions\n for (i = 0; i < globals.NUM_CARDS; i++) {\n var num = cardArray[i].num;\n cards[num].zIndex = i;\n cards[num].xPos = globals.PADDING + globals.SPACE * i;\n }\n\n globals.cardArray = cardArray;\n globals.cards = cards;\n}", "function initCardsFromData() {\n for (const cardKey in data.cards) {\n\n const cardElem = memoryGrid.querySelector('[data-card-id=' + cardKey + ']');\n\n cardElem.className = data.cards[cardKey];\n\n if (cardElem.classList.contains(FLIP) ||\n cardElem.classList.contains(MATCH)) {\n // Update aria label to symbol\n cardElem.setAttribute('aria-label', cardElem.dataset.symbol);\n }\n\n memoryGrid.appendChild(cardElem);\n }\n }", "function evalCards() {\n\n}", "function fetch_cards() {\n\n const GET_CARDS_URL=\"http://127.0.0.1:8090/card/mycards\"; \n let context = {\n method: 'GET'\n };\n \n fetch(GET_CARDS_URL,context)\n .then(reponse => reponse.json().then(body => cardList_callback(body)))\n .catch(error => err_callback(error));\n}", "function getCards(token, skip, limit) {\n return request(app)\n .get('/cards')\n .query({skip, limit})\n .set(authHeader(token));\n}", "function deck() {\n this.names = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];\n this.suits = ['H', 'D', 'S', 'C'];\n var cards = [];\n\n for (var i = 0; i < this.suits.length; i++) {\n for (var j = 0; j < this.names.length; j++) {\n var val = j + 1;\n // if card is JQKA set value\n if (val > 10) {\n val = 10;\n } else if (val === 1) {\n val = 11;\n }\n cards.push(new card(val, this.names[j], this.suits[i]));\n }\n }\n return cards;\n}", "fetchCards() {\n this.cards.push(\n {\n image: \"https://picsum.photos/200/300?random=1\",\n type: 'video',\n duration: 3600,\n title: 'Title 1',\n cardinality: 'single'\n },\n {\n image: \"https://picsum.photos/200/300?random=2\",\n type: 'playlist',\n duration: 1000,\n title: 'Title 2',\n cardinality: 'collection'\n },\n {\n image: \"https://picsum.photos/200/300?random=3\",\n type: 'playlist',\n duration: 2300,\n title: 'Title 3',\n cardinality: 'collection'\n },\n {\n image: \"https://picsum.photos/200/300?random=4\",\n type: 'news',\n duration: 4600,\n title: 'Title 4',\n cardinality: 'single'\n },\n {\n image: \"https://picsum.photos/200/300?random=5\",\n type: 'playlist',\n duration: 1500,\n title: 'Title 5',\n cardinality: 'collection'\n },\n {\n image: \"https://picsum.photos/200/300?random=6\",\n type: 'other',\n duration: 800,\n title: 'Title 6',\n cardinality: 'single'\n },\n {\n image: \"https://picsum.photos/200/300?random=7\",\n type: 'news',\n duration: 1600,\n title: 'Title 7',\n cardinality: 'single'\n },\n {\n image: \"https://picsum.photos/200/300?random=8\",\n type: 'playlist',\n duration: 2400,\n title: 'Title 8',\n cardinality: 'collection'\n },\n {\n image: \"https://picsum.photos/200/300?random=9\",\n type: 'video',\n duration: 3600,\n title: 'Title 9',\n cardinality: 'single'\n }\n )\n }", "function DeckOfCards() {\n var cards = [];\n var _listOfFaces = new Array(\"ace\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"jack\", \"queen\", \"king\");\n var _listOfSuits = new Array(\"clubs\", \"diamonds\", \"hearts\", \"spades\");\n\n function all52Cards() {\n for (var j = 0; j < _listOfFaces.length; j++) {\n for (var k = 0; k < _listOfSuits.length; k++) {\n cards.push(new CardConstructer(_listOfFaces[j], _listOfSuits[k]));\n }\n }\n }\n all52Cards(); // running the function once so the cards[] array is filled with 52 cards without need to return sequenced cards as we shuffle it later anyway\n\n}" ]
[ "0.74409986", "0.66615003", "0.6045272", "0.60004544", "0.59735185", "0.5952333", "0.5909625", "0.5899814", "0.58983094", "0.58823556", "0.5880223", "0.58478355", "0.5814674", "0.5728323", "0.57154405", "0.5688162", "0.56524587", "0.5623733", "0.5619616", "0.56141514", "0.56121975", "0.5603117", "0.559231", "0.5570422", "0.5560108", "0.55323213", "0.5515231", "0.54942083", "0.54661417", "0.54630303", "0.54591936", "0.54560304", "0.5453002", "0.5452148", "0.54517114", "0.54360825", "0.54231274", "0.5418125", "0.5417557", "0.5417045", "0.5410983", "0.5400532", "0.5394038", "0.53824115", "0.5381513", "0.5378847", "0.5369178", "0.53641826", "0.53594655", "0.5348577", "0.5334578", "0.5334277", "0.53168887", "0.53021765", "0.52906895", "0.52738", "0.5267291", "0.5255179", "0.52523357", "0.5242047", "0.5242047", "0.5240097", "0.52400124", "0.52294946", "0.5227852", "0.52262527", "0.5225065", "0.5224204", "0.5223782", "0.52199686", "0.52155465", "0.5211981", "0.5190457", "0.51901084", "0.5187597", "0.5177559", "0.51774806", "0.51774186", "0.5176447", "0.5170439", "0.51689553", "0.51599115", "0.51596737", "0.51451945", "0.5144895", "0.5144428", "0.5137136", "0.51336807", "0.5130827", "0.5130698", "0.5123324", "0.5121543", "0.5115424", "0.5113715", "0.5111581", "0.5104552", "0.51042867", "0.5104092", "0.50873876", "0.5084959" ]
0.87322396
0
takes the json from cardtext.js as a parameter and returns an array of white cards
getWhiteCards(json){ return json.whiteCards; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBlackCards(json){\n var blackCardsRaw = json.blackCards;\n var blackCardsRefined = [];\n for(var card of blackCardsRaw){\n if(card.pick == 1){\n blackCardsRefined.push(card.text);\n }\n }\n return blackCardsRefined;\n }", "function getCards(data){\n\tvar cards = data.items.MTG.cards;\n\tfor(c in cards){\n\t\tvar name = cards[c].split(\"-\")[0];\n\t\tvar span = $(\"<span>\"+name+\"</span><br>\");\n\t\t$(\"#mtg-list\").append(span);\n\t}\n\treturn null;\n}", "function createCards(cards) {\n let type;\n return cards.map((cardConfig) => {\n const tempCards = [];\n if (cardConfig[2]) {\n type = cardConfig[2];\n }\n for (let i = 0; i < cardConfig[0]; i++) {\n tempCards.push({text: cardConfig[1], type})\n }\n return tempCards;\n }).flat().map( function(item, index){\n const el = document.createElement('div');\n el.setAttribute('text', item.text);\n el.setAttribute('type', item.type);\n el.innerHTML = `\n<p>\n ${item.type}\n</p>\n<p>\n ${item.text}\n</p>\n`;\n el.classList.add('card');\n document.body.appendChild(el);\n addListeners(el);\n el.setAttribute('deck', 'origin');\n return el;\n });\n}", "function createCards(jsonObj){\n var x = 1\n var jsonCards = jsonObj['cards'];\n for(var i = 0; i < jsonCards.length; i++){\n cards[i] = new Card(jsonCards[i].name, jsonCards[i].value, jsonCards[i].id, jsonCards[i].image);\n console.log(cards[i]);\n }\n}", "function App() {\n const cardArr = [\n {\n \"id\": 1,\n \"nameRU\": \"«Роллинг Стоунз» в изгнании\",\n \"nameEN\": \"Stones in Exile\",\n \"director\": \"Стивен Кайак \",\n \"country\": \"США\", \"year\": \"2010\",\n \"duration\": 61,\n \"description\": \"В конце 1960-х группа «Роллинг Стоунз», несмотря на все свои мегахиты и сверхуспешные концертные туры, была разорена. Виной всему — бездарный менеджмент и драконовское налогообложение в Британии. Тогда музыканты приняли не самое простое для себя решение: летом 1971 года после выхода альбома «Stiсky Fingers» они отправились на юг Франции записывать новую пластинку. Именно там, на Лазурном Берегу, в арендованном Китом Ричардсом подвале виллы Неллькот родился сборник «Exile on Main St.», который стал лучшим альбомом легендарной группы.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=UXcqcdYABFw\",\n \"created_at\": \"2020-11-23T14:12:21.376Z\",\n \"updated_at\": \"2020-11-23T14:12:21.376Z\",\n \"image\": {\n \"id\": 1, \"name\": \"stones-in-exile\",\n \"alternativeText\": \"\",\n \"caption\": \"\",\n \"width\": 512,\n \"height\": 279,\n \"formats\": {\n \"thumbnail\": { \"hash\": \"thumbnail_stones_in_exile_b2f1b8f4b7\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 245, \"height\": 134, \"size\": 8.79, \"path\": null, \"url\": \"/uploads/thumbnail_stones_in_exile_b2f1b8f4b7.jpeg\" },\n \"small\": { \"hash\": \"small_stones_in_exile_b2f1b8f4b7\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 500, \"height\": 272, \"size\": 25.68, \"path\": null, \"url\": \"/uploads/small_stones_in_exile_b2f1b8f4b7.jpeg\" }\n },\n \"hash\": \"stones_in_exile_b2f1b8f4b7\",\n \"ext\": \".jpeg\",\n \"mime\": \"image/jpeg\",\n \"size\": 25.53,\n \"url\": \"/uploads/stones_in_exile_b2f1b8f4b7.jpeg\",\n \"previewUrl\": null,\n \"provider\": \"local\",\n \"provider_metadata\": null,\n \"created_at\": \"2020-11-23T14:11:57.313Z\",\n \"updated_at\": \"2020-11-23T14:11:57.313Z\"\n }\n },\n {\n \"id\": 2,\n \"nameRU\": \"All Tomorrow's Parties\",\n \"nameEN\": \"All Tomorrow's Parties\",\n \"director\": \" Джонатан Кауэтт\",\n \"country\": \"Великобритания\", \"year\": \"2009\",\n \"duration\": 82,\n \"description\": \"Хроники британского фестиваля, который первым нарушил монополию «Гластонбери», «Ридинга» и прочих пивных сборищ в чистом поле — и с тех пор прослыл одним из самых независимых и принципиальных. ATP из года в год проходит на базе отдыха в английской глуши, где артисты и их поклонники живут в одинаковых номерах, не бывает коммерческих спонсоров, программу составляют приглашенные кураторы (в разное время ими были Ник Кейв, Belle & Sebastian, Sonic Youth и даже Мэтт Грейнинг). И, главное, где не любят вздорных людей — основатель фестиваля Барри Хоган однажды сказал, что никогда больше не станет иметь дело с группой Killing Joke, «потому что они му...аки». Эта демократичность сказалась и на фильме: часть съемок сделана адептами фестиваля на мобильный телефон.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=D5fBhbEJxEU\",\n \"created_at\": \"2020-11-23T14:15:19.238Z\",\n \"updated_at\": \"2020-11-23T14:15:19.238Z\",\n \"image\": { \"id\": 2, \"name\": \"all-tommoros-parties\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 699, \"height\": 266, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 245, \"height\": 93, \"size\": 10.33, \"path\": null, \"url\": \"/uploads/thumbnail_all_tommoros_parties_33a125248d.jpeg\" }, \"small\": { \"hash\": \"small_all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 500, \"height\": 190, \"size\": 35.24, \"path\": null, \"url\": \"/uploads/small_all_tommoros_parties_33a125248d.jpeg\" } }, \"hash\": \"all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 67.06, \"url\": \"/uploads/all_tommoros_parties_33a125248d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:14:08.595Z\", \"updated_at\": \"2020-11-23T14:14:08.595Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n }];\n\n\n const [savedMoviesArr, setSavedMoviesArr] = React.useState([{\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n }])\n\n const history = useHistory();\n\n function handleBack() {\n history.goBack();\n }\n\n function handleCardLike(card) {\n // Проверяем, есть ли уже лайк на этой карточке\n // const isLiked = card.likes.some(i => i._id === currentUser._id);\n\n // // Отправляем запрос в API и получаем обновлённые данные карточки\n // api.changeLikeCardStatus(card._id, isLiked)\n // .then((newCard) => {\n // setCards((cards) =>\n // cards.map((c) =>\n // c._id === card._id ? newCard : c\n // )\n // )\n // })\n setSavedMoviesArr(savedMoviesArr.some(function (el) { return el.id === card.id }) ? [...savedMoviesArr] : [card, ...savedMoviesArr]);\n console.log(savedMoviesArr)\n };\n\n function handleCardDelete(card) {\n setSavedMoviesArr(savedMoviesArr.filter(function (el) { return el.id !== card.id }));\n }\n\n return (\n <>\n {/* <CurrentUserContext.Provider value={currentUser}> */}\n <Switch>\n {/* <ProtectedRoute */}\n <Route\n exact path=\"/\"\n // loggedIn={loggedIn}\n // component={Main}\n >\n <Main />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n <Route\n path=\"/movies\"\n // loggedIn={loggedIn}\n // component={Movies}\n >\n <Header />\n <Movies\n isSaved={false}\n cardArr={cardArr}\n onCardLike={handleCardLike}\n savedMovies={savedMoviesArr}\n />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n <Route\n path=\"/saved-movies\"\n // loggedIn={loggedIn}\n // component={SavedMovies}\n >\n <Header />\n <SavedMovies\n isSaved={true}\n savedCardArr={savedMoviesArr}\n onCardDelete={handleCardDelete}\n />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n {/* <Route\n path=\"/profile\"\n // loggedIn={loggedIn}\n component={Profile}\n /> */}\n <Route path=\"/profile\">\n <Header />\n <Profile\n // onRegister={handleRegister} \n name='Alex'\n email='[email protected]'\n />\n </Route>\n <Route path=\"/signup\">\n <Register\n // onRegister={handleRegister} \n />\n </Route>\n <Route path=\"/signin\">\n <Login\n // onLogin={handleLogin} data={newUserData} \n />\n </Route>\n <Route path=\"/signin\">\n <Login\n // onLogin={handleLogin} data={newUserData} \n />\n </Route>\n <Route path=\"*\">\n <NotFound\n onBack={handleBack}\n />\n </Route>\n <Route>\n {/* {loggedIn ? <Redirect exact to=\"/\" /> : <Redirect to=\"/signin\" />} */}\n </Route>\n </Switch>\n {/* </CurrentUserContext.Provider> */}\n </>\n );\n}", "function getCardInfo(cardName) {\n // qurery ScryFall API, must use exact card name\n var scryfallAPI = \"https://api.scryfall.com/cards/named?exact=\";\n var cardJSON = UrlFetchApp.fetch(scryfallAPI.concat(cardName));\n // parse the JSON file\n var cardInfo = JSON.parse(cardJSON);\n // support for dual face cards\n // if dual face mush all the oracle text together\n if (cardInfo.card_faces) {\n cardInfo.oracle_text = cardInfo.card_faces[0].oracle_text.concat('\\n',cardInfo.card_faces[1].oracle_text);\n }\n return cardInfo;\n}", "function cardloading() {\n // is Ajax method to retrieve the Json file\n $.ajax({\n url: 'results.json'\n , type: 'get'\n , dataType: 'JSON'\n , cache: false\n , error: function (data) {\n console.log(data);\n }\n , success: function (data) {\n // upon successfully retrieving the json file loop through the data dynamically generate cards on the index page\n $.each(data, function (index, value) {\n console.log(Object.keys(value));\n console.log(index);\n console.log(value);\n console.log(value.id);\n console.log(value.name);\n var id = value.id;\n var webtype = value.webtype;\n //\t\t\t\t\tvar gender = value.gender;\n $('#profile').append('<div class=\"person\" id=\"p' + id + '\"></div>');\n $('#p' + id).append(`\n\t\t\t\t\t\t<h3> ${id} </h3>\n//\t\t\t\t\t\t<div class=\"profileImage\">\n//\t\t\t\t\t\t\t<img src=\"img/${id}.jpg\">\n//\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<h4>Webtype: ${webtype}</h4>\n//\t\t\t\t\t\t<p>Gender: ${gender}</p>\n\t\t\t\t\t`);\n });\n }\n });\n }", "loadCards(){\n let cards = require(\"C:\\\\Users\\\\Tony\\\\Desktop\\\\Programming\\\\Yugiosu\\\\Yugiosu - Python (Discord)\\\\yugiosu discord bot\\\\cogs\\\\Yugiosu\\\\cards.json\");\n for(let card of cards){\n this.cards[card[\"id\"]] = new Card(card['id'], card[\"name\"], card[\"cardtype\"], card[\"copies\"], card[\"description\"], card[\"properties\"]);\n }\n }", "function cardArray(cardString){\n if (cardString){\n return cardString.replace(/[\\,\\[\\]]/g,'').trim().split(' ')\n }\n else return null\n}", "function getCards() {\n // Array to hold Suites\n var suites = ['Diamonds', 'Spades', 'Hearts', 'Clubs'];\n // Array to hold non-numeric card faces \n var faceCards = ['J', 'Q', 'K', 'A'];\n\n // Array to hold Cards\n var cards = [];\n\n // Loop for each Suite\n var currentCardIndex = 0;\n for (var suite in suites) {\n // Loop for numeric cards\n for (var i = 2; i <= 10; i++) {\n cards.push(createCard(i, suites[suite], currentCardIndex));\n currentCardIndex++;\n }\n // Loop for non-numeric cards\n for (var face in faceCards) {\n cards.push(createCard(faceCards[face], suites[suite], currentCardIndex));\n currentCardIndex++;\n }\n currentCardIndex = 0;\n}\n\n // Return Array of Card Objects\n return cards;\n}", "function filterCardData(data) {\n\tvar final = [];\n\n\tfor (var i = 0; i < data.length; i++) {\n\t\tvar curr = data[i];\n\t\tvar temp = {\n\t\t\tartists: curr.artists,\n\t\t\tid: curr.id,\n\t\t\tname: curr.name,\n\t\t\tpreview_url: curr.preview_url,\n\t\t\tseconds: (curr.duration_ms / 1000)\n\t\t};\n\t\tfinal.append(temp);\n\t}\n\n\treturn final;\n}", "async function getCards() {\n const response = await fetch(`/api/pokemon/${pokemon_name}`);\n const cards = response.json();\n return cards;\n }", "function lolCards(data){ \n document.getElementById(\"root\").innerHTML= \"\";\n let all = [];\n for(let i = 0; i < data.length; i++){\n all.push(`<div class=\"col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12\">\n <div class=\"card\" style=\"width: 18rem;\">\n <img src=\"${data[i].splash}\" id=\"img\" class=\"img-fluid\" alt=\"splashChampion\">\n <div class=\"card-body\">\n <h3 class=\"card-title\">${data[i].name}</h3>\n <p class=\"card-subtitle\">${data[i].title}</p>\n <p class=\"card-subtitle1\">${data[i].tags.join(\" \")}</p>\n </div>\n <button type=\"button\" class=\"buttonChamp btn2 btn-outline-dark\">More information</button>\n </div>\n </div>`);\n }\n return all;\n}", "function getCardsData() {\n const cards = JSON.parse(localStorage.getItem('cards'));\n return cards === null\n ? [\n {\n question: 'What must a variable begin with?',\n answer: 'A letter, $ or _',\n },\n {\n question: 'What is a variable?',\n answer: 'Container for a piece of data',\n },\n {\n question: 'Example of Case Sensitive Variable',\n answer: 'thisIsAVariable',\n },\n ]\n : cards;\n }", "function indexPull() {\n $.get(\"http://10.1.254.102/Smoelenboek-3.0/PHP_JSON.php\", function(data, status){\n \n //Iterate through the JSON array for all entries\n for (x in data) {\n createAddresCardFromArray(data,x);\n }\n });\n }", "static createListFromJson(jsonObj)\n\t{\n\t\tvar answer = [];\n\t\tfor (var publicationIndex = 0; publicationIndex < jsonObj.length; publicationIndex++)\n\t\t{\n\t\t\tanswer.push(PublicationCard.createFromJson(jsonObj[publicationIndex]));\n\t\t}\n\t\treturn answer;\n\t}", "function loadCards() {\n\tfs.readFile(cardsFile, 'utf8', function(err, contents) {\n\t\tif (err) {\n\t\t\treturn console.log('Failed to read card tokens from disk: ' + err);\n\t\t}\n\t\ttry {\n\t\t\tcards = contents ? JSON.parse(contents) : {};\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log('Failed to parse card tokens data: ' + err);\n\t\t}\n\t});\n}", "function createCards(data) {\n document.getElementById(\"card-container\").innerHTML = \"\";\n\n // Loop over the data to create HTML div elements\n for (let i = 0; i < data.length; i++) {\n let num = i;\n let card = document.createElement(\"div\");\n let cardLabel = document.createElement(\"h3\");\n let cardBody = document.createElement(\"p\");\n let cardCode = document.createElement(\"strong\");\n\n // Add the content to each HTML element based on the data\n cardLabel.innerHTML = data[i].label;\n cardBody.innerHTML = data[i].name;\n cardCode.innerHTML = data[i].plusCode;\n\n // Some Fizz / Buzz Fun\n if (num % 3 == 0 && num % 5 == 0) {\n cardBody.className = \"light-red\";\n } else if (num % 3 == 0) {\n cardBody.className = \"light-blue\";\n } else if (num % 5 == 0) {\n cardBody.className = \"medium-green\";\n } else {\n cardBody.className = \"charcoal\";\n }\n\n // Assemble the card elements here\n card.appendChild(cardLabel);\n card.appendChild(cardBody);\n card.appendChild(cardCode);\n\n card.className = \"card\";\n\n // Attach each card to the card container grid here\n document.getElementById(\"card-container\").appendChild(card);\n }\n }", "static getCards() {\n\t\t//Cards\n\t\tvar cards = [];\n\t\t//Get cards from the card box\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"cardbox\").children));\n\t\t//Get cards from the three mason columns\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol1\").children));\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol2\").children));\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol3\").children));\n\t\t//Get cards from the holding box\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"inactivecards\").children));\n\t\t//Return the cards\n\t\treturn cards;\n\t}", "function generateCards(results) {\n\n var resultsDiv = document.querySelector('#card-append')\n resultsDiv.textContent = \"\";\n\n let generatedCards= '';\n //every time we are looping through the results, create a card using the format in the HTML\n results.map(result => {\n console.log(result)\n generatedCards +=\n `\n<div class=\"card column is-one-quarter\">\n <div class=\"card-image\">\n <figure class=\"image is-4by3\">\n \n <img src= \"${result.recipe.image}\" alt=\"Placeholder image\">\n </figure>\n </div>\n <div class=\"card-content\">\n <div class=\"media\">\n <div class=\"media-left\">\n </div>\n <div class=\"media-content\">\n <p class=\"title is-4\">${result.recipe.label}</p>\n </div>\n </div>\n \n <div class=\"calories\">\n <strong> Cuisine Type: </strong>${result.recipe.cuisineType}\n <br>\n <strong> Calories: </strong>${result.recipe.calories.toFixed(0)}\n <br>\n \n <a class=\"view-btn\" target=\"_blank\" href=\"${result.recipe.url}\">View Recipe</a> \n </div>\n </div>\n </div>\n`\n})\nsearchRecipe.innerHTML = generatedCards;\n}", "function populateReviewCards(){\n \n var reviewCards = '';\n\n $.getJSON('reviews/reviewlist',function(data){\n\n $.each(data,function(){\n \n reviewCards += '<article class=\"card\">';\n reviewCards += '<header><h3>' + this.title + \"</h3></header>\";\n reviewCards += '<img src='+ this.image + \"><hr>\";\n reviewCards += '<body><p>' + this.review + \"</p></body><footer>\";\n reviewCards += '<div class=\"flex full four-500\">';\n reviewCards += '<div><h4>Milk: '+ this.milk_stars +'/5</h4></div>';\n reviewCards += '<div><h4>Tea: '+ this.tea_stars +'/5</h4></div>';\n reviewCards += '<div><h4>Aftertaste: '+ this.aftertaste_stars +'/5</h4></div>';\n reviewCards += '<div><h4>Overall: '+ this.overall_stars +'/5</h4></div></div>';\n reviewCards += '<p>Posted on: '+this.date+' | Last Edited: '+this.datem+'</p></footer>';\n reviewCards += '</article>';\n \n });\n\n $('#cards').html(reviewCards);\n });\n}", "function createCard(data) {\n var html = data.map(item => `\n <div class=\"card\">\n <div class=\"image\">\n <img src=\"${item.image}\" alt=\"product\"/>\n </div>\n <div class=\"info\">\n <span>${item.name}</span>\n <p>${item.description}</p>\n <p>De: R$${item.oldPrice},00</p>\n <p>Por: R$${item.price},00</p>\n <p>ou ${item.installments.count}x de \n R$${item.installments.value.toFixed(2).replace(\".\", \",\")}</p>\n <input class=\"btn\" type=\"button\" value=\"Comprar\"/>\n </div>\n </div>`\n ).join(\"\");\n document.querySelector(\"#cards\").innerHTML += html;\n}", "function readJSON() {\r\n\r\n $.getJSON(\"resources/damageTypes.json\", function (json) {\r\n var i = 1;\r\n for (const key of Object.keys(json)) {\r\n damageCards(json[key], i++);\r\n }\r\n });\r\n\r\n}", "function atualizaCards(){\n\t$.getJSON('mq.json', function(data){\n changeStatus('.card',false);\n\t\tfor(i=0; i < data.length; i++){\n for(j=0; j < data[i].problemas.length; j++){\n var erro = data[i].problemas[j].erro;\n console.log(erro);\n if (erro.search(\"ATMWEB\") > -1 ){\n changeStatus(\".seguranca\",true);\n }\n if(erro.search(\"9201\") > -1){\n changeStatus(\".integrado2\",true);\n }\n if(erro.search(\"9204\") > -1){\n changeStatus(\".integrado\",true);\n }\n if(erro.search(\"SIMUISO\") > -1){\n changeStatus(\".sistemico\",true);\n }\n }\n\t\t}\n\t});\n}", "function convertDeckCard(card) {\n if (Array.isArray(card)) {\n return card.map(convertDeckCard);\n }\n if (card.cardID) {\n return card;\n }\n return {\n tags: [],\n colors: card.details.colors,\n cardID: card.details._id,\n cmc: card.details.cmc || 0,\n type_line: card.details.type,\n };\n}", "function setArr() {\n\n\n//set array to equal to parse json file \n\tarray = JSON.parse (this.responseText)\n\n//called outputCards with array passed into it\n\toutputCards(array);\n}", "function buildCards(data) {\n // Perform POST call to send params and get back results\n postCall('http://api.fitstew.com/api/gymSearchAdvanced/',data, function(obj) {\n // Loop through each result and create card\n if(!obj.status) {\n\t\t $.each( obj, function( key, value ) {\n\t\t $('#partnerBlock').html('<div class=\"box\"><div class=\"gtitle\" data-gid=\"' + value.id + '\" data-addr=\"' + value.address + ', ' + value.city +', ' + value.state + ' ' + value.zipcode + '\" data-email=\"' + value.email + '\" data-phone=\"' + value.phone + '\" data-facebook=\"' + value.facebook + '\" data-twitter=\"' + value.twitter + '\" data-monday=\"' + value.monday + '\" data-tuesday=\"' + value.tuesday + '\" data-wednesday=\"' + value.wednesday + '\" data-thursday=\"' + value.thursday + '\" data-friday=\"' + value.friday + '\" data-saturday=\"' + value.saturday + '\" data-sunday=\"' + value.sunday + '\">' + value.name + '</div><div class=\"glogo\"><img src=\"' + value.image + '\"></div><div class=\"gdistance\">' + value.distance + '</div><div class=\"gmatches\">' + value.matched + '</div></div>');\n\t\t \n\t\t });\n\t\t // Call attachedCards function\n\t\t attachCards();\n\t } else {\n\t\t $('#partnerBlock').html('<div class=\"searchError\">No Results Found</div>');\n\t }\n\t });\n }", "function scrapeCard(element, $) {\n element = $(element);\n var card = {};\n\n //Get the card images\n var $images = element.find(\".scan.left\");\n card.smallImg = $images.find(\"img\").attr(\"src\");\n card.largeImg = $images.find(\"a\").attr(\"href\");\n\n var $card = element.find(\".card\");\n\n //Get the title and set name from the title bar\n var titleArray = $card.find(\"h2.entry-title\").text().match(/(.+) \\((.+)\\)/);\n card.name = titleArray[1];\n card.set = titleArray[2];\n\n //Get the type\n var $p = $card.find(\".tabs-wrap [id^=text-]>p\");\n readCardParagraphs($p, card, $);\n\n return card;\n}", "async function findData() {\r\n try {\r\n\r\n\r\n const res = await fetch(\"https://thronesapi.com/api/v2/characters\");\r\n\r\n const data = await res.json();\r\n\r\n // Method 1 to dispaly content 1 by one using math random\r\n\r\n let jarvis = data[Math.floor((Math.random() * 50) + 1)];\r\n\r\n document.querySelector(\"#output\").innerHTML=jarvis.title;\r\n document.querySelector(\"#output1\").innerHTML=jarvis.family;\r\n document.querySelector(\"#output2\").innerHTML=jarvis.fullName;\r\n document.querySelector(\"#output3\").src= jarvis.imageUrl;\r\n\r\n \r\n // Method 2 is commented as below to display all content in one shot\r\n\r\n\r\n\r\n // for (let i = 1; i < data.length; i++) \r\n // {\r\n // const card = document.querySelector(\".card\");\r\n\r\n // // using template literal displaying content in DOM\r\n // const container = document.createElement(\"div\");\r\n // container.innerHTML = `\r\n // <img src=\"${data[i].imageUrl}\"> <br>\r\n // <span>Title :${data[i].title}</span> <br>\r\n // <span>Family :${data[i].family}</span><br>\r\n // <span>Full Name :${data[i].fullName}</span><br>\r\n \r\n // <hr>`;\r\n // // appended the container \r\n // card.append(container);\r\n // }\r\n \r\n } catch (err) {\r\n console.log(err, \"unable to get data\");\r\n }\r\n}", "function getCardsData() {\n const cards = JSON.parse(localStorage.getItem('cards')); // parse string to array\n return cards === null ? [] : cards; // return empty array if it's equal null - else return cards => shorter ver. of if\n}", "function getCardsData() {\n const cards = JSON.parse(localStorage.getItem('cards'))\n return cards === null ? [] : cards\n}", "function getAllCards(set, channelID, verbose = false) {\n // Read which cards are already saved\n let fileName = getFilename(set, channelID);\n let savedCardlist = JSON.parse(\"[]\");\n fs.exists(fileName, (exists) => {\n if (!exists) {\n // If data file doesn't exist yet, make an empty one\n fs.writeFile(fileName, \"[]\", (err) => {\n if (err) console.log(getDate() + err);\n console.log(getDate() + \"Successfully written to file \" + fileName + \".\");\n });\n }\n else {\n // If data file does exist, try to read it\n try {\n fs.readFile(fileName, function(err, buf) {\n if (err) console.log(getDate() + err);\n savedCardlist = JSON.parse(buf);\n console.log(getDate() + \"Successfully read file \" + fileName + \".\");\n });\n }\n catch(error) {\n console.log(getDate() + \"Something went wrong with parsing data from existing saved file.\");\n console.log(getDate() + error);\n return;\n }\n }\n\n if (verbose) {\n bot.sendMessage({\n to: channelID,\n message: 'Trying to get newly spoiled cards from set with code ' + set + '...',\n });\n }\n\n // Make a request to the Scryfall api\n const https = require('https');\n https.get('https://api.scryfall.com/cards/search?order=spoiled&q=e%3A' + set + '&unique=prints', (resp) => {\n let data = '';\n\n // A chunk of data has been received.\n resp.on('data', (chunk) => {\n data += chunk;\n });\n\n // The whole response has been received.\n resp.on('end', () => {\n try {\n // Parse the data in the response\n cardlist = JSON.parse(data);\n }\n catch(error) {\n console.log(getDate() + \"Something went wrong with parsing data from Scryfall.\");\n console.log(getDate() + error);\n return;\n }\n var newCardlist = [];\n if (cardlist.object == 'list' && cardlist.total_cards > 0) {\n // For every card: check if it's already save, otherwise at it to the new list\n cardlist.data.forEach(function(card) {\n cardId = card.id;\n\n if (!savedCardlist.some(c => c == cardId)) {\n newCardlist.push(card);\n savedCardlist.push(cardId);\n }\n });\n\n // If new list is empty, no new cards were found\n if (newCardlist.length <= 0) {\n console.log(getDate() + 'No new cards were found with set code ' + set);\n if (verbose) {\n bot.sendMessage({\n to: channelID,\n message: 'No new cards were found with set code ' + set + '.',\n });\n }\n }\n else {\n // If new list wasn't empty, send one of the new cards to the channel every second\n console.log(getDate() + newCardlist.length + ' new cards were found with set code ' + set);\n var interval = setInterval(function(cards) {\n if (cards.length <= 0) {\n console.log(getDate() + 'Done with sending cards to channel.');\n clearInterval(interval);\n }\n else {\n // Get all relevant data from the card\n let card = cards.pop();\n cardName = card.name;\n console.log(getDate() + 'Sending ' + cardName + ' to channel.');\n cardImageUrl = card.image_uris.normal;\n cardText = card.oracle_text;\n cardCost = card.mana_cost.replace(new RegExp('[{}]','g'), '');\n cardType = card.type_line;\n cardRarity = card.rarity;\n cardFlavourText = card.flavor_text;\n\n // Construct the discord message\n var message = '**' + cardName + '** - ' + cardCost + '\\n' \n + cardType + ' (' + cardRarity + ')\\n' \n + cardText + '\\n';\n if (cardFlavourText != undefined) {\n message = message + '_' + cardFlavourText + '_\\n';\n }\n message = message + cardImageUrl;\n\n bot.sendMessage({\n to: channelID,\n message: message,\n });\n }\n }, 1000, newCardlist);\n\n try {\n // Save the updated list of saved cards to the datafile\n let savedCardlistJSON = JSON.stringify(savedCardlist);\n fs.writeFile(fileName, savedCardlistJSON, function(err) {\n if (err) console.log(getDate() + err);\n console.log(getDate() + 'New card list has succesfully been saved!');\n });\n }\n catch(error) {\n console.log(getDate() + \"Something went wrong with saving new data.\");\n console.log(getDate() + error);\n return;\n }\n }\n }\n else {\n bot.sendMessage({\n to: channelID,\n message: 'Did not find any card with set code ' + set + '.',\n });\n }\n });\n\n }).on(\"error\", (err) => {\n console.log(getDate() + \"Error: \" + err.message);\n bot.sendMessage({\n to: channelID,\n message: 'Error trying to get cards with set code ' + set + './n' +\n 'Check the console for more details.',\n });\n });\n });\n}", "function getCardsData() {\n const cards= JSON.parse(localStorage.getItem('cards'));\n // if cards is null return an empty array else cards \n return cards === null ? [] : cards;\n }", "function drawCards(filteredCharacters) {\n\n\tconst searchOutput = document.querySelector('.cards');\n\tlet output = '';\n\t//* Se recorre el arreglo y se genera una tarjeta por cada elemento\n\tfilteredCharacters.forEach(champion => {\n\n\t\toutput += `\n\t\t<div class=\"container\">\n\t\t\t<div class=\"card\">\n\t\t\t\t<h1>${champion.name}</h1>\n\t\t\t\t<img src=\"${champion.img}\" width=\"90px\" height=\"90px\"> <br>\n\t\t\t\t<p class=\"title\">Stats:</p>\n\t\t\t\t<p>Attack: ${champion.info.attack}</p>\n\t\t\t\t<p>Defense: ${champion.info.defense}</p>\n\t\t\t\t<p>Magic: ${champion.info.magic}</p>\n\t\t\t\t<p>Difficulty: ${champion.info.difficulty}</p> <br>\n\t\t\t\t<!-- Trigger/Open The Modal -->\n\t\t\t\t<p><button class=\"more\" id=\"${champion.name}\">More</button></p>\n\t\t\t</div>\n\t\t\t<!-- The Modal -->\n\t\t\t<div id=\"${champion.name}myModal\" class=\"modal\">\n\t\t\t\t<!-- Modal content -->\n\t\t\t\t<div class=\"row modal-content\">\n\t\t\t\t\t<span class=\"close\" id=\"${champion.name}Close\">&times;</span>\n\t\t\t\t\t<div class=\"column\">\n\t\t\t\t\t\t<h2><p> ${champion.name} <p></h2><br/>\n\t\t\t\t\t\t<p><img src=\"${champion.splash}\" width=\"100%\" height=\"100%\"></p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"column\">\n\t\t\t\t\t\t<p>hp: ${champion.stats.hp}</p>\n\t\t\t\t\t\t<p>hpperlevel: ${champion.stats.hpperlevel}</p>\n\t\t\t\t\t\t<p>mp: ${champion.stats.mp}</p>\n\t\t\t\t\t\t<p>mpperlevel: ${champion.stats.mpperlevel}</p>\n\t\t\t\t\t\t<p>movespeed: ${champion.stats.movespeed}</p>\n\t\t\t\t\t\t<p>armor: ${champion.stats.armor}</p>\n\t\t\t\t\t\t<p>armorperlevel: ${champion.stats.armorperlevel}</p>\n\t\t\t\t\t\t<p>spellblock: ${champion.stats.spellblock}</p>\n\t\t\t\t\t\t<p>spellblockperlevel: ${champion.stats.spellblockperlevel}</p>\n\t\t\t\t\t\t<p>attackrange: ${champion.stats.attackrange}</p>\n\t\t\t\t\t\t<p>hpregen: ${champion.stats.hpregen}</p>\n\t\t\t\t\t\t<p>hpregenperlevel: ${champion.stats.hpregenperlevel}</p>\n\t\t\t\t\t\t<p>mpregen: ${champion.stats.mpregen}</p>\n\t\t\t\t\t\t<p>mpregenperlevel: ${champion.stats.mpregenperlevel}</p>\n\t\t\t\t\t\t<p>attackdamage: ${champion.stats.attackdamage}</p>\n\t\t\t\t\t\t<p>attackdamageperlevel: ${champion.stats.attackdamageperlevel}</p>\n\t\t\t\t\t\t<p>attackspeedoffset: ${champion.stats.attackspeedoffset}</p>\n\t\t\t\t\t\t<p>attackspeedperlevel: ${champion.stats.attackspeedperlevel}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t`;\n\t\treiniciar.style.display = \"block\";\n\t\tordenar.style.display = \"block\";\n\t});\n\n\n\tsearchOutput.innerHTML = output;\n\n\tlet buttonsMore = document.querySelectorAll(\".more\");\n\tconsole.log(buttonsMore);\n\n\tbuttonsMore.forEach(button => {\n\t\tbutton.addEventListener(\"click\", function () {\n\n\t\t\t// Get the modal\n\t\t\tvar modal = document.getElementById(button.id + \"myModal\");\n\t\t\tconsole.log(\"modal\", modal);\n\n\t\t\n\n\t\t\t// Get the <span> element that closes the modal\n\t\t\tvar span = document.getElementById(button.id + \"Close\");\n\t\t\tconsole.log(span);\n\n\t\t\t// When the user clicks on the button, open the modal \n\n\t\t\tmodal.style.display = \"block\";\n\n\t\t\t// When the user clicks on <span> (x), close the modal\n\t\t\tspan.onclick = function () {\n\t\t\t\tmodal.style.display = \"none\";\n\t\t\t};\n\n\t\t\t// When the user clicks anywhere outside of the modal, close it\n\t\t\twindow.onclick = function (event) {\n\t\t\t\tif (event.target == modal) {\n\t\t\t\t\tmodal.style.display = \"none\";\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t});\n}", "function getCard() {\n\tlet json = {};\n\n\tlet deck = createDeck();\n\tlet random = Math.floor(Math.random() * deck.length);\n\n\tlet fileName = \"development/\" + deck[random];\n\tlet info = fs.readFileSync(fileName, 'utf8');\n\tlet lines = info.split(\"\\n\");\n\n\tjson[\"name\"] = lines[0];\n\tjson[\"description\"] = lines[2];\n\n\treturn json;\n}", "getCardFromMatchingText(matchingText, object, currentTasklist) {\n // if object is a card\n if (object === \"card\") {\n // return card with matchingText as it's name \n return this.allData.data.currentProject.taskLists.find(taskList => taskList.name === currentTasklist).cards.find(card => card.name === matchingText);\n }\n // if object is a comment \n else if (object === \"comment\") {\n // return card which the following is true: card.comment.description === matchingText \n return this.allData.data.currentProject.taskLists.find(taskList => taskList.name === currentTasklist).cards.find(card => card.comments.find(comment => comment.description === matchingText));\n } else if (object === \"tag\") {\n return this.allData.data.currentProject.taskLists.find(taskList => taskList.name === currentTasklist).cards.find(card => card.tags.find(tag => tag.name === matchingText));\n } else {\n console.log(\"Something's wrong, getCardFromMatchingText() was called and didn't return a card\");\n }\n }", "function displayCharacterCards(postResponse) {\r\n // first empty any append html so get ready to display charcaters\r\n clearCards();\r\n //$('.characters-container').empty();\r\n\r\n postResponse.forEach( (character, index) => {\r\n // define the html to append for each character \r\n var htmlToAppend = \r\n \"<div class=\\\"character-info\\\">\" +\r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"id-\" + index + \"\\\">Id:</label>\" + \r\n \"</div>\" + \r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"name-\" + index + \"\\\">Name:</label>\" + \r\n \"</div>\" + \r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"occupation-\" + index + \"\\\">Occupation:</label>\" + \r\n \"</div>\" + \r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"debt-\" + index + \"\\\">Debt:</label>\" + \r\n \"</div>\" + \r\n \"<div class=\\\"block\\\">\" + \r\n \"<label id=\\\"weapon-\" + index + \"\\\">Weapon:</label>\" + \r\n \"</div>\" +\r\n \"</div>\";\r\n\r\n $('.characters-container').append(htmlToAppend);\r\n \r\n // append values of each character\r\n appendCharacterElements(character, index);\r\n \r\n }, this);\r\n}", "function hideCards() {\n\tlet cards = document.getElementsByClassName(\"text\");\n\tfor (var i = 0; i < cards.length; i++) {\n\t\tcards[i].style.display = \"none\";\n\t}\n}", "function strToCards(s) {\n let result = [];\n let card = {};\n for (let i = 0; i < s.length; i++) {\n if (i % 2 == 0) {\n card.value = Number(s[i]);\n card.rendered = s[i].replace('T', '10');\n if (isNaN(card.value)) {\n card.value = CARD_VALUE[s[i]];\n }else{\n card.value--;\n }\n } else {\n card.suit = s[i];\n card.rendered += SUIT[s[i]];\n result.push(card);\n card = {};\n }\n }\n return result;\n}", "function cardsOnScreen(cards) {\n var divContent = document.getElementById(\"container\");\n var str = \"\";\n for(var i=0; i<cards.length; i++) {\n\n str+= `<div id=\"${cards[i].id}\" class=\"game-card\">\n <div class=\"game-card-inner\">\n <div class=\"back rounded\">${cards[i].content}</div>\n <div class=\"front rounded\"></div>\n </div>\n </div>`; \n }\n\n divContent.innerHTML = str;\n}", "function loadCards(e){\n e.preventDefault();\n let xhrLoadCbh = new window.XMLHttpRequest();\n xhrLoadCbh.open(\"GET\", \"/cards/page\");\n xhrLoadCbh.setRequestHeader(\"Content-Type\", \"application/json\");\n xhrLoadCbh.send(JSON.stringify(null));\n xhrLoadCbh.onload = function() {\n let res = JSON.parse(xhrLoadCbh.response);\n if (xhrLoadCbh.readyState == 4 && xhrLoadCbh.status == \"200\"){\n document.getElementById(\"panel1\").innerHTML=res.panel1;\n } else {\n console.error(res);\n }\n }\n}", "function getCards() {\n var cards = [];\n var keys = Object.keys(data);\n // Condition that allows user to filter ingredients by categories or search for them\n if (keys !== 0) {\n keys.forEach((ingredient) => {\n if (\n (filter === \"Filter by Group...\" ||\n filter.includes(data[ingredient][\"categories\"])) &&\n (search === \"\" ||\n ingredient.toLowerCase().includes(search.toLowerCase()))\n ) {\n cards.push(\n <Col key={ingredient} lg={6} style={{ paddingBottom: \"25px\" }}>\n <IngredientCard\n ingredient={data[ingredient]}\n setDetails={setDetails}\n details={details}\n />\n </Col>\n );\n }\n });\n return cards;\n }\n }", "function filterIsCard(array) {\n return array.filter(function(item) {\n return item.type === 'card';\n });\n }", "function processResults(json) {\n // clear the current results\n\n $(\".contentList\").empty();\n var card = $(\"<div>\");\n var card = $(\"<div>\");\n var cardContent = $(\"<div>\");\n var cardHeader = $(\"<div>\");\n var cardHeaderText = $(\"<p>\");\n\n card.addClass(\"card\");\n cardHeader.addClass(\"card-header\");\n cardContent.addClass(\"card-content\");\n cardHeaderText.addClass(\"card-header-title\");\n cardHeaderText.text(\"Social Media\")\n\n\n cardHeader.append(cardHeaderText);\n card.append(cardHeader);\n card.append(cardContent);\n card.appendTo(\".contentList\");\n\n // add the current searches number of articles\n $('.card-content').append(`TOTAL ARTICLES FOUND: ${json.totalArticles}`);\n\n // get all articles models\n newsArray = [...json.articles];\n console.log(newsArray.length)\n\n getRedditResults();\n}", "getAllPossible(category){\n let res = [];\n for (let item of json.jsonArray){\n if(item.key === category){\n for(let character of item.value){\n res.push(character);\n }\n }\n }\n return res;\n }", "function addCardsToDisplaySection(data){\n displaySection.innerHTML = \"\";\n\n for(const item of data.Search){\n // console.log(item);\n // console.log(item.Title);\n // console.log(item.Poster);\n makeCards(item.Poster, item.Title, item.imdbID);\n }\n }", "renderCards(cards) {\n return cards.map((card, i) => <Card key={i} payload={card.structValue} />);\n }", "function listBasicCards() {\r\n fs.readFile(\"./basicCard.txt\", \"utf-8\", function(error, data) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n\r\n console.log(data);\r\n })\r\n}", "function renderAllCards(arrayQuotes){\r\n const grilla = document.getElementById(\"cards\");\r\n let contenido = \"\";\r\n for (const card of arrayQuotes) {\r\n contenido += quoteCardTemplate(card);\r\n }\r\n grilla.innerHTML = contenido;\r\n}", "getEnrolledCards() {\r\n return this.context.enrollService\r\n .GetEnrollmentData(this.context.getUser(), core.Credential.SmartCard)\r\n .then(data => JSON.parse(core.Utf8.fromBase64Url(data)));\r\n }", "function newCard(json){\n\t// Insert Card\n\tdocument.getElementById(\"frame\").innerHTML += json.body;\n\t\n\t// Init drawer if the canvas is present\n\tif (document.getElementById(\"canvas\") != null)\n\t\tinitDrawer();\n\t\t\n\tif (document.getElementsByClassName(\"jscolor\") != null)\n\t\tinitJSColor();\n\t\n\t// Theme and animate if we need to swap cards\n\tlet cards = document.getElementsByClassName(\"card\");\n\tif (cards.length == 2){\n\t\tpopulatePage(json, cards[1]);\n\t\ttheme(cards[1]);\n\t\t\n\t\tif ($(cards[1]).find(\"#timer\")[0] != null)\n\t\t\tstartTimer(60, null);\n\t\t\n\t\ttransitionCards(cards);\n\t} else {\n\t\tpopulatePage(json, cards[0]);\n\t\t\n\t\tif ($(cards[0]).find(\"#timer\")[0] != null)\n\t\t\tcontinueTimer();\n\t\t\n\t\ttheme(cards[0]);\n\t}\n}", "function drawCard(card) {\n\tlet cardHolder = document.createElement('div');\n\tcardHolder.classList.add('card');\n\n\tlet backCard = document.createElement('div');\n\tbackCard.classList.add('backCard');\n\tcardHolder.appendChild(backCard);\n\t// There are no images for all cards (no imageUrl)\n\tlet image = document.createElement(\"img\");\n\tbackCard.appendChild(image);\n\tif (card.imageUrl == undefined) {\n\t\timage.setAttribute(\"src\", \"assets/arena.jpg\");\n\t} else {\n\t\timage.setAttribute(\"src\", card.imageUrl);\n\t};\n\n\tlet frontCard = document.createElement('div');\n\tfrontCard.classList.add('frontCard');\n\tcardHolder.appendChild(frontCard);\n\n\tlet nameC = document.createElement('h3');\n\tnameC.innerText = card.name;\n\tnameC.classList.add('h3-title');\n\tfrontCard.appendChild(nameC);\n\n\tlet artist = document.createElement('p');\n\tartist.innerHTML = `<p>Artist: ${card.artist}</p>`;\n\tartist.classList.add('artist');\n\tfrontCard.appendChild(artist);\n\n\tlet types = document.createElement('p');\n\ttypes.innerText = (card.types) ? card.types.join(', ') : null;\n\tfrontCard.appendChild(types);\n\n\tlet set = document.createElement('p');\n\tset.innerText = card.setName;\n\tfrontCard.appendChild(set);\n\n\tlet colors = document.createElement('p');\n\tcolors.innerText = (card.colors) ? card.colors.join(', ') : null;\n\tfrontCard.appendChild(colors);\n\n\treturn cardHolder;\n}", "function extractCardData(cardData)\n{\n let arr = [];\n for(let j = 0; j < 3; j++)\n arr.push(cardData[j].card_idx);\n return arr;\n}", "function process(json) {\n var movies = [];\n\n json.Movies.forEach(function (movie) {\n var newmovie = {\n 'title' : movie.Title,\n 'poster' : movie.Cover,\n 'torrents' : []\n };\n\n movie.Torrents.forEach(function (torrent) {\n if (config[config.movies].resolutions.indexOf(torrent.Resolution) != -1 &&\n config[config.movies].sources.indexOf(torrent.Source) != -1)\n newmovie.torrents.push(torrent);\n });\n\n if (newmovie.torrents.length)\n movies.push(newmovie);\n });\n\n return movies;\n}", "function scryStripper(obj, section, dfcOnly = false) {\n var sectionData = []\n \n var cardArray = obj.entries[section]\n \n if (dfcOnly == true) {\n var i;\n for (i = 0; i < cardArray.length; i++) {\n var digest = cardArray[i].card_digest;\n if (digest != null) {\n if (digest['image_uris'].hasOwnProperty(\"back\")) {\n sectionData.push({count: cardArray[i].count, name: digest.name, front: digest.image_uris.front, back: digest.image_uris.back});\n }\n }\n }\n }\n else {\n var i;\n for (i = 0; i < cardArray.length; i++) {\n var digest = cardArray[i].card_digest;\n if (digest != null) {\n sectionData.push({count: cardArray[i].count, name: digest.name, front: digest.image_uris.front});\n }\n }\n }\n return sectionData;\n}", "function buildSavedArticleCards(){\n function buildSavedCards(data) {\n var html = `<div class=\"allCards\">`;\n\n data.forEach(function(data) {\n html += `\n <div class=\"card\" data-mongoid=\"${data._id}\">\n <div class=\"card-header\">\n <h3>\n <a class=\"article-link\" target=\"_blank\" rel=\"noopener noreferrer\" href=\"${data.link}\">${data.title}</a>\n <a class=\"btn btn-danger delete\">Delete From Saved</a>\n <a class=\"btn btn-info notes\">Article Notes</a>\n </h3>\n </div>\n <div class=\"card-body\">${data.summary}</div>\n </div>\n `;\n });\n\n html += `</div>`\n return html;\n }\n\n jQuery.ajax({\n method: 'GET',\n url: '/api/articles',\n dataType: 'json',\n success: function(data){\n console.log(data);\n $(\"div.allCards\").remove();\n $(\"div.container-fluid\").append(buildSavedCards(data));\n },\n error: function(e){\n console.error(e)\n }\n });\n}", "function showMovies(){\n let memory = localStorage.getItem(\"MyMovies\");\n console.log(memory);\n let parsedMemory = JSON.parse(memory);\n console.log(parsedMemory);\n\n\n parsedMemory.forEach(movie => {\n \n let cast = movie.cast;\n let castArray = cast.split(\",\");\n \n // append cards\n $(\"#movie-cards\").append(\n `<div class=card><img class=card-img-top src=\"\"></img><div class=card-body><div class=text-center id=card-text><p id = card-title>${movie.title} ${movie.year}</p><p class=card-text id=genre>genre: ${movie.genre}<p class=card-text id=director>dir: ${movie.director}</p><p class=card-text id=cast>top-billed: ${castArray[0]}, ${castArray[1]},</p><p class=card-text id=cast>${castArray[2]}, ${castArray[3]}.</p><p class=card-text id=plot>${movie.plot}</p></div><div class=my-info> <p id=rating>${movie.rating}/5</p><p id=review>${movie.review}</p></div>`\n );\n\n })}", "function showRickandmorty(rickandmorty) {\n for (let i = 0; i < rickandmorty.length; i++) {\n containerRoot.innerHTML += `\n <div>\n <div class=\"Cards\">\n <div class=\"Cards-header\">\n <div class=\"img\">\n <img src=\"${rickandmorty[i].image}\">\n </div>\n <div class=\"Cards-body\"\n <h1>${rickandmorty[i].name}</h1>\n </div>\n </div>\n </div>\n </div>\n `\n\n }\n\n}", "function setCards() {\n let containerCards = document.getElementById('contenedor-pokemon');\n let emptyCard = '';\n data.pokemon.forEach(poke => emptyCard += createCard(poke));\n\n containerCards.innerHTML = emptyCard;\n}", "list () {\n return Object.keys(this.cards);\n }", "function newRndCard() {\n $.getJSON('https://api.scryfall.com/cards/random?q=-type%3Aland+legal%3Alegacy+not%3Atoken+not%3Asplit+not%3Atransform', function (data) {\n saveCard(data);\n })\n }", "function $renderCards(cards){\r\n\t// Number of top cards to display\r\n\tlet counter = STORE.displayedCards;\r\n\tlet topCards = [];\r\n\t// Empty the container in case we refresh\r\n\t$('#clash-cards').empty();\r\n\t// Loop through the array of cards to render applicable data\r\n\tcards.forEach(card => {\r\n\t\t// If the counter hits 0, stop displaying cards\r\n\t\tif(counter > 0){\r\n\t\t\ttopCards.push(card.id);\r\n\t\t\t// Basic DOM object we create and appending info to it\r\n\t\t\tlet $card = $(`<div class=\"card\" data-id=\"${card.id}\">`);\r\n\t\t\t$card.append(`<p class=\"name\">${card.name}</p>`);\r\n\t\t\t$card.append(`<img class=\"app-card\" src=\"${card.cardImg}\" alt=\"${card.name}\">`);\r\n\t\t\t$card.append(`<p class=\"percent\">Win-Rate: <span class=\"perc\">${card.winPerc}%</span></p>`);\r\n\t\t\t$card.append(`<p class=\"use-rate\">Use-Rate: <span class=\"usage\">${card.useRate}%</span></p>`);\r\n\t\t\t// Render the card to the DOM\r\n\t\t\t$('#clash-cards').append($card);\r\n\t\t\t// Remove one from the counter (if 0, stop rendering)\r\n\t\t\tcounter--;\r\n\t\t}\r\n\t})\r\n\treturn topCards;\r\n}", "function getSummaryCardsModel() {\n\tvar model = [];\n\tvar icons = [\"fa-info\",\"fa-signal\",\"fa-exclamation\",\"fa-thumbs-up\",\"fa-tag\"];\n\tvar text = [\"Maharashtra\",\"Tamil Nadu\",\"New Delhi\",\"Uttar Pradesh\",\"Karanataka\"];\n\tvar mDimensions = [\"space\",\"time\"];\n\tvar colors = [\"#FFF\", \"rgb(102, 204, 221)\",\"rgb(255, 187, 34)\",\"rgb(187, 229, 53)\",\"rgb(181, 197, 197)\",\"rgb(245, 101, 69)\"];\n\tfor (var i = 0; i < 20; i++) {\n\t\tvar data = {\n\t\t\t\"id\" : \"card-summary-\"+guid(),\n\t\t\t\"cardtype\" : \"summary-card\",\n\t\t\t\"icon\" : randomElement(icons),\n\t\t\t\"heading\" : Math.floor((Math.random()*9999)),\n\t\t\t\"text\" : randomElement(text),\n\t\t\t\"color\" : randomElement(colors),\n\t\t\t\"orderindex\" : i,\n\t\t\t\"query\" : {\"country\": \"India\"} ,\n\t\t\t\"dimension\" : randomElement(mDimensions)\n\t\t};\n\t\tmodel.push(data);\n\t}\n\treturn model;\n}", "renderCards(cards) {\n return cards.map((card, i) => <Card key={i} payload={card.structValue} />);\n }", "getCardData(cardId) { \n var result = this.deck.filter(card => {\n return card.cardId === cardId;\n });\n return result[0];\n }", "function populateNewsSearchCards(response){\n let newCard = $('<div class=\"card\"');\n $(newCard).attr('id', response.id);\n let cardImage = $('<div class=\"image\"');\n if(response.articles[i].image === null){\n ///Put a radom placeholder \n }else{\n $(cardImage).append('<img src=\"' + response.articles[i].image + '\">');\n }\n newCard.append(cardImage);\n\n let cardContent = $('<div class=\"content\">');\n let cardHeader = $('<div class-=\"header\">').text(response.articles[i].source.name);\n cardContent.append(cardHeader);\n\n let description = $('<div class=\"description\">');\n\n let releaseDate = $('<p>').text('Release Date: ' + response.articles[i].publishedAt);\n description.append(releaseDate);\n\n let articleId = $('<p>').text('News ID: ' + response.id);\n description.append(articleId);\n \n cardContent.append(description);\n newCard.append(cardContent);\n\n $('#news-cards').append(newCard);\n\n}", "function itterateProfiles(array){\n \n const htmlArray = [];\n\n array.forEach(function(item, index){\n \n let profileHTML = createProfileHTMLCards(item);\n htmlArray.push(profileHTML);\n\n })\n\n return htmlArray\n}", "function getAllCardTypes() {\n var allCardTypes = [];\n for (var _i = 0, CARD_SYMBOLS_1 = CARD_SYMBOLS; _i < CARD_SYMBOLS_1.length; _i++) {\n var symbol = CARD_SYMBOLS_1[_i];\n for (var _a = 0, CARD_NAMES_1 = CARD_NAMES; _a < CARD_NAMES_1.length; _a++) {\n var name_1 = CARD_NAMES_1[_a];\n allCardTypes.push({\n symbol: symbol,\n name: name_1,\n color: CARD_COLORS[Math.floor(Math.random() * CARD_COLORS.length)]\n });\n }\n }\n // console.log(`All card types: `); Überprüfen von was erstellt wird\n // console.log(allCardTypes);\n return allCardTypes;\n}", "function displaycard(num){\n for(let i =0; i<num; i++){\n //add details\n let articleEl = document.createElement('article')\n let h2El = document.createElement('h2')\n let imgEl = document.createElement('img')\n let divEl = document.createElement('div')\n let gameEl = document.createElement('span')\n //set class\n articleEl.setAttribute('class', 'card')\n h2El.setAttribute('class', 'card--title')\n imgEl.setAttribute('class', 'card--img')\n divEl.setAttribute('class', 'card--text')\n articleEl.setAttribute('class', 'card')\n h2El.innerText = data[i].name\n // varible\n imgEl.setAttribute('src', data[i].sprites.other[\"official-artwork\"].front_default )\n imgEl.setAttribute('width','256')\n // varible\n const stats = data[i].stats\n for(const item of stats){\n let pEl = document.createElement('p')\n pEl.innerText = `${item.stat.name.toUpperCase()}: ${item.base_stat}`\n divEl.append(pEl)\n }\n // chanllenge1\n const gameIndices = data[i].game_indices\n for(const indice of gameIndices ){\n gameEl.innerText = gameEl.innerText + indice.version.name +'/ '\n divEl.append(\n gameEl\n )\n }\n //chanllenge1\n let sectionEl = document.querySelector('section')\n sectionEl.append(articleEl)\n articleEl.append(h2El, imgEl,divEl)\n } \n}", "displayAvailableCharacters(arr) {\n // clear the current batch of crystals\n $(\"#characterCards\").empty();\n\n for (let i in arr) {\n // Create a bootstrap card for each of the characters \n this.createCharacterCard(i, arr[i], \"#characterCards\");\n }\n }", "function getTweets(json) { return json; }", "function question4() {\n // Answer:\n let woodArray = [];\n for (let i = 0; i < data.length; i++) {\n if (data[i].materials.includes(\"wood\")) {\n woodArray.push(data[i]);\n console.log(data[i].title);\n }\n }\n}", "function renderCard(filterData) {\n card.innerHTML = ''\n // console.log(filterData)\n filterData.forEach(function (data) {\n const content = document.createElement('section');\n content.className = ('container');\n // console.log(data)\n card.appendChild(content).innerHTML += `\n \n <img src=${data.image} alt=\"\" srcset=\"\" style=\"width:200px;height:200px;\">\n <p>${data.name}</p>\n <p>ESTADO: ${data.status}</p>\n <p>ESPECIE: ${data.species}</p>\n <p>ORIGEN: ${data.origin.name}</p>\n <p>LOCALIZACIÓN: ${data.location.name}</p>`\n })\n }", "function getAll_Books()\n{\n //Apaga a area de apresentação\n document.getElementById('apresentacao')? document.getElementById('apresentacao').remove():document.getElementById('apresentacao');\n\n var cardList = getCardList();\n cardList.innerHTML = \"\";\n\n $.ajax({url: \"https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=bGVCvDfP5bmC942U18tq5XYB2YbG0Qpo\", method: \"GET\"})\n .done(function(response) \n { \n if(response.status == \"OK\")\n {\n for (let dado of response.results.books )\n { \n cardList.appendChild(\n createCard(\n \"\", \n dado.rank,\n dado.description,\n \"\",\n dado.book_image\n )\n )\n };\n }\n }) \n}", "function ClozeCard( text, cloze){\n this.text = text;\n this.cloze = cloze;\n this.BasicCards = [];\n\n this.clozed_Text = function(){\n if(!this.clozeValidator()){\n return console.log(\"cloze argument can't be null\");\n }\n else{\n console.log(\"THE CLOZE TEXT: \"+this.cloze);\n return this.cloze;\n }\n };\n\n this.getPartialText = function(){\n if(!this.clozeValidator()){\n return console.log(\"cloze argument can't be null\");\n }\n else{\n var temp = this.text;\n var new_string = temp.replace(this.cloze, '...........');\n console.log(\"THE NEWLY FORMED PARTIAL TEXT: \"+new_string);\n return new_string;\n\n }\n\n }\n\n this.getFullText = function(){\n if(!this.inputTextValidator()){\n return console.log(\"Text argument can't be null\");\n }\n else{\n console.log(\"THE TEXT: \"+this.text);\n if(this.text.includes(this.cloze)){\n return this.text;\n }else{\n return console.log(this.cloze+\" doesn't appear in \"+this.text);\n }\n\n }\n }\n\n this.clozeValidator = function(){\n if(this.cloze.length <=0){\n return false;\n }else{\n return true;\n }\n }\n\n this.inputTextValidator = function(){\n if(this.text.length <=0){\n return false;\n }else{\n return true;\n }\n }\n}", "function makeCards(array) {\n // cards =[];\n fullDeck = [];\n for(let i = 0; i < array.length; i++) {\n fullDeck.push(array[i]);\n }\n //doubles the creation of each card image creating the full deck\n fullDeck = [...fullDeck, ...fullDeck];\n }", "function iterateCardsInfo(n, card_container, array){\n for (var i = 0; i < array.length; ++i) {\n var img_src = array[i].img_src,\n img_alt = array[i].img_alt,\n // pdf_src = urlToOpenPdf + array[i].pdf_src;\n project_name = array[i].project_name,\n project_type = array[i].project_type;\n element_id = i;\n // Cards \n $(card_container).append(createCard(img_src, img_alt, project_name, project_type, element_id));\n }\n }", "getCards(params) {\n return Resource.get(this).resource('Store:getCardsInInventory', params).then(cards => {\n // Reset cards\n this.displayData.cards.electronic = [];\n this.displayData.cards.physical = [];\n // Split the cards into electronic and physical\n cards.map(card => {\n if (card.type === 'electronic') {\n this.displayData.cards.electronic.push(card);\n } else {\n this.displayData.cards.physical.push(card);\n }\n });\n });\n }", "function insertBreeds(json){\n const breeds = Object.keys(json.message);\n const dogList = document.querySelector('ul#dog-breeds');\n\n // Iterate through breeds to display\n breeds.forEach(breed => {\n const li = document.createElement('li');\n li.innerText = breed;\n dogList.appendChild(li);\n dogArray.push(li);\n });\n}", "function viewRecipeCardMaker(text){\n if(ver_tarjeta_receta){\n let card = document.createElement('div');\n card.className = 'big-card';\n card.innerHTML = '<div class=\"big-image\" style=\"background-image: url('+text.img+');\"></div>' +\n '<div class=\"name\">' +\n '<h1>'+text.name+'</h1>' +\n '</div>' +\n '<div class=\"view-other\">' +\n '<p><span>Description: </span><br>'+text.description+'</p>' +\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\n '</div>';\n ver_tarjeta_receta.appendChild(card);\n } \n}", "function useApiData(data) {\n document.querySelector(\"#content\").innerHTML = `\n <div id = \"cardscontainer\">\n <div class=\"row\">\n <div class=\"card\" style=\"width: 18rem;\">\n <img src=\"${data.hits[randomNum].recipe.image}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data.hits[randomNum].recipe.label}</h5>\n <p class=\"card-text\">Some quick example text to build on the card title and make up the bulk of the card's content.</p>\n <a href=\"${data.hits[randomNum].recipe.url}\" class=\"btn btn-primary\">Go somewhere</a>\n </div>\n </div>\n <div class=\"card\" style=\"width: 18rem;\">\n <img src=\"${data.hits[randomNum+1].recipe.image}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data.hits[randomNum+1].recipe.label}</h5>\n <p class=\"card-text\">Some quick example text to build on the card title and make up the bulk of the card's content.</p>\n <a href=\"${data.hits[randomNum+1].recipe.url}\" class=\"btn btn-primary\">Go somewhere</a>\n </div>\n </div>\n <div class=\"card\" style=\"width: 18rem;\">\n <img src=\"${data.hits[randomNum+2].recipe.image}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data.hits[randomNum+2].recipe.label}</h5>\n <p class=\"card-text\">Some quick example text to build on the card title and make up the bulk of the card's content.</p>\n <a href=\"${data.hits[randomNum+2].recipe.url}\" class=\"btn btn-primary\">Go somewhere</a>\n </div>\n </div>\n \n </div>\n\n </div>\n `\n\n\n \n}", "function processData(data) {\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n console.log(data[key].Title);\n\n var title = data[key].Title,\n desc = data[key].Description,\n image = data[key].Image,\n cat = data[key].Category,\n link = data[key].Link;\n\n // If category is new, push to array\n if(catsArray.indexOf(cat) === -1){\n catsArray.push(cat);\n }\n\n // Send data to cards function\n createCards(title,desc,image,cat,link);\n }\n }\n // for (let i = 0; i < data.length; i++) {\n // console.log(data[i]);\n // // Store data as variables\n // var title = data[i].Title,\n // desc = data[i].Description,\n // image = data[i].Image,\n // cat = data[i].Category,\n // link = data[i].Link;\n //\n // // If category is new, push to array\n // if(catsArray.indexOf(cat) === -1){\n // catsArray.push(cat);\n // }\n //\n // // Send data to cards function\n // createCards(title,desc,image,cat,link);\n // };\n\n // Send array to filter function\n createFilter();\n\n // Match colors to categories\n matchColor();\n\n}", "function createDisplay(cards_doc) {\n console.log('start loading cards');\n $.getJSON(cards_doc, function(json) {\n\n // let doc_length = cards_doc.length;\n $.each(json, function(index, card_doc) {\n let { card_id, card_title, OT_tag, how, why, eg_arr } = card_doc;\n if(eg_arr.length == 0) {\n return false;\n }\n\n let NI_id_arr = [];\n eg_arr.forEach(eg => {\n NI_id_arr.push(eg[\"NI_tag_id\"]);\n });\n NI_id_arr.sort();\n\n eg_arr.forEach(eg => {\n let { \n NI_tag_id, NI_tag, \n eg_id, eg_designer, eg_year, eg_source, eg_url\n } = eg;\n \n let NI_joint = $.trim(NI_tag).split(\" \").join(\"-\");\n let card = new AIE_Card({\n card_id, card_title, OT_tag, how, why, \n NI_tag_id, NI_tag, NI_id_arr,\n eg_id, eg_designer, eg_year, eg_source, eg_url\n });\n\n $(`#${NI_joint} > .card-deck`).append(card.drawCard());\n card.cardCreatingComplete();\n });\n\n // if(id == doc_length)\n // console.log(\"All cards are loaded.\");\n });\n });\n\n // deckDisplay();\n // scrollToTop();\n}", "function displayDataCard(data) {\r\n\tlet htmlContent = ''\r\n\tdata.forEach(function (item) {\r\n\t\tlet genresContent = ''\r\n\t\thtmlContent += `\r\n <div class=\"col-sm-3\">\r\n <div class=\"card mb-2\">\r\n <img class=\"card-img-top \" src=\"${POSTER_URL}${item.image}\" alt=\"Card image cap\">\r\n <div class=\"card-body movie-item-body\">\r\n <h6 class=\"card-title\">${item.title}</h5>\r\n\t\t\t</div>\r\n\t\t\t<div class= \"row col-sm-12\" style=\"display:flex;\">\r\n\t\t\t`\r\n\r\n\t\titem.genres.forEach(function (i){\r\n\t\t\tgenresContent += `<div><p style=\"font-size:13px;padding:0 5px;\">${genresArray[i]}</p></div>`\t\t\t\r\n\t\t})\r\n\t\tgenresContent += ` \r\n\t\t </div>\t\t\r\n </div>\r\n\t</div>\t\t\t\t \t \t\r\n`\r\n\t\thtmlContent += genresContent\r\n})\r\n\tdataPanel.innerHTML = htmlContent\r\n\r\n}", "function getHomeData(){\n $.getJSON(\"index.php/getHomeData\", function(jsonObj){\n // can see the object returned\n //var jsonObj = $.parseJSON(rawjson);\n console.log(\"homeData\");\n console.log(jsonObj);\n // get home page text\n $('#title_home').html('<h2>' + jsonObj[0].Title + '</h2>');\n $('#subtitle_home').html('<h3>' + jsonObj[0].Subtitle + '</h3>');\n $('#text_home').html('<p>' + jsonObj[0].Paragraph + '</p>');\n\n var cardhtml = \"\";\n\n // adds the html needed for each card on home page\n for(i = 1; i<jsonObj.length;i++){\n cardhtml += '<div class=\"col-xs-12 col-sm-4 col-xl-3\">';\n cardhtml += '<div class=\"card\">';\n cardhtml += '<a href=\"#\">';\n cardhtml += '<img class=\"card-img-top img-fluid img-thumbnail\" src=\"'+ jsonObj[i].Img +'\">';\n cardhtml += '</a>';\n cardhtml += '<div class=\"card-body\">';\n cardhtml += '<div class=\"card-title\"><h2>' + jsonObj[i].Title + '</h2></div>';\n cardhtml += '<div class=\"card-subtitle\"><h3>' + jsonObj[i].Subtitle + '</h3></div>';\n cardhtml += '<div class=\"card-text\"><p>' + jsonObj[i].Paragraph + '</p></div>';\n cardhtml += '<a href=\"'+ jsonObj[i].Link +'\" class=\"btn btn-primary\">Find out more ...</a>';\n cardhtml += '</div></div></div>';\n }\n $('#cards_home').html(cardhtml);\n });\n}", "function wrapAsArray(card)\n{\n let resultArray = [];\n JSON.stringify(resultArray.push(card));\n return resultArray;\n}", "function genarateCards(){\n const cardHTMLArray = [];\n\n CARD_NAMES.forEach((name, index) => {\n const imageCardHTML = `\n <div class=\"card\" data-id=\"${index}\">\n <div class=\"front-face face\"><img src=\"assets/images/${name}.jpg\"></div> \n <div class=\"back-face face\"><img src=\"assets/images/back.jpg\"></div> \n </div>`;\n const textCardHTML = `\n <div class=\"card\" data-id=\"${index}\">\n <div class=\"front-face face\"><img src=\"assets/images/white.jpg\"><span class=\"card-text\">${name}</span></div> \n <div class=\"back-face face\"><img src=\"assets/images/back.jpg\"></div> \n </div>`;\n\n cardHTMLArray.push(imageCardHTML, textCardHTML);\n });\n cardHTMLArray.sort((a, b) => 0.5 - Math.random());\n document.querySelector('[data-grid]').innerHTML = cardHTMLArray.join('');\n}", "function fillCards(response) {\n // Check how many items are in the array returned\n // do a loop to fill four cards with items 1-4 of the array (item zero is the main card)\n if (response.drinks.length > 4) {\n for (var i = 1; i < 5; i++) {\n var cardID = \"card-\" + i;\n $(\"#\" + cardID).find(\"img\").attr(\"src\", response.drinks[i].strDrinkThumb);\n $(\"#\" + cardID).find(\".card-title\").text(response.drinks[i].strDrink);\n $(\"#\" + cardID).find(\"p\").text(response.drinks[i].strCategory);\n $(\"#\" + cardID).find(\".card-action\").attr(\"href\", \"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=\" + response.drinks[i].strDrink);\n }\n }\n // if there are less than 5 items in the array, fill the remaining cards with random content.\n else {\n for (var i = 1; i < response.drinks.length; i++) {\n var cardID = \"card-\" + i;\n $(\"#\" + cardID).find(\"img\").attr(\"src\", response.drinks[i].strDrinkThumb);\n $(\"#\" + cardID).find(\".card-title\").text(response.drinks[i].strDrink);\n $(\"#\" + cardID).find(\".card-content\").text(response.drinks[i].strCategory);\n $(\"#\" + cardID).find(\".card-action\").attr(\"href\", \"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=\" + response.drinks[i].strDrink);\n }\n\n for (var i = 5; i > response.drinks.length; i--) {\n let cardID = \"card-\" + (i - 1); // if we use var the for loop will finish before the first ajax call comes back, so all the ajax calls will use card-1. \"let\" prevents this.\n var randomURL = \"https://www.thecocktaildb.com/api/json/v1/1/random.php\";\n $.getJSON(randomURL, function (randomCock) {\n $(\"#\" + cardID).find(\"img\").attr(\"src\", randomCock.drinks[0].strDrinkThumb);\n $(\"#\" + cardID).find(\".card-title\").text(randomCock.drinks[0].strDrink);\n $(\"#\" + cardID).find(\".card-content\").text(randomCock.drinks[0].strCategory);\n $(\"#\" + cardID).find(\".card-action\").attr(\"href\", \"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=\" + randomCock.drinks[0].strDrink);\n });\n\n }\n }\n\n\n\n\n}", "getFullList () {\r\n $.ajax({\r\n url : this.BASE_URL + \"/characters\",\r\n method : \"GET\",\r\n success : displayCharacterCards,\r\n error : handleError,\r\n });\r\n }", "function initCardsFromData() {\n for (const cardKey in data.cards) {\n\n const cardElem = memoryGrid.querySelector('[data-card-id=' + cardKey + ']');\n\n cardElem.className = data.cards[cardKey];\n\n if (cardElem.classList.contains(FLIP) ||\n cardElem.classList.contains(MATCH)) {\n // Update aria label to symbol\n cardElem.setAttribute('aria-label', cardElem.dataset.symbol);\n }\n\n memoryGrid.appendChild(cardElem);\n }\n }", "static loadCards() {\n // get languages array from api\n fetch(\"http://localhost:3000/languages\")\n .then(function (response) {\n return response.json();\n })\n .then(function (languages) {\n // save the language object as global variable\n\n compileCards(languages);\n });\n }", "function readMyCards() {\n // Get my cards\n var cards = document.getElementsByClassName('you-player')[0];\n var card1 = cards.getElementsByClassName('card')[0],\n card2 = cards.getElementsByClassName('card')[1];\n\n // Convert each of my cards to string\n var card1String = face[card1.children[0].innerText] + ' of ' + suit[card1.children[1].innerText];\n var card2String = face[card2.children[0].innerText] + ' of ' + suit[card2.children[1].innerText];\n\n return 'Cards in hand are ' + card1String + ' and ' + card2String;\n}", "function listClozeCards() {\r\n fs.readFile(\"./clozeCard.txt\", \"utf-8\", function(error, data) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n\r\n console.log(data);\r\n })\r\n}", "function generateCard(data)\n{\n people = data;\n const contact = data.map(item => `\n <div class=\"card\">\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=${item.picture.medium} alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${item.name.first} ${item.name.last}</h3>\n <p class=\"card-text\">${item.email}</p>\n <p class=\"card-text cap\">${item.location.city}, ${item.location.state}</p>\n </div>\n </div>\n `).join(\"\");\n $gallery.append(contact);\n}", "function Deck() {\n this.names = [2, 3, 4, 5, 6, 7, 8, 9, 10, \"J\", \"Q\", \"K\", \"A\"];\n this.suits = [\"♠\", \"♣\", \"♥\", \"♦\"];\n\n let cards = [];\n\n for (let s = 0; s < this.suits.length; s++) {\n for (let n = 0; n < this.names.length; n++) {\n cards.push(new Card(this.names[n], this.suits[s]));\n }\n }\n\n return cards;\n}", "function getCardsOnPage() {\n const [ cardSectionSelector, cardDigitsSelector ] = setCardSectionSelectors();\n\n const cards = document.querySelectorAll(cardSectionSelector);\n const cardDigits = [];\n cards.forEach((card) => {\n const cardLastFour = card.querySelector(cardDigitsSelector).textContent;\n cardDigits.push( formatCardDigits(cardLastFour) );\n })\n\n\tchrome.runtime.sendMessage({\n\t\taction: \"getCardsOnPage\",\n\t\tnumbers: cardDigits\n\t});\n}", "async function getCards() {\n await connectDB();\n let cards = [];\n let cardLinks = await mongoClient.db(\"memory\").collection(\"cards\").find().toArray();\n for (const i of cardLinks) {\n cards.push(linkToCard(i.link, null));\n }\n return cards;\n }", "function getCards(event) {\n event.preventDefault();\n let inputVal = input.value;\n spinner.style.display = 'block';\n // URL variables för flexibilitet\n let fetchedURL = \"https://www.flickr.com/services/rest/?method=flickr.photos.search\";\n fetchedURL += \"&api_key=\" + apiKey;\n fetchedURL += \"&tags=\" + inputVal;\n fetchedURL += \"&per_page=12\"\n fetchedURL += \"&format=json\";\n fetchedURL += \"&nojsoncallback=1\";\n\n // Skapa en Array som ska vi pusha alla fotorna i\n let cardsArray = [];\n // Skapar en fetch\n fetch(fetchedURL).then(\n function(response) {\n\n // Errorhantering3\n if (inputVal == '') {\n throw 'Search term can not be empty';\n } else {\n if (response.status === 100) {\n throw 'The API key passed was not valid or has expired';\n } else if (response.status === 105) {\n throw 'The requested service is temporarily unavailable'\n } else if (response.status === 106) {\n throw 'The requested operation failed due to a temporary issue.'\n } else if (response.status === 111) {\n throw 'The requested response format was not found'\n } else if (response.status === 112) {\n throw 'The requested method was not found'\n } else if (response.status === 114) {\n throw 'The SOAP envelope send in the request could not be parsed.'\n } else if (response.status === 115) {\n throw 'The XML-RPC request document could not be parsed.'\n } else if (response.status === 116) {\n throw 'One or more arguments contained a URL that has been used for absure on Flickr.'\n } else if (response.status >= 200 && response.status <= 299) {\n return response.json();\n }\n };\n\n }\n ).then(data => {\n // Skapar en for-loop\n for (let i = 0; i < data.photos.photo.length; i++) {\n let id = data.photos.photo[i].id;\n let server = data.photos.photo[i].server;\n let secret = data.photos.photo[i].secret;\n let cardImageSrc = `http://live.staticflickr.com/${server}/${id}_${secret}_q.jpg`;\n // Skapa Card object\n card = new Card(id, cardImageSrc);\n // Pushar in bilderna i arrayn\n cardsArray.push(card);\n }\n\n\n\n // Välja 12 sticker av fotona och dubblar dem och ligga dem i DOM\n let pickedCards = cardsArray.splice(0, 12);\n // Duplicate Fotona\n let dupelicateCardsArr = pickedCards.reduce(function(res, current) {\n return res.concat([current, current]);\n }, []);\n\n //Randomiz arrayen\n let randomizedCards = dupelicateCardsArr.sort(() => Math.random() - 0.5);\n\n // generate korter från arrayen\n spinner.style.display = 'none';\n generateCards(randomizedCards);\n cards = document.querySelectorAll('.card');\n addEventListenerAll();\n startTimer();\n })\n .catch((err) => alert(err));\n}", "function createCards() {\n for (let i = 0; i < imgList.length; i += 1) {\n const cards = document.createElement('div');\n cards.classList.add('card');\n cards.innerHTML = `<div class='back'>${imgList[i]}</div>\n <div class='front'><i class=\"fa fa-line-chart\" style=\"font-size:2em;color:#ffffff;\"></i></div>`;\n cardArray.push(cards);\n }\n // Loops and Shuffles Card Array\n for (let i = cardArray.length - 1; i >= 0; i -= 1) {\n const randomIndex = Math.floor(Math.random() * (i + 1));\n const itemAtIndex = cardArray[randomIndex];\n cardArray[randomIndex] = cardArray[i];\n cardArray[i] = itemAtIndex;\n }\n }", "static async getAllCards() {\n const cards = await db.query(`SELECT * FROM cards`);\n return cards.rows;\n }" ]
[ "0.8210676", "0.6722568", "0.6196194", "0.6124625", "0.6065196", "0.6040029", "0.600154", "0.5948894", "0.58616453", "0.58579737", "0.58498895", "0.584558", "0.57844186", "0.57745796", "0.57662165", "0.57256377", "0.5700944", "0.570047", "0.5642667", "0.5634249", "0.5610377", "0.5605174", "0.55955654", "0.55928147", "0.5585707", "0.55506194", "0.5548447", "0.55360335", "0.5530102", "0.55192083", "0.55070657", "0.55031127", "0.5496301", "0.54814595", "0.548109", "0.5463942", "0.5460211", "0.54568446", "0.54080695", "0.53992647", "0.5396098", "0.5390766", "0.5387381", "0.53821313", "0.53820634", "0.5379249", "0.5377453", "0.5377297", "0.53695166", "0.5365951", "0.53542787", "0.5321686", "0.53211963", "0.531875", "0.53141904", "0.5311582", "0.53109676", "0.5310673", "0.52995837", "0.5291739", "0.52908164", "0.5280484", "0.5278966", "0.5277483", "0.5261413", "0.5258804", "0.5255012", "0.5251087", "0.52413106", "0.52378476", "0.5237601", "0.52366054", "0.5235817", "0.5233131", "0.52317005", "0.52282155", "0.52239645", "0.52133566", "0.52126133", "0.5211459", "0.5203477", "0.5198203", "0.51971066", "0.51963955", "0.5192186", "0.5191022", "0.51887804", "0.5185876", "0.51776755", "0.51754785", "0.5174387", "0.517398", "0.51714593", "0.51679647", "0.51678765", "0.51650614", "0.51589715", "0.51585937", "0.5148993", "0.51457816" ]
0.76214325
1
Variable hoisting: start easy: Why can't we get the console to log any of the a's?
function foo() { var a = 7; function bar() { // var a is hoisted here (don't write this until after) console.log(a) var a = 3 } bar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo() {\n var a;\n console.log( a );\n var a = 2;\n}", "function foo(){\n\ta = 3;\n\n\tconsole.log( a );\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\" to top of foo.\n\n}", "function foo(){\n\ta = 3;\n\n\tconsole.log(a); //3\n\n\tvar a;\t\t// declaration is hoisted at top of foo.\n}", "function foo() {\n a = 3;\n console.log(a); // 3\n var a; // declaration is \"hoisted\"\n // to the top of `foo()`\n }", "function hoistingTest(){\n console.log(c); // display ReferenceError: c is not defined \n console.log(b); // display undefined \n console.log(a); // display ReferenceError: Cannot access 'a' before initialization \n let a = 10; \n var b = 20; \n}", "function foo() {\n\ta = 3;\n\n\tconsole.log( a );\t// 3\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\"\n\t\t\t\t\t\t // to the top of `foo()`\n}", "function funcA() {\n console.log(a);\n console.log(foo());\n var a = 1;\n function foo() {\n return 2;\n }\n}", "function foo() {\n console.log(b);\n var b = 1; // Split out and hoisted to the top\n}", "function foo() {\n\ta = 3;\n\n\t//console.log( a );\t// 3\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\"\n // to the top of `foo()`\n}", "function saminu() {\n var a, A;\n a = 6;\n A =8;\n function foo() {\n return 6;\n }\n console.log(a);\n console.log(A);\n console.log(foo());\n}", "function test() {\n\n console.log(a);\n \n console.log(foo());\n \n var a = 1;\n \n function foo() {\n \n return 2;\n \n }\n \n}", "function funcA() {\n console.log(a);\n console.log(foo());\n var a = 1;\n function foo() {\n return 2;\n }\n}", "function hoistingcheck5(){\n x = 5; \n console.log(x);\n var x;\n} //console returns 5 and undefined", "function funcA() {\n console.log(a);\n console.log(foo());\n\n var a = 1;\n function foo() {\n return 2;\n }\n}", "function hoistDemo(){\n\tconsole.log(i);\n\tvar i = 10;\n}", "function printLet() {\r\n\tif (true) {\r\n\t\tlet a = 10;\r\n\t}\r\n\r\n\t//console.log(a); // not defined\r\n}", "function h() {\r\n const magic = 3;\r\n console.log(magic);\r\n}", "function foo() {\n console.log(age); //undefined, because of Hoisting.\n var age = 65;\n console.log(age); //65\n}", "function foo() {\n expect(a).be.undefined;\n a = 3;\n expect(a).to.eql(3);\n var a; // declaration is \"hoisted\" to the top of `foo()`\n expect(a).to.eql(3);\n }", "function foo() {\n var a;\n console.log(a); // undefined\n a = 2;\n}", "function foo() {\n var a;\n console.log(a); // undefined\n a = 2;\n}", "function one() {\n // this `a` only belongs to the `one()` function\n var a = 1;\n console.log( a );\n}", "function foo() {\n // Hoisting also applies in this function's execution context\n console.log(\"age = \" + age + \" (foo()'s execution context);\");\n // age defined inside here is different compared to the age defined outside this function\n var age = 99; \n console.log(\"age = \" + age + \" (foo()'s execution context);\");\n}", "function foo() {\n var a;\n console.log( a ); // undefined\n a = 2;\n}", "function foo() {\n\ta = 1;\t// `a` not formally declared\n}", "function bar() {\n var a;\n console.log(a); // undefined, a exists!!\n a = 2;\n}", "function a() { // 2.\n b(); // 3.\n var c; // 6.\n}", "function myFunction() {\n console.log(\"Hoisting\");\n}", "function a() {\n console.log('hi')\n}", "function a() {\n console.log('hi')\n}", "function foo() {\n\tvar bar = 'bat'\n\n\tfunction asdf() {\n\t\tconsole.log(bar)\n\t}\n\tasdf() // bat\n}", "function a() {\n console.log('hello');\n}", "function x () {\n var a = 17\n\n function y () {\n console.log(a)\n }\n y()\n}", "function hoistTest(){\n console.log(testVar);\n var testVar = 10\n console.log(testVar) \n}", "function foo() {\n console.log(a) // 2\n}", "function a() {\n console.log('Hi');\n}", "function f_after_js_hoisting(){\n var a,b,c;\n console.log(\"a\",a); //undefined\n a=10;\n console.log(\"a\",a); //10\n if(a>0){\n b=20;\n console.log(\"b\",b); //20\n }\n console.log(\"b\",b); //20\n if(a>100){\n c=30;\n console.log(\"c\",c); //won't enter\n }\n console.log(\"c\",c); //undefined\n}", "function magic() { // 'magic()' also gets hoisted to the top\n var foo; // here 'foo' is declared within 'magic()' and gets hoisted\n foo = \"hello world\"; // we assign a value to our function scoped 'foo'\n console.log(foo); // we log it as 'hello world'\n}", "function walk()\n{\n var a = 101;\n console.log(a)\n}", "function a() {\n console.log('hello')\n}", "function hoisting(){\n // console.log('value='+value); // value=undefined\n const value = 10;\n console.log('value='+value); // value=10\n}", "function magic() {\n\t// 'magic()' also gets hoisted to the top\n\tvar foo; // here 'foo' is declared within 'magic()' and gets hoisted to the top of its scope\n\tfoo = \"hello world\"; // we assign a value to our function scoped 'foo'\n\tconsole.log(foo); // we log it as 'hello world'\n}", "function abc() {\n\n console.log(a); // output ?\n\n var a = 10;\n\n console.log(b); // output ?\n\n let b = 20\n\n}", "function hoistDemo(){\n console.log(i) // if the used variable(i) is not defined in the function scope then js throw an error, but if var i is in function scope\n // but not declared till it's use then js will create a var i and its value will be undefined.\n // this process is called \"Variable Hoisting\"\n var i=10;\n}", "function foo() {\n console.log(a) // 3 not 2\n}", "function foo() {\n alert(a); // Alerts \"0\", because `foo` can access `a`\n }", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "function foo(){\n\t//child Scope\n\tvar b = 2;\n\tvar a = 2;\n\ta = 3;\n\tconsole.log(a);\n\t//console.log(window.a);\n}", "function scopeTest() {\n\n if (true) {\n var a = 123;\n }\n\n console.log(a);\n}", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('Prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "function a(x) {\n console.log(x);\n}", "function logA() {\n console.log(\"A\");\n}", "function hoist() {\n console.log('hoisted to the top');\n}", "function hello(){\n var a = 10 \n hi()\n\n function hi(){\n var b = 20\n console.log(a)\n console.log(b)\n //console.log(c)\n\n bye()\n\n function bye(){\n var c = 90\n console.log(a)\n console.log(b)\n console.log(c)\n }\n }\n}", "function f() {\n (function () {\n x;\n function a() {}\n print(a)\n })()\n}", "function hoistingBonusInAction() {\n // it is possible to use 'var' variable declared further in the function,\n // even in the sub-scope because 'var' are function-scoped.\n // prints 'undefined', because varI is not initialized at this point\n console.log(varI);\n\n varI = 1;\n\n if (varI === 1) {\n // this is where varI is declared:\n var varI;\n }\n\n // prints 1\n console.log(varI);\n}", "function fun() {\n let a = 4;\n console.log(a);\n}", "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function printvar(a)\r\n{\r\n console.log(a);\r\n}", "function hoistingFunc()\n{ \n console.log('hoisting ordinary fufunc')\n \n}", "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function mysteryScoping3() {\n const x = 'out of block';\n if (true) {\n var x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function hi() {\n var name = \"Lucy\";\n console.log(name);\n}", "function test() {\n console.assert(a === undefined)\n console.assert(foo() === 2)\n\n var a = 1\n function foo() {\n return 2\n }\n}", "function test() {\n\n console.assert(a === undefined)\n console.assert(foo() === 2)\n\n var a = 1\n function foo() {\n return 2\n }\n}", "function testScope() {\n//var e is hoisted only to the top of the function, not the global scope. Since this is functional scoped.\n console.log(e); //undefined\n var e = \"I'm a var in a function!\";\n console.log(e); //\"I'm a var in a function\"\n}", "function example2() {\n\n console.log(a); // return undefined (no error)\n var a = 1;\n\n console.log(b); // * Error: variable isn't defined\n var b = 2;\n}", "function mysteryScoping2() {\n debugger\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function foo() {\n bar = 4; // ASSIGN_BEFORE_DECL alarm\n var bar;\n console.log(bar);\n}", "function hoistTest(){\n var testVar;\n console.log(testVar);\n testVar = 10;\n console.log(testVar);\n}", "function hoistTest(){\n console.log(testVar); //logs as undefined because prior to defining testVar...\n var testVar = 10;\n console.log(testVar); //logs 10 because testVar was defined prior line of code ran...\n}", "function something() {\n\tlet ye = 5;\n \tconsole.log(ye);\n}", "function sampleA() {\n\n\t'use strict';\n\n\twindow.console.log(\"Sample A\");\n}", "function a() {\n\tvar myVar = 2;\n\tfunction b() {\n\t\tconsole.log(myVar);\n\t}\n\tb();\n}", "function foo(){\n console.log( 1 );\n}", "function hi(){\r\n\tvar name = \"Chris\";\r\n\tconsole.log(name);\r\n}", "function hoistedFunction() {\n console.log('I work, even if they call me before my definition.');\n}", "function top2() {\n var a;\n function inner() {\n console.log(a);\n }\n inner();\n}", "function b() {\n\tconsole.log(myVar);\n}", "function foo() {\n console.log('aloha');\n }", "function fun () {\n let a = b = 0;\n console.log(a);\n}", "function aFunc() {\n // declaring a here - scoped here\n let a = 1;\n}", "function testShadow(){\n const a = 5;\n if(true){\n const a = 10;\n console.log(a);\n }\n console.log(a);\n}", "function top4(){\n var a;\n function inner1(){\n var b;\n function inner2(){\n console.log(a,b);\n }\n inner2();\n }\n inner1();\n}", "function mysteryScoping2() {\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function b() {\r\n\tconsole.log(myVar);\r\n}", "function hello(){\n console.log(\"Function Declaration\")\n} // function declaration hoistinga uchraydi", "function b() {\n console.log(myVar);\n}", "function b() {\n console.log(myVar);\n}", "function variableHoisting(x){\n console.log(x);\n var y;\n console.log(y); //undefined\n y = 10;\n}", "function test4(){\n console.log(a);\n var a = 5;//default initial value undefined\n}", "function foo() {\n a = 1; // no declaration\n}", "function usingvar (){\n console.log(a); // return undefined\n var a = 10;\n}", "function foo(a) {\n b = a; // it creates var a in global scope\n console.log(a + b);\n}", "function mysteryScoping2() {\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function mysteryScoping2() {\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function mysteryScoping2() {\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}", "function mysteryScoping2() {\n const x = 'out of block';\n if (true) {\n const x = 'in block';\n console.log(x);\n }\n console.log(x);\n}" ]
[ "0.72118473", "0.7019086", "0.6983794", "0.69248724", "0.6908453", "0.68406683", "0.68113464", "0.6803133", "0.6790225", "0.6780439", "0.677071", "0.66323876", "0.6569807", "0.656771", "0.6475423", "0.6388807", "0.6367336", "0.6358963", "0.6347891", "0.633064", "0.633064", "0.63211465", "0.63010037", "0.62938553", "0.627865", "0.6269622", "0.6256449", "0.62460274", "0.6243988", "0.6243988", "0.6240555", "0.62240857", "0.6222798", "0.62153065", "0.6206313", "0.6203255", "0.62029344", "0.6188313", "0.61819786", "0.6173801", "0.6161109", "0.6158685", "0.6139758", "0.6133905", "0.61293685", "0.611632", "0.6109977", "0.6061685", "0.6059863", "0.604949", "0.60392433", "0.6030424", "0.60282904", "0.6019813", "0.60061926", "0.5999644", "0.59996194", "0.5996698", "0.5983544", "0.59727085", "0.5969268", "0.5969268", "0.5969268", "0.5969268", "0.5969041", "0.5961598", "0.59572625", "0.5956257", "0.5949589", "0.59410226", "0.59372395", "0.5933876", "0.5932457", "0.5926805", "0.5919914", "0.5917261", "0.59031254", "0.5899312", "0.5897633", "0.5888702", "0.58794546", "0.5871575", "0.58682775", "0.58575904", "0.58447593", "0.5841702", "0.58378977", "0.5837692", "0.5837468", "0.5835456", "0.5835456", "0.58311135", "0.5824432", "0.5820921", "0.57921445", "0.5783042", "0.5779062", "0.5779062", "0.5779062", "0.5779062" ]
0.7297764
0
return prior to declaring function b()
function b() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function b() {\n\treturn doSomething();\n}", "function b() {\n}", "function b(){\n \n}", "function b() {\n\tconsole.log('Called b');\n}", "function a() {\n b();\n console.log('I an a function a');\n}", "function b(){\n console.log('Called b');\n}", "function b(){f.call(this)}", "function b() {\n console.log(c)\n return c;\n}", "function b() {\n console.log('Called function b()!');\n}", "function b() { return function c(){ console.log('c') }}", "function b() {\n let a = 4;//esta linea en particular vive con \n //el universo de b\n}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function B(){}", "function a(b) {\r\n if (b < 10) {\r\n return 2;\r\n } else {\r\n return 4;\r\n }\r\n console.log(b);\r\n}", "function a(b) {\n if (b < 10) {\n return 2;\n }\n else {\n return 4;\n }\n console.log(b);\n}", "function a(b) { //a(2)\n return b;\n}", "function myFunc(b){\r\n console.log('this is confusing')\r\n b()\r\n}", "function a(b) {\n if (b < 10) {\n return 2;\n } else {\n return 4;\n }\n console.log(b);\n}", "function a(b) {\n if (b < 10) {\n return 2;\n } else {\n return 4;\n }\n console.log(b);\n}", "function a(b){\n if(b<10) {\n return 2;\n }\n    else {\n return 4;\n }\n console.log(b);\n}", "function a(b){\n if(b<10) {\n return 2;\n }\n    else {\n return 4;\n }\n console.log(b);\n}", "function funcB() {\n var a = b = 0;\n a++;\n return a;\n}", "function a(b){\n if(b<10) {\n return 2;\n }\n else {\n return 4;\n }\n console.log(b);\n}", "function B() {\n }", "ba () {\n\t\tfor (let i = 0; i < 3; i++)\n\t\t\tthis.b();\n\t}", "function funcB() {\n let a = b = 0;\n a++;\n return a;\n}", "function B()\n{\n}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function bar() {\n b = a;\n}", "function a1(){\n\treturn 1;\n}", "function a(b) {\r\n return b;\r\n}", "function a() { // 2.\n b(); // 3.\n var c; // 6.\n}", "function funcB() {\n let a = b = 0;\n a++;\n return a;\n}", "function funcB() {\n let a = b = 0;\n a++;\n return a;\n}", "function b() {\n return function c() { console.log(\"bye\") }\n}", "function a() {}", "function a() {}", "function a() {}", "function a() {\n return 5\n}", "function a(b) {\n return b;\n}", "function a(b) {\n return b;\n}", "function cf(){\n \t var b = \"b\";\n\n \t return function(){\n \t \treturn b;\n \t }\n }", "function a(b) { //a(15)\n if (b < 10) { //15<10\n return 2;\n }    \n else {\n return 4; //false retorna 4 b = 4\n }\n console.log(b); // console.log(4)\n}", "function a(b){\n console.log(b);\n return b*3;\n}", "function a(){\n \t var i = 0;\n \t function b(){\n \t\tcc.log(++i);\n \t}\n \t return b;\n }", "function a(b) {\r\n console.log(b);\r\n return b * 3;\r\n}", "function a(b) {\n console.log(b);\n return b * 3;\n}", "function a(b) {\n console.log(b);\n return b * 3;\n}", "function a(b) {\n console.log(b);\n return b * 3;\n}", "function b() {\n return { \n name: \"Yaakov\"\n };\n}", "function fun3(a,b){\n return \n\n}", "function a(b){\n    console.log(b);\n return b*3;\n}", "function a(){\n return 4;\n}", "function a(){\n return 4;\n}", "function a() {\n return 4;\n}", "function a() {\n return 4;\n}", "function b1() {\n ; nullFunc_X(0);return +0;\n}", "function inicio(){\n return b;\n}", "function b(){ // creates a execution context\n console.log(\"called b!\");\n}", "function clou1(){\n\tvar b = 'b';\n\treturn function(){\n\t\treturn b;\n\t}\n}", "function b(h, f) {\n o(h)\n i(f)\n o('end')\n}", "function dummyReturn(){\n}", "function a() {\n console.log('hello');\n return 15;\n}", "function b(M,e){0}", "function Z() {\n var b = 10;\n function T() {\n console.log(\"B:\", b); // will give output of 100 cuz before return it value change over refernece if we access it anywhere it will give new data\n }\n b = 100;\n return T;\n }", "function test(){\n return a;\n}", "function a(fn) { fn()}", "function a() \n{\n b(function fun(x){\n console.log(x)\n }); /** passing a parameter as function */\n}", "function B(A,t){0}", "function f() {\n var a = 1;\n a = 2;\n var b = g();\n a = 3;\n return b;\n function g() {\n return a;\n }\n}", "function Cb(){}", "function a(b){\n return b;\n}", "function a(b){\n return b;\n}", "function a(b) { // a(3)\n     \n console.log(b); //console.log(3)\n return b * 3; //return 3*3\n}", "function B(t, n, i, e) {\n void 0 !== e && x(t, n, i, e);\n}", "function g(a){[\"next\",\"throw\",\"return\"].forEach(function(b){a[b]=function(a){return this._invoke(b,a)}})}", "function inside3() {\n //console.log('B= ' + b);\n }", "function B(x) {\n console.log(\"B\");\n\n return x ** 2;\n}", "function c() {}", "function sb(a){this.b=a}", "function Xb(){return function(v){return v}}", "function foo() {\n console.log(b);\n var b = 1; // Split out and hoisted to the top\n}", "function foo(a, b) {\n var c = a + b;\n\n function bar() {\n return c;\n }\n\n return bar();\n}", "function a(b){\n return b*4;\n console.log(b);\n }", "function a1() {\n }", "function an(){}", "function a(b) {\n return b * 4;\n console.log(b);\n}", "function a(b) {\n return b * 4;\n console.log(b);\n}", "function b(a){je=a}", "function b(a){je=a}", "function foo() {\n a = b * bar( b );\n}" ]
[ "0.7704876", "0.7617843", "0.7488174", "0.71260774", "0.7116076", "0.69878525", "0.6900003", "0.68656015", "0.68651724", "0.67736363", "0.66854113", "0.66850024", "0.66850024", "0.66850024", "0.66850024", "0.6677642", "0.6633063", "0.66072047", "0.66033137", "0.6599044", "0.65945363", "0.65945363", "0.657272", "0.657272", "0.6571076", "0.65701574", "0.6565648", "0.65319854", "0.6488972", "0.64824784", "0.642619", "0.642619", "0.642619", "0.642619", "0.642619", "0.642619", "0.64257807", "0.6408848", "0.6373091", "0.6372832", "0.6361941", "0.6361941", "0.6359338", "0.63400215", "0.63400215", "0.63400215", "0.6337669", "0.6334479", "0.6334479", "0.63244224", "0.6320839", "0.63072646", "0.63028795", "0.62792385", "0.62758046", "0.62758046", "0.62758046", "0.62664163", "0.6255789", "0.6243005", "0.6238684", "0.6238684", "0.6222892", "0.6222892", "0.62156796", "0.621208", "0.61987454", "0.6192548", "0.6189586", "0.6177807", "0.6163428", "0.6162632", "0.61573416", "0.6135549", "0.6127062", "0.6109869", "0.6105394", "0.60688144", "0.60356283", "0.6028109", "0.6028109", "0.601359", "0.60124636", "0.6010766", "0.6003692", "0.5995897", "0.5991808", "0.59728", "0.59631056", "0.5943287", "0.59375167", "0.59367156", "0.5917334", "0.59039813", "0.5900545", "0.5900545", "0.5892453", "0.5892453", "0.58913857" ]
0.78171366
1
Hoisted b function definition
function b() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function b() {\n}", "function Bo(t,e){0}", "function b(){\n \n}", "function b(){\n console.log('Called b');\n}", "function Ha(){}", "function b() {\n\tconsole.log('Called b');\n}", "function Bevy() {}", "function gh(a,b){var c;if(b){var d=this;c=function(a){var c=hh.call(d,a);a=void 0===c?a:null===c?d.yb():c;b.call(d,a);return c}}else c=hh;gh.aa.constructor.call(this,ih,c);this.Xa(a||\"\")}", "function b(M,e){0}", "function b() {\n console.log('Called function b()!');\n}", "function bleh() {}", "function b(h, f) {\n o(h)\n i(f)\n o('end')\n}", "function Xb(){return function(v){return v}}", "function b(){f.call(this)}", "function B(){}", "function B(A,t){0}", "function Cb(){}", "function Fb(a,b,c){this.a=a;this.b=b||1;this.f=c||1}", "function myFunc(b){\r\n console.log('this is confusing')\r\n b()\r\n}", "function B(a,b){this.h=[];this.N=b||null;this.b=this.c=!1;this.f=void 0;this.ma=this.v=this.i=!1;this.g=0;this.d=null;this.u=0}", "function wa(){}", "function Hb(t){return t=Object(ie[\"b\"])(t,1),t>1?2:1}", "function B() {\n }", "function sb(a){this.b=a}", "function hoge() {}", "function H(a){A(a)}", "function hb(a,b,c){G.call(this,c);this.g=a||0;this.f=void 0===b?Infinity:b}", "function H(a,b){this.cf=a;this.bb=b;Ug(this);var c=Vg(this)[0];this.sb=c[1];H.aa.constructor.call(this,c[0])}", "function hobbitPrototype(){}", "function bP(e,...t){return AL(e,null,void 0)}", "function $B(t,e){var n=wi()(t);if(bi.a){var r=bi()(t);e&&(r=vi()(r).call(r,(function(e){return mi()(t,e).enumerable}))),n.push.apply(n,r)}return n}", "function Gb(){}", "function hc(){}", "function vj(a,b,c){gf.call(this,c);this.$a=b||wj;this.fh=a instanceof nb?a:rb(a,null)}", "function c() {}", "function bE(a,b){this.h=[];this.D=a;this.H=b||null;this.g=this.a=!1;this.f=void 0;this.C=this.ja=this.m=!1;this.j=0;this.b=null;this.A=0}", "function B()\n{\n}", "function blabla() {\n\n}", "function Xh(){}", "function ea(){}", "function Gb(a){this.Xc=new Fb(0,25);this.La(a)}", "function Bare() {}", "function Bare() {}", "function b() { return function c(){ console.log('c') }}", "function B(f) {\n return function(g) {\n return function(x) {\n return f (g (x));\n };\n };\n }", "function B(f) {\n return function(g) {\n return function(x) {\n return f (g (x));\n };\n };\n }", "function $f(a){a=a||B;var b;if(a.Db)b=a.Db();else if(a.Za)b=a.Za();else throw\"Not Block or Workspace: \"+a;a=Object.create(null);for(var c=0;c<b.length;c++){var d=b[c].Yb;if(d)for(var d=d.call(b[c]),e=0;e<d.length;e++){var h=d[e];h&&(a[h.toLowerCase()]=h)}}b=[];for(var k in a)b.push(a[k]);return b}", "function zb(a,b,c){H.call(this,c);this.c=a||0;this.b=void 0===b?Infinity:b}", "function a() {\n b();\n console.log('I an a function a');\n}", "function a(b){\n    console.log(b);\n return b*3;\n}", "function Burnisher () {}", "function a(b){\n console.log(b);\n return b*3;\n}", "function fh(a,b){this.Y=a;this.ea=null;this.type=b;this.Ha=this.cc=0;this.Vb=a.ha.Bl;this.eh=!this.Vb;this.ic=!1}", "function a() {}", "function a() {}", "function a() {}", "function a(b) {\r\n return b;\r\n}", "function zb(a,b,c){this.a=a;this.b=b||1;this.f=c||1}", "function oi(){}", "function Bind_A_Obound() {\r\n}", "function F(a,b){this.h=[];this.F=b||null;this.b=this.c=!1;this.e=void 0;this.U=this.u=this.i=!1;this.g=0;this.d=null;this.r=0}", "function B(a,b){this.oa=a;this.o=b||this.De()}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function wb(a,b,c){this.a=a;this.b=b||1;this.f=c||1}", "function abc (a, b, bla ){\n return bla(a,b)\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function a(b) {\r\n console.log(b);\r\n return b * 3;\r\n}", "function B(x) {\n console.log(\"B\");\n\n return x ** 2;\n}", "function b() {\n\treturn doSomething();\n}", "function g() {}", "function bf(name, modulePath, arity, vararity, loc){\n return new functionBinding(name, modulePath, arity, vararity, [], false, loc);\n }", "function fm(){}", "function ba(e,t,n,i){xa.call(this,e,t,n,i)}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function Bandcamp() {}", "function yb(t,e){var n=wi()(t);if(bi.a){var r=bi()(t);e&&(r=vi()(r).call(r,(function(e){return mi()(t,e).enumerable}))),n.push.apply(n,r)}return n}", "function b() {\n return { \n name: \"Yaakov\"\n };\n}", "function a(b){\n return b;\n}", "function a(b){\n return b;\n}", "function WriteB() {\r\n}", "function a(b) {\n return b;\n}", "function a(b) {\n return b;\n}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}" ]
[ "0.7471411", "0.7471411", "0.7471411", "0.7471411", "0.72615397", "0.71583223", "0.7034969", "0.6852821", "0.68467975", "0.68266106", "0.6799481", "0.67558056", "0.67402947", "0.67230123", "0.6679206", "0.6624308", "0.6608131", "0.6597286", "0.656898", "0.6506699", "0.6455955", "0.6450972", "0.64466476", "0.64195675", "0.64111835", "0.64102244", "0.6403649", "0.6393206", "0.6389333", "0.6386729", "0.6369467", "0.6349098", "0.6320186", "0.63186103", "0.63058126", "0.6277144", "0.6276639", "0.6272887", "0.6262576", "0.62160987", "0.6211737", "0.6209606", "0.62049276", "0.61954594", "0.61947805", "0.61924803", "0.61924803", "0.61633015", "0.6160905", "0.6160905", "0.61576945", "0.6146721", "0.6144572", "0.6123871", "0.61137515", "0.6093944", "0.6070416", "0.6069302", "0.6069302", "0.6069302", "0.60526156", "0.6036934", "0.60288024", "0.60159373", "0.60049105", "0.6001495", "0.5993685", "0.5993685", "0.5993685", "0.5993685", "0.5993685", "0.5993685", "0.59823567", "0.5982059", "0.5976322", "0.5976322", "0.5976036", "0.59688264", "0.5965736", "0.59554404", "0.5951671", "0.59473944", "0.5945865", "0.5927843", "0.5927843", "0.5927843", "0.59184796", "0.5914804", "0.5910509", "0.59088403", "0.59088403", "0.5904488", "0.58960366", "0.58960366", "0.5888326", "0.5888326", "0.5888326", "0.5888326", "0.5888326" ]
0.75755507
0
TODO: Create a function to write README file
function writeToFile(fileName, data) { fs.writeFile(`./${fileName}.md`,data, (err) => { if (err){ console.log(err) } console.log ("Generating README..."); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeREADME(savefileName, data) {\n fs.writeFile(savefileName, data, () => {});\n \n console.log('Your README has been generated, check the dist folder')\n}", "function writeToFile(data) {\n fs.writeFile(\"./README.md\", generatePage(data), (err) => {\n if (err) throw new Error(err);\n\n console.log(\"README complete! Check out README.md to see the output!\");\n });\n}", "function generateREADME(answers) {\n\nreturn `# ${answers.title} ![License](https://img.shields.io/badge/License-${answers.license}-brightgreen)\n \nby ${answers.author}\n\n## Description\n${answers.description}\n\n## Table of contents\n[Installation](#Installation) \n[Usage](#Usage) \n[License](#License) \n[Contributing](#Contributing) \n[Tests](#Tests) \n \n## Installation\n${answers.install}\n\n \n## Usage\n${answers.usage}\n \n## Contributing\n${answers.contribute}\n \n## Tests\n${answers.test}\n \n## License\nNOTICE: This application is issued and used under provisions established by [${answers.license}](https://choosealicense.com/licenses/${answers.license}/) licensing.\n\n## Questions\nContact the author: https://github.com/${answers.github} \nIf you have any questions or recommendations please contact ${answers.author} at ${answers.email}`;\n}", "function writeToFile(data) { \n fs.writeFile(`./readme.md`, data, (err)=>{\n if(err){\n console.log(err);\n }\n console.log(\"readme created\");\n })\n}", "function writeToFile() {\n fs.writeFile(\"README.md\", \"\", function(err){console.log(err || \"File written successfully!\")})\n}", "function writeToFile(data) {\n\n /*var fileName = data.Title\n .toUpperCase()\n .split(' ')\n .join('') + '.md';*/\n\n var ReadMe = generate_markdown(data);\n console.log(\"Generating README......\");\n\n fs.writeFile(\"README.md\", ReadMe, function (err) {\n if (err) {\n return console.log(err);\n }\n });\n\n console.log(\"README.md generated!\")\n\n}", "function makeTheFile(name, data){\n fs.writeFile('README.md', data, (err) => {\n if (err){\n console.log(err);\n }\n console.log(\"README has been successfully generated.\")\n })\n }", "function writeToFile(data) {\n fs.writeFile(\"README.md\", markdownGen(data), function(err) {\n\n if (err) {\n return console.log(err);\n }\n});\n}", "function writeToFile(data) {\n fs.writeFile(\"README.md\", generateMarkdown(data), (err) =>\n err ? console.log(err)\n : console.log(\"generating a readme.md file\")\n );\n}", "function generateREADME(response) {\n let READMEString = `\n# ${response.title}\n\n## Description \n\n${response.description}\n![badmath](https://img.shields.io/badge/-${response.license}-yellow/)\n\n## Table of Contents \n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Credits](#credits)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n\n## Installation\n\n${response.installation}\n\n## Usage \n\n${response.usage}\n\n## Credits\n\n${response.contributors}\n\n## License\n\n${response.license}\n\n## Contributing\n\n${response.contributors}\n\n## Tests\n\n${response.tests}\n\n## Questions\n\nYou can find other projects that I have worked on at https://github.com/${response.gitHub}.\nIf there are any questions you may have please contact me at ${response.email}. \n\n---\n© 2020 Steven Galarza . All Rights Reserved.\n`\n\n return READMEString;\n}", "function writeToFile(filename, data){\n fs.writeFile('./dist/README.md',(filename, data), err => {\n if (err){\n console.log(err);\n return\n }\n console.log ('README GENERATED!');\n })\n}", "writing() {\n let pkg = this.fs.readJSON('package.json', false)\n\n if (!pkg) {\n return this.log.error('Cannot create readme file because package.json is missing')\n }\n\n this.packageName = pkg.name\n this.camelCaseName = camel(stripScope(pkg.name))\n\n let author = pkg.author\n , copyrightHolder = this.config.get('copyrightHolder')\n\n if (typeof author === 'string') author = parseAuthor(author) || {}\n\n if (copyrightHolder && (!author || copyrightHolder !== author.name)) {\n this.authorLink = copyrightHolder\n } else if (author) {\n if (author.url) this.authorLink = '['+author.name+']('+author.url+')'\n else this.authorLink = author.name\n } else {\n this.authorLink = ''\n }\n\n this.packageLicense = pkg.license\n this.packageDescription = pkg.description\n\n let repo = pkg.repository || ''\n , url = typeof repo == 'string' ? repo : repo.url || ''\n , match = url.match(/^(.*github.com\\/)?([^\\.#\\/]+\\/[^\\.#\\/$]+)/)\n\n this.repoName = (match && match[2]) || ''\n\n if (!this.repoName) {\n this.log.info('[readme] No repository name found')\n }\n\n this.hasTravis = this.fs.exists('.travis.yml')\n this.hasAppVeyor = this.fs.exists('appveyor.yml')\n\n this.template('_readme.md', 'readme.md')\n }", "function createREADMEcontent(responses) {\n return `# ${responses.title}\n${licenseBadges[responses.license]}\n\n## Description \n${responses.description}\n\n## Table of Contents\n* [Installation](#Installation)\n* [Usage](#Usage)\n* [License](#License)\n* [Contributing](#Contributing)\n* [Tests](#Tests)\n* [Questions](#Questions)\n\n## Installation\n${responses.installation}\n\n## Usage\n${responses.usage}\n\n## License\n${licenseDetails[responses.license]}\n\n## Contributing\n${responses.contributing}\n\n## Tests\n${responses.tests}\n\n## Questions\nPlease contact me with questions about this project.\n\n* Name: **${responses.name}**\n* GitHub: ${responses.githubUsername} | ${responses.githubURL}\n* Email: ${responses.email}\n`\n}", "function generateREADME(answers) {\n\t//Set additional project links\n\n\tlet additionalProjectLinks = '';\n\n\tif (answers.projectLinks) {\n\t\tadditionalProjectLinks = answers.projectLinks.split(',').join('<br>');\n\t}\n\n\t//Set Screenshots template according to the user iniput\n\tlet screenshots = '';\n\tif (answers.imageURL) {\n\t\tfor (let i = 0; i < answers.imageURL.split(',').length; i++) {\n\t\t\tscreenshots += `<kbd>![screenshot-demo${i + 1}](${answers.imageURL.split(',')[i].trim()})</kbd>`;\n\t\t}\n\t}\n\n\t// Main README structure\n\treturn ` \n # ${answers.title.toUpperCase()}\n [![github-follow](https://img.shields.io/github/followers/${answers.username\n .trim()\n .toLowerCase()}?label=Follow&logoColor=purple&style=social)](https://github.com/${answers.username.trim().toLowerCase()})\n [![project-languages-used](https://img.shields.io/github/languages/count/${answers.username\n .trim()\n .toLowerCase()}/${answers.repoName.trim()}?color=important)](https://github.com/${answers.username.trim().toLowerCase()}/${answers.repoName.trim()})\n [![project-top-language](https://img.shields.io/github/languages/top/${answers.username\n .trim()\n .toLowerCase()}/${answers.repoName.trim()}?color=blueviolet)](https://github.com/${answers.username.trim().toLowerCase()}/${answers.repoName.trim()})\n [![license](https://img.shields.io/badge/License-${answers.license\n .toUpperCase()\n .split('-')\n .join('v')}-brightgreen.svg)](https://choosealicense.com/licenses/${answers.license}/)\n ## Table of Content\n * [ Project Links ](#Project-Links)\n * [ Screenshots-Demo ](#Screenshots)\n * [ Project Objective ](#Project-Objective)\n * [ User Story ](#User-Story)\n * [ Technologies ](#Technologies)\n * [ Installation ](#Installation)\n * [ Usage ](#Usage)\n * [ Credits and Reference ](#Credits-and-Reference)\n * [ Tests ](#Tests)\n * [ Author Contact ](#Author-Contact)\n * [ License ](#License)\n #\n ## Project Links\n https://github.com/${answers.username.trim().toLowerCase()}/${answers.repoName.trim()}<br>\n ${additionalProjectLinks}\n ## Screenshots-Demo\n ${screenshots}\n \n ## Project Objective\n ${answers.objective}\n \n ## User Story\n ${answers.userStory}\n ## Technologies \n \\`\\`\\`\n ${ answers.technologies}\n \\`\\`\\`\n \n ## Installation\n ${answers.installation}\n ## Usage \n ${answers.usage}\n \n ## Credits and Reference\n ${answers.credits}\n ## Tests\n ${answers.test}\n ## Author Contact\n Contact the author with any questions!<br>\n Github link: [${answers.username\n\t\t.trim()\n\t\t.toLowerCase()}](https://github.com/${answers.username.trim().toLowerCase()})<br>\n Email: ${answers.email}\n ## License\n This project is [${answers.license.toUpperCase()}](https://choosealicense.com/licenses/${answers.license}/) licensed.<br />\n Copyright © ${year} [${answers.authorName.trim().toUpperCase()}](https://github.com/${answers.username.trim().toLowerCase()})\n \n <hr>\n <p align='center'><i>\n This README was generated with ❤️ by ${answers.authorName.trim().toUpperCase()}\n </i></p>\n `;\n}", "function generateREADME(answers) {\n return ` \n# ${answers.title}\n${badges} \\n\n\n## Description \n${answers.description} \\n\n\n## Installation\n${\"```\"}\n${answers.installation} \\n\n${\"```\"}\n\n## Usage\n${answers.usage} \\n\n![](./assets/img/${answers.screenshot}) \\n\n\n## License\n${answers.license} \\n\n\n## Contributing\n${answers.contributing} \\n\n\n## Questions\n - Contact ${answers.email} for questions \\n\n![](https://avatars3.githubusercontent.com/u/60083822?v=4.img) \n`;\n}", "function writeToFile(fileName, data) {\n fs.writeFile('./dist/README.md',(fileName, data), err =>{\n if(err){\n console.log(err);\n return;\n } else {\n console.log(\"Readme successfully generated\");\n }\n })\n}", "function writeToFile(data) {\n fs.writeFile('./dist/README.md', data, err => {\n if (err) {\n console.log(err)\n return\n }\n console.log('File Created Successfully!')\n })\n}", "function writeToFile(genReadMe, data) {\n fs.writeFile(genReadMe, data, (err) => {\n console.log(err);\n });\n console.log(\"README.md successfully made!\");\n}", "function writeToFile(readmeFile, data) {\n fs.writeFile('README-test.md', readmeFile, (err) => err ? console.error(err) : console.log('Success, go to the README-test.md file!') )\n \n}", "function writeToFile(readMeString) {\n fs.writeFile(\"./README.md\", readMeString, function (err) {\n if (err) throw err;\n console.log('Success!');\n})}", "function writeToFile(fileName, data) {\n\n return thenableWriteREADME(fileName, data)\n\n}", "function writeToFile(fileName, data) {\n let readMe = `#${data.title}\n # ${data.title} \n ## Description\n ${data.description}\n ## Table of Contents\n 1. Instructions\n 2. User Story\n 3. Credits\n 4. License\n 5. Questions \n\n ## Instructions\n ${data.instructions}\n ## User Story\n ${data.userStory}\n ## Credits\n ${data.credits}\n ## License\n ${data.license}\n ## Contact\n Please contact me at ${data.email} or find me on Github ${data.github}(https://github.com/${data.github}). \n `\n fs.writeFileSync('README.md', readMe)\n }", "function writeReadMe(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err)\n throw err;\n console.log(\"All data created in README.\")\n });\n}", "function writeToFile( data) {\n const fileName = \"./dist/README.md\"\n fs.writeFile(fileName +'.md', generateMarkdown(data), function(err) {\n\n if (err) {\n return console.log(err);\n }\n \n console.log('Complete!');\n \n });\n}", "function writeToFile(data) {\n try {\n fs.writeFileSync(\"README.md\", data)\n }\n catch (err) { }\n}", "function writeToFile(fileName, data) {\n // console.log('in the writetoFile' + data.license + ' is the license');\n fs.writeFile(\"README.md\", generatePage(data), (err) => {\n if (err) \n console.log(err);\n else {\n console.log('README complete! Check out README.md to see the output!');\n }\n });\n}", "function writeToFile( data) {\n fs.writeFile(\"./generated-files/README.md\",generateMarkdown(data), err =>{\n if(err){\n throw err;\n }\n console.log(\"file generated!\")\n })\n}", "function writeToFile(fileName, data) {\n fs.writeFileSync('./generated/'+fileName, generateMarkdown(data), error => {\n console.log(\"Generating README\");\n if (error) throw error;\n console.log(\"README generated.\");\n });\n \n}", "function writeToFile(readMe, data) {\n const userData = generateMD(data);\n fs.writeFile(readMe, userData, function(err) {\n if(err) {\n throw err\n } else {\n console.log(\"You have successfully created a new README.md file.\")\n }\n })\n}", "function writeToFile(fileName, data) {\n console.log(data);\n fs.writeFile(\"generatedREADME.md\", data, function(err){\n if (err){\n throw err;\n }\n console.log(data)\n })\n}", "function writeFile(readMeText) {\n return new Promise((resolve, reject) => {\n fs.writeFile('./dist/README.md', readMeText, err => {\n if (err) {\n reject(err);\n return;\n }\n \n resolve({\n ok: true,\n message: 'File created!'\n });\n });\n });\n}", "function writeToFile(fileName, data) {\n\n fs.appendFile(\n fileName, \n generateMarkdown(data) ,\n function(err) {\n if(err) {\n return console.log(err);\n }\n \n console.log(\"Your README file is created successfully!\");\n })\n\n fs.appendFile(\n fileName, \n generateLicense(data) ,\n function(err) {\n if(err) {\n return console.log(err);\n }\n \n console.log(\"Your README file is created successfully!\");\n })\n\n \n\n \n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName,generateMarkdown(data),err=>{\n if(err) throw err;\n console.log('readme created')\n })\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName,generateMarkdown(data),err=> {\n if (err) throw err;\n console.log('README complete! Check out readmeGenerated.md to see the output!')\n })\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, \"utf8\", function (err) {\n if (err) {\n throw err;\n }\n console.log(\"You have successfully generated a README file for your project!\");\n });\n}", "function writeToFile(content) {\n fs.writeFile('./Output/README.md', content, (err) =>\n err ? console.error(err) : console.log('Success! Your README has been stored in the Output folder')\n );\n}", "function writeToFile(fileName, data) {\n let genMarkdown = markdown(data);\n fs.writeFile(fileName, genMarkdown, (err) => {\n err ? console.log(err) : console.log(\"Serving up your README\");\n })\n}", "function writeToFile(fileName, data) {\n\n fs.writeFile(\"README.md\", generateMarkdown(data), err => {\n if (err) {\n return console.log(err);\n }\n console.log(\"Success!\");\n });\n}", "function writeToFile(fileName, data) {\n //path - join method\n fs.writeFile(\"README.md\", data, (err) => {\n err ? console.log(err) : console.log(\"README file has been created\");\n });\n}", "async function writeToFile (data) {\n try {\n await asyncWrite(\"README.md\", generateMarkdown.generateMarkdown(data));\n console.log(\"Your README.md was created successfully.\");\n } catch(err) {\n console.log(err);\n }\n}", "function generateMarkdown(appData) {\n\n fs.writeFile(\"./dist/README.md\", template.getMarkdown(appData), err => {\n if (err) {\n return console.log(err);\n } else {\n console.log('File created!');\n }\n });\n\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), err => { if (err) throw err; console.log('Your new README.md was created successfully!') });\n}", "function writeMarkdown(markDown, data) {\n // const markDown = \"demo/README-demo.md\";\n fs.writeFile(markDown, generateMarkdown(data), null, function (err) {\n if (err) {\n return console.log(err);\n }\n console.log(\"Successfully wrote README!\")\n });\n}", "function doBuildReadme() {\n process.stdout.write('Building README.md\\n');\n var readmeBuf = fs.readFileSync(__dirname + '/README.md.hbs');\n var readmeTemplate = Handlebars.compile(readmeBuf.toString());\n // Collect all example files as `[{ title: '', 'content: '' }, ...]`\n var examples = fs.readdirSync(__dirname + '/examples')\n // match only js files\n .filter(function (filePath) {\n return filePath.match(/\\.js$/);\n })\n // convert file paths into template objects\n .reduce(function (list, filePath) {\n var mtch = filePath.match(/^(.*)\\.js$/);\n if (mtch && mtch[1]) {\n list.push({\n // title is extracted from file name\n title: mtch[1].replace(/_/g, ' '),\n // read file contents into buffer\n content: fs.readFileSync(path.resolve(__dirname + '/examples', filePath))\n });\n }\n return list;\n }, []);\n\n var readmeBuilt = readmeTemplate({\n examples: examples\n });\n\n fs.writeFileSync(__dirname + '/../README.md', readmeBuilt);\n}", "function writeToFile(fileName, data) {\n let markdownText = generateMarkdown(data)\n fs.writeFile(fileName, markdownText, (err) =>\n err ? console.log(err): console.log('README successfully created!'))\n}", "function writeToFile(fileName, createFile) {\n fs.writeFile(fileName, createFile, function (err) {\n if (err) {\n console.log(err);\n }\n console.log(\"Your README.md is created!\");\n });\n}", "async function writeReadME(){\n let {title, description, installation, usage, license, contributing, test, github, email} = await getUserInput()\n\n //switch statement written to allow the user to select from the license name rather than the entire links in the terminal.\n switch(license){\n case \"Apache\":\n license = \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\"\n break;\n\n case \"MIT\":\n license = \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\"\n break;\n\n case \"IBM\":\n license = \"[![License: IPL 1.0](https://img.shields.io/badge/License-IPL%201.0-blue.svg)](https://opensource.org/licenses/IPL-1.0)\"\n break;\n\n case \"Mozilla\":\n license = \"[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\"\n break;\n\n case \"Eclipse\":\n license = \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\"\n break;\n }\n//template literal variable completely written in markdown.\n\nconst myReadMe = `\n# ${title}\n\n${license}\n\n${description}\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [test](#test)\n* [Questions](#Questions)\n\n## Installation\n\n${installation}\n\n## Usage\n\n${usage}\n\n## Contributing\n\n${contributing}\n\n## Test\n\n${test}\n\n## Questions\n\nCheck out more of my work at my GitHub profile [${github}](https://github.com/${github}) \n\nIf you have any further questions, you can reach me at ${email}.\n`\n //file system write file function that writes MYREADME.md with the third parameter being a callback function using a \n //terniary operator to log an error if one occurs else log success!\n fs.writeFile(\"MYREADME.md\", myReadMe, (err) =>\n err ? console.log(err) : console.log(\"Success\")\n );\n}", "function writeToFile(fileName, data) {\r\n fs.writeFile(fileName, data, (err) => {\r\n if (err)\r\n throw err;\r\n console.log('Your README.md has been generated!');\r\n })\r\n}", "function writeToFile(fileName, data) {\n const readmeContent = markdown(data);\n fs.writeFile(fileName, readmeContent, (err) =>\n err ? console.log(err) : console.log('Successfully created README.md!')\n );\n}", "function writeToFile(fileName, data) {\n const licenseBadge = \"\";\n const licenseText = \"\";\n generateLicense(data)\n .then(function (data) {\n })\n .catch(function (err) {\n console.log(err);\n });\n const markDownContent = generateMarkdown(data);\n fs.writeFile(fileName, markDownContent, (err) => {\n if (err) throw err;\n console.log(\"Your README.md file has been saved!\");\n });\n}", "function writeToFile(filetype, data) {\n fs.writeFile(filetype, data, (err) =>\n err ? console.log(err) : console.log('Created your README!')\n )\n}", "function writeToFile(fileName, data) {\n const newReadme = generateMarkdown(data);\n fs.writeFile(fileName, newReadme, err => {\n if (err) throw (err);\n console.log(\"SUCCESS! Your README.md file has been created.\");\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if(err) {\n console.error(err)\n }else {\n console.log(\"README file created successfully\");\n }\n });\n }", "function writeToFile(fileName, { title, description, usage, install, contribution, license, testing, github, email }) {\n const codeStyling = \"```\"\n const readme = `# ${title}\n## License\n![GitHub license](https://img.shields.io/badge/license-${license}-red.svg)\n## Description\n${description}\n## Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n## Installation\nTo install the necessary denpendencies, run the following command:\n${codeStyling}\n${install}\n${codeStyling}\n## Usage\n${usage}\n## Contributing\n${contribution}\n## Tests\n${testing}\n## Questions\nIf you have any questions you can email me at: ${email}\nAlso feel free to check out my GitHub page here: https://github.com/${github}\n`\n\n // console.log('readme: ', readme);\n\n fs.writeFile(fileName, readme, err => {\n if (err) {\n throw err;\n }\n console.log(`Saved`);\n },)\n .catch (err => console.log(err));\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) throw err;\n\n console.log('README has been generated!')\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), err => {\n if (err) {\n console.log(err);\n return;\n } else {\n console.log('README.md file has been created!')\n }\n })\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => \n err ? console.error(err) : console.log('README created!'))\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err ? console.log(err) : console.log(\"README generated!\")\n );\n}", "function generateReadMe(data) {\n\n return `# ${data.name}\n \n## Description \n \n${data.description}\n \n## Table of Contents \n \n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contributing)\n * [Test](#tests)\n * [Questions](#questions)\n \n \n## Installation\n \n${data.install}\n \n\n## Usage \n \n${data.usage}\n \n \n## License\n\n${data.license}\n\n \n## Contributing\n \n${data.contribute}\n\n \n## Tests\n \n${data.testing}\n\n\n## Questions\n\nGithub: ${data.github}\n \nIf you have questions or would like to contact me about this project - \n\nEmail: ${data.email}\n \n \n---\n`;\n}", "function generateReadme (answer) {\n return `\n# ${answer.title}\n\n![GitHub license](https://img.shields.io/badge/Made%20by-%40ChambersM97-orange)\n\n# Table of Contents\n\n\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n- [Contributing](#contributing)\n- [Tests](#tests)\n- [Questions](#questions)\n\n## Description:\n This area is designed for leaving a report of what the project is and it's purpose.\n ${answer.description}\n\n## Installation:\n These are the necessary steps to follow/files to download that you need in order to run the application.\n ${answer.installation}\n\n## Usage:\n ${answer.usage}\n\n## License:\n[![License](https://img.shields.io/badge/License-${answer.license}%202.0-blue.svg)](https://opensource.org/licenses/${answer.license})\n\n## Contributing:\n ${answer.contributing}\n\n## Tests:\n\n![Password-Generator-gif](readmeGenerator.gif)\n![Password-Generator_img](readmepic.PNG)\n\n## Questions:\n- GitHub: [${answer.username}](https://github.com/${answer.username})\n- Email: Contact me @ ${answer.email} for any other questions you might have!\n\n `\n\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) {\n return console.log(err);\n }\n\n console.log(\"Your README.md has been successfully generated!\");\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n err ? console.log(err):console.log(\"It successfully created README file!\")\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err);\n }\n console.log(\"YAY, your README was generated\")\n });\n}", "function writeToFile(mdString) {\n fs.writeFile('README.md', mdString, (err) => {\n if (err) {\n console.log(err);\n }\n })\n console.log('Successfully written!');\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, function(err) { \n if (err) {\n return console.error(err);\n }\n console.log('Successfully wrote README file!');\n }\n )\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err);\n }\n console.log(\"Your README markdown file has been created!\")\n });\n}", "function main() {\n promptUser()\n .then((answers) => {\n const html = generateMD(answers);\n return writeFileAsync(\"readme.md\", html);\n })\n .then(() => {\n console.log(\"Successfully created a new readme.md file\");\n })\n .catch((err) => {\n console.log(err);\n });\n}", "function writeToFile(fileName, data) {\n\n fs.writeFile(fileName, data, (err) =>\n err ? console.log(err) : console.log('Successfully created README.md!')\n );\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) {\n return console.log(err);\n }\n console.log(\"Successfully created README: \" + fileName);\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) {\n return console.log(err);\n }\n\n console.log(\"Success! Your README.md file has been generated\");\n });\n}", "function writeToFile(fileName, data) {\n\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err);\n }\n\n console.log(\"Success! You created your README.md file\")\n });\n\n}", "async function main() {\r\n\r\n //prompt user for answers to questions and store answers as variable\r\n let answers = await inquirer.prompt(questions);\r\n\r\n //Generate the markdown for the README file\r\n let markdown = generateMarkdown(answers, licenses);\r\n\r\n //Write the generated markdown to a file\r\n writeToFile('Generated_README.md', markdown);\r\n}", "function init() {\n //1 ask all the questions we need for the read me!\n inquirer.prompt(questions).then((answers) => {\n console.log(JSON.stringify(answers, null, ' '));\n //2 Make the fake read me string\n var makeReadMe = generateMarkdown(answers);\n // 3 then fs.writeFIle with the fakeReadMe\n console.log(makeReadMe)\n fs.writeFile('README.md', makeReadMe, function(err){\n\n })\n });\n \n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) {\n throw err;\n }\n });\n console.log('README.md created!')\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err);\n }\n console.log('Your README file has been successfully created!');\n });\n}", "function writeToFile(filename, readmeData) {\n console.log(filename, readmeData);\n return fs.writeFileSync(path.join(process.cwd(), filename), readmeData);\n}", "function READMETemplate(userAnswer) {\n return `# ${userAnswer.title}\n![GitHub top language](https://img.shields.io/github/languages/top/${userAnswer.githubUsername}/${userAnswer.title})\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n \n## Description \n${userAnswer.description}\n\n## Table of Contents \n* [Installation](#Installation)\n* [Usage](#Usage)\n* [License](#License)\n* [Contributing](#Contributing)\n* [Tests](#Tests)\n* [Questions](#Questions)\n\n## Installation\n${userAnswer.installation}\n\n## Usage\n${userAnswer.usage}\n\n## License\n${userAnswer.license}\n\n## Contributing \n${userAnswer.contributing}\n\n## Tests\n${userAnswer.tests}\n\n## Questions \nPlease contact me if you have any questions at:\n<br>Email: ${userAnswer.email}\n<br>Github: ${userAnswer.githubUrl}\n`\n }", "function writeToFile(fileName, data) {\n //this function determines the file type readme.md\n fs.writeFile(fileName, generateMarkdown(data), (err) =>\n err ? console.error(err) : console.log('ReadMe successfully created')\n );\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n throw err;\n } else {\n console.log(\"README created!!! Check current repo for created file\")\n }\n });\n}", "function init() {\n promptUser()\n .then(readmeContent => {\n writeFile(generateMarkdown(readmeContent));\n });\n}", "function writeToFile(fileName, data) {\n inquirer.prompt(questions)\n .then(answers => {\n\n let template = `## ${answers.title}\n ## Description\n ${answers.description}\n ##Installation\n ${answers.installation}\n ##Instuctions\n ${answers.instructions}\n ##Contributors\n ${answers.contributors}\n ##Test\n ${answers.test}\n ##License\n ![GitHub license](https://img.shields.io/badge/license-${answers.license}-blue.svg)\n Contact\n Email: ${answers.email}\n Github: ${answers.github}`\n\n fs.writeFile('README.md', template, function(err) {\n if (err) return console.log(err);\n else \n console.log(\"README created successfully!\");\n })\n }\n )}", "function init() {\n promptUser()\n .then((answers) => writeToFile('README.md', answers))\n .then(() => console.log('Successfully wrote to README'))\n .catch((err) => console.error(err));\n}", "function writeToFile(fileName, data) {\n console.log(\"writeToFile: Filename is \" + fileName);\n console.log(\"writeToFile: data is \" + data);\n fs.writeFile(fileName, data, function(err){\n if (err) {\n throw err;\n };\n console.log(\"The README was created successfully\");\n})\n }", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, \"utf8\", (err) => {\n if (err) throw err;\n console.log(\"You're README file is now ready!\");\n });\n}", "function writeToFile(title, data) {\n const fileName = title.toLowerCase().split(\" \").join(\"-\");\n fs.writeFile(`./${fileName}.md`, data, (err) =>\n err\n ? console.log(err)\n : console.log(\n `${fileName}.md has been generated in your current directory.`\n )\n );\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err ? console.log(err): console.log(\"New README file created with success\")\n );\n}", "function writeToFile(fileName, answers, apiData) {\n\n fs.writeFile(fileName, generateMarkdown(answers, apiData), err => {\n if (err) {\n throw err\n }\n console.log(\"README.md succesfully created!\");\n })\n}", "function writeToFile(fileName, answers) {\n //function to write README.md here\n const markdown = generateMarkdown({ ...answers}) // \"...\" needs to be used as answers has multiple values\n // write the file with the fileName, markdown and an error function\n fs.writeFile(fileName, markdown, function (error) {\n if (error) {\n return console.log(error, \"There has been an error. Please try again\");\n };\n });\n}", "function writeToFile(fileName, data) {\n return fs.writeFile(fileName, data, (err) =>\n err ? console.log(err) : console.log(\"Generating README.md ...\")\n );\n}", "function init() {\n inquirer.prompt(questions).then((response) => {\n let text = gen.generateMarkdown(response);\n try { \n writeToFile(\"README.md\", text)\n } catch (error) {\n console.error(error);\n }})\n\n}", "function writeToFile(fileName, data) {\n fs.writeFile(`./dist/${fileName}`, data, err => {\n if (err) {\n throw err\n };\n console.log('README created!')\n });\n}", "function writeToFile(fileName, answers) {\n fs.writeFile(fileName, answers, err => {\n if (err) {\n return console.log(err);\n }\n console.log('README File Created')\n\n });\n}", "function init() {\n\n promptUser().then(answers => writeToFile(\"readme.md\", answers))\n}", "function fileCreate(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err);\n }\n console.log('Your readme has been generated!')\n});\n}", "function writeToFile(data) {\n fs.writeFile(\"readME.md\", generateMarkdown(data), (err) => {\n err ? console.error(err) : console.log(\"Successfully made!\");\n })\n}", "function writeToFile(fileName, data) {\n // Creating README file blueprint\n return fs.writeFile(fileName, data, err => {\n if (err) throw err;\n })\n}", "function init() {\n inquirer.prompt(questions).then(data => {\n writeToFile('./dist/README.md', markdown(data))\n })\n}", "function writeToFile(fileName, data) {\n let licenseBadge = generateMarkdown.renderLicenseBadge(data.license);\n let licenseLink = generateMarkdown.renderLicenseLink(data.license);\n let licenseText = generateMarkdown.renderLicenseSection(data.license, data.contributors);\n // let contributionlink = generateMarkdown.rendercontributors(data.contributors);\n\n let readMe =`# ${data.title} \n\n ${licenseBadge} \n \n## Table of Contents\n* [Description](#description)\n* [Installation](#installation)\n* [Usage](#usage)\n* [Contributors](#contributors)\n* [License](#license)\n* [Test](#test)\n* [Contact](#contact)\n\n\n## Description\n${data.description}\n\n## Installation \n${data.installation}\n\n## Usage\n${data.usage}\n\n## Contributors\n ${data.contributors} \n\n* [UCLA Extension Coding Bootcamp](https://bootcamp.uclaextension.edu/coding/)\n\n## License\n${data.license} Link: ${licenseLink} ${licenseText} ${licenseBadge}\n\n\n## Tests\n${data.test}\n\n## Questions | Contact \nIf you have any questions about my work OR wish to collaborate in the future please contact me via email: ${data.email} OR feel free to connect via GitHub : [${data.username}](https://github.com/Kimberly-Rodriguez).`\n\n \n fs.writeFile(fileName, readMe, (err) =>\n err ? console.error(err) : console.log('Success!')\n);\n}", "function init() {\n inq.prompt(questions).then((res) => {\n // console.log(res);\n\n const licBadge = checkLicense(res);\n const returnMD = mark.generateMarkdown(res);\n // console.log(returnMD);\n\n // function to write README file\n fs.writeFileSync(\"genReadme/README.md\", returnMD, \"utf8\");\n });\n}", "function init() {\r\n try{\r\n let data = await promptUser();\r\n let createContent = ReadMeTemplate(data);\r\n\r\n await createFile('./dist/README.md', createContent);\r\n console.log('Successfully created README.md');\r\n } catch(err) {\r\n console.log(err);\r\n }\r\n}" ]
[ "0.80459154", "0.769568", "0.7688438", "0.7662486", "0.7625201", "0.7613852", "0.7600793", "0.75778055", "0.7540343", "0.7540213", "0.75199854", "0.75136596", "0.7454612", "0.74240106", "0.7417176", "0.7403209", "0.7387397", "0.73748857", "0.736913", "0.7356774", "0.7356653", "0.73541063", "0.7331621", "0.7279534", "0.72754294", "0.7264906", "0.72412014", "0.7224723", "0.7202707", "0.7183694", "0.7182839", "0.7177902", "0.7171596", "0.7092789", "0.7092117", "0.7063586", "0.70418274", "0.70227766", "0.69965225", "0.6980618", "0.6980014", "0.6976437", "0.6965154", "0.6962322", "0.6913086", "0.6903143", "0.68861246", "0.68691325", "0.6856036", "0.6850334", "0.6844871", "0.6844852", "0.6829722", "0.68257993", "0.68135333", "0.6809267", "0.6791793", "0.67865026", "0.67804784", "0.67684525", "0.6768316", "0.6767757", "0.67616636", "0.67554206", "0.675331", "0.6748274", "0.67462605", "0.6742469", "0.67272925", "0.6709997", "0.6706285", "0.6701154", "0.669244", "0.6684988", "0.667862", "0.66776866", "0.66637284", "0.66624635", "0.66507787", "0.664559", "0.6644594", "0.66437995", "0.6631077", "0.6630583", "0.66275066", "0.6621994", "0.66113544", "0.66109735", "0.6608348", "0.6607651", "0.65981984", "0.65651053", "0.65497196", "0.6549468", "0.6546962", "0.6540848", "0.65369034", "0.6533816", "0.65191144", "0.6499153" ]
0.7187643
29
TODO: Create a function to initialize app
function init() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initApp() {\n var router = new App.Router();\n var dispatcher = new App.Dispatcher();\n\n router.once('route', function() {\n dispatcher.runAction(router.getCurrent(), router.getParams());\n });\n\n // Start!\n router.startHistory();\n}", "function initApp() {\n\tinitSounds();\n\tinitSensors();\n\tshowWelcome();\n}", "function _initApp(){\n console.log('[ app_logic.js ] : ' + 'initiating app ..'); // debug message > app is launching\n _check_modules(); // check if the necessary modules are present\n _initial_setup_app_init(); // actually init the app's 'initial setup' config/params (..)\n }", "function init() {\n inquirer.prompt(questions).then(answers => {\n let appTitle = answers.appTitle.trim();\n let appDescription = answers.appDescription ? answers.appDescription.trim() : \"\";\n let packageName = answers.packageName.trim();\n let openui5 = answers.openui5.trim();\n let appType = answers.type.trim();\n let splitApp = appType === \"split\";\n let routing = answers.routing || splitApp;\n\n ui5init.createFolders();\n ui5init.createComponent(packageName, routing);\n ui5init.createManifest(packageName, appType, routing);\n ui5init.createIndex(packageName, appTitle);\n ui5init.createI18n(appTitle, appDescription);\n jsGenerator.generateFile(\"App\", packageName, jsGenerator.types.controller);\n viewGenerator.generateAppView(packageName, splitApp, routing);\n if (routing || splitApp) {\n jsGenerator.generateFile(\"Master\", packageName, jsGenerator.types.controller);\n viewGenerator.generateView(\"Master\", packageName);\n }\n if (splitApp) {\n jsGenerator.generateFile(\"Detail\", packageName, jsGenerator.types.controller);\n viewGenerator.generateView(\"Detail\", packageName);\n }\n\n runtime.createPackage(appTitle, appDescription);\n runtime.createServer(openui5);\n runtime.createGruntEnvironment();\n\n console.log(`Application \"${appTitle}\" initialized.`);\n console.log(`Run npm install && npm start to install and start the app.`);\n });\n}", "function initApp() {\n var urlParams, configManager, layoutManager;\n console.log('jimu.js init...');\n urlParams = getUrlParams();\n\n DataManager.getInstance();\n\n html.setStyle(jimuConfig.loadingId, 'display', 'none');\n html.setStyle(jimuConfig.mainPageId, 'display', 'block');\n\n layoutManager = LayoutManager.getInstance({\n mapId: jimuConfig.mapId\n }, jimuConfig.layoutId);\n configManager = ConfigManager.getInstance(urlParams);\n\n layoutManager.startup();\n configManager.loadConfig();\n }", "init() {\n // Action to execute on load of the app\n }", "function initApp() {\n\tauthCode = null;\n\tchildWindow = null;\n\t//registerBbm();\n\n\t// setup our Foursquare credentials, and callback URL to monitor\n\tfoursquareOptions = {\n\t\tclientId: '*',\n\t\tclientSecret: '*',\n\t\tredirectUri: '*'\n\t};\n\n\t// (bbUI) push the start.html page\n\tbb.pushScreen('start.html', 'start');\n}", "async initApp() {\n if (!this.context) {\n await this.connect();\n }\n }", "function init() {\n return new Application();\n}", "function get_app() {\n return app;\n}", "function App() {\n this.modules = [];\n this.registry = new registry.Registry();\n\n this._started = false;\n\n // Register a bunch of default utilities\n this.registry.registerUtility(notification.defaultNotifier,\n 'notifier');\n\n // And set up default components.\n this.include(authz.acl);\n this.include(identity.simple);\n this.include(storage.noop);\n}", "function init() {\n\t\t//console.log(\"app.init()\");\n\t\tif(initDone) {\n\t\t\t//console.log(\"init already done.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tinitDone = true;\n\t\t}\n\n\t\t// Init HTML layout and from there the GUI/UI with interaction.\n\t\tlayout.init();\n\t\tscene.init();\n\t\t//ui.init();\n\t\t// Proceed directly to startup of the loop.\n\t\t//start();\n\t}", "function initApp () {\n loadThemes();\n}", "function initApplication() {\n\tconsole.log(\"Starting Mustang v2...\");\n}", "function init() {\n console.log(\"Init app.\");\n gapi.hangout.data.addStateChangeListener(stateUpdated);\n gapi.hangout.addParticipantsListener(participantsUpdated);\n\n // This application is pretty simple, but use this special api ready state\n // event if you would like to any more complex app setup.\n gapi.hangout.addApiReadyListener(apiReady);\n}", "function initializeApp () {\n makeQuiz();\n eventHandlers();\n}", "constructor(app = null) {\n this.app = app;\n }", "function $$init() {\n let windowAllClosed = false;\n\n /**\n * creates a window\n */\n function createStartupWindow() {\n // startup window will shown immediately after created regardless of the preference\n createWindow(`${appProtocol}://${appHostname}${appStartupPath}`, null, true);\n }\n\n // quit application when all windows are closed\n app.on('window-all-closed', () => {\n // on macOS it is common for applications to stay open until the user explicitly quits\n windowAllClosed = true;\n if (process.platform !== 'darwin') {\n app.quit();\n }\n });\n\n app.on('activate', () => {\n // on macOS it is common to re-create a window even after all windows have been closed\n if (windowAllClosed) {\n createStartupWindow();\n windowAllClosed = false;\n }\n });\n\n createStartupWindow();\n }", "function App() {\n\n // load some scripts (uses promises :D)\n loader.load({\n url: \"./bower_components/jquery/dist/jquery.min.js\"\n }, {\n url: \"./bower_components/lodash/dist/lodash.min.js\"\n }, {\n url: \"./bower_components/backbone/backbone.js\"\n }, {\n url: \"./bower_components/backbone.localStorage/backbone.localStorage.js\"\n }, {\n url: \"./js/models/todo.js\"\n }, {\n url: \"./js/collections/todos.js\"\n }, {\n url: \"./js/views/todos.js\"\n }, {\n url: \"./js/views/app.js\"\n }, {\n url: \"./js/routers/router.js\"\n }, {\n url: \"./js/tapp.js\"\n }).then(function() {\n _.templateSettings.interpolate = /{([\\s\\S]+?)}/g;\n\n // start app?\n \n });\n}", "function initializeApplication(initObj) {\n initializeConfig();\n _router.initialize();\n\n if (initObj.view) {\n _view = initObj.view;\n } else {\n console.log('Nori, no view. Creating default.');\n _view = createApplicationView({});\n }\n\n if (initObj.model) {\n _model = initObj.model;\n } else {\n console.log('Nori, no model. Creating default.');\n _model = createApplicationModel({});\n }\n\n configureApplicationEvents();\n\n _appEvents.applicationInitialized();\n }", "function onAppReady(obj) {\r\n \"use strict\";\r\n \r\n console.log(\"init.js: onAppReady\");\r\n \r\n require([\"MainApp\", \"Router\", \"Config\", \"DataService\", \"handlebars\", \"templates\"], function (MainApp, Router, Config, DataService, handlebars, templates) {\r\n window.app = new MainApp(Config, templates, DataService);\r\n window.app.init();\r\n });\r\n}", "function initApp() {\r\n var startUpInfo;\r\n MemoryMatch.setPlatform();\r\n startUpInfo = \"Loading \" + MemoryMatch.getAppInfo();\r\n if (MemoryMatch.debugMode) {\r\n MemoryMatch.debugLog(startUpInfo);\r\n } else {\r\n console.log(startUpInfo);\r\n }\r\n\r\n // Listeners for all possible cache events\r\n\r\n var cache = window.applicationCache;\r\n if (cache != null) {\r\n cache.addEventListener('cached', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('checking', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('downloading', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('error', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('noupdate', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('obsolete', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('progress', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('updateready', MemoryMatch.logCacheEvent, false);\r\n }\r\n if (document.getElementById(MemoryMatch.loaderElement) != null) {\r\n // show canvas under loader so we can implement a loadbar until we get everything setup for EaselJS to take over\r\n document.getElementById(MemoryMatch.loaderElement).style.display = \"block\";\r\n document.getElementById(MemoryMatch.stageCanvasElement).style.display = \"block\";\r\n }\r\n\r\n // Determine canvas size, it will determine which assets need to be loaded\r\n MemoryMatch.isDesiredOrientationWhenLoadStarted = MemoryMatch.isDesiredOrientation();\r\n MemoryMatch.setCanvasSize(null);\r\n MemoryMatch.loadAllAssets(false);\r\n\r\n //runTests(); // run unit tests\r\n}", "function createApp(){ console.log(\"create an app\") }", "function createApp(){\n\tconsole.log('createApp: ')\n\tu.createMetroApp(app.name);\n}", "function App () {\n Base.call(this);\n this.dependencies = {};\n}", "function initializeApplication() {\n\n app.utils.getPageResources(chkErr(function(templates, content, config) {\n \n app.storage.getData(chkErr(function(contacts) {\n\n listTemplate = templates.partials_contact_list;\n pageContents = content;\n\n app.utils.renderPage(templates.page_contacts, content);\n refreshContactList(contacts);\n addContactPageListeners();\n\n }));\n\n }));\n\n }", "initialize() {\n templates.loadTemplates()\n .then(() => {\n // Initialize GUIs\n GUI.initialize();\n\n // Initialize Others\n this.initializeAutoMinimize();\n this.initializeHotkeys();\n this.initializeIpcListeners();\n\n // Check dependencies and update poe.ninja\n this.checkDependencies();\n Pricecheck.updateNinja();\n Pricecheck.updatePoeData();\n return;\n })\n .catch((error) => {\n var errorMsg = \"Error initializing app\\n\" + JSON.stringify(error, null, 4);\n\n log.error(errorMsg);\n alert(errorMsg);\n windowManager.closeAll();\n return;\n });\n }", "async function initialize() {\n process.on('uncaughtException', criticalErrorHandler.processUncaughtExceptionHandler.bind(criticalErrorHandler));\n global.willAppQuit = false;\n\n // initialization that can run before the app is ready\n initializeArgs();\n initializeConfig();\n initializeAppEventListeners();\n initializeBeforeAppReady();\n\n // wait for registry config data to load and app ready event\n await Promise.all([\n registryConfig.init(),\n app.whenReady(),\n ]);\n\n // no need to continue initializing if app is quitting\n if (global.willAppQuit) {\n return;\n }\n\n // initialization that should run once the app is ready\n initializeInterCommunicationEventListeners();\n initializeAfterAppReady();\n initializeMainWindowListeners();\n}", "function startApplication() {\n app.router = new Router({\n collection:app.collections.projectCollection\n });\n\n app.navigation = new HamburgerComponent({\n router:app.router\n });\n }", "function startApp(attrs) {\n var App;\n\n var attributes = Ember['default'].merge({}, config['default'].APP);\n attributes = Ember['default'].merge(attributes, attrs); // use defaults, but you can override;\n\n Router['default'].reopen({\n location: 'none'\n });\n\n Ember['default'].run(function() {\n App = Application['default'].create(attributes);\n App.setupForTesting();\n App.injectTestHelpers();\n });\n\n // App.reset(); // this shouldn't be needed, i want to be able to \"start an app at a specific URL\"\n\n return App;\n }", "function app() {\n\n // load some scripts (uses promises :D)\n //loader.load(\n {\n url: \"./bower_components/jquery/dist/jquery.min.js\"\n }; {\n url: \"./bower_components/lodash/dist/lodash.min.js\"\n }; {\n url: \"./bower_components/pathjs/path.min.js\"\n };then(function() {\n _.templateSettings.interpolate = /{([\\s\\S]+?)}/g;\n\n var options = {\n api_key: \"ab2ph0vvjrfql5ppli3pucmw\"\n }\n // start app?\n var client = new EtsyClient(options);\n\n\n })\n\n}", "function startApp() {\n //first calls, default dataset? \n }", "async function start () {\n await app.initDB()\n app.initSocket()\n app.initMiddlewares()\n app.initSubApp()\n await app.initHttp()\n }", "function App() {\n return null;\n }", "function App() {\n return null;\n }", "function runApp(app_name){\n app.mount(app_name);\n}", "static init() {\n console.log(\"App is Initialize...\");\n }", "function initApp(appname) {\n return new Promise(function( resolve, reject ) {\n return RPCCall(0,'load',[appname]).then( function() {\n resolve( cache[0] ); // return the apploader\n } );\n } );\n}", "function startup() {\n // Set initial UI data for our app and Vue\n // App data will be populated after updateUI is called in onMessage EVENT_BRIDGE_OPEN_MESSAGE \n dynamicData = deepCopy(CONFIG.INITIAL_DYNAMIC_DATA);\n defaultMaterialProperties = {\n shadeless: deepCopy(CONFIG.INITIAL_DYNAMIC_DATA[STRING_MATERIAL].shadeless),\n pbr: deepCopy(CONFIG.INITIAL_DYNAMIC_DATA[STRING_MATERIAL].pbr)\n };\n \n // Create the tablet app\n ui = new AppUi({\n buttonName: CONFIG.BUTTON_NAME,\n home: URL,\n onMessage: onMessage, // UI event listener \n // Icons are located in graphicsDirectory\n // AppUI is looking for icons named with the BUTTON_NAME \"avatar-101\" \n // For example: avatar-101-a.svg for active button icon, avatar-101-i.svg for inactive button icon\n graphicsDirectory: Script.resolvePath(\"./resources/icons/\"), \n onOpened: onOpened,\n onClosed: onClosed\n });\n\n // Connect unload function to the script ending\n Script.scriptEnding.connect(unload);\n // Connect function callback to model url changed signal\n MyAvatar.skeletonModelURLChanged.connect(onAvatarModelURLChanged);\n }", "function init() {\n\n require('dotenv').load();\n\n app.port = process.env.PORT || 3002;\n\n // Default route\n app.get('/', function (req, res) {\n res.json({\n name: 'League of Legends eSports API',\n version: \"0.9.0\",\n author: \"Robert Manolea <[email protected]>\",\n repository: \"https://github.com/Pupix/lol-esports-api\"\n });\n });\n\n // Dynamic API routes\n XP.forEach(routes, function (func, route) {\n app.get(route, requestHandler);\n });\n\n //Error Handling\n app.use(function (req, res) { res.status(404).json({error: 404, message: \"Not Found\"}); });\n app.use(function (req, res) { res.status(500).json({error: 500, message: 'Internal Server Error'}); });\n\n // Listening\n app.listen(app.port, function () { console.log('League of Legends eSports API is listening on port ' + app.port); });\n }", "function App() {\n this.express = express();\n this.middleware();\n this.routes();\n }", "setupApp() {\n this.app = express();\n if (this.config.bodyParserOptions.json) {\n this.app.use(bodyParser.json(this.config.bodyParserOptions.json));\n }\n if (this.config.bodyParserOptions.raw) {\n this.app.use(bodyParser.raw(this.config.bodyParserOptions.raw));\n }\n if (this.config.bodyParserOptions.text) {\n this.app.use(bodyParser.text(this.config.bodyParserOptions.text));\n }\n if (this.config.bodyParserOptions.urlencoded) {\n this.app.use(bodyParser.urlencoded(this.config.bodyParserOptions.urlencoded));\n }\n this.app.use(cookieParser(this.config.cookieParserOptions));\n this.app.use(morgan(this.config.morganOptions));\n this.app.use(compression(this.config.compressionOptions));\n }", "function main() {\n // Resolve our container and intialize our application\n let canvasEl = document.getElementById('canvas');\n assert(canvasEl, 'Unable to find #canvas element');\n window.app = new App(canvasEl);\n}", "function main() {\n new App().main();\n}", "function initApp() {\n const logoutBtn = document.querySelector('#logout');\n const search = document.querySelector('#search');\n\n logoutBtn.addEventListener('click', logout);\n search.addEventListener('submit', searchContacts);\n\n loadAppState();\n}", "function initializeApp() {\n return function(dispatch, getState) {\n dispatcherHandler_2.registerListener();\n dispatch(registerRibbonFunctions());\n dispatcherHandler_2.getResourceStrings(resources_2.resourceStrings,\n function(response) {\n var values = JSON.parse(response.functionArguments[1]).values;\n resources_2.default.initialize(values);\n });\n dispatcherHandler_2.getCrmAccessKey(function(response) {\n var crmAccessKey = JSON.parse(response.functionArguments[1]).requestSecurityTokenResponse;\n var result = crmAccessKey.replace('<RequestOAuthSecurityTokenResponse><AccessToken>', '');\n result = result.substring(0, result.indexOf('</AccessToken><EncodedAccessToken>'));\n dispatch(acquiredCrmAccessKey(result));\n });\n dispatcherHandler_2.getCallbackTokenAsync(function(response) {\n var value = JSON.parse(response.functionArguments[1]).onRequestCallbackTokenAsyncResponse;\n // Since the dispatcher doesn't actually let us know if it succeeds or not, we must test its type.\n if (typeof value == 'string') {\n dispatch(acquiredCallbackToken(value));\n }\n dispatcherHandler_2.sendTelemetryEvent({\n name: 'mailapp_module_init',\n data: {\n type: 'mailapp_module_init'\n }\n });\n // If it's some error object. This is unsupported, try old auth?\n dispatch({\n type: actionTypes.INITIALIZE_APP,\n payload: {}\n });\n });\n };\n }", "function startApplication() {\n var appComponent = new AppComponent(document.querySelector('.content'));\n appComponent.start();\n}", "constructor(app) {\n super(app);\n }", "function initializeAppEnv() {\n appEnv = cfenv.getAppEnv(appEnvOpts);\n if (appEnv.isLocal) {\n require('dotenv').load();\n }\n if (appEnv.services.cloudantNoSQLDB) {\n initCloudant();\n } else {\n console.error(\"No Cloudant service exists.\");\n }\n\n if(appEnv.services.conversation){\n console.log(\"Services\");\n initConversation();\n }else{\n console.error(\"No Conversation service exists\");\n }\n}", "function onPreappinit() {\n kony.print(\"LOG : onPreappinit - START\");\n gAppData = new initAppData();\n}", "start() {\n //DO BEFORE START APP CONFIGURATION/INITIALIZATION\n super.start();\n }", "function initExpressApp() {\n\n const port = process.env.PORT || 3001;\n\n if (isDev()) {\n dotenv.config();\n }\n\n const app = express();\n app.use(cors());\n app.use(bodyParser.json());\n\n app.listen(port, () => {\n console.log(`listening on port ${port}`);\n });\n\n return app;\n}", "function App() {\n this.googlePassportObj = new GooglePassport_1[\"default\"]();\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = 100;\n this.Postcards = new PostcardModel_1.PostcardModel();\n this.Collections = new CollectionModel_1.CollectionModel();\n }", "function Application() {}", "function auxinApp(uiaId)\n{\n log.debug(\"auxinApp App constructor called...\");\n\n baseApp.init(this, uiaId);\n}", "function init() {\n console.log(\"FaustPlayground: version 1.0.0\");\n var app = new App();\n var ressource = new Ressources;\n ressource.getRessources(app);\n}", "function initializeApplication() {\n invokePageFunction(APPLICATION_METHOD_INITIALIZE);\n }", "function App(core, ee) {\n this.core = core;\n this.ee = ee;\n this.sessionfile = __dirname + \"/session.json\";\n}", "function _createApplication() {\n /**\n * Create the root of the application\n */\n mkdirSync(appPath);\n\n /**\n * Copy the baseline structure of the application\n */\n const templateBaselinePath = path.join(__dirname, '..', constants.TEMPLATE_BASELINE_PATH);\n deepCopySync(templateBaselinePath, appPath);\n\n /**\n * Copy the index.html file according to the configuration\n */\n if (program.menu === 'left') {\n deepCopySync(path.join(__dirname, '..', constants.INDEX_LEFT_MENU), appPath);\n } else {\n deepCopySync(path.join(__dirname, '..', constants.INDEX_TOP_MENU), appPath);\n }\n\n /**\n * Create the other directiories that are needed for the start\n */\n constants.DIRECTORIES_FOR_mkdirSync.forEach(__path => {\n mkdirSync(path.join(appPath, __path));\n });\n\n /**\n * Run the steps to aquire the final form of the skeleton\n */\n startTaskRunner(appPath);\n}", "function init()\r\n{\r\n\tif(!$.appConfiguration)\r\n\t{\r\n\t\tconsole.error(\"No appliation configuration is defined.\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t//Load templates\r\n\tvar templateFiles = $.appConfiguration.templates;\r\n\r\n\tif(templateFiles)\r\n\t{\r\n\t\tfor(var i = 0; i < templateFiles.length; i++)\r\n\t\t{\r\n\t\t\tconsole.log(\"Loading template file - \" + templateFiles[i]);\r\n\t\t\t$.loadCustomDirectives(templateFiles[i]);\r\n\t\t}\r\n\t}\r\n}", "constructor(_atdiroverride = -1, _apiurl = -1, _averbose = false){\r\n\t\tthis._app_initialized = false;\r\n\t\tthis._app_conf = { _template_dir: _atdiroverride, _api_url: _apiurl };\r\n\t\tthis._app_templates = [];\r\n\t\tthis._app_templates_buffer = [];\r\n\t\tthis._app_template_styles = [];\r\n\t\tthis._app_started = false;\r\n\t\tthis._app_verbose = _averbose;\r\n\t}", "function initializeApp(options, name) {\n\t if (name === undefined) {\n\t name = DEFAULT_ENTRY_NAME;\n\t } else {\n\t if (typeof name !== 'string' || name === '') {\n\t error('bad-app-name', { name: name + '' });\n\t }\n\t }\n\t if (contains(apps_, name)) {\n\t error('duplicate-app', { name: name });\n\t }\n\t var app = new FirebaseAppImpl(options, name, namespace);\n\t apps_[name] = app;\n\t callAppHooks(app, 'create');\n\t return app;\n\t }", "function init(){\n var config = JSON.parse(fs.readFileSync(CONFIG_FILE));\n \n var projectConfig = config[\"project\"];\n console.log(\"\\n --- \" + projectConfig[\"name\"] + \" --- \\n\" + projectConfig[\"description\"] + \"\\n\"); //project logo\n \n var databaseConfig = config[\"databaseConnection\"];\n var systemUser = config[\"systemUser\"];\n var keysPath = config[\"keysPath\"];\n \n var privateKey = fs.readFileSync(path.join(__dirname, keysPath[\"privateKey\"])).toString();\n \n var dataManager = new DataManager({\n host: databaseConfig[\"host\"],\n port: databaseConfig[\"port\"],\n database: databaseConfig[\"database\"],\n user: databaseConfig[\"user\"],\n password: databaseConfig[\"password\"]\n }, privateKey);\n \n dataManager.query(\"UPDATE Users SET password = ?, inputDate = NOW() WHERE firstName = 'System'\", [dataManager.strToAES(systemUser[\"password\"])], function(field, row, err){});\n \n dataManager.setConfigData(config);\n \n var channelManager = new ChannelManager(dataManager);\n var app = new App(dataManager, channelManager, privateKey);\n \n app.getApp().on(\"error\", function(err){\n console.log(\"FATAL ERROR: \" + err);\n init();\n });\n\n var systemConfig = config[\"system\"];\n http.globalAgent.maxSockets = config[\"maxClients\"];\n http.createServer(app.getApp()).listen(systemConfig[\"serverPort\"]);\n console.log(\"Server running on port \" + systemConfig[\"serverPort\"]);\n}", "_boot(){\r\n\t\tvar core = this;\r\n\t\tif(core._app_conf._template_dir != -1){\r\n\t\t\t\tcore._app_initialized = true;\r\n\t\t} else {\r\n\t\t\t\tcore._rest(\"POST\", core._app_conf._api_url, [[\"api\", \"template_get_dir\"]], core._app_conf, \"_template_dir\");\r\n\r\n\t\t\t// Wait until all the config variables are all retrieved\r\n\t\t\tvar _tmpVarCheck = setInterval(function(){\r\n\r\n\t\t\t\tif(core._app_verbose) console.log(\"Initializing application...\");\r\n\t\t\t\tif(core._app_conf._template_dir != -1){\r\n\t\t\t\t\tcore._app_initialized = true;\r\n\t\t\t\t\tclearInterval(_tmpVarCheck);\r\n\t\t\t\t}\r\n\t\t\t}, 1);\r\n\t\t}\r\n\t}", "async initialize(appConfig) {\n this.preferences = this.externalServices.createPreferences();\n this.appConfig = appConfig;\n\n await this._readPreferences();\n await this._parseHashParameters();\n this._forceCssTheme();\n await this._initializeL10n();\n\n if (\n this.isViewerEmbedded &&\n AppOptions.get(\"externalLinkTarget\") === LinkTarget.NONE\n ) {\n // Prevent external links from \"replacing\" the viewer,\n // when it's embedded in e.g. an <iframe> or an <object>.\n AppOptions.set(\"externalLinkTarget\", LinkTarget.TOP);\n }\n await this._initializeViewerComponents();\n\n // Bind the various event handlers *after* the viewer has been\n // initialized, to prevent errors if an event arrives too soon.\n this.bindEvents();\n this.bindWindowEvents();\n\n // We can start UI localization now.\n const appContainer = appConfig.appContainer || document.documentElement;\n this.l10n.translate(appContainer).then(() => {\n // Dispatch the 'localized' event on the `eventBus` once the viewer\n // has been fully initialized and translated.\n this.eventBus.dispatch(\"localized\", { source: this });\n });\n\n this._initializedCapability.resolve();\n }", "function serverInit(app){\n\n\tvar config = app.config;\n\tconsole.log('app init...');\n\t\n\tapp.set('views', config.static_assets.views);\n\tapp.use(favicon(path.join(config.static_assets.dir, 'favicon.ico')));\n\t\n\tif(config.app.env == 'development') {\n\t\tapp.use(logger('dev'));\n\t}\n\tapp.use(bodyParser.json());\n\tapp.use(bodyParser.urlencoded());\n\tapp.use(cookieParser());\n\tapp.use(session({ secret: config.session.secret, cookie: { maxAge: config.session.max_age} }));\n\tapp.use(express.static(config.static_assets.dir));\n\t\t\n\t//db e config injecting\n\tapp.use(function(req, res, next){\n\t\treq.dataDB = app.db.data;\n\t\treq.userDB = app.db.users;\n\t\treq.config = config;\n\t\tnext();\n\t});\n\t\n\t//inizializzo le componenti del controller\n\tvar controller = require('./controller');\n\tcontroller.init(app);\n\t\n}", "async function bootApp() {\n await sessionStore.sync();\n await syncDb();\n await createApp();\n await startListening();\n}", "function loadApplication() {\n console.log(\"Application loaded\");\n // Load directly to the main menu\n configureUI(displayMainMenu());\n\n}", "async function init(){\n const libAppSettings = require(\"lib-app-settings\");\n var appSettings = new libAppSettings(\".settings\");\n await appSettings.loadSettingsFromFile()\n .then((settings)=>{\n if (settings){\n apps = settings.apps;\n addApps();\n checkAppsSlow();\n startApps();\n }\n })\n .catch((error)=>{\n alert(\"Problem with settings file - \" + error);\n });\n}", "function loadApp() {\n console.log(\"loadApp\");\n displayHomePage();\n}", "function App(opts) {\n // new customizable settings for each App instance\n this.settings = getAppSettings();\n\n // if no path sent in to init, nor to App constructor,\n // then take the process's working directory as apper root\n this.path = opts.path || process.cwd();\n\n this.mountPath = opts.mountPath || \"\";\n\n // indent starts at 0 to demarcate subapps with increasing indent\n this.indent = opts.indent || 1;\n\n this.socketIO = opts.socketIO;\n}", "function App() {\n this.googlePassportObj = new GooglePassport_1[\"default\"]();\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = Math.floor(Math.random() * (max - min) + min);\n this.Recipes = new RecipeModel_1.RecipeModel();\n this.RecipesCatalog = new RecipeCatalogModel_1.RecipeCatalogModel();\n this.RecipeCatalogDetails = new RecipeCatalogDetailsModel_1.RecipeCatalogDetailsModel();\n this.User = new UserModel_1.UserModel();\n }", "function init(application, config) {\n app = application;\n cfg = config;\n\n // register URLs\n\tapp.get(/.*/, function(req, res) { utils.processRequest(req, res, cfg, FUNCTIONS); } );\n\tapp.put(/.*/, function(req, res) { utils.processRequest(req, res, cfg, FUNCTIONS); } );\n\tapp.post(/.*/, function(req, res) { utils.processRequest(req, res, cfg, FUNCTIONS); } );\n\tapp.delete(/.*/, function(req, res) { utils.processRequest(req, res, cfg, FUNCTIONS); } );\n}", "function Application( autoInvoke /*, Arguments */ ) {\n\n if( autoInvoke ) {\n\n this.Init( /* Arguments */ )\n\n }\n\n return this;\n}", "async function bootApp() {\n await syncDb() // initializing and seeding your database\n await createApp()\n await startListening()\n }", "constructor() {\n this.app = express();\n this.config();\n }", "function init() {\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", app)\n\telse\n\t\tapp()\n}", "function initApp(apiUrl) {\n //localStorage.clear();\n localStorage.setItem(\"api\", apiUrl);\n localStorage.setItem(\"currPost\", 0);\n // Initialises the page.\n genNavBar();\n genSearch(\"generate\");\n genLogin(\"generate\");\n genSignup(\"generate\");\n genProfile(\"generate\");\n genModDelPost(\"generate\");\n genFeed(\"generate\");\n genPages(\"generate\");\n genUpvotes(\"generate\");\n genComments(\"generate\");\n genPost(\"generate\");\n eventListen();\n scroll();\n}", "function startApp() {\n Backbone.history.start({\n pushState: false\n });\n\n var isFirstLoad = localStorage.getItem('firstLoad') === null;\n\n if (isFirstLoad) {\n var onboardView = new OnboardView();\n\n $('body').append(onboardView.render().el);\n localStorage.setItem('firstLoad', 1);\n }\n}", "function startApp() {\n connection.connect(function (err) {\n if (err) throw err;\n console.log('connected as id ' + connection.threadId);\n console.log('\\n');\n managerView();\n });\n}", "function init() {\n\tspeechEngine = Homey.manager('speech-output');\n\tHomey.log('NU.nl news app loaded.');\n\t\n\t// Create settings variables with default values if none seem to exist\n\tif (!Homey.manager('settings').get('mode')) {\n\t\tHomey.manager('settings').set('mode', 'title');\n\t\tHomey.log('Created setting: mode');\n\t}\n\tif (!Homey.manager('settings').get('max')) {\n\t\tHomey.manager('settings').set('max', 10);\n\t\tHomey.log('Created setting: max');\n\t}\n}", "function createApp() {\n const app = new Koa();\n const router = new Router();\n /* \n Middlewares\n */\n\tapp.use(helmet());\n\tapp.use( async (ctx, next) => {\n\t\tconst reqOrigin = ctx.header.origin;\n\t\tregisterName.forEach(origin => {\n\t\t\tif (origin === reqOrigin) ctx.set(\"Access-Control-Allow-Origin\", reqOrigin);\n\t\t});\n\t\tctx.set(\"Access-Control-Allow-Methods\", \"GET, POST\");\n\t\tctx.set(\"Access-Control-Allow-Credentials\", true);\n\t\tctx.set(\"Access-Control-Allow-Headers\", [\n\t\t\t'Origin', 'Content-Type', 'Accept', 'Authorization', 'Access-token', 'Refresh-token'\n\t\t]);\n\t\tctx.set(\"X-Powered-By\", \"PHP 4.2.0\");\n\t\tctx.set(\"X-XSS-Protection\", \"1; mode=block; report=/report-xss-violation\");\n\t\tawait next();\n\t});\n app.use(uid);\n /*\n Connect all routes\n */\n router.use('/api/v1/auth', authRouter.routes());\n router.use('/api/v1/global', refreshRouter.routes());\n\n app.use(router.allowedMethods());\n app.use(router.routes());\n return app;\n}", "function AppUtils() {}", "async function start () {\n\n\ttry {\n\t\t/*\n\t\t * Store basic inforamation about the application\n\t\t * for other modules to use */\n\t\t//args.name_pretty = 'Admin Dashboard';\n\t\t//args.desc = 'Mission control station';\n\n\t\t/*\n\t\t * Common startup file for all apss */\n\t\t//log = await startup.init(args);\n\t\t//await kv.get_and_store (`config/app/vc/`, { recurse : true });\n\n\t\t//log.info ({ args }, `starting app ${name} with arguments`);\n\n\t\trequire ('./www');\n\t}\n\tcatch (e) {\n\t\tconsole.error (colors.red ('fatal error : ') + e);\n\t\tif (e.stack)\n\t\t\tconsole.error (e.stack);\n\n\t\tprocess.exit (1);\n\t}\n}", "function intiApp() {\n app.listen(port, (err) => {\n if (err)\n logger.error(`Unable to lunch the application :: ${err.message}`);\n else {\n logger.info(`Application launch successfully on port ${port}`);\n console.log('application is running on port ' + port);\n }\n })\n}", "function init() {\n\tconst params = getUrlParameters() // valuable information is encoded in the URL\n\tconst dataPromise = loadData(params) // start loading the data\n\tconst callback = () => app(params, dataPromise)\n\n\t// set error handlers\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", callback)\n\telse\n\t\tcallback()\n}", "function App() {\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = 102;\n this.Properties = new PropertyModel_1.PropertyModel();\n this.Users = new UserModel_1.UserModel();\n this.Bookings = new BookingModel_1.BookingModel();\n this.Reviews = new ReviewModel_1.ReviewModel();\n this.googlePassportObj = new GooglePassport_1[\"default\"]();\n }", "async function givenRunningApplicationWithCustomConfiguration() {\n app = new application_1.TodoListApplication({\n rest: testlab_1.givenHttpServerConfig(),\n });\n await app.boot();\n /**\n * Override default config for DataSource for testing so we don't write\n * test data to file when using the memory connector.\n */\n app.bind('datasources.config.db').to({\n name: 'db',\n connector: 'memory',\n });\n // Start Application\n await app.start();\n }", "init(app) {\n this.app = app;\n this.expressLimiter();\n this.bodyParser();\n this.cors();\n this.helmet();\n this.override();\n this.compression();\n }", "appExecute() {\n\n\t\tthis.appConfig();\n\t\tthis.includeRoutes(this.app);\n\n\t\tthis.http.listen(this.port, this.host, () => {\n\t\t\tconsole.log(`Listening on http://${this.host}:${this.port}`);\n\t\t});\n\t}", "function App() {\n this.db = new DatabaseConnection_1.DatabaseConnection();\n this.express = express();\n this.middleware();\n this.routes();\n this.setViews();\n var classifier = new ReleaseClassifier_1.ReleaseClassifier();\n var commitClassifier = new CommitClassifier_1.CommitClassifier();\n //classifier.readReleases();\n //commitClassifier.readCommits();\n }", "function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n } else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }", "function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n } else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }", "function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n } else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }", "function initializeAppEnv() {\n appEnv = cfenv.getAppEnv(appEnvOpts);\n if (appEnv.isLocal) {\n require('dotenv').load();\n }\n if (appEnv.services.cloudantNoSQLDB) {\n initCloudant();\n } else {\n console.error(\"No Cloudant service exists.\");\n }\n}", "function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }", "function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }", "function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }", "function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }", "function initializeApp(options, name) {\n if (name === undefined) {\n name = DEFAULT_ENTRY_NAME;\n }\n else {\n if (typeof name !== 'string' || name === '') {\n error('bad-app-name', { name: name + '' });\n }\n }\n if (contains(apps_, name)) {\n error('duplicate-app', { name: name });\n }\n var app = new FirebaseAppImpl(options, name, namespace);\n apps_[name] = app;\n callAppHooks(app, 'create');\n return app;\n }", "function App () {\n\n this.taskRepository = new TaskRepository();\n\n this.todosController = new TodosController(this.taskRepository);\n\n }" ]
[ "0.79483765", "0.77004915", "0.75859904", "0.7392242", "0.73389673", "0.7337566", "0.7098709", "0.7094714", "0.70335907", "0.70264256", "0.70233685", "0.69898516", "0.6983825", "0.6980272", "0.69399434", "0.6926202", "0.69252443", "0.69087744", "0.68747747", "0.6861737", "0.6847013", "0.68469596", "0.6832527", "0.6807746", "0.6807065", "0.6787931", "0.67023855", "0.6674997", "0.6657791", "0.6643947", "0.663732", "0.6608848", "0.66065794", "0.6593314", "0.6593314", "0.658335", "0.6577757", "0.6574134", "0.6567644", "0.65669584", "0.65658617", "0.65598804", "0.6554315", "0.65538895", "0.65213585", "0.6507013", "0.6504236", "0.65017086", "0.65005606", "0.6497632", "0.6479279", "0.6476846", "0.6465423", "0.6463654", "0.64554805", "0.6454109", "0.64504546", "0.64500046", "0.6440417", "0.6438924", "0.64259344", "0.640501", "0.63972026", "0.6394819", "0.6391415", "0.6385431", "0.6381386", "0.63813645", "0.63789535", "0.63741195", "0.6369189", "0.6368408", "0.6364923", "0.6363224", "0.6354211", "0.63459194", "0.63426226", "0.6337443", "0.63346434", "0.633441", "0.63161135", "0.6308342", "0.6301769", "0.6300281", "0.6291626", "0.6276836", "0.62760425", "0.6275703", "0.6271411", "0.62698746", "0.6267628", "0.62652314", "0.62652314", "0.62652314", "0.62651914", "0.62641805", "0.62641805", "0.62641805", "0.62641805", "0.62641805", "0.6260911" ]
0.0
-1
date may be null or if it is entered it should be date
function check_text_datenull(InpDateObj) { var InpDate=InpDateObj.value; if(InpDate != "") { return check_text_date(InpDateObj); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDate(input) {\n return input && input.getDate && !isNaN(input.valueOf());\n }", "function dateCheck(date){\n let finalDate;\n if (date==null){\n finalDate='';\n }else{\n finalDate= date;\n }\n return finalDate;\n}", "get date() {\n return this.addValidator({\n message: (value, label) => `Expected ${label} to be a date, got \\`${value}\\``,\n validator: valiDate\n });\n }", "function isDate(date) {\n return (date && date.getDate) ? date : false;\n }", "static validate(date) {\n if (!date || !moment(date).isValid()) { return null; }\n // Check if date is greater than minimum date\n if (date < minimumDate) { return null; }\n return date;\n }", "static _validateDateField(req, obj, field) {\n if (obj[field] == null) {\n return;\n }\n const d = obj[field];\n //Date constructor accepts other types such as arrays but we don't\n //allow this.\n const v = d instanceof Date ? d : new Date(\n (typeof d === 'number' || typeof d === 'string') ? d : NaN);\n if (!Number.isFinite(v.getTime())) { // NaN for invalid date\n throw new NoSQLArgumentError(`Invalid ${field} value`, req);\n }\n obj[field] = v;\n }", "function validDate(sender, args)\n{\n\tif (args.Value.length > 0)\n\t\targs.IsValid = isDate(args.Value);\n\telse\n\t\targs.IsValid = true;\n}", "function dateForInputs(date){\r\n return date.getFullYear() + \"-\" + twoNum(date.getMonth()+1) + \"-\" + twoNum(date.getDate())\r\n }", "setDate(event) {\n if (this.props.changeDate) {\n if (event.target.parentNode.firstChild.value.length !== 10) {\n alert('Please type date in the following format: year-month-day. Example:2019-04-12');\n } else if (event.target.parentNode.firstChild.value.length === 10) {\n this.props.changeDate(this.props.baseCurrency, event.target.parentNode.firstChild.value);\n }\n }\n }", "function check_DateObj(obj,blank)\n{\n\tif (obj == null) return false;\n\t\n\tobj.value = obj.value.trim();\n\tvar value = obj.value.trim();\n\tif (value == \"\") {\n\t\tif(blank == null)\n\t\t\t return true;\n\t\t\n\t\treturn false;\n\t}\n\tvar formatedDate = formatDate(value, \"-\");\t\n\tif (formatedDate == null)\n\t{\n\t\treturn false;\n\t}\n\tif (!isDateString(formatedDate, \"-\"))\n\t{\n\t\treturn false;\n\t}\n\t\n\tobj.value = formatedDate;\n\treturn true;\n}", "static supportsDateInput() {\n const input = document.createElement(`input`);\n input.setAttribute(`type`, `date`);\n\n const notADateValue = `not-a-date`;\n input.setAttribute(`value`, notADateValue);\n\n return !(input.value === notADateValue);\n }", "function dateValidation( date ) {\n\n\t\tvar pass = /^\\d{4}-\\d{2}-\\d{2}/.test( date );\n\t\treturn pass;\n\n\t}", "function isAptDateValid(dateElem) {\n var messageId = \"dateAptInfo\";\n if(dateElem.value.length === 0)\n return showValErrorMessage(dateElem, \"Please select a date\", messageId);\n else if (new Date(dateElem.value) < new Date())\n return showValErrorMessage(dateElem, \"Date must be in the future\", messageId);\n else\n return removeValErrorMessage(dateElem, messageId);\n}", "get valueAsDate() {\n return this.getInput().valueAsDate;\n }", "function isDateObj(obj,blank)\n{\n\tif (obj == null) return false;\n\t\n\tobj.value = obj.value.trim();\n\tvar value = obj.value.trim();\n\tif (value == \"\") {\n\t\tif(blank == null) return true;\n\t\tif(blank !=\"false\"){\n\t\talert(getMessage(\"MSG_SYS_037\"));\n\t\t}\n\t\tobj.focus();\n\t\tobj.select();\n\t\treturn false;\n\t}\n\tvar formatedDate = formatDate(value, \"-\");\t\n\tif (formatedDate == null)\n\t{\n\t if(blank !=\"false\"){\n\t\talert(getMessage(\"MSG_SYS_004\"));\n\t\t}\n\t\tobj.focus();\n\t\tobj.select();\n\t\treturn false;\n\t}\n\tif (!isDateString(formatedDate, \"-\"))\n\t{\n\t if(blank !=\"false\"){\n\t\talert(getMessage(\"MSG_SYS_024\"));\n\t\t}\n\t\tobj.focus();\n\t\tobj.select();\t\t\n\t\treturn false;\n\t}\n\t\n\tobj.value = formatedDate;\n\treturn true;\n}", "function validateDate(value){\n if(value){ //if value isn't null\n if(/^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/.test(value)){\n if(/^(0[1-9]|1[0-2])\\/(0[1-9]|1\\d|2\\d|3[01])\\/(19|20)\\d{2}$/.test(value)){ //use regex to check if the the string is in date format (mm/dd/yyyy)\n return {isValid: true, error: null, details: null};\n }\n return {isValid: false, error: 'Invalid date', details: '\"'+value+'\" date is invalid or out of bound.'};\n }\n return {isValid: false, error: 'Must be in date format', details: '\"'+value+'\" is NOT in MM/DD/YYYY date format.'};\n }\n return {isValid: false, error:'Empty Field', details: 'Please fill out this field to resolve this issue.'};\n}", "function cdr_type_date_text(date) {\n let result = null;\n\n if (date) {\n let temp = moment(date).format(`YYYY-MM-DD`);\n result = temp;\n }\n\n return result;\n}", "function validDate (value) {\n\t return isDate(value) &&\n\t isNumber(Number(value))\n\t}", "function validateBirthdate(date) {\n if(date.value == \"\") {\n setError(date, errorMessages.birthdate);\n return false;\n }\n else {\n let birthdate = new Date(date.value);\n\tlet today = new Date();\n\t\tif (\n\t\t\tbirthdate.getDate() >= today.getDate() &&\n\t\t\tbirthdate.getMonth() == today.getMonth() &&\n\t\t\tbirthdate.getFullYear() == today.getFullYear()\n\t\t) {\n setError(date, errorMessages.birthdateInvalid);\n return false;\n }\n else {\n removeError(date);\n return true;\n }\n }\n}", "function checkdate(input){\t \nvar validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}$/ // Basic check for format validity\n\t var returnval= 0\n\t if (!validformat.test(input.value)){\n\t\t input.select();\n\t\t return -1;\n\t }\n\t else{ // Detailed check for valid date ranges\n\t var monthfield=input.value.split(\"/\")[0]\n\t var dayfield=input.value.split(\"/\")[1]\n\t var yearfield=input.value.split(\"/\")[2]\n\t var dayobj = new Date(yearfield, monthfield-1, dayfield)\n\t if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))\n\t\t return -2\n\t \n\t return 0;\n}\n}", "function validateStartDate (date) {\n if (new Date(date) <= new Date()) {\n return false\n }\n}", "isDate(value) {\n return (\n value &&\n Object.prototype.toString.call(value) === \"[object Date]\" &&\n !isNaN(value)\n );\n }", "function validateDate(date, errMsg)\r\n{\r\n if(!checkIfBlank(date))\r\n{\r\n\t var dt=date.value\r\n\t if (isDate(dt)==false)\r\n\t {\r\n\t alert(errMsg);\r\n\t date.value=\"\";\r\n date.focus();\r\n\t return false;\r\n\t }\r\n\r\n\t var pos1=dt.indexOf(dtCh);\r\n\t var pos2=dt.indexOf(dtCh,pos1+1);\r\n\t var strDay=dt.substring(0,pos1);\r\n\t var strMonth=dt.substring(pos1+1,pos2);\r\n\t var strYear=dt.substring(pos2+1);\r\n\r\n\t if(strMonth.length !=2)\r\n\t\t strMonth = '0' + strMonth;\r\n\r\n\t if(strDay.length !=2)\r\n\t\t strDay = '0' + strDay;\r\n\t\r\n\t var strDate = strDay + dtCh + strMonth + dtCh +strYear;\r\n\t date.value = strDate;\r\n\r\n}\r\n return true;\r\n}", "function prepDate(model) { return _.isEmpty(model) ? null : moment(model).toDate();}", "function dateValidator() {\n var dateFormat = /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n var now = new Date(Date.now()); //get currents date\n if (!dateFormat.test(this.value)) {\n alert(\"You put invalid date format\");\n return false;\n }\n //check date\n if (this.value.substring(0, 2) != now.getDate()) {\n alert(\"You put not current day.\");\n return false;\n }\n //check month\n else if (this.value.substring(3, 5) != now.getMonth() + 1) {\n alert(\"You put not current month.\");\n return false;\n }\n //check year\n else if (this.value.substring(6, 10) != now.getFullYear()) {\n alert(\"You put not current year.\");\n return false;\n }\n return true;\n }", "function validate_date(input_date) {\n\tvar dateFormat = /^\\d{1,4}[\\.|\\/|-]\\d{1,2}[\\.|\\/|-]\\d{1,4}$/;\n\tif (dateFormat.test(input_date)) {\n\t\ts = input_date.replace(/0*(\\d*)/gi, \"$1\");\n\t\tvar dateArray = input_date.split(/[\\.|\\/|-]/);\n\t\tdateArray[1] = dateArray[1] - 1;\n\t\tif (dateArray[2].length < 4) {\n\t\t\tdateArray[2] = (parseInt(dateArray[2]) < 50) ? 2000 + parseInt(dateArray[2]) : 1900 + parseInt(dateArray[2]);\n\t\t}\n\t\tvar testDate = new Date(dateArray[2], dateArray[1], dateArray[0]);\n\t\tif (testDate.getDate() != dateArray[0] || testDate.getMonth() != dateArray[1] || testDate.getFullYear() != dateArray[2]) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function isValidDate(input) {\n\treturn isDate(input) && isFinite(input);\n}", "function validateDate(d) {\n if (typeof d == 'string' && d.toLowerCase() == \"invalid date\")\n return \"Unknown\";\n \n return d;\n}", "fromModel(date) {\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\n { year: date.year, month: date.month, day: date.day } :\n null;\n }", "function isDate(value) {\n\t return value instanceof Date && !isNaN(+value);\n\t}", "function isNullDate(dateObject,captionName) {\n\n if(!(dateObject.value.length >0)){\n\talert(captionName + \" is a compulsory field. Please enter the required details\");\n\tif(document.all){\n\t\tdateObject.focus();\n\t}\n\treturn false;\n }\n return true;\n\n}", "function isDate(input) {\n\t// Avoid cross-frame issues by using toString.\n\treturn Object.prototype.toString.call(input) === '[object Date]';\n}", "function check_valid_date(date) {\n\tvar base_url = $('#base_url').val();\n\tvar check_date1 = $('#' + date).val();\n\n\t$.post(base_url + 'view/load_data/finance_date_validation.php', { check_date: check_date1 }, function (data) {\n\t\tif (data !== 'valid' && data !== '') {\n\t\t\terror_msg_alert(data);\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t});\n}", "function ValidateDateObj(selectdate) {\n var bool = true;\n if (selectdate != null && selectdate != undefined && String(selectdate).trim() != '') {\n var dt = String(selectdate).split(',');\n if (!(parseInt(dt[1]) > 0 && parseInt(dt[1]) < 13)) {\n\n // alert(\"Invalid Date Format. Date Must be MM/DD/YYYY\");\n bool = false;\n return bool;\n }\n else if (!(parseInt(dt[2]) > 0 && parseInt(dt[2]) < 31)) {\n // alert(\"Invalid Date Format. Date Must be MM/DD/YYYY\");\n bool = false;\n return bool;\n }\n else if (!(dt[3].length == 4 && parseInt(dt[3]) > 0)) {\n if (parseInt(a[0]) > 12 || parseInt(a[1] > 31)) {\n // alert(\"Invalid Date Format. Date Must be MM/DD/YYYY\");\n bool = false;\n return bool;\n }\n }\n }\n return bool;\n}", "getValidDateOrNull(obj) {\n return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;\n }", "getValidDateOrNull(obj) {\n return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;\n }", "getValidDateOrNull(obj) {\n return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;\n }", "function isCorrectDate(string) {\n DEFAULT_DATE_FORMAT=\"mm/dd/yyyy\";\n if(string==\"\")\n \treturn true;\n string=trimWhitespace(string);\n if(string.indexOf(\"(\")>0 && string.indexOf(\")\")>string.lastIndexOf(\"(\")){\n \t format=string.substring(string.indexOf(\"(\")+1,tring.lastIndexOf(\"(\")-1);\n \t date=string.substring(0,string.indexOf(\"(\")-1);\n }else{\n \t format=DEFAULT_DATE_FORMAT;\n \t date=string;\n }\n return isDate(date,format)\t\n}", "function checkDate(date, messages) {\r\n if (!checkNotEmpty(date)) {\r\n messages.push(\"You must enter a valid date\");\r\n }else if(!checkDigits(date) || !checkLength(date, 1, 2)) {\r\n messages.push(\"date must be the correct length\");\r\n }\r\n }", "function checkinputdate(thisDateField) \n{\n // add by charlie, 21-09-2003. trim the value before validation\n thisDateField.value = trim(thisDateField.value);\n // end add by charlie\n\tvar day = thisDateField.value.charAt(0).concat(thisDateField.value.charAt(1));\n\tvar month = thisDateField.value.charAt(3).concat(thisDateField.value.charAt(4));\n\tvar year = thisDateField.value.charAt(6).concat(thisDateField.value.charAt(7));\n\n\t// check input date is null or not\n\t//if (thisDateField.value.length==0) {\n\t\t//alert(\"Please provide the date\");\n\t\t//return false;\n\t//}\n\n // skip validation if no value is input\n\tif (thisDateField.value.length!=0){\n // check input length \n if (trim(thisDateField.value).length != 8) {\n alert(\"Input Date Format should be dd-mm-yy, ex: 01-04-01 for 1 April 2001\");\n thisDateField.focus(); \n return false;\n } \n\n // validate year input\n if (isNaN(year) || year < 0 || thisDateField.value.charAt(6)==\"-\") {\n alert(\"Year should between 00 to 99\");\n thisDateField.focus();\n return false;\n }\n\t\n // validate month input\n if (isNaN(month) || month <=0 || month > 12) {\n alert(\"Month should between 01 to 12\");\n thisDateField.focus();\n return false;\n }\n\n // validate day input\n if (isNaN(day) || day <= 0 || day > 31) {\n alert(\"Day range should between 01 to 31\");\n thisDateField.focus();\n return false;\n }\n\n // validate max day input allow according to the input month for (April, June, September, November)\n if ((month==4 || month==6 || month==9 || month==11) && day > 30) {\n alert(\"Day range should between 01 to 30\");\n thisDateField.focus(); \n return false;\n }\n\t\n // validate max day input allow for February according to input year (leap year)\n if (month==2) {\n if ( (parseInt(year) % 4 == 0 && parseInt(year) % 100 != 0 ) \n || parseInt(year) % 400 == 0 ){\n if (day > 29) {\n alert(\"Day range should between 0 to 29\");\n thisDateField.focus(); \n return false;\n }\n } else {\n if (day > 28) {\n alert(\"Day range should between 0 to 28\");\n thisDateField.focus();\n return false;\n }\n }\n }\n\t\n // validate is it a proper seperator between day and month, also between month and year\n if (thisDateField.value.charAt(2)!=\"-\" || thisDateField.value.charAt(5)!=\"-\") {\n alert(\"Invalid input for date, use - as a seperator\");\n thisDateField.focus();\n return false;\n }\n\n\n\n }\n\t\n\t// if input date is ok return true\n\treturn true;\n}", "function canConvertToDate(date) {\r\n let validDate = new Date(date);\r\n return !isNaN(validDate);\r\n}", "function parseDate() {\n let date = dateBox.value;\n let today = new Date();\n //use today's date if left empty\n if (date == \"\") {\n date = today;\n }\n return \"\" + date;\n}", "function validateDate(){\r\n\r\n\t\tvar date=document.getElementById(\"date\").value;\r\n\r\n\r\n \tif(date==\"\"){\r\n\r\n \t\tprintError(\"date of birth is required\",\"dateError\",\"red\");\r\n\t\ttextboxBorder(\"date\");\r\n\t\treturn false;\r\n\r\n \t}\r\n\r\n \r\n\r\n\r\n printSuccess(\"date\",\"green\",\"dateError\");\r\n return true;\r\n\r\n\r\n\r\n\r\n\r\n}", "function isInvalidDate(input) {\n\treturn isDate(input) && isNaN(input);\n}", "function checkDate (yearField, monthField, dayField, labelString, OKtoOmitDay)\r\n{ // Next line is needed on NN3 to avoid \"undefined is not a number\" error\r\n // in equality comparison below.\r\n if (checkDate.arguments.length == 4) OKtoOmitDay = false;\r\n if (!isYear(yearField.value)) return warnInvalid (yearField, iYear);\r\n if (!isMonth(monthField.value)) return warnInvalid (monthField, iMonth);\r\n if ( (OKtoOmitDay == true) && isEmpty(dayField.value) ) return true;\r\n else if (!isDay(dayField.value))\r\n return warnInvalid (dayField, iDay);\r\n if (isDate (yearField.value, monthField.value, dayField.value))\r\n return true;\r\n alert (iDatePrefix + labelString + iDateSuffix)\r\n return false\r\n}", "function checkDate (yearField, monthField, dayField, labelString, OKtoOmitDay)\r\n{ // Next line is needed on NN3 to avoid \"undefined is not a number\" error\r\n // in equality comparison below.\r\n if (checkDate.arguments.length == 4) OKtoOmitDay = false;\r\n if (!isYear(yearField.value)) return warnInvalid (yearField, iYear);\r\n if (!isMonth(monthField.value)) return warnInvalid (monthField, iMonth);\r\n if ( (OKtoOmitDay == true) && isEmpty(dayField.value) ) return true;\r\n else if (!isDay(dayField.value))\r\n return warnInvalid (dayField, iDay);\r\n if (isDate (yearField.value, monthField.value, dayField.value))\r\n return true;\r\n alert (iDatePrefix + labelString + iDateSuffix)\r\n return false\r\n}", "function CandyDate(date) {\n // if (!(this instanceof CandyDate)) {\n // return new CandyDate(date);\n // }\n if (date) {\n if (date instanceof Date) {\n this.nativeDate = date;\n }\n else if (typeof date === 'string') {\n this.nativeDate = new Date(date);\n }\n else {\n throw new Error('The input date type is not supported (\"Date\" and \"string\" is now recommended)');\n }\n }\n else {\n this.nativeDate = new Date();\n }\n }", "function initialDateValidate() {\n var initialDateInput = document.getElementById(\"add_initial_date\");\n\n if (initialDateInput.value == \"\") {\n document.getElementById(\"initialDateStatus\").innerHTML =\n \"Please enter the initial date for the event\";\n document.getElementById(\"initialDateStatus\").style.display = \"block\";\n return false;\n } else {\n document.getElementById(\"initialDateStatus\").style.display = \"none\";\n newEvent.initialDate = document.getElementById(\"add_initial_date\").value;\n return true;\n }\n }", "handleDateSubmit(event) {\n event.preventDefault();\n const err = this.validate();\n if (!err) {\n this.updateMapDate();\n }\n }", "function date$validateValue(value) {\n if (isNaN(value)) {\n // TODO(floitsch): Use real exception object.\n throw Error(\"Invalid Date\");\n }\n return value;\n}", "function checkInput (date, city){\n\n // get the current date and check if the entered date is less than it \n // if its less show an alert\n var varDate = new Date(date); //will be in the format dd-mm-YYYY\n var today = new Date();\n today.setHours(0,0,0,0);\n if(varDate > today) {\n return true\n } else{\n alert (\"enter a correct date\")\n return false;\n }\n }", "validateDate(day, month, year, elem){\n let date = `${month}-${day}-${year}`;\n date = new Date(date);\n const today = new Date();\n today.setHours(0);\n today.setMinutes(0);\n today.setSeconds(0);\n today.setMilliseconds(0);\n\n // checking if date is valid\n if (date.getTime() >= today.getTime()){\n // checking if there are any error shown\n if (elem.nextElementSibling.tagName === 'SPAN'){\n // calling method to clear error message\n this.ui.clearError(elem.nextElementSibling);\n }\n\n // if date is valid, check if mechanic has a value\n const mechanic = document.querySelector('form select[name=mechanic]');\n if (mechanic.value !== ''){\n // if mechanic has value, then validate mechanic\n this.validateMechanic(mechanic, `${year}-${month}-${day}`);\n }\n }else {\n // invalid date. calling method to show error\n this.ui.showError(elem,'Invalid date');\n }\n }", "function validateDateNotFuture(field) {\n if (field === undefined || field === null || !validateDateFormatted(field)) {\n return true;\n }\n var split = field.split(_config_AppConfig__WEBPACK_IMPORTED_MODULE_1__[\"DATE_INPUT_GAP_SEPARATOR\"]);\n var month = parseInt(split[0]);\n var day = parseInt(split[1]);\n var year = parseInt(split[2]);\n var current_year = new Date().getFullYear();\n var current_month = new Date().getMonth() + 1;\n var current_day = new Date().getDate();\n if (year > current_year) {\n return false;\n }\n if (year == current_year && month > current_month) {\n return false;\n }\n return !(year == current_year && month == current_month && day > current_day);\n}", "function isDate(p_Expression){\nreturn !isNaN(new Date(p_Expression));// <<--- this needs checking\n}", "function dateCheck(srcObj){\n if (!srcObj) \n return false;\n if (srcObj.value.length < 2) {\n alert(\"Please enter it in 2 digit Format : 01\");\n srcObj.focus();\n return false;\n }\n return true;\n}", "function parseEvent(){\n parseInt(ddlValue(\"startday\"));\n\tparseInt(ddlValue(\"startmonth\"));\n\tparseInt(ddlValue(\"startyear\"));\n\tparseInt(ddlValue(\"starthrs\"));\n\tparseInt(ddlValue(\"startmins\"));\n \n var tryDate = isDate(ddlValue(\"startmonth\") + \"/\" + ddlValue(\"startday\") + \"/\" + ddlValue(\"startyear\"));\n //if tryDate === false, then not a valid date object \n if(tryDate===false) {\n\t\tdocument.getElementById(\"err\").innerHTML = \"Invalid date\";\n\t\treturn false;\n\t}\n else{\n return tryDate;\n }\n}", "function checkdate(input){\n\t//alert(input.value);\n\tvar validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}$/ //Basic check for format validity\n\tvar returnval=false;\n\tif (!validformat.test(input.value)){\n\t\talert(\"Invalid Date Format. Please correct and submit again.\")\n\t\tdob.focus();\n\t\treturn_val = false;\n\t\treturn false;\n\t}\n\telse{ //Detailed check for valid date ranges\n\t\tvar monthfield=input.value.split(\"/\")[0]\n\t\tvar dayfield=input.value.split(\"/\")[1]\n\t\tvar yearfield=input.value.split(\"/\")[2]\n\t\tvar dayobj = new Date(yearfield, monthfield-1, dayfield)\n\t\tif ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield)){\n\t\t\talert(\"Invalid Day, Month, or Year range detected. Please correct and submit again.\");\n\t\t\treturn_val = false;\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn true;\n}", "function ossValidateDateField( id )\n{\n // get the appropriate regexp\n\n var re_day_strict = \"((0[1-9]{1})|([12][0-9]{1})|(3[01]{1}))\";\n var re_month_strict = \"((0[1-9]{1})|(1[012]{1}))\";\n\n var re_day = \"((0[1-9]{1})|([12][0-9]{1})|(3[01]{1})|[1-9]{1})\";\n var re_month = \"((0[1-9]{1})|(1[012]{1})|[1-9]{1})\";\n var re_year = \"(\\\\d{4})\";\n var re;\n var df;\n\n // case values correspond to OSS_Date DF_* constants\n switch( $( \"#\" + id ).attr( 'data-dateformat' ) )\n {\n case '2':\n re = re_month + '\\\\/' + re_day + '\\\\/' + re_year;\n df = 'MM/DD/YYYY';\n break;\n\n case '3':\n re = re_year + '-' + re_month + '-' + re_day;\n df = 'YYYY-MM-DD';\n break;\n\n case '4':\n re = re_year + '\\\\/' + re_month + '\\\\/' + re_day;\n df = 'YYYY/MM/DD';\n break;\n\n case '5':\n re = re_year + re_month_strict + re_day_strict;\n df = 'YYYYMMDD';\n break;\n\n case '1':\n default:\n re = re_day + '\\\\/' + re_month + '\\\\/' + re_year;\n df = 'DD/MM/YYYY';\n break;\n }\n\n re = '^' + re + '$';\n re = new RegExp( re );\n\n if( $( \"#\" + id ).val().match( re ) )\n {\n $( \"#div-form-\" + id ).removeClass( \"error\" );\n\n $( '#help-' + id ).html( \"\" );\n $( '#help-' + id ).hide( );\n return true;\n }\n else\n {\n $( \"#div-form-\" + id ).addClass( \"error\" );\n if( $( \"#help-\" + id ).length == 0 )\n $( \"#div-controls-\" + id ).append( '<p id=\"help-' + id + '\" class=\"help-block\"></p>' );\n $( '#help-' + id ).html( \"Bad date - use \" + df );\n $( '#help-' + id ).show( );\n return false;\n }\n}", "function test_datepicker_field_set_to_required() {}", "function checkDate(){ \n try\n { \n //converting value of dates from day id, month id and year id into date string\n //getinputvaluebyid is a method which is used to return value using document.queryselector for particular id and returns the output.\n let dates= getInputValueById(\"#day\")+\" \"+getInputValueById(\"#month\")+\" \"+getInputValueById(\"#year\");\n //dates is parsed to date and passed to object of employee payroll data class - start date\n dates=new Date(Date.parse(dates));\n checkStartDate(dates);\n //if condition is not satisfied, then error is thrown and catched by try-catch block\n dateError.textContent=\"\";\n }\n catch(e)\n {\n dateError.textContent=e;\n }\n document.querySelector('#cancelButton').href= site_properties.home_page;\n}", "static get fieldType() {\n return 'date';\n }", "static get fieldType() {\n return 'date';\n }", "function getDate() {\n date = document.getElementById('date').value;\n}", "function validDate(date) {\n\n // check if date is falsey\n if (!date)\n return false;\n\n // check format & return true if date string matches YYYY-MM-DD format\n const regex = /^[0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}$/g;\n const str = date.substring(0, 10);\n return regex.test(str);\n}", "function isDate()\n{\n\tvar yy,mm,dd;\n\tvar im,id,iy;\n\tvar present_date = new Date();\n\tyy = 1900 + present_date.getYear();\n\tif (yy > 3000)\n\t{\n\t\tyy = yy - 1900;\n\t}\n\tmm = present_date.getMonth();\n\tdd = present_date.getDate();\n\tim = document.forms[0].month.selectedIndex;\n\tid = document.forms[0].day.selectedIndex;\n\tiy = document.forms[0].year.selectedIndex;\n\tvar entered_month = document.forms[0].month.options[im].value;\n\tvar invalid_month = document.forms[0].month.options[im].value - 1; \n\tvar entered_day = document.forms[0].day.options[id].value; \n\tvar entered_year = document.forms[0].year.options[iy].value; \n\tif ( (entered_day == 0) || (entered_month == 0) || (entered_year == 0) )\n\t{\n\t\talert(\"Please enter your birhtday\");\n\t\treturn false;\n\t}\n\tif ( is_greater_date(entered_year,entered_month,entered_day,yy,mm,dd) && is_valid_day(invalid_month,entered_day,entered_year) )\n\t{\n\t\treturn true; \n\t}\n\treturn false;\n}", "function validateDate(){\r\n var date = document.getElementById(\"enterDate\").value;\r\n var verifyDate = formatDate(date)\r\n if (verifyDate == false){\r\n date = \"Invalid Date Format\";\r\n } else if (verifyDate == true){\r\n date = \"Success\";\r\n }\r\n document.getElementById(\"date\").innerHTML = date;\r\n}", "function validateDate(){\n\tvar boo;\n\tvar date = $(\"#datepicker\");\n\n\tif(emptyString(date[0].value)) {\n\t\tsetErrorOnBox(date);\n\t\tboo = false;\n\t} else {\n\t\tsetValidOnBox(date);\n\t\tboo = true;\n\t}\n\t\n\treturn boo;\n}", "toModel(date) {\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\n { year: date.year, month: date.month, day: date.day } :\n null;\n }", "function convertionDate(daty)\n { \n var date_final = null; \n if(daty!='Invalid Date' && daty!='' && daty!=null)\n {\n console.log(daty);\n var date = new Date(daty);\n var jour = date.getDate();\n var mois = date.getMonth()+1;\n var annee = date.getFullYear();\n if(mois <10)\n {\n mois = '0' + mois;\n }\n date_final= annee+\"-\"+mois+\"-\"+jour;\n }\n return date_final; \n }", "function parseDate(viewValue) {\n if (!viewValue) {\n ngModel.$setValidity('date', true);\n return null;\n } else if (angular.isDate(viewValue)) {\n ngModel.$setValidity('date', true);\n return viewValue;\n } else if (angular.isString(viewValue)) {\n var date = new Date(viewValue);\n if (isNaN(date)) {\n ngModel.$setValidity('date', false);\n return undefined;\n } else {\n ngModel.$setValidity('date', true);\n return date;\n }\n } else {\n ngModel.$setValidity('date', false);\n return undefined;\n }\n }", "function isDate(value) {\n return getType(value) === \"[object Date]\";\n}", "function inputDateCheck()\n{\n var element_mm = eval(this.element_mm);\n var element_dd = eval(this.element_dd);\n var element_yyyy = eval(this.element_yyyy);\n\n if ( typeof element_mm != 'undefined' && element_dd !='undefined' && element_yyyy !='undefined' )\n {\n this.custom_alert = (typeof this.custom_alert != 'undefined') ? this.custom_alert : '';\n\n this.ref_label = ( this.ref_label ) ? this.ref_label\n : JS_RESOURCES.getFormattedString('field_name.substitute', [this.element_mm.name]);\n\n if ( element_mm.selectedIndex == -1 || element_dd.selectedIndex == -1 || element_yyyy == -1 )\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.date.required', [this.ref_label]));\n\n if ( element_mm.selectedIndex == -1 )\n {\n element_mm.focus();\n }\n else if ( element_dd.selectedIndex == -1 )\n {\n element_dd.focus();\n }\n else\n {\n element_yyyy.focus();\n }\n\n return false;\n }\n }\n\n return true;\n}", "function validateDate(e){\n\tvar today = $.datepicker.formatDate(\"mm/dd/yy\", new Date());\n\tvar currentdateTime = today+\" 12:00:00 am\"; \n\ttry{\n\t\tvar inputValue = $(e).val().split(\" \")[0];\n\t\tif(Date.parse(inputValue) <= Date.parse(today)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t$(e).val(currentdateTime);\n\t\t\treturn false;\n\t\t}\n\t}catch(ex){}\n}", "toModel(date) {\n return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) ? this._toNativeDate(date) :\n null;\n }", "handleChange(e) {\n e.preventDefault();\n\n let data_form = {}\n if (e.target.type === 'date'){\n let date = new Date(e.target.value)\n data_form[e.target.name] = date\n } else {\n data_form[e.target.name] = e.target.value\n }\n\n this.setState({data: data_form})\n }", "validateDate(date, minDate){\n if(!moment(date,this.getDateFormat(this.props.type), true).isValid()){\n this.setState({\n validationErrorText: <FormattedMessage id=\"invalid-date-format\" />,\n showValidationError: true,\n })\n return false\n }\n if(minDate){\n if(moment(date).isBefore(minDate)){\n this.setState({\n validationErrorText: <FormattedMessage id=\"validation-afterStartTimeAndInFuture\" />,\n showValidationError: true,\n })\n return false\n }\n }\n\n this.setState({\n showValidationError: false,\n })\n return true\n }", "function _mjs_checkDateConstraint(el,cons,value)\n{\n\tvar stFmt=_dat_getStorageFormat(el);\n\tvar edFmt=_dat_getEditingFormat(el);\n\n\tLOGTRACE(\"check date value <%s> with formats <%s:%s>\",value,stFmt,edFmt);\n\n\tvar dt=mjs_parseDateValue(value,stFmt);\n\n\tif(value==\"\")\n\t{\n\t\treturn true;\n\t}\n\n\t// Check if we have a date value\n\tif(!mjs_valued(dt))\n\t{\n\t\treturn mjs_formValidationFailed(\"Date is incorrect\");\n\t}\n\n\t// Check if this date value corresponds to an existing day\n\tvar d=dt['day'],m=dt['month']-1,y=dt['year'];\n\tvar date=new Date(y,m,d);\n\n\tif((m<0) || (m>11))\n\t{\n\t\treturn mjs_formValidationFailed(\"Month is incorrect\");\n\t}\n\tif(y<1970)\n\t{\n\t\treturn mjs_formValidationFailed(\"Year is incorrect\");\n\t}\n\tif(date.getDate()!=d || date.getMonth()!=m || date.getFullYear()!=y)\n\t{\n\t\t// We need to do this test because \"mktime\" is smart enought to\n\t\t// turn dates such as \"sep 32\" into \"oct 1\". We don't want this\n\t\t// to be done automatically, and we need to report broken dates\n\t\treturn mjs_formValidationFailed(\"This date does not exist\");\n\t}\n\n\tvar v;\n\tif(mjs_valued(v=cons['min']))\n\t{\n\t\tvar cdt=mjs_parseDateExpr(v,stFmt);\n\t\tif(mjs_valued(cdt) && cdt>date)\n\t\t{\n\t\t\treturn mjs_formValidationFailed(\"This date must be set after %s\",mjs_formatDateValue(cdt,edFmt));\n\t\t}\n\t}\n\tif(mjs_valued(v=cons['max']))\n\t{\n\t\tvar cdt=mjs_parseDateExpr(v,stFmt);\n\t\tif(mjs_valued(cdt) && cdt<date)\n\t\t{\n\t\t\treturn mjs_formValidationFailed(\"This date must be set before %s\",mjs_formatDateValue(cdt,edFmt));\n\t\t}\n\t}\n\treturn true;\n}", "constructor(date = new Date()) {\n this.date = date;\n }", "function checkDate(calendar) {\n \n \n for (var i = 0; i < calendar.length; i++) {\n if (calendar[i].date === undefined) {\n calendar[i].date = currentDate();\n }\n }\n \n}", "function fx_Date(data)\n{\n\t//has format?\n\tif (String_IsNullOrWhiteSpace(data))\n\t{\n\t\t//use default\n\t\tdata = \"D/M/Y\";\n\t}\n\t//get current date\n\tvar theDate = new Date();\n\t//Format it\n\treturn VarManager_FormatDate(data, theDate);\n}", "function isDate (text){\n var isDateBool = false;\n if (text === \"startDate\" || text === \"endDate\" || text === \"feeDateFrom\" || text === \"feeDateTo\") {\n isDateBool = true;\n } else {\n isDateBool = false;\n }\n return isDateBool;\n}", "function t(t) {\n return \"date\" === t.type || \"esriFieldTypeDate\" === t.type;\n }", "function validPerformanceDate() {\n var performanceDate = $('performance_start_datetime');\n var date = performanceDate.value.downcase();\n if (date.blank()) {\n alert('Date cannot be blank.');\n return false;\n }\n return true;\n}", "function handleOnChange(date){\r\n\r\n // fake event because handleInputChange receives an event\r\n onChange({target:{\r\n value: date.toDate(),\r\n name: 'birthday'\r\n }\r\n });\r\n }", "function validateDate(data) {\n\tvar error = \"\";\n\tvar re = /\\d{1,2}?\\s\\w{3}?\\s\\d{4}?/;\n\tif (!re.test(data.value)) {\n\t\tdata.style.background = \"Red\";\n\t\tdocument.getElementById(\"dateValidationError\").innerHTML =\n\t\t\t\"Enter Valid date\";\n\t\tvar error = \"1\";\n\t} else {\n\t\tdata.style.background = 'url(\"assets/back-blur3.jpg\")';\n\t\tdocument.getElementById(\"dateValidationError\").innerHTML = \"\";\n\t}\n\treturn error;\n}", "function isCorrectDate(value) {\n\t if (typeof value === \"string\" && value) { //是字符串但不能是空字符\n\t var arr = value.split(\"-\") //可以被-切成3份,并且第1个是4个字符\n\t if (arr.length === 3 && arr[0].length === 4) {\n\t var year = ~~arr[0] //全部转换为非负整数\n\t var month = ~~arr[1] - 1\n\t var date = ~~arr[2]\n\t var d = new Date(year, month, date)\n\t return d.getFullYear() === year && d.getMonth() === month && d.getDate() === date\n\t }\n\t }\n\t return false\n\t }", "getValidDate(obj) {\r\n return this.dateTimeAdapter.isDateInstance(obj) && this.dateTimeAdapter.isValid(obj)\r\n ? obj\r\n : null;\r\n }", "getValidDate(obj) {\r\n return this.dateTimeAdapter.isDateInstance(obj) && this.dateTimeAdapter.isValid(obj)\r\n ? obj\r\n : null;\r\n }", "display_date_formate(date) {\n if (!date)\n return null;\n const [year, month, day] = date.split('-');\n let new_date = `${day}-${month}-${year}`;\n return new_date;\n }", "function validateDate(value, field) {\n\tif (value === field.unknown) return []\n\n\tif (value === undefined || value === '')\n\t\treturn [`'${field.label}' can not be empty`]\n\n\t// Check valid_values\n\tfor (let validValue of field.valid_values.split(','))\n\t\tif (value === validValue.trim()) return []\n\n\t// Check format\n\tif (!/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/.test(value))\n\t\treturn [`'${value}' is not in correct format YYYY-MM-DD`]\n\n\t// Validate date with moment\n\treturn moment(value).isValid() ? [] : [`'${value}' is not in a valid date`]\n}", "function isDate(obj) {\n return Object.prototype.toString.call(obj) === '[object Date]';\n }", "fromModel(date) {\n return (date instanceof Date && !isNaN(date.getTime())) ? this._fromNativeDate(date) : null;\n }", "set startDate(value)\n {\n if(value <= new Date())\n {\n console.log(\"Valid Date\");\n this._startDate = value;\n }\n else\n throw \"A future date is not accepted\";\n }", "function autoInputDate() {\n const now = new Date();\n now.setUTCHours(-5); // Bogotá\n\n Array.from(arguments)[0].forEach(e => {\n if (e.value === \"\") {\n e.value = now.toISOString().split('T')[0];\n }\n });\n}", "function checkDateWorked(str) {\n if (!str) {\n alert(\"You must select or insert a valid date.\");\n document.getElementById(\"txtDateWorked\").focus();\n }else{\n return true;\n }\n}", "function checkDate(form) {\r\n // Pattern ensures there is at least one character surrounding the '@' and '.'\r\n // e.g. '[email protected]' is acceptable\r\n var datePattern =/^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})$/;\r\n if(!datePattern.test(form.dateForm.value)) {\r\n document.getElementById(\"noDate\").style.display = 'inline-block';\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "handleTDateInput(date){\n this.setState({ tDate: date });\n }", "function supportsDateInputType() {\n var testInputElement, supportsFlag;\n\n testInputElement = document.createElement(\"input\");\n testInputElement.setAttribute(\"type\", \"date\");\n return testInputElement.type !== \"text\";\n}", "function pickedDate(date) {\n if (date) {\n if ($('[id$=TB_Print_Date2]').val() == '' || $('[id$=TB_Print_Date2]').val() == 'To Date') { $('[id$=TB_Print_Date2]').val(date) }\n if ($('[id$=TB_Print_Date2]').val() < date) { $('[id$=TB_Print_Date2]').val(date) }\n if ($('[id$=TB_Print_Date1]').val() != 'From Date') { $('[id$=TB_Print_Date1]').css('color', 'black'); }\n if ($('[id$=TB_Print_Date2]').val() != 'To Date') { $('[id$=TB_Print_Date2]').css('color', 'black'); }\n }\n }", "function inputDate(display, recursive = true) {\n let input = new Date(inputString(display, persistent));\n if(isNaN(input.getTime())) {\n if(recursive) {\n console.log(\"ERROR: Response must be a date! Please try again!\");\n input = inputDate(display, recursive);\n }\n else {\n throw \"ERROR: Response must be a date!\";\n }\n }\n return input;\n}" ]
[ "0.75898683", "0.728999", "0.72037995", "0.70714414", "0.6936811", "0.6865594", "0.67343247", "0.6655354", "0.6600792", "0.6585052", "0.6583183", "0.656694", "0.65499693", "0.65420526", "0.6535592", "0.6521928", "0.6507404", "0.65072006", "0.6499294", "0.6479706", "0.64716333", "0.6431697", "0.64180315", "0.6416096", "0.6409086", "0.638493", "0.6376561", "0.6373835", "0.63634276", "0.63556355", "0.63529414", "0.6345817", "0.6333924", "0.6333866", "0.63110757", "0.63110757", "0.63110757", "0.6291319", "0.628787", "0.6281582", "0.62738025", "0.6256872", "0.6253966", "0.62363124", "0.6232583", "0.6232583", "0.62256587", "0.6208577", "0.6206233", "0.620234", "0.62020344", "0.6200572", "0.62003636", "0.6197079", "0.61868143", "0.6182277", "0.61786795", "0.6178032", "0.61774755", "0.61613345", "0.6144316", "0.6144316", "0.61363703", "0.6133987", "0.6133085", "0.6132076", "0.6128087", "0.6128083", "0.61194444", "0.6119313", "0.61141044", "0.6112769", "0.6111579", "0.6110837", "0.6104428", "0.6100016", "0.6091624", "0.60909086", "0.60893786", "0.6087187", "0.60850817", "0.6080685", "0.6078331", "0.6074202", "0.606713", "0.606713", "0.6065372", "0.6065372", "0.6052162", "0.6050299", "0.6049557", "0.6047074", "0.6038722", "0.603685", "0.6036306", "0.6035036", "0.6027558", "0.6026293", "0.60258645", "0.6023424" ]
0.6181998
56
Function to check the field is empty.If there is no data true is returned else false is returned.
function checkFieldEmpty(FieldData,cntErrField) { if(FieldData.length) { return false; } else { cntErrField.value=""; return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_field_empty(field) {\n if (field == undefined || field == '')\n return true;\n else\n return false;\n}", "checkFieldIfEmpty(field) {\n var empty = false;\n if (this.salutationForm.get(field).value == null ||\n this.salutationForm.get(field).value == '') {\n empty = true;\n }\n return empty;\n }", "function isEmpty(field) {\r\r\tif ((field.value == \"\") || (field.length == 0)) {\r\r\t\treturn true;\r\r\t} else {\r\r\t\treturn false;\r\r\t}\r\r}", "function checkIfEmpty(field) {\n \t\n \tif (isEmpty(field.val().trim())) {\n \tsetInvalid(field, `${field.attr('name')} no puede estar vacio.`);\n \treturn true;\n \t} else {\n\t\tsetValid(field);\n\t\treturn false;\n \t}\n}", "function isEmptyOrNull(field) {\n return (null == field || \"\" == field);\n }", "function checkIfEmpty(field)\n{\n if(isEmpty(field.value.trim())){\n setInvalid(field, `Este campo no puede ser vacio`);\n return true;\n }else{\n setValid(field);\n return false;\n }\n}", "function FieldIsEmpty(strInput) {\n\treturn TrimString(strInput).length == 0;\n}", "is_empty()\n\t{\n\t\tconst { value } = this.props\n\t\treturn !value || !value.trim()\n\t}", "function empty(campo){\n\tif(campo === '' || campo === undefined || campo === null || campo === false){\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "emptyField(string) {\n if (string === \"\" || string === null || string === undefined) {\n return true;\n }\n return false;\n }", "function empty(data)\n{\n\tif (typeof data === \"undefined\" || data==null || data==\"\" ) { \n\t\treturn true;\n\t}\n\treturn false;\n}", "function checkIfEmpty(field) {\n if (isEmpty(field.value.trim())) {\n //set valid as invalid\n setInvalid(field , `${field.name} must not be empty`);\n return true;\n } else {\n //set field valid\n setValid(field);\n return false;\n }\n}", "function validateNotEmpty(data){\n if (data == ''){\n return true;\n }else{\n return false;\n }\n}", "function checkIfEmpty(field) {\n if (isEmpty(field.value.trim())) {\n //set invalid\n setInvalid(field, `${field.name} must not be empty`);\n return true;\n } else {\n //set field valid\n setValid(field);\n return false;\n }\n}", "function checkIfEmpty(field) {\n if (isEmpty(field.value.trim())) {\n // set field invalid\n setInvalid(field, `${field.name} must not be empty`);\n return true;\n } else {\n // set field valid\n setValid(field);\n return false;\n }\n}", "isValueEmpty(input) {\n return input ? true : false\n }", "function isEmpty(input){\r\n //console.log(input.val());\r\n if(input.val().length==0){\r\n return true;\r\n }\r\n return false;\r\n}", "function checkIfEmpty(field) {\n if (isEmpty(field.value.trim())) {\n // set field invalid\n setInvalid(field, `${field.name} must not be empty`);\n return true;\n } else {\n // set field valid\n setValid(field);\n return false;\n }\n}", "isEmpty() {\n return (this.data.length===0);\n }", "is_empty()\n\t{\n\t\tconst { value } = this.props\n\n\t\t// `0` is not an empty value\n\t\tif (typeof value === 'number' && value === 0)\n\t\t{\n\t\t\treturn false\n\t\t}\n\n\t\t// An empty string, `undefined`, `null` –\n\t\t// all those are an empty value.\n\t\tif (!value)\n\t\t{\n\t\t\treturn true\n\t\t}\n\n\t\t// Whitespace string is also considered empty\n\t\tif (typeof value === 'string' && !value.trim())\n\t\t{\n\t\t\treturn true\n\t\t}\n\n\t\t// Not empty\n\t\treturn false\n\t}", "function isEmpty(field){\n id = document.getElementById(`${field}`);\n err = document.getElementById(`${field+'_error'}`);\n\n if(id.value == \"\")\n {\n err.style=\"display:block\"; \n return true;\n }\n else {\n err.style=\"display:none\"; \n switch(field){\n case 'name':\n convertUpperCase(id);\n removeWhiteSpaces(id);\n break;\n case 'address1': \n case 'city':\n removeWhiteSpaces(id);\n convertFist2CapitalLetter(id); \n break;\n default:\n break;\n } \n \n return false;\n }\n}", "function isEmpty() {\r\n\r\n if (nameInput.value == \"\" || emailInput.value == \"\" || passInput.value == \"\"|| repassInput.value == \"\"|| phoneInput.value.value == \"\"|| ageInput.value == \"\") {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function validateNotEmpty(data) {\n if (data == '') {\n return true;\n } else {\n return false;\n }\n}", "function isEmpty(str) {\n return !str.replace(/^\\s+/g, '').length; // boolean (`true` if field is empty)\n }", "function is_Blank(input){\n if (input.length === 0)\n return true;\n else \n return false;\n}", "function noFieldsEmpty(_formData) {\n for (let entry of _formData) {\n if (entry[1] == \"\") {\n alert(entry[0] + \" is empty, please fill it in...\");\n return false;\n }\n }\n return true;\n }", "function isNotEmpty(field){\n return field.trim() !== ''\n}", "function isEmpty(element){\n\tvar is_empty = false;\n\n\tif (element.val() == '' || element.val() == null || element.val() == undefined){\n\t\tis_empty = true;\n\t}\n\n\treturn is_empty;\n}", "function isFiledEmpty() {\n let isFiledEmpty = true;\n $(\".combo-content\").each(function () {\n if ($(this).val() != \"\") {\n isFiledEmpty = false;\n }\n });\n return isFiledEmpty;\n }", "function isEmpty(){\n\n if (signUpName.value == \"\" || signUpEmail.value == \"\" || signUpPass.value == \"\") {\n return false\n } else {\n return true\n }\n}", "isEmpty() {\n return this.data.length === 0;\n }", "function allFieldsAreEmpty() {\n\t\n\tif (\n\tdocument.getElementById(\"net-sales\").value == \"\" && \n\tdocument.getElementById(\"20-auto-grat\").value == \"\" &&\n\tdocument.getElementById(\"event-auto-grat\").value == \"\" &&\n\tdocument.getElementById(\"charge-tip\").value == \"\" &&\n\tdocument.getElementById(\"liquor\").value == \"\" &&\n\tdocument.getElementById(\"beer\").value == \"\" &&\n\tdocument.getElementById(\"wine\").value == \"\" &&\n\tdocument.getElementById(\"food\").value == \"\" \n\t){\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n\t\n}", "isEmpty(value) {\n return value == '' ? true : false;\n }", "function _hasValue(oField)\n{\n\tif (oField.value.replace(/(^\\s*)|(\\s*$)/g, \"\") == \"\")\n\t\treturn false;\n\telse\n\t\treturn true;\n}", "isEmpty() {\r\n return this.data.isEmpty();\r\n }", "isEmpty() {\r\n return this.data.isEmpty();\r\n }", "function isEmpty() {\n return this.toString().length === 0;\n }", "function isBlank (input) {\n if (input === \"\" ) {\n return true\n } \n return false \n}", "function empty(quote,fields){\n\t\t\tfor(var i=0;i<fields.length;i++){\n\t\t\t\tvar val=quote[fields[i]];\n\t\t\t\tif(typeof val!=\"undefined\") return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function emptyString (data) {\n return data === '';\n }", "validateEmptyFields(firstName,lastName,address,city,state,property,description,pricing){\n if (validator.isEmpty(firstName,lastName,address,city,state,property,description,pricing)){\n return 'This field is required';\n }\n return false;\n }", "isEmpty () {\n return (!this || this.length === 0 || !this.trim());\n }", "get empty() {\n return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() &&\n !this.autofilled;\n }", "get empty() {\n return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() && !this.autofilled;\n }", "function isFilled() {\r\n\r\n /*\r\n gets the value of a specific field in the signup form\r\n then removes leading and trailing blank spaces\r\n */\r\n var username = validator.trim($('#username').val());\r\n var pw = validator.trim($('#pw').val());\r\n\r\n\r\n /*\r\n checks if the trimmed values in fields are not empty\r\n */\r\n var usernameEmpty = validator.isEmpty(username);\r\n var pwEmpty = validator.isEmpty(pw);\r\n\r\n return !usernameEmpty && !pwEmpty;\r\n }", "function hasInput(fieldElement){\n\tif(fieldElement.value == null || trim(fieldElement.value) == \"\"){\n\t\treturn false;\n\t}\n\treturn true;\n}", "checkEmptyInput() {\n if (\n this.state.selected === \"\" ||\n this.state.date === \"\" ||\n this.state.date2 === \"\" ||\n this.state.timeStart === \"\" ||\n this.state.timeEnd === \"\"\n ) {\n alert(\"Error!Dont Leave Blank Fields!\");\n return false;\n }\n return true;\n }", "function is_Blank(input) {\n return input === \"\";\n}", "function validate(){\n\n\t\tvar isValid = true;\n\n\t \t$('.inputData').each(function() {\n\t \tif ( $(this).val() === '' )\n\t isValid = false;\n\t\t});\n\n\t \treturn isValid;\n\t}", "function validate(){\n\n\t\tvar isValid = true;\n\n\t \t$('.inputData').each(function() {\n\t \tif ( $(this).val() === '' )\n\t isValid = false;\n\t\t});\n\n\t \treturn isValid;\n\t}", "isEmptyRecord(record) {\n const properties = Object.keys(record);\n let data, isDisplayed;\n return properties.every((prop, index) => {\n data = record[prop];\n /* If fieldDefs are missing, show all columns in data. */\n isDisplayed = (this.fieldDefs.length && isDefined(this.fieldDefs[index]) &&\n (isMobile() ? this.fieldDefs[index].mobileDisplay : this.fieldDefs[index].pcDisplay)) || true;\n /*Validating only the displayed fields*/\n if (isDisplayed) {\n return (data === null || data === undefined || data === '');\n }\n return true;\n });\n }", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "function notEmpty(value){\n\t\treturn value && value != \"\";\n\t}", "_isEmpty() {\n return this.modelValue?.length === 0;\n }", "function checkData(value) {\n var result = true;\n if (value === undefined || value === null || value === '') {\n result = false;\n } else if (_.isObject(value) && _.isEmpty(value)) {\n result = false;\n }\n return result;\n}", "empty(schema, object) {\n return !_.find(schema, function (field) {\n // Return true if not empty\n const value = object[field.name];\n if (value !== null && value !== undefined && value !== false) {\n const emptyTest = self.fieldTypes[field.type].empty;\n if (!emptyTest) {\n // Type has no method to check emptiness, so assume not empty\n return true;\n }\n return !emptyTest(field, value);\n }\n });\n }", "isEmpty() {\n return this.length() === 0;\n }", "function emptyOrNot(input) {\n\n if (input) {\n return true\n } else {\n return false\n }\n \n }", "function check_empty(student) {\r\n if ((student.roll_no === '') || (student.Course_enrolled === '') || (student.project === '') || (student.Specialized_skills === '')) {\r\n return true;\r\n }\r\n return false;\r\n}", "function isNotEmpty(parm){\n \treturn !isEmpty(parm);\n }", "function isEmptyField(id) {\n var elementId = document.getElementById(id);\n if (elementId != null && elementId != undefined) {\n if (elementId.value == \"\" || elementId.value == null || elementId.value == undefined) {\n return true;\n }\n }\n return false;\n}", "function isEmpty(input) {\n if ( null === input || \"\" === input ) { \n return true; \n } \n return false; \n }", "function isFieldEmpty(fieldId, alertFlag, errMsg){\n var obj = document.getElementById(fieldId);\n if (!obj || obj.disabled) \n return false;\n if (!obj.value.length) {\n if (alertFlag) \n alert(errMsg);\n obj.focus();\n return true;\n }\n return false;\n}", "is_empty(value) {\n return (\n (value == undefined) ||\n (value == null) ||\n (value.hasOwnProperty('length') && value.length === 0) ||\n (value.constructor === Object && Object.keys(value).length === 0)\n )\n }", "function isEmpty(val)\n{\n if (val == null ||\n val.length == 0 ||\n isBlank(val))\n return true;\n\n return false;\n}", "function isBlank(a) {\n    if(a === \"\") {\n        return true;\n    }\n    else {\n        return false;\n    }\n}", "function notEmpty(value) {\n\treturn isDefined(value) && value.toString().trim().length > 0;\n}", "isEmpty(){\n let isEmpty = true;\n for(let i=0; i<this.data.length; i++){\n if(typeof this.data[i] !== \"undefined\"){\n isEmpty = false;\n }\n }\n return isEmpty;\n }", "get empty() {\n return !this._elementRef.nativeElement.value || this._elementRef.nativeElement.value.length === 0;\n }", "function fieldsEmpty() {\n var isEmpty = false;\n\n if (!r.value) {\n r.style.borderBottom = \"1px solid red\";\n $('#messageR').text(\"Это поле обязательно для заполнения\");\n isEmpty = true;\n } else $('#messageR').text(\"\");\n\n if (!x.value) {\n x.style.borderBottom = \"1px solid red\";\n $('#messageX').text(\"Это поле обязательно для заполнения\");\n isEmpty = true;\n } else $('#messageX').text(\"\");\n\n if (!y.value) {\n y.style.borderBottom = \"1px solid red\";\n $('#messageY').text(\"Это поле обязательно для заполнения\");\n isEmpty = true;\n } else $('#messageY').text(\"\");\n return isEmpty;\n}", "function chmIsAllEmpty(arrFields,msg)\r\n {\r\n // set this flag to true if you want this function to validate\r\n var bValidate = true; \r\n var len = arrFields.length;\r\n var iIndex = 0;\r\n\r\n if(!bValidate)\r\n {\r\n return false;\r\n }\r\n\r\n for(iIndex = 0; iIndex < len; iIndex++)\r\n {\r\n if(eval(arrFields[iIndex]))\r\n {\r\n if(!isEmpty(eval(arrFields[iIndex])))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n alert(msg);\r\n return true;\r\n }", "get empty() {\n return !this.inputElement.value;\n }", "isEmpty() {\n return this._elementRef.nativeElement.value.length === 0;\n }", "isEmpty() {\n return this._elementRef.nativeElement.value.length === 0;\n }", "function isNotEmpty(elem) {\n var x = elem.val();\n return (x != null && x.trim() != '');\n}", "function bs_isEmpty(theVar) {\n\tif (bs_isNull(theVar)) return true;\n\tif (theVar == '') return true;\n\treturn false;\n}", "function checkEmptyInput() {\r\n let isEmpty = false;\r\n const CheckFullName = document.querySelector(\"#fname\").value;\r\n const CheckEmail = document.querySelector(\"#email\").value;\r\n const CheckAge = document.querySelector(\"#age\").value;\r\n // remember about empty input\r\n if (CheckFullName === \"\") {\r\n alert(\"Full Name Connot Be Empty\");\r\n isEmpty = true;\r\n } else if (CheckEmail === \"\") {\r\n alert(\"Email Connot Be Empty\");\r\n isEmpty = true;\r\n } else if (CheckAge === \"\") {\r\n alert(\"Age Connot Be Empty\");\r\n isEmpty = true;\r\n }\r\n return isEmpty;\r\n}", "function isEmpty(value) {\n return value === \"\";\n}", "function isEmpty(value) {\n return value === \"\";\n}", "function notEmpty(value) {\n return isDefined(value) && value.toString().trim().length > 0;\n}", "function checkIfItemIsEmpty(item) {\n if(item.trim().length == 0){\n return true;\n }\n else {\n return false;\n }\n}", "function isEmailEmpty() {\n var field = document.getElementById('email');\n if (field.value === '') {\n return true;\n } else {\n return false;\n }\n}", "requiredFields(){\n // get all the keys in the state\n let keys = Object.keys(this.state);\n // intialize the variable as false\n let emptyFields = false;\n // loop through all the keys and check the value in state to see if any of them are empty strings, if empty then set variable to true\n keys.forEach((key) => {\n if(this.state[key] === ''){\n emptyFields = true;\n }\n })\n return emptyFields;\n }", "function isEmptyText(theField)\n{\n\t// Copy the value so changes can be made..\n\tvar theValue = theField.value;\n\n\t// Strip whitespace off the left side.\n\twhile (theValue.length > 0 && (theValue.charAt(0) == ' ' || theValue.charAt(0) == '\\t'))\n\t\ttheValue = theValue.substring(1, theValue.length);\n\t// Strip whitespace off the right side.\n\twhile (theValue.length > 0 && (theValue.charAt(theValue.length - 1) == ' ' || theValue.charAt(theValue.length - 1) == '\\t'))\n\t\ttheValue = theValue.substring(0, theValue.length - 1);\n\n\tif (theValue == '')\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function isEmpty(value)\r\n\t{\r\n\t\tif(value!=\"\" && value!=null && value!=undefined)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function hasValue(elem){\n\t\t\treturn $(elem).val() != '';\n\t\t}", "function isEmptyInput(text_input){\n if(text_input.is(\"input\")){\n return text_input.val().replace(/^\\s+|\\s+$/g, \"\").length == 0 ? true : false;\n }\n if(text_input.is(\"select\")){\n return text_input.find(\"option:not(:disabled)\").is(\":selected\") ? false : true;\n }\n }", "function IsNotEmpty(value) {\n if (value) {\n return true;\n } else {\n return false;\n }\n }", "isEmpty() {\n if (this.type === undefined) return true;\n return false;\n }", "function isEmptyString(strData) {\n // checks if it exist\n if (typeof strData === 'undefined') return true;\n // since there is data check for valid data\n return (!strData.trim() || strData.lenght === 0);\n}", "function checkEmptyInput()\r\n {\r\n var isEmpty = false,\r\n name = document.getElementById(\"name\").value,\r\n bday = document.getElementById(\"bday\").value,\r\n gender = document.getElementById(\"gender\").value;\r\n \r\n if(name === \"\"){\r\n alert(\"Name is Empty\");\r\n isEmpty = true;\r\n }\r\n else if(bday === \"\"){\r\n alert(\"Birthdate is Empty\");\r\n isEmpty = true;\r\n }\r\n else if(gender === \"\"){\r\n alert(\"Gender is Empty\");\r\n isEmpty = true;\r\n }\r\n return isEmpty;\r\n }", "function isEmpty(value) {\n if (value.length === 0) {\n return true;\n } else {\n return false;\n }\n}", "isEmpty () {\n\t\treturn (this.length === 0);\n\t}", "isEmpty(){\r\n return (this.value+'' === 0+'');\r\n }", "isEmpty (param) {\n if (param == null || param === '') {\n return true\n }\n return false\n }", "function isEmpty(elem)\n {\n /* getting the text */\n var str = elem.value;\n\n /* defining a regular expression for non-empty string */\n var regExp = /.+/;\n return !regExp.test(str);\n }", "function nonEmptyString (data) {\n return string(data) && data !== '';\n }", "validateData() {\n if(_.isEmpty(this.refs.email.getValue()) || _.isEmpty(this.refs.pass.getValue()) || _.isEmpty(this.refs.username.getValue())) {\n return true;\n }\n }" ]
[ "0.8195775", "0.81227344", "0.80921924", "0.8033589", "0.7949832", "0.7820507", "0.7785254", "0.7696803", "0.76803434", "0.76574886", "0.7600648", "0.75945216", "0.7564241", "0.7542774", "0.75282973", "0.75060576", "0.74979615", "0.7483086", "0.74465925", "0.74423015", "0.7383348", "0.73735386", "0.73686934", "0.73398274", "0.7318179", "0.73028713", "0.7301896", "0.72766715", "0.7269332", "0.72660124", "0.7261035", "0.72549736", "0.7234367", "0.722654", "0.7212156", "0.7212156", "0.72087586", "0.7204094", "0.7193112", "0.71763223", "0.71544635", "0.7151019", "0.71480346", "0.71381587", "0.7109074", "0.7093276", "0.7083501", "0.70806414", "0.70760846", "0.70760846", "0.7066429", "0.7040192", "0.7040192", "0.7040192", "0.7038101", "0.7028719", "0.70253015", "0.7014211", "0.6999732", "0.69985193", "0.69960004", "0.6985642", "0.6983625", "0.69825304", "0.69785243", "0.6953356", "0.6942868", "0.69311416", "0.69200194", "0.69198114", "0.69021386", "0.6898065", "0.6891904", "0.68825805", "0.68781054", "0.68781054", "0.6873005", "0.6872674", "0.68518424", "0.68497646", "0.68497646", "0.6843994", "0.6841409", "0.6839075", "0.6837801", "0.68363464", "0.6834563", "0.68308055", "0.68307537", "0.6825957", "0.68234026", "0.68008614", "0.67922497", "0.67892706", "0.67806005", "0.67798185", "0.67791533", "0.67724836", "0.67718244", "0.6770537" ]
0.8005818
4
Function for comparing two dates
function checkDates(dateField1,dateField2,errorMsg) { frmDate=dateField1.value; frmDate=Date.UTC(frmDate.substr(6,4),frmDate.substr(3,2)-1,frmDate.substr(0,2)); toDate=dateField2.value; toDate=Date.UTC(toDate.substr(6,4),toDate.substr(3,2)-1,toDate.substr(0,2)); if(frmDate > toDate) { alert(errorMsg); dateField2.focus(); return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareDates(date1, date2)\r\n{\r\n if(date1 < date2)\r\n return -1;\r\n else if(date1 > date2)\r\n return 1;\r\n else\r\n return 0;\r\n}", "function compare_dates(fecha, fecha2) \r\n { \r\n\t\r\n var xMonth=fecha.substring(3, 5); \r\n var xDay=fecha.substring(0, 2); \r\n var xYear=fecha.substring(6,10); \r\n var yMonth=fecha2.substring(3,5);\r\n var yDay=fecha2.substring(0, 2);\r\n var yYear=fecha2.substring(6,10); \r\n \r\n if (xYear > yYear){ \r\n return(true); \r\n }else{ \r\n if (xYear == yYear){ \r\n\t if (xMonth > yMonth){ \r\n\t \t\treturn(true); \r\n\t }else{ \r\n\t\t if (xMonth == yMonth){ \r\n\t\t if (xDay> yDay) \r\n\t\t return(true); \r\n\t\t else \r\n\t\t return(false); \r\n\t\t }else{\r\n\t\t \t return(false); \r\n\t\t } \r\n\t } \r\n }else{\r\n \t return(false); \r\n } \r\n \r\n } \r\n}", "function compareDate(dos, rd) {\n\n }", "function compareDates(a, b) {\n var aDate = a.date;\n var bDate = b.date;\n\n let comparison = 0;\n if (aDate > bDate) {\n comparison = 1;\n } \n else if (aDate < bDate) {\n comparison = -1;\n }\n \n return comparison;\n}", "function compareDateFunction(date1,date2){\r\n\tvar leftDate;\r\n\tvar rightDate;\r\n\tif(typeof(date1) == \"object\"){\r\n\t\tleftDate = date1;\r\n\t}else{\r\n\t\tleftDate = convertStr2Date(date1);\r\n\t}\r\n\tif(typeof(date2) == \"object\"){\r\n\t\trightDate = date2;\r\n\t}else{\r\n\t\trightDate = convertStr2Date(date2);\r\n\t}\r\n\treturn compareDate(leftDate,rightDate,0);\r\n}", "function compareDate(fromDate, toDate) {\r\r\tvar dt1 = parseInt(fromDate.substring(0, 2), 10);\r\r\tvar mon1 = parseInt(fromDate.substring(3, 5), 10);\r\r\tvar yr1 = parseInt(fromDate.substring(6, 10), 10);\r\r\tvar dt2 = parseInt(toDate.substring(0, 2), 10);\r\r\tvar mon2 = parseInt(toDate.substring(3, 5), 10);\r\r\tvar yr2 = parseInt(toDate.substring(6, 10), 10);\r\r\tvar date1 = new Date(yr1, mon1, dt1);\r\r\tvar date2 = new Date(yr2, mon2, dt2);\r\r\tif (date1 > date2) {\r\r\t\treturn 1;\r\r\t} else {\r\r\t\tif (date1 < date2) {\r\r\t\t\treturn -1;\r\r\t\t} else {\r\r\t\t\treturn 0;\r\r\t\t}\r\r\t}\r\r}", "function compareDates(a, b)\n{\n var x=new Date(a.Date);\n var y=new Date(b.Date);\n \n console.log(\"hello we are hee\");\t\n\n console.log(x);\n console.log(y);\t\n\n if(x>y)\n {\n console.log(1);\n return 1;\n\n }\n else\n {\n console.log(-1);\t \n return -1;\n }\n}", "function CompareDate(date1, date2)\n{\n var std_format = date1.split(\"-\"); \n s_dt= new Date(std_format[1]+\"-\"+std_format[0]+\"-\"+std_format[2]);\n var etd_format = date2.split(\"-\"); \n e_dt= new Date(etd_format[1]+\"-\"+etd_format[0]+\"-\"+etd_format[2]);\n if(s_dt>e_dt)\n return true;\n else \n return false;\n}", "function compareDates(date1, date2) {\n if (!date1 && !date2) {\n return true;\n }\n else if (!date1 || !date2) {\n return false;\n }\n else {\n return (date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate());\n }\n}", "function compare_date( a, b ) {\n if ( a.date < b.date){\n return -1;\n }\n if ( a.date > b.date ){\n return 1;\n }\n return 0;\n}", "function compareDatesWH(date1, date2){\n var comp = DATES_EQUALS; // Son iguales\n if(date1.getFullYear() < date2.getFullYear()){\n comp = DATES_LOWER; // Date 1 es menor que date 2\n }\n else if(date1.getFullYear() > date2.getFullYear()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() < date2.getMonth()){\n comp = DATES_LOWER;\n }\n else if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() > date2.getMonth()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() < date2.getDate()){\n comp = DATES_LOWER;\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() > date2.getDate()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n }\n }\n }\n return comp;\n }", "function compareDate(a,b) {\n if (a.date < b.date)\n return -1;\n else if (a.date > b.date)\n return 1;\n else\n return 0;\n }", "compareDate(a, b) {\n if (a.startDate < b.startDate) return -1\n if (a.startDate > b.startDate) return 1\n else return 0\n }", "function myFunction(date1, date2) {\n return (\n date1.getYear() === date2.getYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}", "function compareDate(a, b) {\r\n if (a.date > b.date) return 1;\r\n if (b.date > a.date) return -1;\r\n return 0;\r\n}", "function compareDates(date_One, date_Two) {\n if (date_One.getFullYear() > date_Two.getFullYear())\n return 1;\n else if (date_One.getFullYear() < date_Two.getFullYear())\n return -1;\n else {\n if (date_One.getMonth() > date_Two.getMonth())\n return 1;\n else if (date_One.getMonth() < date_Two.getMonth())\n return -1;\n else {\n if (date_One.getDate() > date_Two.getDate())\n return 1;\n else if (date_One.getDate() < date_Two.getDate())\n return -1;\n else\n return 0;\n }\n }\n}", "function compareDates(a,b) {\n if(a.attributes.date.isBefore(b.attributes.date)) {return -1;}\n if(b.attributes.date.isBefore(a.attributes.date)) {return 1;}\n return 0;\n}", "function dateCompare(date1, date2) {\n\t\tif (date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "function calendar_helper_dateEquals(date1, date2){\n if (date1.getFullYear() == date2.getFullYear())\n if (date1.getMonth() == date2.getMonth())\n if (date1.getDate() == date2.getDate())\n return true;\n return false;\n}", "function compareDates (date1, date2)\n{\n newDate1 = new Date(date1);\n newDate1.setHours(0,0,0,0);\n newDate2 = new Date(date2);\n newDate2.setHours(0,0,0,0);\n var t1 = newDate1.getTime();\n var t2 = newDate2.getTime();\n if (t1 === t2) return 0;\n else if (t1 > t2) return 1;\n else return -1;\n}", "function compareDates(ymd1,ymd2){\n\t// parse\n\tvar y1 = parseInt(ymd1.slice(0,4));\n\tvar m1 = parseInt(ymd1.slice(5,7));\n\tvar d1 = parseInt(ymd1.slice(8,10));\n\tvar y2 = parseInt(ymd2.slice(0,4));\n\tvar m2 = parseInt(ymd2.slice(5,7));\n\tvar d2 = parseInt(ymd2.slice(8,10));\n\t// compare years\n\tif(y1 > y2){\n\t\treturn 1\n\t} else if (y1 < y2) {\n\t\treturn -1\n\t} else {\n\t\t// compare months\n\t\tif(m1 > m2){\n\t\t\treturn 1\n\t\t} else if (m1 < m2) {\n\t\t\treturn -1 \n\t\t} else {\n\t\t\t// compare days\n\t\t\tif(d1 > d2){\n\t\t\t\treturn 1\n\t\t\t} else if (d1 < d2) {\n\t\t\t\treturn -1\n\t\t\t} else {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n}", "function datesAreEquivalent(date1,date2){\n return (date1.getMonth() == date2.getMonth()) && (date1.getFullYear() == date2.getFullYear()) && (date1.getDate() == date2.getDate()) ;\n}", "function compareDates(d1, m1, y1, d2, m2, y2) {\n\n\tvar date1\t= new Number(d1);\n\tvar month1\t= new Number(m1);\n\tvar year1\t= new Number(y1);\n\tvar date2\t= new Number(d2);\n\tvar month2\t= new Number(m2);\n\tvar year2\t= new Number(y2);\n\n\tvar\treturnVal = 0;\n\tif (year1 < year2) {\n\t\treturnVal = -1;\n\t} else if (year1 > year2) {\n\t\treturnVal = 1;\n\t} else {\n\t\t//alert('same year');\n\t\tif (month1 < month2) {\n\t\t\treturnVal = -1;\n\t\t} else if (month1 > month2) {\n\t\t\treturnVal = 1;\n\t\t} else {\n\t\t\t//alert('same month');\n\t\t\tif (date1 < date2) {\n\t\t\t\treturnVal = -1;\n\t\t\t} else if (date1 > date2) {\n\t\t\t\treturnVal = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnVal;\n\n}", "function compareDate(fromDate, toDate){\r\n\t// check both value is there or not\r\n\t// in else it will return true its due to date field validation is done on form level\r\n\tif (toDate != '' && fromDate != ''){\r\n\t\t// extract day month and year from both of date\r\n\t\tvar fromDay = fromDate.substring(0, 2);\r\n\t\tvar toDay = toDate.substring(0, 2);\r\n\t\tvar fromMon = eval(fromDate.substring(3, 5)-1);\r\n\t\tvar toMon = eval(toDate.substring(3, 5)-1);\r\n\t\tvar fromYear = fromDate.substring(6, 10);\r\n\t\tvar toYear = toDate.substring(6, 10);\r\n\r\n\t\t// convert both date in date object\r\n\t\tvar fromDt = new Date(fromYear, fromMon, fromDay);\r\n\t\tvar toDt = new Date(toYear, toMon, toDay); \r\n\r\n\t\t// compare both date \r\n\t\t// if fromDt is greater than toDt return false else true\r\n\t\tif (fromDt > toDt) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}else{\r\n\t\treturn true;\r\n\t}\r\n}", "function comparisonByDate(dateA, dateB) {\n var c = new Date(dateA.date);\n var d = new Date(dateB.date);\n return c - d;\n }", "function compareDates(d1, d2) {\n var r = compareYears(d1, d2);\n if (r === 0) {\n r = compareMonths(d1, d2);\n if (r === 0) {\n r = compareDays(d1, d2);\n }\n }\n return r;\n }", "function DateCompareEqual(_strDate1, _strDate2) {\n var strDate;\n var strDateArray;\n var strDay;\n var strMonth;\n var strYear;\n\n strDateArray = _strDate1.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate1 = new Date(strYear, GetMonth(strMonth), strDay);\n\n strDateArray = _strDate2.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate2 = new Date(strYear, GetMonth(strMonth), strDay);\n\n if (_strDate1 >= _strDate2) {\n return true;\n }\n else {\n return false;\n }\n}", "function compareDates(a, b) {\n\t\tif (b.transaction_date < a.transaction_date) {\n\t\t\treturn -1\n\t\t}\n\t\tif (b.transaction_date > a.transaction_date) {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}", "function compareDates(a, b) {\n\t\tif (b.transaction_date < a.transaction_date) {\n\t\t\treturn -1\n\t\t}\n\t\tif (b.transaction_date > a.transaction_date) {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}", "function dateChecker(date1, date2 = new Date()) {\n var date1 = new Date(Date.parse(date1));\n var date2 = new Date(Date.parse(date2));\n var ageTime = date2.getTime() - date1.getTime();\n\n if (ageTime < 0) {\n return false; //date2 is before date1\n } else {\n return true;\n }\n}", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "function cmpDate(dat1, dat2) {\r\n var day = 1000 * 60 * 60 * 24, // milliseconds in one day\r\n mSec1, mSec2; // milliseconds for dat1 and dat2\r\n // valudate dates\r\n if (!isDate(dat1) || !isDate(dat2)) {\r\n alert(\"cmpDate: Input parameters are not dates!\");\r\n return 0;\r\n }\r\n // prepare milliseconds for dat1 and dat2\r\n mSec1 = (new Date(dat1.substring(6, 10), dat1.substring(0, 2) - 1, dat1.substring(3, 5))).getTime();\r\n mSec2 = (new Date(dat2.substring(6, 10), dat2.substring(0, 2) - 1, dat2.substring(3, 5))).getTime();\r\n // return number of days (positive or negative)\r\n return Math.ceil((mSec2 - mSec1) / day);\r\n}", "function CheckDateDifference(lowDate, highDate, comparison) {\n\t lowDateSplit = lowDate.split('/');\n\t highDateSplit = highDate.split('/');\n\n\t date1 = new Date();\n\t date2 = new Date();\n\n\t date1.setDate(lowDateSplit[0]);\n\t date1.setMonth(lowDateSplit[1] - 1);\n\t date1.setYear(lowDateSplit[2]);\n\n\t date2.setDate(highDateSplit[0]);\n\t date2.setMonth(highDateSplit[1] - 1);\n\t date2.setYear(highDateSplit[2]);\n\n\t if(comparison == \"eq\") {\n\t\t if(date1.getTime() == date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"lt\") {\n\t\t if(date1.getTime() < date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"gt\") {\n\t\t if(date1.getTime() > date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"le\") {\n\t\t if(date1.getTime() <= date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"ge\") {\n\t\t if(date1.getTime() >= date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n}", "sameDate(dateA, dateB) {\n return ((dateA.getDate() === dateB.getDate()) && (dateA.getMonth() === dateB.getMonth()) && (dateA.getFullYear() === dateB.getFullYear()));\n }", "compareTwoObjectsByDate(a,b) {\n let x = a.approach_date;\n let y = b.approach_date;\n if (x < y) {return -1;}\n if (x > y) {return 1;}\n return 0;\n }", "function by_datetime( a, b ) {\n\n const a_date = moment( a.day.split(' - ')[1], 'MM/DD/YYYY');\n const b_date = moment( b.day.split(' - ')[1], 'MM/DD/YYYY');\n\n if ( b_date.isAfter( a_date ) ) {\n return -1;\n } else if ( b_date.isBefore( a_date ) ) {\n return 1;\n } else {\n return 0;\n }\n\n}", "function isStringDate2Greater(date1,date2)\r\n{\r\n // date1 and date2 are strings\r\n //This function checks if date2 is later than date1\r\n //If the second date is null then it sets date2 to current date and checks if first date is later than the current date\r\n var sd=date1;\r\n if (date1 == \"\") return false;\r\n else if (date2 == \"\") return false;\r\n else\r\n {\r\n var ed=date2;\r\n var End= new Date(changeDateFormat(ed));\r\n }\r\n var Start= new Date(changeDateFormat(sd));\r\n var diff=End-Start;\r\n if (diff>=0) return true;\r\n else\r\n {\r\n// alert(msg);\t\r\n return false;\r\n }\r\n}", "function compareDay(day1, day2){\n return day1.getFullYear() === day2.getFullYear() &&\n day1.getMonth() === day2.getMonth() &&\n day1.getDate() === day2.getDate();\n}", "function sameDate(d0, d1) {\n\treturn d0.getFullYear() == d1.getFullYear() && d0.getMonth() == d1.getMonth() && d0.getDate() == d1.getDate();\n}", "static compare(date1, date2) {\n let d1 = this.reverseGregorian(date1);\n let d2 = this.reverseGregorian(date2);\n\n return d1.localeCompare(d2);\n }", "function SP_CompareDates(firstDate, secondDate) {\n\tif (arguments.length === 2) {\n\t\tvar date1 = SP_Trim(document.getElementById(firstDate).value),\n\t\t\tdate2 = SP_Trim(document.getElementById(secondDate).value),\n\t\t\tdiff = \"\";\n\t\t\n\t\tif (SP_Trim(date1) != \"\" && SP_Trim(date2) != \"\") {\n\t\t\tif (languageSelect && languageSelect !== \"en_us\") {\n\t\t\t\tvar enteredDate1 = date1.split('-'),\n\t\t\t\t\tenteredDate2 = date2.split('-');\n\t\t\t\t\n\t\t\t\tswitch (dateFormat) {\n\t\t\t\t\tcase \"dd-mmm-yyyy\":\n\t\t\t\t\t\tdate1 = new Date(enteredDate1[2], SP_GetMonthNumber(enteredDate1[1]), enteredDate1[0]);\n\t\t\t\t\t\tdate2 = new Date(enteredDate2[2], SP_GetMonthNumber(enteredDate2[1]), enteredDate2[0]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"yyyy-mm-dd\":\n\t\t\t\t\t\tdate1 = new Date(enteredDate1[0], enteredDate1[1], enteredDate1[2]);\n\t\t\t\t\t\tdate2 = new Date(enteredDate2[0], enteredDate2[1], enteredDate2[2]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdate1 = new Date(date1.replace(/-/g,' '));\n\t\t\t\tdate2 = new Date(date2.replace(/-/g,' '));\n\t\t\t}\n\t\t\n\t\t\tdiff = date1 - date2;\n\t\t\tdiff = diff > 0 ? 1 : diff < 0 ? -1 : 0;\n\t\t}\n\n\t\treturn diff;\n\t}\n}", "checkIfDelay(date1,date2){\n a = new Date(date1);\n b = new Date(date2);\n\n if(b > a){\n return true\n }else{\n return false\n }\n\n }", "function compareDateObject(date1, date2){\r\n if(date1 == null) return false;\r\n if(date2 == null) return false;\r\n\r\n var date1Long = date1.getTime();\r\n var date2Long = date2.getTime();\r\n\r\n if(date1Long - date2Long > 0) return '>';\r\n if(date1Long - date2Long == 0) return '=';\r\n if(date1Long - date2Long < 0) return '<';\r\n else\r\n return '';\r\n}", "function DateCompare(_strDate1, _strDate2) {\n var strDate;\n var strDateArray;\n var strDay;\n var strMonth;\n var strYear;\n\n strDateArray = _strDate1.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate1 = new Date(strYear, GetMonth(strMonth), strDay);\n\n strDateArray = _strDate2.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate2 = new Date(strYear, GetMonth(strMonth), strDay);\n\n if (_strDate1 > _strDate2) {\n return true;\n }\n else {\n return false;\n }\n}", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "function date_greater_than (date1, date2)\n{\n //Dates should be in the format Month(maxlength=3) Day(num minlength=2), Year hour(minlength=2):minute(minlength=2)(24h time)\n //Eg Apr 03 2020 23:59\n //the function caller is asking \"is date1 greater than date2?\" and gets a boolean in return\n\n let months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n\n //Compares the years\n if (parseInt(date1.substr(7, 4)) > parseInt(date2.substr(7, 4))) return true\n else if (parseInt(date1.substr(7, 4)) < parseInt(date2.substr(7, 4))) return false\n else //the elses are for if both values are the same\n {\n //Compares the months\n if (months.indexOf(date1.substr(0, 3)) > months.indexOf(date2.substr(0, 3))) return true\n else if (months.indexOf(date1.substr(0, 3)) < months.indexOf(date2.substr(0, 3))) return false\n else\n {\n //Compares the days\n if (parseInt(date1.substr(4, 2)) > parseInt(date2.substr(4, 2))) return true\n if (parseInt(date1.substr(4, 2)) < parseInt(date2.substr(4, 2))) return false\n else\n {\n //Compares the hours\n if (parseInt(date1.substr(12, 2)) > parseInt(date2.substr(12, 2))) return true\n else if (parseInt(date1.substr(12, 2)) < parseInt(date2.substr(12, 2))) return false\n else\n {\n //Compares minutes\n if (parseInt(date1.substr(15, 2)) > parseInt(date2.substr(15, 2))) return true\n else return false\n }\n }\n }\n }\n}", "function compareDates(date1,dateformat1,date2,dateformat2) {\r\n\tvar d1=getDateFromFormat(date1,dateformat1);\r\n\tvar d2=getDateFromFormat(date2,dateformat2);\r\n\tif (d1==0 || d2==0) {\r\n\t\treturn -1;\r\n\t\t}\r\n\telse if (d1 > d2) {\r\n\t\treturn 1;\r\n\t\t}\r\n\treturn 0;\r\n\t}", "function compareDates(date1,dateformat1,date2,dateformat2) {\r\n\tvar d1=getDateFromFormat(date1,dateformat1);\r\n\tvar d2=getDateFromFormat(date2,dateformat2);\r\n\tif (d1==0 || d2==0) {\r\n\t\treturn -1;\r\n\t\t}\r\n\telse if (d1 > d2) {\r\n\t\treturn 1;\r\n\t\t}\r\n\treturn 0;\r\n\t}", "function compareDate(inputDate1, inputDate2) {\r\n if(!inputDate1 || !inputDate2) {\r\n return -1;\r\n }\r\n\tvar date1 = inputDate1.split('-');\r\n\tvar date2 = inputDate2.split('-');\r\n\t\r\n\tif(date1.length != 3 || date2.length != 3 ) { //checks if dates are valid\r\n\t\treturn -1;\r\n\t}\r\n\tif(date1[0] < date2[0]) {\r\n\t\treturn 1;\r\n\t}\r\n\tif(date1[0] == date2[0]) {\r\n\t\tif(date1[1] < date2[1]) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(date1[1] == date2[1]) {\r\n\t\t\tif(date1[2] <= date2[2]) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "function compararFecha(fecha, fecha2) {\n var xMonth = fecha.substring(3, 5);\n var xDay = fecha.substring(0, 2);\n var xYear = fecha.substring(6, 10);\n var yMonth = fecha2.substring(3, 5);\n var yDay = fecha2.substring(0, 2);\n var yYear = fecha2.substring(6, 10);\n if (xYear > yYear) {\n return 1;\n }\n else {\n if (xYear == yYear) {\n if (xMonth > yMonth) {\n return 1;\n }\n else {\n if (xMonth == yMonth) {\n if (xDay == yDay) {\n return 0;\n } else {\n if (xDay > yDay)\n return 1;\n else\n return -1;\n }\n }\n else\n return -1;\n }\n }\n else\n return -1;\n }\n}", "function compareDates(date1, dateformat1, date2, dateformat2) {\n var d1 = getDateFromFormat(date1, dateformat1);\n var d2 = getDateFromFormat(date2, dateformat2);\n if (d1 == 0 || d2 == 0) {\n return -1;\n } else if (d1 > d2) {\n return 1;\n }\n return 0;\n}", "function isDateWithinSameDay(date1, date2) {\n return date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear();\n }", "function compFunc(a, b)\n{\n\tif (a.date < b.date)\n\t\treturn 1;\n\telse if (a.date > b.date)\n\t\treturn -1;\n\telse\n\t\treturn 0;\n}", "validateTwoDates(startDate, endDate){\n if( startDate < endDate) {\n return true;\n } else {\n return false\n }\n }", "function compare(a,b) {\n\t\t\t\tif (new Date(a.date) < new Date(b.date))\n\t\t\t\t\treturn 1;\n\t\t\t\tif (new Date(a.date) > new Date(b.date))\n\t\t\t\t \treturn -1;\n\t\t\t\treturn 0;\n\t\t\t}", "function compareEqualsToday(sender, args)\n{\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date > today || date<today)\n {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function cmpCurrentDate(dat1,datInMsec) {\r\n var day = 1000 * 60 * 60 * 24, // milliseconds in one day\r\n mSec1, mSec2; // milliseconds for dat1 and dat2\r\n // valudate dates\r\n if (!isDate(dat1)) {\r\n // alert(\"cmpDate: Input parameters are not dates!\");\r\n return 0;\r\n }\r\n \r\n // prepare milliseconds for dat1 and dat2\r\n mSec1 = (new Date(dat1.substring(6, 10), dat1.substring(0, 2) - 1, dat1.substring(3, 5))).getTime();\r\n mSec2 = datInMsec;\r\n // return number of days (positive or negative)\r\n return Math.ceil((mSec2 - mSec1) / day);\r\n}", "function isCorrectOrder(yyyymmdd1, yyyymmdd2) {\r\n return yyyymmdd1 < yyyymmdd2;\r\n}", "function fecha2MayorFecha1(fechaFinal,fechaFormulario){\n\n if((Date.parse(fechaFormulario)) <= (Date.parse(fechaFinal))) {\n alert(\"fecha nacimiento mayor que la actual\");\n return true;\n\n }else{\n return false;\n }\n\n\n\n\n\n}", "function sortByDate(a, b) {\n let comparison = 0;\n\n // -------------------------------------------------------------JavaScript - Conditional Statments Ex. 3||\n if (a.getDate >= b.date) {\n comparison = 1;\n } else if (a.date <= b.date) {\n comparison = -1;\n }\n return comparison;\n}", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDate(date1, date2) {\n\n //Hours equal\n if (date1.getHours() == date2.getHours()) {\n\n //Check minutes\n if (date1.getMinutes() == date2.getMinutes()) {\n return 0;\n } else {\n if (date1.getMinutes() > date2.getMinutes()) {\n return 1;\n } else {\n return -1;\n }\n }\n }\n\n //Hours not equal\n else {\n if (date1.getHours() > date2.getHours()) {\n return 1;\n } else {\n return -1;\n }\n }\n}", "function compareDate(s1, flag){\t\r\n\t\t s1 = s1.replace(/-/g, \"/\");\r\n\t\t s1 = new Date(s1);\r\n\t\t var currentDate = new Date();\r\n\t\t \r\n\t\t var strYear = currentDate.getYear();\r\n\t\t\tvar strMonth= currentDate.getMonth() + 1;\r\n\t\t\tvar strDay = currentDate.getDate();\r\n\t\t\tvar strDate = strYear + \"/\" + strMonth + \"/\" + strDay;\t\t \r\n\t\t s2 = new Date(strDate);\r\n\t\t \r\n\t\t var times = s1.getTime() - s2.getTime();\r\n\t\t if(flag == 0){\r\n\t\t \treturn times;\r\n\t\t }\r\n\t\t else{\r\n\t\t \tvar days = times / (1000 * 60 * 60 * 24);\r\n\t\t \treturn days;\r\n\t\t }\r\n\t }", "function compareDatesValues(strDataInicial, strDataFinal)\n{\n if ((empty(strDataInicial)) || (empty(strDataFinal)))\n return false;\n if ((strDataInicial.length < 10) || (strDataFinal.length < 10))\n return false;\n if (convertDate(strDataInicial, 'YmdHis') > convertDate(strDataFinal, 'YmdHis')) {\n alertDialog('A data inicial deve ser sempre menor ou igual a data final.', 'Validação', 250, 150);\n return false;\n }\n return true;\n}", "function compareDatesWithFunction(d1, d2, fnC) {\n var c1 = fnC(d1);\n var c2 = fnC(d2);\n if (c1 > c2) return 1;\n if (c1 < c2) return -1;\n return 0;\n }", "function compareDate(date1, date2) {\n let dateparts1 = date1.split('-');\n let dateparts2 = date2.split('-');\n let newdate1 = new Date(dateparts1[0], dateparts1[1] - 1, dateparts1[2]);\n let newdate2 = new Date(dateparts2[0], dateparts2[1] - 1, dateparts2[2]);\n return Math.ceil((newdate2 - newdate1) / (1000 * 3600 * 24)) + 1;\n}", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDate(paramFirstDate,paramSecondDate)\n{\n\tvar fromDate = new Date(paramFirstDate);\n//\tvar hour = fromDate.getHours();\n\t\n\t\n\tvar toDate = new Date(paramSecondDate);\n\tvar diff = toDate.getTime() - fromDate.getTime();\n\treturn (diff);\n}", "function compararFechas()\n{\n var f1 = document.getElementById(\"fecha1\").value;\n var f2 = document.getElementById(\"fecha2\").value;\n\n var df1 = f1.substring(0, 2);\n var df11 = parseInt(df1);\n var mf1 = f1.substring(3, 5);\n var mf11 = parseInt(mf1);\n var af1 = f1.substring(6, 10);\n var af11 = parseInt(af1);\n\n var fe111 = new Date(af11, mf11, df11);\n\n var df2 = f2.substring(0, 2);\n var df22 = parseInt(df2);\n var mf2 = f2.substring(3, 5);\n var mf22 = parseInt(mf2);\n var af2 = f2.substring(6, 10);\n var af22 = parseInt(af2);\n\n\n\n var fe222 = new Date(af22, mf22, df22);\n\n\n /* if (fe111 > fe222) {\n sweetAlert(\"ERROR!!!\", \"la primera fecha es mayor!\", \"error\");\n\n } else\n {\n sweetAlert(\"ERROR!!!\", \"La segunda fecha es mayor ctm\", \"error\");\n\n }*/\n alert(\"fecha \"+fe222);\n\n}", "static isSameDate(dateA, dateB) {\n return (\n dateA.getFullYear() === dateB.getFullYear()\n && dateA.getMonth() === dateB.getMonth()\n && dateA.getDate() === dateB.getDate()\n );\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) {\n timeless = true;\n }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDateTime(paramFirstDate,paramSecondDate)\n{\n\tvar fromDate = new Date(paramFirstDate);\n\tvar toDate = new Date(paramSecondDate);\n\ttoDate.setHours(23);\n\ttoDate.setMinutes(59);\n\ttoDate.setSeconds(59);\n\tvar diff = toDate.getTime() - fromDate.getTime();\n\treturn (diff);\n}", "function CheckDate(TrDate, StDt, EdDt) {\n ////debugger\n var check = Date.parse(TrDate);\n var from = Date.parse(StDt);\n var to = Date.parse(EdDt);\n if ((check <= to && check >= from))\n return (true);\n else\n return false;\n}", "function byDate(a, b) {\n return a.date - b.date;\n}", "function compare(a, b) {\n const dateA = a.date;\n const dateB = b.date;\n\n let comparison = 0;\n if (dateA > dateB) {\n comparison = 1;\n } else if (dateA < dateB) {\n comparison = -1;\n }\n return comparison * -1;\n }", "function compareDateTimes(date1, date2) {\n if (date1.year == date2.year) {\n if (date1.month == date2.month) {\n if (date1.day == date2.day) {\n if (date1.hour == date2.hour) {\n if (date1.minute == date2.minute) {\n return 0;\n }\n return date1.minute - date2.minute;\n }\n return date1.hour - date2.hour;\n }\n return date1.day - date2.day;\n }\n return date1.month - date2.month;\n }\n return date1.year - date2.year;\n}", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) {\n timeless = true;\n }\n\n if (timeless !== false) {\n return new Date(date1.getTime()).setHours(0, 0, 0, 0) - new Date(date2.getTime()).setHours(0, 0, 0, 0);\n }\n\n return date1.getTime() - date2.getTime();\n }", "function isDate2OnOrAfterDate1(date1Value, date2Value) {\r\n if (date1Value == null || date1Value == '') {\r\n return 'U';\r\n }\r\n if (date2Value == null || date2Value == '') {\r\n return 'U';\r\n }\r\n // Make sure the date is in mm/dd/yyyy format.\r\n var reTestDate = /[0-9]{2,2}\\/[0-9]{2,2}\\/[0-9]{4,4}/;\r\n if (!reTestDate.test(date1Value) || !reTestDate.test(date2Value)) {\r\n return 'U';\r\n }\r\n // Put the dates in yyyymmdd format for the comparison.\r\n var newDate1Value = date1Value.substr(6, 4) + date1Value.substr(0, 2) + date1Value.substr(3, 2);\r\n var newDate2Value = date2Value.substr(6, 4) + date2Value.substr(0, 2) + date2Value.substr(3, 2);\r\n if (newDate1Value > newDate2Value) {\r\n return 'N';\r\n }\r\n else {\r\n return 'Y';\r\n }\r\n}", "isSameDate(date1, data2) {\n\t\treturn Moment(date1).isSame(data2);\n\t}", "function withinDate(d, m, y) {\n\n startDateArray = $('#startDate').val().split(\" \");\n endDateArray = $('#endDate').val().split(\" \");\n\n var startDay = parseInt(startDateArray[0]);\n var startMonth2 = monthNames.indexOf(startDateArray[1]) + 1;\n if (startMonth2 < 10){\n startMonth2 = \"0\" + startMonth2;\n }\n var startMonth = parseInt(startMonth2);\n var startYear = parseInt(startDateArray[2]);\n\n var endDay = parseInt(endDateArray[0]);\n var endMonth2 = monthNames.indexOf(endDateArray[1]) + 1;\n if (endMonth2 < 10){\n endMonth2 = \"0\" + endMonth2;\n }\n var endMonth = parseInt(endMonth2);\n var endYear = parseInt(endDateArray[2]);\n\n var d1 = [startMonth, startDay, startYear];\n var d2 = [endMonth, endDay, endYear];\n var c = [m, d, y];\n\n var from = new Date(d1); // -1 because months are from 0 to 11\n var to = new Date(d2);\n var check = new Date(c);\n\n return(check >= from && check <= to);\n }", "function compareDashedDates(date1, date2) {\n console.log(date1);\n console.log(date2);\n date1 = date1.split('-');\n date2 = date2.split('-');\n console.log(date1);\n console.log(date2);\n for (let i = 0; i < date1.length; i++) {\n if (parseInt(date1[i]) < parseInt(date2[i])) {\n return true;\n } else if (parseInt(date1[i]) > parseInt(date2[i])) {\n return false;\n }\n }\n return true;\n}", "function checkTodateLess(dateField1,dateField2,patname,errorMsg1)\n{\n frmDate=dateField1.value;\n frmDate=Date.UTC(frmDate.substr(6,4),frmDate.substr(3,2)-1,frmDate.substr(0,2)); \n toDate=dateField2.value;\n toDate=Date.UTC(toDate.substr(6,4),toDate.substr(3,2)-1,toDate.substr(0,2)); \n if(frmDate > toDate)\n {\n alert(errorMsg1);\n dateField2.focus();\n return false;\n }\n else\n {\n return true; \n }\n}", "function compareDates$static(d1/*:Date*/, d2/*:Date*/)/*:Number*/ {\n if (d1 === d2) {\n return 0;\n }\n\n if (d1 && d2) {\n var time1/*:Number*/ = d1.getTime();\n var time2/*:Number*/ = d2.getTime();\n if (time1 === time2) {\n return 0;\n } else if (time1 > time2) {\n return 1;\n }\n return -1;\n }\n\n if (!d1) {\n return 1;\n }\n\n if (!d2) {\n return -1;\n }\n }", "function compare(a,b) {\n if (a.dateOfEvent > b.dateOfEvent)\n return -1;\n if (a.dateOfEvent < b.dateOfEvent)\n return 1;\n return 0;\n }", "function HijridateCompare(date1, date2) {\n //\n if (date1.split('/').length < 3 || date2.split('/').length < 3)\n return -2;\n if (parseInt(date1.split('/')[2]) > parseInt(date2.split('/')[2]))\n return 1;\n else if (parseInt(date1.split('/')[2]) < parseInt(date2.split('/')[2]))\n return -1;\n else if (parseInt(date1.split('/')[1]) > parseInt(date2.split('/')[1]))\n return 1;\n else if (parseInt(date1.split('/')[1]) < parseInt(date2.split('/')[1]))\n return -1;\n else if (parseInt(date1.split('/')[0]) > parseInt(date2.split('/')[0]))\n return 1;\n else if (parseInt(date1.split('/')[0]) < parseInt(date2.split('/')[0]))\n return -1;\n else return 0;\n}", "function compareFuture(sender, args)\n{\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date >= today) {\n args.IsValid = true;\n }\n else\n {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function compareGreaterThanEqualsToday(sender, args) {\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date >= today) {\n args.IsValid = true;\n }\n else {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function checkDates(issueDate, expirationDate, errorMessage)\n{\n var returnVal = compareDate(issueDate, expirationDate);\n// alert(\"checkDates(issueDate, expirationDate, errorMessage) returnVal=\" + returnVal);\n if ( returnVal < 0)\n {\n alert(\"ERROR\\n\\n\" + errorMessage);\n //\"The Start Date and Time must be the same or earlier than the End Date and Time.\");\n return false;\n }\n return true;\n}", "function isSameDate(date1, date2) {\n return (date1 instanceof Date && date2 instanceof Date && date1.getDay()==date2.getDay() && date1.getMonth()==date2.getMonth() && date1.getFullYear()==date2.getFullYear());\n}", "function validateDate() {\n var date1 = strToDate($('#timeMin').val());\n var date2 = strToDate($('#timeMax').val());\n return Date.compare(date1, date2);\n \n}" ]
[ "0.7933325", "0.79294527", "0.78513306", "0.782929", "0.7825834", "0.7821799", "0.7812741", "0.7737143", "0.7702262", "0.76856935", "0.76489323", "0.76326287", "0.76181084", "0.7574218", "0.75381714", "0.75355226", "0.75211674", "0.74805105", "0.7459372", "0.74500567", "0.7449201", "0.7417648", "0.74007475", "0.7333023", "0.731888", "0.73138225", "0.7284869", "0.72627944", "0.72627944", "0.72472584", "0.7210481", "0.7210481", "0.7210481", "0.72098124", "0.71799004", "0.7143392", "0.71396506", "0.7106729", "0.7092865", "0.70918185", "0.7086773", "0.706008", "0.70556855", "0.70251346", "0.7012441", "0.7005467", "0.6999753", "0.6999753", "0.6984515", "0.6976174", "0.6976174", "0.69624305", "0.6958498", "0.6958498", "0.69209516", "0.692095", "0.69115245", "0.68978757", "0.6896522", "0.68878037", "0.68652666", "0.6857842", "0.6853032", "0.6841071", "0.6839035", "0.68321955", "0.68206114", "0.68199575", "0.6814321", "0.6806731", "0.6804202", "0.6798339", "0.67860794", "0.6777663", "0.6775837", "0.67668813", "0.6764894", "0.6764894", "0.6764894", "0.6764894", "0.6764894", "0.6761571", "0.67592967", "0.6740619", "0.67404383", "0.67369354", "0.67329216", "0.67175406", "0.6690949", "0.6686093", "0.6678112", "0.66754675", "0.6665758", "0.66298866", "0.6625172", "0.6624223", "0.6610646", "0.6607234", "0.658102", "0.6568774" ]
0.6813696
69
Function to compare two dates from date and to date
function checkTodateLess(dateField1,dateField2,patname,errorMsg1) { frmDate=dateField1.value; frmDate=Date.UTC(frmDate.substr(6,4),frmDate.substr(3,2)-1,frmDate.substr(0,2)); toDate=dateField2.value; toDate=Date.UTC(toDate.substr(6,4),toDate.substr(3,2)-1,toDate.substr(0,2)); if(frmDate > toDate) { alert(errorMsg1); dateField2.focus(); return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareDate(fromDate, toDate) {\r\r\tvar dt1 = parseInt(fromDate.substring(0, 2), 10);\r\r\tvar mon1 = parseInt(fromDate.substring(3, 5), 10);\r\r\tvar yr1 = parseInt(fromDate.substring(6, 10), 10);\r\r\tvar dt2 = parseInt(toDate.substring(0, 2), 10);\r\r\tvar mon2 = parseInt(toDate.substring(3, 5), 10);\r\r\tvar yr2 = parseInt(toDate.substring(6, 10), 10);\r\r\tvar date1 = new Date(yr1, mon1, dt1);\r\r\tvar date2 = new Date(yr2, mon2, dt2);\r\r\tif (date1 > date2) {\r\r\t\treturn 1;\r\r\t} else {\r\r\t\tif (date1 < date2) {\r\r\t\t\treturn -1;\r\r\t\t} else {\r\r\t\t\treturn 0;\r\r\t\t}\r\r\t}\r\r}", "function compare_dates(fecha, fecha2) \r\n { \r\n\t\r\n var xMonth=fecha.substring(3, 5); \r\n var xDay=fecha.substring(0, 2); \r\n var xYear=fecha.substring(6,10); \r\n var yMonth=fecha2.substring(3,5);\r\n var yDay=fecha2.substring(0, 2);\r\n var yYear=fecha2.substring(6,10); \r\n \r\n if (xYear > yYear){ \r\n return(true); \r\n }else{ \r\n if (xYear == yYear){ \r\n\t if (xMonth > yMonth){ \r\n\t \t\treturn(true); \r\n\t }else{ \r\n\t\t if (xMonth == yMonth){ \r\n\t\t if (xDay> yDay) \r\n\t\t return(true); \r\n\t\t else \r\n\t\t return(false); \r\n\t\t }else{\r\n\t\t \t return(false); \r\n\t\t } \r\n\t } \r\n }else{\r\n \t return(false); \r\n } \r\n \r\n } \r\n}", "function compareDates(date1, date2)\r\n{\r\n if(date1 < date2)\r\n return -1;\r\n else if(date1 > date2)\r\n return 1;\r\n else\r\n return 0;\r\n}", "function compareDates(a, b) {\n var aDate = a.date;\n var bDate = b.date;\n\n let comparison = 0;\n if (aDate > bDate) {\n comparison = 1;\n } \n else if (aDate < bDate) {\n comparison = -1;\n }\n \n return comparison;\n}", "function compareDate(fromDate, toDate){\r\n\t// check both value is there or not\r\n\t// in else it will return true its due to date field validation is done on form level\r\n\tif (toDate != '' && fromDate != ''){\r\n\t\t// extract day month and year from both of date\r\n\t\tvar fromDay = fromDate.substring(0, 2);\r\n\t\tvar toDay = toDate.substring(0, 2);\r\n\t\tvar fromMon = eval(fromDate.substring(3, 5)-1);\r\n\t\tvar toMon = eval(toDate.substring(3, 5)-1);\r\n\t\tvar fromYear = fromDate.substring(6, 10);\r\n\t\tvar toYear = toDate.substring(6, 10);\r\n\r\n\t\t// convert both date in date object\r\n\t\tvar fromDt = new Date(fromYear, fromMon, fromDay);\r\n\t\tvar toDt = new Date(toYear, toMon, toDay); \r\n\r\n\t\t// compare both date \r\n\t\t// if fromDt is greater than toDt return false else true\r\n\t\tif (fromDt > toDt) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}else{\r\n\t\treturn true;\r\n\t}\r\n}", "function compareDates(date1, date2) {\n if (!date1 && !date2) {\n return true;\n }\n else if (!date1 || !date2) {\n return false;\n }\n else {\n return (date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate());\n }\n}", "function compareDateFunction(date1,date2){\r\n\tvar leftDate;\r\n\tvar rightDate;\r\n\tif(typeof(date1) == \"object\"){\r\n\t\tleftDate = date1;\r\n\t}else{\r\n\t\tleftDate = convertStr2Date(date1);\r\n\t}\r\n\tif(typeof(date2) == \"object\"){\r\n\t\trightDate = date2;\r\n\t}else{\r\n\t\trightDate = convertStr2Date(date2);\r\n\t}\r\n\treturn compareDate(leftDate,rightDate,0);\r\n}", "function compareDates(a, b)\n{\n var x=new Date(a.Date);\n var y=new Date(b.Date);\n \n console.log(\"hello we are hee\");\t\n\n console.log(x);\n console.log(y);\t\n\n if(x>y)\n {\n console.log(1);\n return 1;\n\n }\n else\n {\n console.log(-1);\t \n return -1;\n }\n}", "function CompareDate(date1, date2)\n{\n var std_format = date1.split(\"-\"); \n s_dt= new Date(std_format[1]+\"-\"+std_format[0]+\"-\"+std_format[2]);\n var etd_format = date2.split(\"-\"); \n e_dt= new Date(etd_format[1]+\"-\"+etd_format[0]+\"-\"+etd_format[2]);\n if(s_dt>e_dt)\n return true;\n else \n return false;\n}", "function compareDate(dos, rd) {\n\n }", "function compareDatesWH(date1, date2){\n var comp = DATES_EQUALS; // Son iguales\n if(date1.getFullYear() < date2.getFullYear()){\n comp = DATES_LOWER; // Date 1 es menor que date 2\n }\n else if(date1.getFullYear() > date2.getFullYear()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() < date2.getMonth()){\n comp = DATES_LOWER;\n }\n else if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() > date2.getMonth()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() < date2.getDate()){\n comp = DATES_LOWER;\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() > date2.getDate()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n }\n }\n }\n return comp;\n }", "function compareDates (date1, date2)\n{\n newDate1 = new Date(date1);\n newDate1.setHours(0,0,0,0);\n newDate2 = new Date(date2);\n newDate2.setHours(0,0,0,0);\n var t1 = newDate1.getTime();\n var t2 = newDate2.getTime();\n if (t1 === t2) return 0;\n else if (t1 > t2) return 1;\n else return -1;\n}", "function compareDates(date_One, date_Two) {\n if (date_One.getFullYear() > date_Two.getFullYear())\n return 1;\n else if (date_One.getFullYear() < date_Two.getFullYear())\n return -1;\n else {\n if (date_One.getMonth() > date_Two.getMonth())\n return 1;\n else if (date_One.getMonth() < date_Two.getMonth())\n return -1;\n else {\n if (date_One.getDate() > date_Two.getDate())\n return 1;\n else if (date_One.getDate() < date_Two.getDate())\n return -1;\n else\n return 0;\n }\n }\n}", "function datesAreEquivalent(date1,date2){\n return (date1.getMonth() == date2.getMonth()) && (date1.getFullYear() == date2.getFullYear()) && (date1.getDate() == date2.getDate()) ;\n}", "function compare_date( a, b ) {\n if ( a.date < b.date){\n return -1;\n }\n if ( a.date > b.date ){\n return 1;\n }\n return 0;\n}", "function compareDate(a,b) {\n if (a.date < b.date)\n return -1;\n else if (a.date > b.date)\n return 1;\n else\n return 0;\n }", "compareDate(a, b) {\n if (a.startDate < b.startDate) return -1\n if (a.startDate > b.startDate) return 1\n else return 0\n }", "function compareDates(a,b) {\n if(a.attributes.date.isBefore(b.attributes.date)) {return -1;}\n if(b.attributes.date.isBefore(a.attributes.date)) {return 1;}\n return 0;\n}", "function myFunction(date1, date2) {\n return (\n date1.getYear() === date2.getYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}", "function compareDates(ymd1,ymd2){\n\t// parse\n\tvar y1 = parseInt(ymd1.slice(0,4));\n\tvar m1 = parseInt(ymd1.slice(5,7));\n\tvar d1 = parseInt(ymd1.slice(8,10));\n\tvar y2 = parseInt(ymd2.slice(0,4));\n\tvar m2 = parseInt(ymd2.slice(5,7));\n\tvar d2 = parseInt(ymd2.slice(8,10));\n\t// compare years\n\tif(y1 > y2){\n\t\treturn 1\n\t} else if (y1 < y2) {\n\t\treturn -1\n\t} else {\n\t\t// compare months\n\t\tif(m1 > m2){\n\t\t\treturn 1\n\t\t} else if (m1 < m2) {\n\t\t\treturn -1 \n\t\t} else {\n\t\t\t// compare days\n\t\t\tif(d1 > d2){\n\t\t\t\treturn 1\n\t\t\t} else if (d1 < d2) {\n\t\t\t\treturn -1\n\t\t\t} else {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n}", "function compareDate(a, b) {\r\n if (a.date > b.date) return 1;\r\n if (b.date > a.date) return -1;\r\n return 0;\r\n}", "function by_datetime( a, b ) {\n\n const a_date = moment( a.day.split(' - ')[1], 'MM/DD/YYYY');\n const b_date = moment( b.day.split(' - ')[1], 'MM/DD/YYYY');\n\n if ( b_date.isAfter( a_date ) ) {\n return -1;\n } else if ( b_date.isBefore( a_date ) ) {\n return 1;\n } else {\n return 0;\n }\n\n}", "function compareDates(a, b) {\n\t\tif (b.transaction_date < a.transaction_date) {\n\t\t\treturn -1\n\t\t}\n\t\tif (b.transaction_date > a.transaction_date) {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}", "function compareDates(a, b) {\n\t\tif (b.transaction_date < a.transaction_date) {\n\t\t\treturn -1\n\t\t}\n\t\tif (b.transaction_date > a.transaction_date) {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}", "function CheckDateDifference(lowDate, highDate, comparison) {\n\t lowDateSplit = lowDate.split('/');\n\t highDateSplit = highDate.split('/');\n\n\t date1 = new Date();\n\t date2 = new Date();\n\n\t date1.setDate(lowDateSplit[0]);\n\t date1.setMonth(lowDateSplit[1] - 1);\n\t date1.setYear(lowDateSplit[2]);\n\n\t date2.setDate(highDateSplit[0]);\n\t date2.setMonth(highDateSplit[1] - 1);\n\t date2.setYear(highDateSplit[2]);\n\n\t if(comparison == \"eq\") {\n\t\t if(date1.getTime() == date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"lt\") {\n\t\t if(date1.getTime() < date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"gt\") {\n\t\t if(date1.getTime() > date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"le\") {\n\t\t if(date1.getTime() <= date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"ge\") {\n\t\t if(date1.getTime() >= date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n}", "function dateCompare(date1, date2) {\n\t\tif (date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "function comparisonByDate(dateA, dateB) {\n var c = new Date(dateA.date);\n var d = new Date(dateB.date);\n return c - d;\n }", "function compareDates(d1, m1, y1, d2, m2, y2) {\n\n\tvar date1\t= new Number(d1);\n\tvar month1\t= new Number(m1);\n\tvar year1\t= new Number(y1);\n\tvar date2\t= new Number(d2);\n\tvar month2\t= new Number(m2);\n\tvar year2\t= new Number(y2);\n\n\tvar\treturnVal = 0;\n\tif (year1 < year2) {\n\t\treturnVal = -1;\n\t} else if (year1 > year2) {\n\t\treturnVal = 1;\n\t} else {\n\t\t//alert('same year');\n\t\tif (month1 < month2) {\n\t\t\treturnVal = -1;\n\t\t} else if (month1 > month2) {\n\t\t\treturnVal = 1;\n\t\t} else {\n\t\t\t//alert('same month');\n\t\t\tif (date1 < date2) {\n\t\t\t\treturnVal = -1;\n\t\t\t} else if (date1 > date2) {\n\t\t\t\treturnVal = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnVal;\n\n}", "function dateChecker(date1, date2 = new Date()) {\n var date1 = new Date(Date.parse(date1));\n var date2 = new Date(Date.parse(date2));\n var ageTime = date2.getTime() - date1.getTime();\n\n if (ageTime < 0) {\n return false; //date2 is before date1\n } else {\n return true;\n }\n}", "function compareDates(d1, d2) {\n var r = compareYears(d1, d2);\n if (r === 0) {\n r = compareMonths(d1, d2);\n if (r === 0) {\n r = compareDays(d1, d2);\n }\n }\n return r;\n }", "function calendar_helper_dateEquals(date1, date2){\n if (date1.getFullYear() == date2.getFullYear())\n if (date1.getMonth() == date2.getMonth())\n if (date1.getDate() == date2.getDate())\n return true;\n return false;\n}", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "static compare(date1, date2) {\n let d1 = this.reverseGregorian(date1);\n let d2 = this.reverseGregorian(date2);\n\n return d1.localeCompare(d2);\n }", "validateTwoDates(startDate, endDate){\n if( startDate < endDate) {\n return true;\n } else {\n return false\n }\n }", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "compareTwoObjectsByDate(a,b) {\n let x = a.approach_date;\n let y = b.approach_date;\n if (x < y) {return -1;}\n if (x > y) {return 1;}\n return 0;\n }", "function isStringDate2Greater(date1,date2)\r\n{\r\n // date1 and date2 are strings\r\n //This function checks if date2 is later than date1\r\n //If the second date is null then it sets date2 to current date and checks if first date is later than the current date\r\n var sd=date1;\r\n if (date1 == \"\") return false;\r\n else if (date2 == \"\") return false;\r\n else\r\n {\r\n var ed=date2;\r\n var End= new Date(changeDateFormat(ed));\r\n }\r\n var Start= new Date(changeDateFormat(sd));\r\n var diff=End-Start;\r\n if (diff>=0) return true;\r\n else\r\n {\r\n// alert(msg);\t\r\n return false;\r\n }\r\n}", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "function validate_validDates(to) {\n\n\tvar offset = to.split('-');\n\tvar from_date = $('#check_in-' + offset[1]).val();\n\tvar to_date1 = $('#' + to).val();\n\n\tvar edate = from_date.split('-');\n\te_date = new Date(edate[2], edate[1] - 1, edate[0]).getTime();\n\tvar edate1 = to_date1.split('-');\n\te_date1 = new Date(edate1[2], edate1[1] - 1, edate1[0]).getTime();\n\n\tvar from_date_ms = new Date(e_date).getTime();\n\tvar to_date_ms = new Date(e_date1).getTime();\n\n\tif (from_date_ms > to_date_ms) {\n\t\terror_msg_alert('Date should not be greater than valid to date');\n\t\t$('#check_in-' + offset[1]).css({ border: '1px solid red' });\n\t\t$('#check_in-' + offset[1]).focus();\n\t\tg_validate_status = false;\n\t\treturn false;\n\t}\n\telse {\n\t\t$('#check_in-' + offset[1]).css({ border: '1px solid #ddd' });\n\t\treturn true;\n\t}\n}", "function date_greater_than (date1, date2)\n{\n //Dates should be in the format Month(maxlength=3) Day(num minlength=2), Year hour(minlength=2):minute(minlength=2)(24h time)\n //Eg Apr 03 2020 23:59\n //the function caller is asking \"is date1 greater than date2?\" and gets a boolean in return\n\n let months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n\n //Compares the years\n if (parseInt(date1.substr(7, 4)) > parseInt(date2.substr(7, 4))) return true\n else if (parseInt(date1.substr(7, 4)) < parseInt(date2.substr(7, 4))) return false\n else //the elses are for if both values are the same\n {\n //Compares the months\n if (months.indexOf(date1.substr(0, 3)) > months.indexOf(date2.substr(0, 3))) return true\n else if (months.indexOf(date1.substr(0, 3)) < months.indexOf(date2.substr(0, 3))) return false\n else\n {\n //Compares the days\n if (parseInt(date1.substr(4, 2)) > parseInt(date2.substr(4, 2))) return true\n if (parseInt(date1.substr(4, 2)) < parseInt(date2.substr(4, 2))) return false\n else\n {\n //Compares the hours\n if (parseInt(date1.substr(12, 2)) > parseInt(date2.substr(12, 2))) return true\n else if (parseInt(date1.substr(12, 2)) < parseInt(date2.substr(12, 2))) return false\n else\n {\n //Compares minutes\n if (parseInt(date1.substr(15, 2)) > parseInt(date2.substr(15, 2))) return true\n else return false\n }\n }\n }\n }\n}", "function logicalDates(from, to) {\n if (vm.to === null || vm.to === undefined || vm.to == NaN) {\n vm.logicalDatesBool = true;\n } else {\n if (new Date(vm.from) > new Date(vm.to)) {\n vm.logicalDatesBool = false;\n } else {\n vm.logicalDatesBool = true;\n }\n }\n }", "function isDate2OnOrAfterDate1(date1Value, date2Value) {\r\n if (date1Value == null || date1Value == '') {\r\n return 'U';\r\n }\r\n if (date2Value == null || date2Value == '') {\r\n return 'U';\r\n }\r\n // Make sure the date is in mm/dd/yyyy format.\r\n var reTestDate = /[0-9]{2,2}\\/[0-9]{2,2}\\/[0-9]{4,4}/;\r\n if (!reTestDate.test(date1Value) || !reTestDate.test(date2Value)) {\r\n return 'U';\r\n }\r\n // Put the dates in yyyymmdd format for the comparison.\r\n var newDate1Value = date1Value.substr(6, 4) + date1Value.substr(0, 2) + date1Value.substr(3, 2);\r\n var newDate2Value = date2Value.substr(6, 4) + date2Value.substr(0, 2) + date2Value.substr(3, 2);\r\n if (newDate1Value > newDate2Value) {\r\n return 'N';\r\n }\r\n else {\r\n return 'Y';\r\n }\r\n}", "function checkDates(dateField1,dateField2,errorMsg)\n{\n frmDate=dateField1.value;\n frmDate=Date.UTC(frmDate.substr(6,4),frmDate.substr(3,2)-1,frmDate.substr(0,2)); \n toDate=dateField2.value;\n toDate=Date.UTC(toDate.substr(6,4),toDate.substr(3,2)-1,toDate.substr(0,2)); \n if(frmDate > toDate)\n {\n alert(errorMsg);\n dateField2.focus();\n return false;\n }\n else\n {\n return true; \n }\n}", "function cmpDate(dat1, dat2) {\r\n var day = 1000 * 60 * 60 * 24, // milliseconds in one day\r\n mSec1, mSec2; // milliseconds for dat1 and dat2\r\n // valudate dates\r\n if (!isDate(dat1) || !isDate(dat2)) {\r\n alert(\"cmpDate: Input parameters are not dates!\");\r\n return 0;\r\n }\r\n // prepare milliseconds for dat1 and dat2\r\n mSec1 = (new Date(dat1.substring(6, 10), dat1.substring(0, 2) - 1, dat1.substring(3, 5))).getTime();\r\n mSec2 = (new Date(dat2.substring(6, 10), dat2.substring(0, 2) - 1, dat2.substring(3, 5))).getTime();\r\n // return number of days (positive or negative)\r\n return Math.ceil((mSec2 - mSec1) / day);\r\n}", "function compareDates(date1,dateformat1,date2,dateformat2) {\r\n\tvar d1=getDateFromFormat(date1,dateformat1);\r\n\tvar d2=getDateFromFormat(date2,dateformat2);\r\n\tif (d1==0 || d2==0) {\r\n\t\treturn -1;\r\n\t\t}\r\n\telse if (d1 > d2) {\r\n\t\treturn 1;\r\n\t\t}\r\n\treturn 0;\r\n\t}", "function compareDates(date1,dateformat1,date2,dateformat2) {\r\n\tvar d1=getDateFromFormat(date1,dateformat1);\r\n\tvar d2=getDateFromFormat(date2,dateformat2);\r\n\tif (d1==0 || d2==0) {\r\n\t\treturn -1;\r\n\t\t}\r\n\telse if (d1 > d2) {\r\n\t\treturn 1;\r\n\t\t}\r\n\treturn 0;\r\n\t}", "function fecha2MayorFecha1(fechaFinal,fechaFormulario){\n\n if((Date.parse(fechaFormulario)) <= (Date.parse(fechaFinal))) {\n alert(\"fecha nacimiento mayor que la actual\");\n return true;\n\n }else{\n return false;\n }\n\n\n\n\n\n}", "function DateCompareEqual(_strDate1, _strDate2) {\n var strDate;\n var strDateArray;\n var strDay;\n var strMonth;\n var strYear;\n\n strDateArray = _strDate1.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate1 = new Date(strYear, GetMonth(strMonth), strDay);\n\n strDateArray = _strDate2.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate2 = new Date(strYear, GetMonth(strMonth), strDay);\n\n if (_strDate1 >= _strDate2) {\n return true;\n }\n else {\n return false;\n }\n}", "function compareDates(date1, dateformat1, date2, dateformat2) {\n var d1 = getDateFromFormat(date1, dateformat1);\n var d2 = getDateFromFormat(date2, dateformat2);\n if (d1 == 0 || d2 == 0) {\n return -1;\n } else if (d1 > d2) {\n return 1;\n }\n return 0;\n}", "function SP_CompareDates(firstDate, secondDate) {\n\tif (arguments.length === 2) {\n\t\tvar date1 = SP_Trim(document.getElementById(firstDate).value),\n\t\t\tdate2 = SP_Trim(document.getElementById(secondDate).value),\n\t\t\tdiff = \"\";\n\t\t\n\t\tif (SP_Trim(date1) != \"\" && SP_Trim(date2) != \"\") {\n\t\t\tif (languageSelect && languageSelect !== \"en_us\") {\n\t\t\t\tvar enteredDate1 = date1.split('-'),\n\t\t\t\t\tenteredDate2 = date2.split('-');\n\t\t\t\t\n\t\t\t\tswitch (dateFormat) {\n\t\t\t\t\tcase \"dd-mmm-yyyy\":\n\t\t\t\t\t\tdate1 = new Date(enteredDate1[2], SP_GetMonthNumber(enteredDate1[1]), enteredDate1[0]);\n\t\t\t\t\t\tdate2 = new Date(enteredDate2[2], SP_GetMonthNumber(enteredDate2[1]), enteredDate2[0]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"yyyy-mm-dd\":\n\t\t\t\t\t\tdate1 = new Date(enteredDate1[0], enteredDate1[1], enteredDate1[2]);\n\t\t\t\t\t\tdate2 = new Date(enteredDate2[0], enteredDate2[1], enteredDate2[2]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdate1 = new Date(date1.replace(/-/g,' '));\n\t\t\t\tdate2 = new Date(date2.replace(/-/g,' '));\n\t\t\t}\n\t\t\n\t\t\tdiff = date1 - date2;\n\t\t\tdiff = diff > 0 ? 1 : diff < 0 ? -1 : 0;\n\t\t}\n\n\t\treturn diff;\n\t}\n}", "function compareDate(date1, date2) {\n let dateparts1 = date1.split('-');\n let dateparts2 = date2.split('-');\n let newdate1 = new Date(dateparts1[0], dateparts1[1] - 1, dateparts1[2]);\n let newdate2 = new Date(dateparts2[0], dateparts2[1] - 1, dateparts2[2]);\n return Math.ceil((newdate2 - newdate1) / (1000 * 3600 * 24)) + 1;\n}", "sameDate(dateA, dateB) {\n return ((dateA.getDate() === dateB.getDate()) && (dateA.getMonth() === dateB.getMonth()) && (dateA.getFullYear() === dateB.getFullYear()));\n }", "function compareDate(inputDate1, inputDate2) {\r\n if(!inputDate1 || !inputDate2) {\r\n return -1;\r\n }\r\n\tvar date1 = inputDate1.split('-');\r\n\tvar date2 = inputDate2.split('-');\r\n\t\r\n\tif(date1.length != 3 || date2.length != 3 ) { //checks if dates are valid\r\n\t\treturn -1;\r\n\t}\r\n\tif(date1[0] < date2[0]) {\r\n\t\treturn 1;\r\n\t}\r\n\tif(date1[0] == date2[0]) {\r\n\t\tif(date1[1] < date2[1]) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(date1[1] == date2[1]) {\r\n\t\t\tif(date1[2] <= date2[2]) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}", "function compareDay(day1, day2){\n return day1.getFullYear() === day2.getFullYear() &&\n day1.getMonth() === day2.getMonth() &&\n day1.getDate() === day2.getDate();\n}", "function validateFromToDate(validFor,specificRadioObject,fromDateObject,toDateObject,oldFromDateValue,currentDateValue,dateFormat){\n \n\t\n\tif(!isNullDate(fromDateObject,\"From Date\")){\n\n \t\treturn false;\n\t}else{\n\t\tif(!validateDateDifference(validFor,currentDateValue,oldFromDateValue,fromDateObject,'',dateFormat,'From Date'))\n \t\t{\n \t\t\treturn false;\n \t\t}\n\n \t}\n\n\tif(specificRadioObject.checked){\n\t\t\n \t if(!isNullDate(toDateObject,\"To Date\")){\n \t return false;\n }else{\n \t if(!validateDateDifference(validFor,currentDateValue,oldFromDateValue\n , fromDateObject\n , toDateObject\n , dateFormat,'To Date'))\n \t\t {\n\n \t\t return false;\n \t\t }\n }\n\n\t}\n\treturn true;\n}", "checkIfDelay(date1,date2){\n a = new Date(date1);\n b = new Date(date2);\n\n if(b > a){\n return true\n }else{\n return false\n }\n\n }", "function CheckDate(TrDate, StDt, EdDt) {\n ////debugger\n var check = Date.parse(TrDate);\n var from = Date.parse(StDt);\n var to = Date.parse(EdDt);\n if ((check <= to && check >= from))\n return (true);\n else\n return false;\n}", "function compareDateObject(date1, date2){\r\n if(date1 == null) return false;\r\n if(date2 == null) return false;\r\n\r\n var date1Long = date1.getTime();\r\n var date2Long = date2.getTime();\r\n\r\n if(date1Long - date2Long > 0) return '>';\r\n if(date1Long - date2Long == 0) return '=';\r\n if(date1Long - date2Long < 0) return '<';\r\n else\r\n return '';\r\n}", "function validate_validDate (from, to) {\n\t\n\tvar from_date = $('#' + from).val();\n\tvar to_date = $('#' + to).val();\n\n\tvar edate = from_date.split('-');\n\te_date = new Date(edate[2], edate[1] - 1, edate[0]).getTime();\n\tvar edate1 = to_date.split('-');\n\te_date1 = new Date(edate1[2], edate1[1] - 1, edate1[0]).getTime();\n\n\tvar from_date_ms = new Date(e_date).getTime();\n\tvar to_date_ms = new Date(e_date1).getTime();\n\n\tif (from_date_ms > to_date_ms) {\n\t\terror_msg_alert('Date should not be greater than valid to date');\n\t\t$('#' + from).css({ border: '1px solid red' });\n\t\tdocument.getElementById(from).value = '';\n\t\t$('#' + from).focus();\n\t\tg_validate_status = false;\n\t\treturn false;\n\t}\n\telse {\n\t\t$('#' + from).css({ border: '1px solid #ddd' });\n\t\treturn true;\n\t}\n\treturn true;\n}", "function compararFecha(fecha, fecha2) {\n var xMonth = fecha.substring(3, 5);\n var xDay = fecha.substring(0, 2);\n var xYear = fecha.substring(6, 10);\n var yMonth = fecha2.substring(3, 5);\n var yDay = fecha2.substring(0, 2);\n var yYear = fecha2.substring(6, 10);\n if (xYear > yYear) {\n return 1;\n }\n else {\n if (xYear == yYear) {\n if (xMonth > yMonth) {\n return 1;\n }\n else {\n if (xMonth == yMonth) {\n if (xDay == yDay) {\n return 0;\n } else {\n if (xDay > yDay)\n return 1;\n else\n return -1;\n }\n }\n else\n return -1;\n }\n }\n else\n return -1;\n }\n}", "function isDateWithinSameDay(date1, date2) {\n return date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear();\n }", "function compareEqualsToday(sender, args)\n{\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date > today || date<today)\n {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function compararFechas()\n{\n var f1 = document.getElementById(\"fecha1\").value;\n var f2 = document.getElementById(\"fecha2\").value;\n\n var df1 = f1.substring(0, 2);\n var df11 = parseInt(df1);\n var mf1 = f1.substring(3, 5);\n var mf11 = parseInt(mf1);\n var af1 = f1.substring(6, 10);\n var af11 = parseInt(af1);\n\n var fe111 = new Date(af11, mf11, df11);\n\n var df2 = f2.substring(0, 2);\n var df22 = parseInt(df2);\n var mf2 = f2.substring(3, 5);\n var mf22 = parseInt(mf2);\n var af2 = f2.substring(6, 10);\n var af22 = parseInt(af2);\n\n\n\n var fe222 = new Date(af22, mf22, df22);\n\n\n /* if (fe111 > fe222) {\n sweetAlert(\"ERROR!!!\", \"la primera fecha es mayor!\", \"error\");\n\n } else\n {\n sweetAlert(\"ERROR!!!\", \"La segunda fecha es mayor ctm\", \"error\");\n\n }*/\n alert(\"fecha \"+fe222);\n\n}", "function checkDates($from, $thru) {\n if ($from.val() && $thru.val() && anchor && nonAnchor) {\n if (anchor > nonAnchor) {\n $from.val(nonAnchor.toString('MM/dd/yyyy'));\n $thru.val(anchor.toString('MM/dd/yyyy'));\n } else {\n $from.val(anchor.toString('MM/dd/yyyy'));\n $thru.val(nonAnchor.toString('MM/dd/yyyy'));\n }\n }\n }", "function compareDatesValues(strDataInicial, strDataFinal)\n{\n if ((empty(strDataInicial)) || (empty(strDataFinal)))\n return false;\n if ((strDataInicial.length < 10) || (strDataFinal.length < 10))\n return false;\n if (convertDate(strDataInicial, 'YmdHis') > convertDate(strDataFinal, 'YmdHis')) {\n alertDialog('A data inicial deve ser sempre menor ou igual a data final.', 'Validação', 250, 150);\n return false;\n }\n return true;\n}", "function matchToDateWithFromDate(){\n\tvar fDate = dojo.byId('fromDate');\n\tvar tDate = dojo.byId('toDate');\n\tif(tDate.value.length == 0){\n\t\t\tsyncDate(fDate);\n\t\t\ttDate.value = fDate.value;\n\t\t}\t\n}", "function compare(a,b) {\n\t\t\t\tif (new Date(a.date) < new Date(b.date))\n\t\t\t\t\treturn 1;\n\t\t\t\tif (new Date(a.date) > new Date(b.date))\n\t\t\t\t \treturn -1;\n\t\t\t\treturn 0;\n\t\t\t}", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function sameDate(d0, d1) {\n\treturn d0.getFullYear() == d1.getFullYear() && d0.getMonth() == d1.getMonth() && d0.getDate() == d1.getDate();\n}", "function dateBetween(date1, date2)\r{\r var zeroReplaceDate1 = date1.replace(\" 00:00:00\", \"\");\r var zeroReplaceDate2 = date2.replace(\" 00:00:00\", \"\");\r\r var converDt1 = zeroReplaceDate1.split('-').join('/');\r var converDt2 = zeroReplaceDate2.split('-').join('/');\r\r var date3 = new Date(converDt1);\r var date4 = new Date(converDt2);\r\r var timeDiff = date4.getTime() - date3.getTime();\r if (timeDiff > 0)\r return 1\r else\r return 0;\r}", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function byDate(a, b) {\n return a.date - b.date;\n}", "function compareDate(paramFirstDate,paramSecondDate)\n{\n\tvar fromDate = new Date(paramFirstDate);\n//\tvar hour = fromDate.getHours();\n\t\n\t\n\tvar toDate = new Date(paramSecondDate);\n\tvar diff = toDate.getTime() - fromDate.getTime();\n\treturn (diff);\n}", "function withinDate(d, m, y) {\n\n startDateArray = $('#startDate').val().split(\" \");\n endDateArray = $('#endDate').val().split(\" \");\n\n var startDay = parseInt(startDateArray[0]);\n var startMonth2 = monthNames.indexOf(startDateArray[1]) + 1;\n if (startMonth2 < 10){\n startMonth2 = \"0\" + startMonth2;\n }\n var startMonth = parseInt(startMonth2);\n var startYear = parseInt(startDateArray[2]);\n\n var endDay = parseInt(endDateArray[0]);\n var endMonth2 = monthNames.indexOf(endDateArray[1]) + 1;\n if (endMonth2 < 10){\n endMonth2 = \"0\" + endMonth2;\n }\n var endMonth = parseInt(endMonth2);\n var endYear = parseInt(endDateArray[2]);\n\n var d1 = [startMonth, startDay, startYear];\n var d2 = [endMonth, endDay, endYear];\n var c = [m, d, y];\n\n var from = new Date(d1); // -1 because months are from 0 to 11\n var to = new Date(d2);\n var check = new Date(c);\n\n return(check >= from && check <= to);\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) {\n timeless = true;\n }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function DateCompare(_strDate1, _strDate2) {\n var strDate;\n var strDateArray;\n var strDay;\n var strMonth;\n var strYear;\n\n strDateArray = _strDate1.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate1 = new Date(strYear, GetMonth(strMonth), strDay);\n\n strDateArray = _strDate2.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate2 = new Date(strYear, GetMonth(strMonth), strDay);\n\n if (_strDate1 > _strDate2) {\n return true;\n }\n else {\n return false;\n }\n}", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compare(a, b) {\n const dateA = a.date;\n const dateB = b.date;\n\n let comparison = 0;\n if (dateA > dateB) {\n comparison = 1;\n } else if (dateA < dateB) {\n comparison = -1;\n }\n return comparison * -1;\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) {\n timeless = true;\n }\n\n if (timeless !== false) {\n return new Date(date1.getTime()).setHours(0, 0, 0, 0) - new Date(date2.getTime()).setHours(0, 0, 0, 0);\n }\n\n return date1.getTime() - date2.getTime();\n }", "function compareDate(date1, date2) {\n\n //Hours equal\n if (date1.getHours() == date2.getHours()) {\n\n //Check minutes\n if (date1.getMinutes() == date2.getMinutes()) {\n return 0;\n } else {\n if (date1.getMinutes() > date2.getMinutes()) {\n return 1;\n } else {\n return -1;\n }\n }\n }\n\n //Hours not equal\n else {\n if (date1.getHours() > date2.getHours()) {\n return 1;\n } else {\n return -1;\n }\n }\n}", "function compareDateTime(paramFirstDate,paramSecondDate)\n{\n\tvar fromDate = new Date(paramFirstDate);\n\tvar toDate = new Date(paramSecondDate);\n\ttoDate.setHours(23);\n\ttoDate.setMinutes(59);\n\ttoDate.setSeconds(59);\n\tvar diff = toDate.getTime() - fromDate.getTime();\n\treturn (diff);\n}", "function compareDateTimes(date1, date2) {\n if (date1.year == date2.year) {\n if (date1.month == date2.month) {\n if (date1.day == date2.day) {\n if (date1.hour == date2.hour) {\n if (date1.minute == date2.minute) {\n return 0;\n }\n return date1.minute - date2.minute;\n }\n return date1.hour - date2.hour;\n }\n return date1.day - date2.day;\n }\n return date1.month - date2.month;\n }\n return date1.year - date2.year;\n}", "function isCorrectOrder(yyyymmdd1, yyyymmdd2) {\r\n return yyyymmdd1 < yyyymmdd2;\r\n}", "function compareFuture(sender, args)\n{\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date >= today) {\n args.IsValid = true;\n }\n else\n {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function sortByDate(a, b) {\n let comparison = 0;\n\n // -------------------------------------------------------------JavaScript - Conditional Statments Ex. 3||\n if (a.getDate >= b.date) {\n comparison = 1;\n } else if (a.date <= b.date) {\n comparison = -1;\n }\n return comparison;\n}", "function compareDashedDates(date1, date2) {\n console.log(date1);\n console.log(date2);\n date1 = date1.split('-');\n date2 = date2.split('-');\n console.log(date1);\n console.log(date2);\n for (let i = 0; i < date1.length; i++) {\n if (parseInt(date1[i]) < parseInt(date2[i])) {\n return true;\n } else if (parseInt(date1[i]) > parseInt(date2[i])) {\n return false;\n }\n }\n return true;\n}", "function compareGreaterThanEqualsToday(sender, args) {\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date >= today) {\n args.IsValid = true;\n }\n else {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "function compFunc(a, b)\n{\n\tif (a.date < b.date)\n\t\treturn 1;\n\telse if (a.date > b.date)\n\t\treturn -1;\n\telse\n\t\treturn 0;\n}", "function validateFromToDate(from, to) {\n try {\n if (from != '' && to != '') {\n var fromDate = new Date(from);\n var toDate = new Date(to);\n if (fromDate.getTime() > toDate.getTime()) {\n return false;\n }\n }\n return true;\n } catch (e) {\n alert('validateFromToDate:' + e.message);\n }\n }", "function comparafecha(fecha1, fecha2){\n if ( !checkdate(fecha1) || !checkdate(fecha2) ) return -1;\n dia = fecha1.substring(0,2)\n mes = fecha1.substring(3,5)\n anho = fecha1.substring(6,10)\n fecha1x = anho + mes + dia\n dia = fecha2.substring(0,2)\n mes = fecha2.substring(3,5)\n anho = fecha2.substring(6,10)\n fecha2x = anho + mes + dia\n return (fecha1x>fecha2x?1:(fecha1x<fecha2x?2:0));\n}", "isSameDate(date1, data2) {\n\t\treturn Moment(date1).isSame(data2);\n\t}", "function isAfter (date1, date2) {\n if (date1.getFullYear() > date2.getFullYear()) return true\n else if (date1.getFullYear() >= date2.getFullYear() && date1.getMonth() > date2.getMonth()) return true\n else if (date1.getFullYear() >= date2.getFullYear() && date1.getMonth() >= date2.getMonth() && date1.getDate() >= date2.getDate()) return true\n else return false\n}" ]
[ "0.80404806", "0.7633265", "0.7597395", "0.75823194", "0.74235076", "0.74127644", "0.7399676", "0.73860925", "0.7352716", "0.7342239", "0.73357934", "0.7276899", "0.72608376", "0.72474813", "0.7247469", "0.7189725", "0.7170247", "0.71696043", "0.7167364", "0.7134652", "0.7129022", "0.7037997", "0.7030128", "0.7030128", "0.7008281", "0.69871426", "0.69743305", "0.69575816", "0.6935853", "0.69321287", "0.6912104", "0.6905515", "0.6905515", "0.68694687", "0.6864481", "0.68641526", "0.68641526", "0.68586046", "0.68461037", "0.68228316", "0.68228316", "0.68228316", "0.6806358", "0.6803771", "0.6797416", "0.67965657", "0.67875594", "0.6781866", "0.6757616", "0.6757616", "0.6752649", "0.67399395", "0.67327297", "0.67292327", "0.6685918", "0.6685217", "0.6683289", "0.6677788", "0.6672735", "0.666322", "0.66540843", "0.66514933", "0.66485673", "0.6647882", "0.6641446", "0.6617343", "0.6616348", "0.6613624", "0.6601513", "0.6585942", "0.6583995", "0.656684", "0.6564766", "0.6538496", "0.65373355", "0.6522769", "0.65092766", "0.6508081", "0.650712", "0.65064526", "0.6506338", "0.6506338", "0.6506338", "0.6506338", "0.6506338", "0.6495321", "0.648669", "0.648297", "0.647462", "0.64718086", "0.6468303", "0.6456989", "0.6451844", "0.64499927", "0.64499015", "0.6422866", "0.6421767", "0.6415626", "0.64145744", "0.639485" ]
0.64847404
87
Function for comparing dates with time
function dateTimeDiff(D1,D2,errorMsg,patname) { if(!(patname.test(trim(D1.value)))) { alert(errorMsg); D1.focus(); return false; } if(!(patname.test(trim(D2.value)))) { alert(errorMsg); D2.focus(); return false; } D1Arr=D1.value.split(" "); D2Arr=D2.value.split(" "); D1Date=D1Arr[0]; D1Time=D1Arr[1]; D2Date=D2Arr[0]; D2Time=D2Arr[1]; D1DateArr=D1Date.split('-'); D1TimeArr=D1Time.split(':'); D2DateArr=D2Date.split('-'); D2TimeArr=D2Time.split(':'); d1=Date.UTC(D1DateArr[2],D1DateArr[1]-1,D1DateArr[0],D1TimeArr[0],D1TimeArr[1],D1TimeArr[2]); d2=Date.UTC(D2DateArr[2],D2DateArr[1]-1,D2DateArr[0],D2TimeArr[0],D2TimeArr[1],D2TimeArr[2]); if(d2<=d1) { alert(errorMsg); return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkDate(date, time) {\r\n let inputDate = new Date(date);\r\n if (time) {\r\n let hours = time.slice(0, 2);\r\n let minutes = time.slice(3, 5);\r\n inputDate.setHours(hours);\r\n inputDate.setMinutes(minutes);\r\n inputDate.setSeconds(99);\r\n }\r\n else {\r\n inputDate.setHours(23);\r\n inputDate.setMinutes(59);\r\n inputDate.setSeconds(99);\r\n }\r\n //gets current date and time to compare against\r\n let today = new Date();\r\n\r\n if (inputDate < today) {\r\n return false;\r\n }\r\n return true;\r\n}", "compareTime(time1, time2) {\n return new Date(time1) > new Date(time2);\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDate(date1, date2) {\n\n //Hours equal\n if (date1.getHours() == date2.getHours()) {\n\n //Check minutes\n if (date1.getMinutes() == date2.getMinutes()) {\n return 0;\n } else {\n if (date1.getMinutes() > date2.getMinutes()) {\n return 1;\n } else {\n return -1;\n }\n }\n }\n\n //Hours not equal\n else {\n if (date1.getHours() > date2.getHours()) {\n return 1;\n } else {\n return -1;\n }\n }\n}", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) {\n timeless = true;\n }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDateTimes(date1, date2) {\n if (date1.year == date2.year) {\n if (date1.month == date2.month) {\n if (date1.day == date2.day) {\n if (date1.hour == date2.hour) {\n if (date1.minute == date2.minute) {\n return 0;\n }\n return date1.minute - date2.minute;\n }\n return date1.hour - date2.hour;\n }\n return date1.day - date2.day;\n }\n return date1.month - date2.month;\n }\n return date1.year - date2.year;\n}", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) {\n timeless = true;\n }\n\n if (timeless !== false) {\n return new Date(date1.getTime()).setHours(0, 0, 0, 0) - new Date(date2.getTime()).setHours(0, 0, 0, 0);\n }\n\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }", "function compareDate(paramFirstDate,paramSecondDate)\n{\n\tvar fromDate = new Date(paramFirstDate);\n//\tvar hour = fromDate.getHours();\n\t\n\t\n\tvar toDate = new Date(paramSecondDate);\n\tvar diff = toDate.getTime() - fromDate.getTime();\n\treturn (diff);\n}", "function compareTime(t1, t2) {\n return t1 > t2;\n}", "checkIfDelay(date1,date2){\n a = new Date(date1);\n b = new Date(date2);\n\n if(b > a){\n return true\n }else{\n return false\n }\n\n }", "function CompareDate(date1, date2)\n{\n var std_format = date1.split(\"-\"); \n s_dt= new Date(std_format[1]+\"-\"+std_format[0]+\"-\"+std_format[2]);\n var etd_format = date2.split(\"-\"); \n e_dt= new Date(etd_format[1]+\"-\"+etd_format[0]+\"-\"+etd_format[2]);\n if(s_dt>e_dt)\n return true;\n else \n return false;\n}", "function compareDateTime(paramFirstDate,paramSecondDate)\n{\n\tvar fromDate = new Date(paramFirstDate);\n\tvar toDate = new Date(paramSecondDate);\n\ttoDate.setHours(23);\n\ttoDate.setMinutes(59);\n\ttoDate.setSeconds(59);\n\tvar diff = toDate.getTime() - fromDate.getTime();\n\treturn (diff);\n}", "validateEndDate(start_time, end_time){\n let start_date = new Date(start_time);\n let end_date = new Date(end_time);\n if(start_date.getFullYear() == end_date.getFullYear()){\n if(start_date.getMonth() == end_date.getMonth()){\n if(start_date.getDate() == end_date.getDate()){\n let hourToMilliseconds = 3600000;\n if(end_date.getTime() - start_date.getTime() >= hourToMilliseconds){\n return true;\n }\n }\n }\n }\n\n return false;\n }", "function isValidDate(date, time) {\r\n\tif(date.val() == '') {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tvar d = new Date(date.val() + \"T\" + time.val());\r\n\tvar today = new Date();\r\n\t\t\r\n\tif (d < today)\r\n\t\treturn false;\r\n\telse \r\n\t\treturn true;\r\n}", "function compareDates (date1, date2)\n{\n newDate1 = new Date(date1);\n newDate1.setHours(0,0,0,0);\n newDate2 = new Date(date2);\n newDate2.setHours(0,0,0,0);\n var t1 = newDate1.getTime();\n var t2 = newDate2.getTime();\n if (t1 === t2) return 0;\n else if (t1 > t2) return 1;\n else return -1;\n}", "function dateBetween(date1, date2)\r{\r var zeroReplaceDate1 = date1.replace(\" 00:00:00\", \"\");\r var zeroReplaceDate2 = date2.replace(\" 00:00:00\", \"\");\r\r var converDt1 = zeroReplaceDate1.split('-').join('/');\r var converDt2 = zeroReplaceDate2.split('-').join('/');\r\r var date3 = new Date(converDt1);\r var date4 = new Date(converDt2);\r\r var timeDiff = date4.getTime() - date3.getTime();\r if (timeDiff > 0)\r return 1\r else\r return 0;\r}", "function compare_dates(fecha, fecha2) \r\n { \r\n\t\r\n var xMonth=fecha.substring(3, 5); \r\n var xDay=fecha.substring(0, 2); \r\n var xYear=fecha.substring(6,10); \r\n var yMonth=fecha2.substring(3,5);\r\n var yDay=fecha2.substring(0, 2);\r\n var yYear=fecha2.substring(6,10); \r\n \r\n if (xYear > yYear){ \r\n return(true); \r\n }else{ \r\n if (xYear == yYear){ \r\n\t if (xMonth > yMonth){ \r\n\t \t\treturn(true); \r\n\t }else{ \r\n\t\t if (xMonth == yMonth){ \r\n\t\t if (xDay> yDay) \r\n\t\t return(true); \r\n\t\t else \r\n\t\t return(false); \r\n\t\t }else{\r\n\t\t \t return(false); \r\n\t\t } \r\n\t } \r\n }else{\r\n \t return(false); \r\n } \r\n \r\n } \r\n}", "function CheckTimeAfterTime(time1,time2) {\r\n let time2arr = time2.split(\":\");\r\n let time3hr = parseInt(time2arr[0]) + 12;\r\n if (time3hr > 23) { time3hr = time3hr - 24; }\r\n let time3 = time3hr + \":\" + time2arr[1];\r\n \r\n if (CheckTimeBetween(time2,time3,time1)) { return 1; }\r\n else { return 0;}\r\n \r\n}", "function by_datetime( a, b ) {\n\n const a_date = moment( a.day.split(' - ')[1], 'MM/DD/YYYY');\n const b_date = moment( b.day.split(' - ')[1], 'MM/DD/YYYY');\n\n if ( b_date.isAfter( a_date ) ) {\n return -1;\n } else if ( b_date.isBefore( a_date ) ) {\n return 1;\n } else {\n return 0;\n }\n\n}", "function timeCompare (tSta, tEnd, secSta, secEnd) {\n\t// 6:00 5:00\n\tif ( tEnd > secSta && secEnd > tSta ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function validateDate() {\n var date1 = strToDate($('#timeMin').val());\n var date2 = strToDate($('#timeMax').val());\n return Date.compare(date1, date2);\n \n}", "function compareDate(dos, rd) {\n\n }", "function compareDate(fromDate, toDate) {\r\r\tvar dt1 = parseInt(fromDate.substring(0, 2), 10);\r\r\tvar mon1 = parseInt(fromDate.substring(3, 5), 10);\r\r\tvar yr1 = parseInt(fromDate.substring(6, 10), 10);\r\r\tvar dt2 = parseInt(toDate.substring(0, 2), 10);\r\r\tvar mon2 = parseInt(toDate.substring(3, 5), 10);\r\r\tvar yr2 = parseInt(toDate.substring(6, 10), 10);\r\r\tvar date1 = new Date(yr1, mon1, dt1);\r\r\tvar date2 = new Date(yr2, mon2, dt2);\r\r\tif (date1 > date2) {\r\r\t\treturn 1;\r\r\t} else {\r\r\t\tif (date1 < date2) {\r\r\t\t\treturn -1;\r\r\t\t} else {\r\r\t\t\treturn 0;\r\r\t\t}\r\r\t}\r\r}", "function timeCompare(time1, time2) {\n time1 = time1.toLowerCase();\n time2 = time2.toLowerCase();\n var regex = /^(\\d{1,2}):(\\d{2}) ?(am|pm)$/;\n regex.exec(time1);\n var time1amPm = RegExp.$3;\n var time1Hour = RegExp.$1;\n var time1Minute = RegExp.$2; \n regex.exec(time2);\n var time2amPm = RegExp.$3;\n var time2Hour = RegExp.$1;\n var time2Minute = RegExp.$2;\n\n //if am/pm are different, determine and return\n if(time1amPm == 'am' && time2amPm == 'pm') return -1;\n else if(time1amPm == 'pm' && time2amPm == 'am') return 1;\n //if hours are different determine and return\n if(time1hour < time2hour) return -1;\n else if(time1hour > time2hour) return 1;\n //if minutes are different determine and return\n if(time1Minute < time2Minute) return -1;\n else if(time1Minute > time2Minute) return 1;\n\n //times are the same\n return 0;\n}", "function checkDate(){\n //get timeStamp from dates\n let beginDate = Math.round(new Date(datetimeBegin).getTime()/1000);\n let endDate = Math.round(new Date(datetimeEnd).getTime()/1000);\n\n if(beginDate < endDate && eventTitle !== \"\" && eventDescription !== \"\" && beginDate !== \"\" && endDate !== \"\"){\n return true\n }else{\n return false\n }\n }", "function test_specific_dates_and_time_in_timepicker() {}", "function dateChecker(date1, date2 = new Date()) {\n var date1 = new Date(Date.parse(date1));\n var date2 = new Date(Date.parse(date2));\n var ageTime = date2.getTime() - date1.getTime();\n\n if (ageTime < 0) {\n return false; //date2 is before date1\n } else {\n return true;\n }\n}", "function date_greater_than (date1, date2)\n{\n //Dates should be in the format Month(maxlength=3) Day(num minlength=2), Year hour(minlength=2):minute(minlength=2)(24h time)\n //Eg Apr 03 2020 23:59\n //the function caller is asking \"is date1 greater than date2?\" and gets a boolean in return\n\n let months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n\n //Compares the years\n if (parseInt(date1.substr(7, 4)) > parseInt(date2.substr(7, 4))) return true\n else if (parseInt(date1.substr(7, 4)) < parseInt(date2.substr(7, 4))) return false\n else //the elses are for if both values are the same\n {\n //Compares the months\n if (months.indexOf(date1.substr(0, 3)) > months.indexOf(date2.substr(0, 3))) return true\n else if (months.indexOf(date1.substr(0, 3)) < months.indexOf(date2.substr(0, 3))) return false\n else\n {\n //Compares the days\n if (parseInt(date1.substr(4, 2)) > parseInt(date2.substr(4, 2))) return true\n if (parseInt(date1.substr(4, 2)) < parseInt(date2.substr(4, 2))) return false\n else\n {\n //Compares the hours\n if (parseInt(date1.substr(12, 2)) > parseInt(date2.substr(12, 2))) return true\n else if (parseInt(date1.substr(12, 2)) < parseInt(date2.substr(12, 2))) return false\n else\n {\n //Compares minutes\n if (parseInt(date1.substr(15, 2)) > parseInt(date2.substr(15, 2))) return true\n else return false\n }\n }\n }\n }\n}", "function CompareDateTime(dtFrm, dtTo) {\r\n var sDtFrm = ConvertDateTime(dtFrm); \r\n if(dtTo=='now'){\r\n var currentTime = new Date();\r\n var month = currentTime.getMonth() + 1;\r\n var day = currentTime.getDate();\r\n var year = currentTime.getFullYear();\r\n var tempdate = day + \"/\" + month + \"/\" + year; \r\n var timeTo = '';\r\n if(dtFrm.length>15){\r\n //var hour = currentTime.getHours() + 1;\r\n // var minute = currentTime.getMinutes();\r\n // var second = currentTime.getSeconds();\r\n // var temptime = hour + \":\" + minute + \":\" + second;\r\n // timeTo = \" \"+fmFullTime(temptime);\r\n timeTo = \" 23:59:59\";\r\n }\r\n \r\n dtTo = fmFullDate(tempdate)+timeTo; \r\n }\r\n var sDtTo = ConvertDateTime(dtTo);\r\n if (sDtFrm > sDtTo) \r\n {\r\n return false;\r\n }\r\n \r\n return true;\r\n}", "function compareDates(a, b)\n{\n var x=new Date(a.Date);\n var y=new Date(b.Date);\n \n console.log(\"hello we are hee\");\t\n\n console.log(x);\n console.log(y);\t\n\n if(x>y)\n {\n console.log(1);\n return 1;\n\n }\n else\n {\n console.log(-1);\t \n return -1;\n }\n}", "function myFunction(date1, date2) {\n return (\n date1.getYear() === date2.getYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}", "function CheckDate(TrDate, StDt, EdDt) {\n ////debugger\n var check = Date.parse(TrDate);\n var from = Date.parse(StDt);\n var to = Date.parse(EdDt);\n if ((check <= to && check >= from))\n return (true);\n else\n return false;\n}", "function IsDateTimeBetween(timeToCheck, beginTime, endTime)\n{\n\treturn ((timeToCheck >= beginTime) && (timeToCheck <= endTime));\t\t\n}", "function IsTimeEqual(timeOne, timeTwo)\n{\n\treturn ((timeOne.getHours() == timeTwo.getHours()) && (timeOne.getMinutes() == timeTwo.getMinutes()) && (timeOne.getSeconds() == timeTwo.getSeconds()));\n}", "function myFunction({ a, b }) {\n return a.getTime() < b.getTime();\n}", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "sameDate(first, second) {\n if (first && second) {\n let firstValid = this.isValid(first);\n let secondValid = this.isValid(second);\n if (firstValid && secondValid) {\n return !this.compareDate(first, second);\n }\n return firstValid == secondValid;\n }\n return first == second;\n }", "function compareDateFunction(date1,date2){\r\n\tvar leftDate;\r\n\tvar rightDate;\r\n\tif(typeof(date1) == \"object\"){\r\n\t\tleftDate = date1;\r\n\t}else{\r\n\t\tleftDate = convertStr2Date(date1);\r\n\t}\r\n\tif(typeof(date2) == \"object\"){\r\n\t\trightDate = date2;\r\n\t}else{\r\n\t\trightDate = convertStr2Date(date2);\r\n\t}\r\n\treturn compareDate(leftDate,rightDate,0);\r\n}", "function fecha2MayorFecha1(fechaFinal,fechaFormulario){\n\n if((Date.parse(fechaFormulario)) <= (Date.parse(fechaFinal))) {\n alert(\"fecha nacimiento mayor que la actual\");\n return true;\n\n }else{\n return false;\n }\n\n\n\n\n\n}", "function CheckPastTime(t, e, n, a) { var i = t.split(\"/\"), o = n.split(\"/\"); return new Date(JtoG(i[0], i[1], i[2], !0) + \" \" + e) < new Date(JtoG(o[0], o[1], o[2], !0) + \" \" + a) }", "isOnDate(date) {\n const selfDate = this.timeHuman.split(\" \")[0];\n const selfDay = Number(selfDate.split(\"-\")[2]);\n const day = Number(date.split(\"-\")[2]);\n return selfDay === day;\n }", "validateStartDate(start_time){\n let start_time_date = new Date(start_time);\n let tempDate = new Date();\n tempDate.setDate(tempDate.getDate());\n let date_difference = tempDate.getTime() - start_time_date.getTime();\n let dayToMillis = 86400000;\n date_difference = date_difference / dayToMillis;\n if(date_difference >= 0 && date_difference < 7){\n return true;\n }\n return false;\n }", "function compareDates(date1, date2) {\n if (!date1 && !date2) {\n return true;\n }\n else if (!date1 || !date2) {\n return false;\n }\n else {\n return (date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate());\n }\n}", "function compareTime(a, b){\r\n return (a.done ? !b.done : b.done) ? (a.done ? 1 : -1) : (a.date > b.date ? 1 : a.date < b.date ? -1 : 0);\r\n}", "function checkDate(int,tomorrow,array){\r\n\tvar dateInfo = getTime();\r\n\tif(tomorrow){ //adjust day if needed\r\n\t\tif(dateInfo[2] == 6) {\r\n\t\t\tdateInfo[2] = 0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdateInfo[2] = dateInfo[2]+1;\r\n\t\t}\r\n\t}\r\n\tvar hourFloat = concot(dateInfo);\r\n\tif(finder(\"openWhen\",queryResult) != undefined) {\r\n\t\thourFloat = parseFloat(finder(\"openWhen\",queryResult));\r\n\t}\r\n\r\n\tif(dateInfo[2] == 6){\r\n\t\tvar saturday = array[int][\"tid_lordag\"].split(\" - \");\r\n\t\tif(parseFloat(saturday[0])<hourFloat&&parseFloat(saturday[1])>hourFloat || array[int][\"tid_lordag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\telse if (dateInfo[2] == 0) {\r\n\t\tvar sunday = array[int][\"tid_sondag\"].split(\" - \");\r\n\t\tif(parseFloat(sunday[0])<hourFloat &&parseFloat(sunday[1])>hourFloat || array[int][\"tid_sondag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tvar weekday = array[int][\"tid_hverdag\"].split(\" - \");\r\n\t\tif(parseFloat(weekday[0])<hourFloat&&parseFloat(weekday[1])>hourFloat || array[int][\"tid_hverdag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "isValidDate(hire_date){\n let arr = hire_date.split('-');\n let hireDate = new Date(parseInt(arr[0]), parseInt(arr[1]) - 1, parseInt(arr[2]));\n let currDate = new Date();\n\n if(hireDate.getTime() < currDate.getTime()){\n return true;\n }\n return false;\n }", "function calendar_helper_dateEquals(date1, date2){\n if (date1.getFullYear() == date2.getFullYear())\n if (date1.getMonth() == date2.getMonth())\n if (date1.getDate() == date2.getDate())\n return true;\n return false;\n}", "function compareDates(a, b) {\n var aDate = a.date;\n var bDate = b.date;\n\n let comparison = 0;\n if (aDate > bDate) {\n comparison = 1;\n } \n else if (aDate < bDate) {\n comparison = -1;\n }\n \n return comparison;\n}", "function isAppointmentInTheFuture(date, time){\n date.setHours(Number(time.split(\"-\")[1].split(\":\")[0]));\n date.setMinutes(Number(time.split(\"-\")[1].split(\":\")[1]));\n return new Date() < date;\n}", "function checkTime() {\n\n var dateText = $(\"#calendar\").val();\n var timeText = $(\"#clock\").val();\n var newTimeText = convertTimeStringformat(24, timeText);\n var selectedTime = new Date(dateText + ' ' + newTimeText);\n var now = new Date();\n\n console.log(selectedTime);\n console.log(now);\n\n if (selectedTime < now) {\n alert(\"Time must be in the future\");\n $(\"#clock\").val('')\n }\n}", "async timeToCompare(context, date) {\n try {\n\n let d = new Date(date),\n hour = \"\" + d.getHours(),\n minute = \"\" + d.getMinutes(),\n second = \"\" + d.getSeconds();\n\n if (hour.length < 2) hour = \"0\" + hour;\n if (minute.length < 2) minute = \"0\" + minute;\n if (second.length < 2) second = \"0\" + second;\n \n const now = hour + \":\" + minute + \":\" + second;\n\n context.commit('updateNow', now);\n\n } catch (error) {\n context.commit('getError', error);\n }\n }", "function DateCompareEqual(_strDate1, _strDate2) {\n var strDate;\n var strDateArray;\n var strDay;\n var strMonth;\n var strYear;\n\n strDateArray = _strDate1.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate1 = new Date(strYear, GetMonth(strMonth), strDay);\n\n strDateArray = _strDate2.split(\"-\");\n\n strDay = strDateArray[0];\n strMonth = strDateArray[1];\n strYear = strDateArray[2];\n\n _strDate2 = new Date(strYear, GetMonth(strMonth), strDay);\n\n if (_strDate1 >= _strDate2) {\n return true;\n }\n else {\n return false;\n }\n}", "function compare_date( a, b ) {\n if ( a.date < b.date){\n return -1;\n }\n if ( a.date > b.date ){\n return 1;\n }\n return 0;\n}", "function compareDates(date1, date2)\r\n{\r\n if(date1 < date2)\r\n return -1;\r\n else if(date1 > date2)\r\n return 1;\r\n else\r\n return 0;\r\n}", "function datesAreEquivalent(date1,date2){\n return (date1.getMonth() == date2.getMonth()) && (date1.getFullYear() == date2.getFullYear()) && (date1.getDate() == date2.getDate()) ;\n}", "function checkDates(issueDate, expirationDate, errorMessage)\n{\n var returnVal = compareDate(issueDate, expirationDate);\n// alert(\"checkDates(issueDate, expirationDate, errorMessage) returnVal=\" + returnVal);\n if ( returnVal < 0)\n {\n alert(\"ERROR\\n\\n\" + errorMessage);\n //\"The Start Date and Time must be the same or earlier than the End Date and Time.\");\n return false;\n }\n return true;\n}", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "function dateBetween(start,end,data){\n let s=start.replace(\":\",\" \");\n let e=end.replace(\":\",\" \");\n let d=data.day+\"/\"+data.month+\"/\"+data.year+\" \"+data.hour+\":\"+data.minutes+\":\"+data.seconds;\n\n s=Date.parse(s);\n e=Date.parse(e);\n d=Date.parse(d);\n\n return( (s<=d) && (d<=e));\n\n}", "function filterdateTime(ldata) {\n return ldata.datetime === forminput;\n}", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "function entregaAntesDeHoy() {\n let today = new Date(getDiaActual());\n let fecha_entrega = new Date($('#pi-fecha').val());\n\n if (fecha_entrega.getTime() < today.getTime()) {\n //fecha es anterior a hoy\n return true;\n } else {\n return false;\n }\n}", "function compareTime(timeA, timeB) {\n var startTimeParse = timeA.split(\":\");\n var endTimeParse = timeB.split(\":\");\n var firstHour = parseInt(startTimeParse[0]);\n var firstMinute = parseInt(startTimeParse[1]);\n var secondHour = parseInt(endTimeParse[0]);\n var secondMinute = parseInt(endTimeParse[1]);\n if (firstHour == secondHour) {\n if (firstMinute == secondMinute)\n return 0;\n if (firstMinute < secondMinute)\n return -1\n return 1\n }\n else {\n if (firstHour < secondHour)\n return -1\n return 1\n }\n}", "function compareHoursAndMinutes(t1, t2) {\n return (t1.hours === t2.hours) && (t1.minutes === t2.minutes);\n}", "function checkDate(){\n var date = $(\".datetimecontainer .form-group .form-control\").val();\n var hour = $(\".datetimecontainer .timeselect .form-group:first-of-type .form-control\").val();\n var min = $(\".datetimecontainer .timeselect .form-group:last-of-type .form-control\").val();\n \n var year = date.substr(-4, 4);\n var month = date.substr(3, 2);\n var day = date.substr(0, 2);\n date = year + \"-\" + month + \"-\" + day + \" \" + hour + \":\" + min + \":00\";\n var inputDate = new Date(date);\n inputDate = inputDate.toISOString();\n \n var currentDate = new Date();\n currentDate = currentDate.toISOString();\n \n if ( inputDate < currentDate){\n $(\".datetimecontainer .alert-error\").show();\n $(\".datetimecontainer .form-group .form-control\").css('border', 'red 1px solid');\n $(\".datetimecontainer .control-label\").css('color', 'red');\n } else {\n $(\".datetimecontainer .alert-error\").hide();\n $(\".datetimecontainer .form-group .form-control\").css('border', 'green 1px solid');\n $(\".datetimecontainer .control-label\").css('color', 'green');\n }\n\n }", "function isWithinTimeWindow(starttime, endtime) { \r\n //Dummy Record to get current timeof day\r\n var dummyConfig = record.create({type: \"customrecord_flo_spider_configuration\", isDynamic: true});\r\n currenttime = dummyConfig.getValue({fieldId: 'custrecord_flo_conf_current_tod'})\r\n \r\n\r\n var ret = false;\r\n\r\n //Compare by Hour and Minutes because Timezone is a mess.\r\n\r\n if(starttime != null && starttime != \"\" && endtime != null && endtime != \"\" && currenttime) {\r\n\r\n log.debug(\"currenttime\",currenttime.getHours() + \" : \" + currenttime.getMinutes());\r\n log.debug(\"starttime\",starttime.getHours() + \" : \" + starttime.getMinutes());\r\n log.debug(\"endtime\",endtime.getHours() + \" : \" + endtime.getMinutes());\r\n\r\n if(starttime.getHours() > endtime.getHours()) {\r\n if(currenttime.getHours() > starttime.getHours()) { \r\n ret = true;\r\n } else if(currenttime.getHours() == starttime.getHours() && currenttime.getMinutes() >= starttime.getMinutes()) {\r\n ret = true;\r\n } else if(currenttime.getHours() < endtime.getHours() ) {\r\n ret = true;\r\n } else if(currenttime.getHours() == endtime.getHours() && currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() >= starttime.getHours() && currenttime.getHours() <= endtime.getHours()) {\r\n if(currenttime.getHours() == starttime.getHours() && currenttime.getHours() == endtime.getHours()) {\r\n if(currenttime.getMinutes() >= starttime.getMinutes() && currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() == starttime.getHours()) {\r\n if(currenttime.getMinutes() >= starttime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() == endtime.getHours()) {\r\n if(currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n } \r\n } else {\r\n ret = true;\r\n }\r\n \r\n }\r\n } else {\r\n ret = true; \r\n }\r\n \r\n return ret;\r\n }", "sameDate(dateA, dateB) {\n return ((dateA.getDate() === dateB.getDate()) && (dateA.getMonth() === dateB.getMonth()) && (dateA.getFullYear() === dateB.getFullYear()));\n }", "function compareEqualsToday(sender, args)\n{\n args.IsValid = true;\n\n var todaypart = getDatePart(new Date().format(\"dd/MM/yyyy\"));\n var datepart = getDatePart(args.Value);\n\n var today = new Date(todaypart[2], (todaypart[1] - 1), todaypart[0]);\n var date = new Date(datepart[2], (datepart[1] - 1), datepart[0]);\n\n if (date > today || date<today)\n {\n args.IsValid = false;\n }\n\n return args.IsValid;\n}", "matches(timeToCheck) {\n return this.time.getHours() === timeToCheck.getHours()\n && this.time.getMinutes() === timeToCheck.getMinutes()\n && this.time.getSeconds() === timeToCheck.getSeconds();\n }", "function isTimeSmallerOrEquals(time1, time2, doNotInvolveMinutePart) {\r\n\t\t\tvar regex = '^(-|\\\\+)?([0-9]+)(.([0-9]{1,2}))?$';\r\n\t\t\t(new RegExp(regex, 'i')).test(time1);\r\n\t\t\tvar t1 = parseInt(RegExp.$2) * 60;\r\n\t\t\tif (RegExp.$4 && !doNotInvolveMinutePart) t1 += parseInt(RegExp.$4);\r\n\t\t\tif (RegExp.$1 == '-') t1 *= -1;\r\n\t\t\t(new RegExp(regex, 'i')).test(time2);\r\n\t\t\tvar t2 = parseInt(RegExp.$2) * 60;\r\n\t\t\tif (RegExp.$4 && !doNotInvolveMinutePart) t2 += parseInt(RegExp.$4);\r\n\t\t\tif (RegExp.$1 == '-') t2 *= -1;\r\n\t\t\tif (t1 <= t2) return true;\r\n\t\t\telse return false;\r\n\t\t}", "function compareDate(a, b) {\r\n if (a.date > b.date) return 1;\r\n if (b.date > a.date) return -1;\r\n return 0;\r\n}", "function checkScheduleDate()\n {\n var date_published_input=$(\".date_published\");\n if(date_published_input.val()!=\"\")\n {\n var now=$(\"#server_time\").val(); // server time\n var now=Date.parse(now); //parse it so it becomes unix timestamp\n\n var schedule_date=new Date(date_published_input.val()); // date from text input\n var schedule_date=Date.parse(schedule_date); //parse it so it becomes unix timestamp\n\n if(schedule_date < now)\n {\n swal(\"Oops...\", \"You cannot publish story in the past\", \"error\");\n return false;\n }\n else\n return true;\n }\n }", "function compareDate(a,b) {\n if (a.date < b.date)\n return -1;\n else if (a.date > b.date)\n return 1;\n else\n return 0;\n }", "function matchdate(dt, dt2) {\n\n if (dt2 == undefined) {\n return false;\n }\n if (dt2 == '') {\n return false;\n }\n\n //window.console &&console.log(dt + \" ?? \" + dt2);\n\n //dt2 will have a range in it, denoted by either a - or the word 'to'\n\n var dtt = dt2; //handles case of 0 meeting length\n if (dt2.indexOf(\"to\") != -1) {\n dtt = dt2.substring(0, dt2.indexOf(\"to\") - 1);\n }\n if (dt2.indexOf(\"-\") != -1) {\n dtt = dt2.substring(0, dt2.indexOf(\"-\") - 1);\n }\n\n // next, it is possible that the time is like 7pm but needs to be changed to 7:00pm\n // So, first see if it contains a : although some might not even have a time....\n if (dtt == \"Today\") {\n dtt = \"Today 12:00am\";\n }\n if (dtt.indexOf(\":\") == -1) {\n // precede the am or pm with a ':00 '\n if (dtt.indexOf(\"am\") != -1) {\n //concatenate on\n dtt = dtt.substring(0, dtt.indexOf(\"am\")) + \":00 am\";\n }\n if (dtt.indexOf(\"pm\") != -1) {\n //concatenate on\n dtt = dtt.substring(0, dtt.indexOf(\"pm\")) + \":00 pm\";\n }\n\n } else {\n if (dtt.indexOf(\"am\") != -1) {\n //concatenate on\n dtt = dtt.substring(0, dtt.indexOf(\"am\")) + \" am\";\n }\n if (dtt.indexOf(\"pm\") != -1) {\n //concatenate on\n dtt = dtt.substring(0, dtt.indexOf(\"pm\")) + \" pm\";\n }\n\n }\n //replace today\n if (dtt.indexOf(\"Today\") != -1) {\n //concatenate on\n var dtt1 = sbDateFormat(Date.now());\n //replace up to the comma\n dtt = dtt1.match(/\\w+ \\d+, \\d+/) + \" \" + dtt.match(/\\d+:\\d+ \\w+/);\n }\n if (Date.parse(dt) == Date.parse(dtt)) {\n\n //window.console &&console.log(dt + \" == \" + dtt);\n return true;\n }\n\n //window.console &&console.log(dt + \" != \" + dtt);\n return false;\n\n}", "function compare(a,b) {\r\n var startTimeA = (a.StartTimeHour*60) + a.StartTimeMinute;\r\n var startTimeB = (b.StartTimeHour*60) + b.StartTimeMinute;\r\n return startTimeA - startTimeB;\r\n}", "compareDate(a, b) {\n if (a.startDate < b.startDate) return -1\n if (a.startDate > b.startDate) return 1\n else return 0\n }", "function dateCompare(date1, date2) {\n\t\tif (date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "function compareDay(day1, day2){\n return day1.getFullYear() === day2.getFullYear() &&\n day1.getMonth() === day2.getMonth() &&\n day1.getDate() === day2.getDate();\n}", "function compareDatesWH(date1, date2){\n var comp = DATES_EQUALS; // Son iguales\n if(date1.getFullYear() < date2.getFullYear()){\n comp = DATES_LOWER; // Date 1 es menor que date 2\n }\n else if(date1.getFullYear() > date2.getFullYear()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() < date2.getMonth()){\n comp = DATES_LOWER;\n }\n else if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() > date2.getMonth()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() < date2.getDate()){\n comp = DATES_LOWER;\n }\n else{\n if(date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() > date2.getDate()){\n comp = DATES_HIGHER; // Date 1 es mayor que Date 2\n }\n }\n }\n }\n return comp;\n }", "function date_available(year,month,day,hour) {\n console.log(year + \",\" + month + \",\" + day + \",\" + hour);\n for(var i=0;i<available_times.length;i++) {\n\n //console.log(available_times[i][0] + \",\" + available_times[i][1] + \",\" + available_times[i][2] + \",\" + available_times[i][3]);\n //console.log(year + \",\" + month + \",\" + day + \",\" + hour);\n //console.log('');\n\n if(available_times[i][0] == year && available_times[i][1] == month &&\n available_times[i][2] == day && available_times[i][3] == hour) {\n return true;\n }\n }\n return false;\n}", "function isStringDate2Greater(date1,date2)\r\n{\r\n // date1 and date2 are strings\r\n //This function checks if date2 is later than date1\r\n //If the second date is null then it sets date2 to current date and checks if first date is later than the current date\r\n var sd=date1;\r\n if (date1 == \"\") return false;\r\n else if (date2 == \"\") return false;\r\n else\r\n {\r\n var ed=date2;\r\n var End= new Date(changeDateFormat(ed));\r\n }\r\n var Start= new Date(changeDateFormat(sd));\r\n var diff=End-Start;\r\n if (diff>=0) return true;\r\n else\r\n {\r\n// alert(msg);\t\r\n return false;\r\n }\r\n}", "function comparisonByDate(dateA, dateB) {\n var c = new Date(dateA.date);\n var d = new Date(dateB.date);\n return c - d;\n }", "function isDateWithinSameDay(date1, date2) {\n return date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear();\n }", "function episodeTimeValid(timeStamp){\n var t = moment(timeStamp);\n var tn = moment.utc();\n var d = tn.diff(t,\"minutes\");\n //console.log(d);\n if(d < matchTime){\n return true;\n }\n else{\n //console.log(\"show too old: \" + d + \" minutes\")\n return false;\n }\n}", "function sights(data){\n return data.datetime == date; \n}", "function compararFechas()\n{\n var f1 = document.getElementById(\"fecha1\").value;\n var f2 = document.getElementById(\"fecha2\").value;\n\n var df1 = f1.substring(0, 2);\n var df11 = parseInt(df1);\n var mf1 = f1.substring(3, 5);\n var mf11 = parseInt(mf1);\n var af1 = f1.substring(6, 10);\n var af11 = parseInt(af1);\n\n var fe111 = new Date(af11, mf11, df11);\n\n var df2 = f2.substring(0, 2);\n var df22 = parseInt(df2);\n var mf2 = f2.substring(3, 5);\n var mf22 = parseInt(mf2);\n var af2 = f2.substring(6, 10);\n var af22 = parseInt(af2);\n\n\n\n var fe222 = new Date(af22, mf22, df22);\n\n\n /* if (fe111 > fe222) {\n sweetAlert(\"ERROR!!!\", \"la primera fecha es mayor!\", \"error\");\n\n } else\n {\n sweetAlert(\"ERROR!!!\", \"La segunda fecha es mayor ctm\", \"error\");\n\n }*/\n alert(\"fecha \"+fe222);\n\n}", "function CheckDateDifference(lowDate, highDate, comparison) {\n\t lowDateSplit = lowDate.split('/');\n\t highDateSplit = highDate.split('/');\n\n\t date1 = new Date();\n\t date2 = new Date();\n\n\t date1.setDate(lowDateSplit[0]);\n\t date1.setMonth(lowDateSplit[1] - 1);\n\t date1.setYear(lowDateSplit[2]);\n\n\t date2.setDate(highDateSplit[0]);\n\t date2.setMonth(highDateSplit[1] - 1);\n\t date2.setYear(highDateSplit[2]);\n\n\t if(comparison == \"eq\") {\n\t\t if(date1.getTime() == date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"lt\") {\n\t\t if(date1.getTime() < date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"gt\") {\n\t\t if(date1.getTime() > date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"le\") {\n\t\t if(date1.getTime() <= date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n\t else if(comparison == \"ge\") {\n\t\t if(date1.getTime() >= date2.getTime()) {\n\t\t\t return true;\n\t\t }\n\t\t else {\n\t\t\t return false;\n\t\t }\n\t }\n}", "function compareDashedDates(date1, date2) {\n console.log(date1);\n console.log(date2);\n date1 = date1.split('-');\n date2 = date2.split('-');\n console.log(date1);\n console.log(date2);\n for (let i = 0; i < date1.length; i++) {\n if (parseInt(date1[i]) < parseInt(date2[i])) {\n return true;\n } else if (parseInt(date1[i]) > parseInt(date2[i])) {\n return false;\n }\n }\n return true;\n}", "function compareDate(fromDate, toDate){\r\n\t// check both value is there or not\r\n\t// in else it will return true its due to date field validation is done on form level\r\n\tif (toDate != '' && fromDate != ''){\r\n\t\t// extract day month and year from both of date\r\n\t\tvar fromDay = fromDate.substring(0, 2);\r\n\t\tvar toDay = toDate.substring(0, 2);\r\n\t\tvar fromMon = eval(fromDate.substring(3, 5)-1);\r\n\t\tvar toMon = eval(toDate.substring(3, 5)-1);\r\n\t\tvar fromYear = fromDate.substring(6, 10);\r\n\t\tvar toYear = toDate.substring(6, 10);\r\n\r\n\t\t// convert both date in date object\r\n\t\tvar fromDt = new Date(fromYear, fromMon, fromDay);\r\n\t\tvar toDt = new Date(toYear, toMon, toDay); \r\n\r\n\t\t// compare both date \r\n\t\t// if fromDt is greater than toDt return false else true\r\n\t\tif (fromDt > toDt) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}else{\r\n\t\treturn true;\r\n\t}\r\n}", "function withinDate(d, m, y) {\n\n startDateArray = $('#startDate').val().split(\" \");\n endDateArray = $('#endDate').val().split(\" \");\n\n var startDay = parseInt(startDateArray[0]);\n var startMonth2 = monthNames.indexOf(startDateArray[1]) + 1;\n if (startMonth2 < 10){\n startMonth2 = \"0\" + startMonth2;\n }\n var startMonth = parseInt(startMonth2);\n var startYear = parseInt(startDateArray[2]);\n\n var endDay = parseInt(endDateArray[0]);\n var endMonth2 = monthNames.indexOf(endDateArray[1]) + 1;\n if (endMonth2 < 10){\n endMonth2 = \"0\" + endMonth2;\n }\n var endMonth = parseInt(endMonth2);\n var endYear = parseInt(endDateArray[2]);\n\n var d1 = [startMonth, startDay, startYear];\n var d2 = [endMonth, endDay, endYear];\n var c = [m, d, y];\n\n var from = new Date(d1); // -1 because months are from 0 to 11\n var to = new Date(d2);\n var check = new Date(c);\n\n return(check >= from && check <= to);\n }", "function compareDate(s1, flag){\t\r\n\t\t s1 = s1.replace(/-/g, \"/\");\r\n\t\t s1 = new Date(s1);\r\n\t\t var currentDate = new Date();\r\n\t\t \r\n\t\t var strYear = currentDate.getYear();\r\n\t\t\tvar strMonth= currentDate.getMonth() + 1;\r\n\t\t\tvar strDay = currentDate.getDate();\r\n\t\t\tvar strDate = strYear + \"/\" + strMonth + \"/\" + strDay;\t\t \r\n\t\t s2 = new Date(strDate);\r\n\t\t \r\n\t\t var times = s1.getTime() - s2.getTime();\r\n\t\t if(flag == 0){\r\n\t\t \treturn times;\r\n\t\t }\r\n\t\t else{\r\n\t\t \tvar days = times / (1000 * 60 * 60 * 24);\r\n\t\t \treturn days;\r\n\t\t }\r\n\t }", "function check_sched_conflict(dt,hr,mn,duration){\n //--- assume all is valid\n modelInspection.set(\"isvalid\",true);\n var idx_date = {Jan:\"0\",Feb:\"1\",Mar:\"2\",Apr:\"3\",May:\"4\",Jun:\"5\",Jul:\"6\",Aug:\"7\",Sep:\"8\",Oct:\"9\",Nov:\"10\",Dec:\"11\"};\n var arr = dt.split(\"-\");\n var new_sdate = new Date(arr[2],idx_date[arr[1]],arr[0],hr,mn,0,0);\n var new_edate = new Date(new_sdate.getTime() +duration*60000 );\n \n var cur_Date = new Date();\n if( new_sdate < cur_Date){\n modelInspection.set(\"isvalid\",false);\n return false;\n }\n\n $.each(modelInspection.data_source_inspection.data(), function (field, value) { \n var tmparr = value.date_start.split(\" \");\n var tmpampm = value.start_time.split(\" \");\n var tmptime = tmpampm[0].split(\":\");\n var plushour = tmpampm[1] == \"PM\" && parseInt(tmptime[0]) < 12 ?12:0;\n plushour = tmpampm[1] == \"AM\" && parseInt(tmptime[0]) == 12 ?-12:plushour;\n\n var cur_sdate = new Date(tmparr[2],idx_date[tmparr[1]],tmparr[0],parseInt(tmptime[0])+plushour,tmptime[1],0,0);\n var cur_edate = new Date(cur_sdate.getTime() +value.duration*60000);\n \n\n\n if(new_sdate >= cur_sdate && new_sdate < cur_edate ){\n modelInspection.set(\"isvalid\",false);\n }\n \n if(new_sdate == cur_sdate){\n modelInspection.set(\"isvalid\",false);\n } \n\n if(new_edate > cur_sdate && new_edate <= cur_edate ){\n modelInspection.set(\"isvalid\",false);\n }\n if(new_sdate <= cur_sdate && new_edate >= cur_edate ){\n modelInspection.set(\"isvalid\",false);\n }\n\n });\n\n var startdate = kendo.parseDate(new_sdate);\n var enddate = kendo.parseDate(new_edate);\n return {date_start:kendo.toString(startdate, \"dd MMM yyyy\"),start_time:kendo.toString(startdate, \"hh:mm tt\"),end_time:kendo.toString(enddate, \"hh:mm tt\"),duration:duration};\n \n}", "function validateDate() {\n if (!formData[\"startdatetime\"]) return false;\n if (!formData[\"enddatetime\"]) return false;\n if (formData[\"startdatetime\"] > formData[\"enddatetime\"]) {\n return false;\n } \n \n return true;\n }" ]
[ "0.72111106", "0.70316315", "0.69489896", "0.6844882", "0.6834171", "0.68082154", "0.6789528", "0.6788058", "0.67773443", "0.67773443", "0.67773443", "0.67773443", "0.67773443", "0.6774891", "0.67360973", "0.6703634", "0.6702823", "0.6657916", "0.6647032", "0.6594081", "0.658787", "0.6552355", "0.65523314", "0.6542311", "0.6505876", "0.64923114", "0.6490433", "0.6475419", "0.6472008", "0.6468053", "0.6463555", "0.64622897", "0.6462064", "0.64557654", "0.6435477", "0.6412612", "0.6377929", "0.6377777", "0.6366435", "0.62965715", "0.6287188", "0.62694615", "0.62694615", "0.62694615", "0.6269292", "0.6263506", "0.6263491", "0.624882", "0.6227997", "0.6222664", "0.62156445", "0.6210376", "0.6197065", "0.6196868", "0.6183096", "0.6178475", "0.617748", "0.6169287", "0.61639863", "0.6163945", "0.6151882", "0.61176306", "0.6116978", "0.61156076", "0.61156076", "0.6084752", "0.6084068", "0.608002", "0.608002", "0.60736006", "0.60653114", "0.6056757", "0.6055775", "0.60497063", "0.6043423", "0.60431755", "0.60294867", "0.60057664", "0.5982219", "0.5968003", "0.5967686", "0.5967335", "0.59631467", "0.59551644", "0.595277", "0.59508085", "0.5941272", "0.59264636", "0.59255373", "0.5925481", "0.59217745", "0.5918817", "0.5915532", "0.5909336", "0.5886689", "0.5884891", "0.58823967", "0.58698887", "0.5863328", "0.5858358", "0.5857658" ]
0.0
-1
This for loop is a short cut for var hourNine = localStorage.getItem("hour9"); $("hour9").val(hourNine); get localstorage
function getLocalStorage() { for (var i = 9; i < 18; i++) { $("#hour-" + i).val(localStorage.getItem("hour-" + i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFromLocalStorage(){\n for (let i = 9; i <= 19; i++) {\n let x = \"#hour\" + i\n if(localStorage.getItem(x)){\n let w = (localStorage.getItem(x))\n let p = document.querySelector(x)\n p.value = w\n }\n } \n }", "function pullStorage() {\n // for each hour block\n for (var i=9; i<18; i++) {\n // slight adjustment for 1pm-5pm cases\n if (i > 12) {\n j = i-12;\n $(`#hour-${j}`).val(dailyTasks[`hour-${j}`]);\n }\n // regular 12 hour time\n else {\n $(`#hour-${i}`).val(dailyTasks[`hour-${i}`]);\n }\n }\n}", "function dailyTask () {\n for (var i = 0; i < timeSlotArray.length; i++) {\n $(`#hour${timeSlotArray[i]} .input-slot`).val(localStorage.getItem(timeSlotArray[i]));\n }\n }", "function pullStorage() {\n for(let i=0; i<hours.length; i++) {\n $(`.textarea${i}`)[0].value = localStorage.getItem(`timeBlock${i}`);\n }\n}", "function reload(){\n hourArray.forEach(function(hour){\n let ActivityTxT = localStorage.getItem(hour);\n $(\"#activity-\"+hour).val(ActivityTxT)\n })\n}", "function loadLocalStorage() {\n$(\"#hour9 .description\").text(localStorage.getItem(\"hour9\"));\n$(\"#hour10 .description\").text(localStorage.getItem(\"hour10\"));\n$(\"#hour11 .description\").text(localStorage.getItem(\"hour11\"));\n$(\"#hour12 .description\").text(localStorage.getItem(\"hour12\"));\n$(\"#hour1 .description\").text(localStorage.getItem(\"hour1\"));\n$(\"#hour2 .description\").text(localStorage.getItem(\"hour2\"));\n$(\"#hour3 .description\").text(localStorage.getItem(\"hour3\"));\n$(\"#hour4 .description\").text(localStorage.getItem(\"hour4\"));\n$(\"#hour5 .description\").text(localStorage.getItem(\"hour5\"));\n}", "function saveToLocal(){\n // forloop here !! lets Try\n // var timeblock = $(divSec).children('div').eq(i);\n var scheduleList = {\n schedule9am: $(\"#schedule0\").val(),\n schedule10am: $(\"#schedule1\").val(),\n schedule11am: $(\"#schedule2\").val(),\n schedule12pm: $(\"#schedule3\").val(),\n schedule1pm: $(\"#schedule4\").val(),\n schedule2pm: $(\"#schedule5\").val(),\n schedule3pm: $(\"#schedule6\").val(),\n schedule4pm: $(\"#schedule7\").val(),\n schedule5pm: $(\"#schedule8\").val(),\n schedule6pm: $(\"#schedule9\").val(),\n }\n \n localStorage.setItem(\"schedule\", JSON.stringify(scheduleList));\n\n }", "function saveToLocalStorage() {\n let p = this.id\n let x = \"#hour\" + p\n let w = document.querySelector(x).value\n localStorage.setItem(x, w)\n \n }", "function getStoredSchedule() {\n for(let i = 9; i <= 17; i++) {\n let storedSchedule = localStorage.getItem(i);\n $(\"#\"+ i).find(\"textarea\").text(storedSchedule);\n }\n}", "function savePlanner() {\n $(\".hour\").each(function() {\n var currentHour = $(this).text();\n var currentInput = localStorage.getItem(currentHour)\n\n if(currentInput !== null) {\n $(this).siblings(\".input\").val(currentInput);\n }\n });\n}", "function loadLocalStorage() {\n // Return empty array if getItem returns null\n let schedule = JSON.parse(localStorage.getItem('schedule') || '[]');\n if (schedule.length === 0) {\n schedule = initLocalStorage(); \n }\n\n // Display data from localStorage\n for (let i = 0; i <= 8; i++) {\n // Schedule starts at hour 9\n const currentHour = i + 9; \n const box = $('#hour-' + currentHour);\n // Set the description of the time block to the saved description\n let description = schedule[i];\n box.find('.description').text(description);\n }\n}", "function refresh(){\n for (var i = 8; i < 18; i++){\n var holder = localStorage.getItem(\"#\" + i)\n if (holder !== \"\"){\n $(\"#\" + i).val(holder);\n }\n }\n }", "function getlocalStorage(hour){\n var inputval = localStorage.getItem(hour)\n if(true){\n // $(\"input\").data(`input${hour}`)\n var text= $(`input#inputText${hour}`).val(inputval)\n console.log(text)\n }\n }", "function saveAll() {\n hourRows.forEach(element => {\n let currentTask = $(\"#\" + element).val();\n localStorage.setItem(element, currentTask);\n });\n }", "function SavedSchedule () {\n var allSchedules = localStorage.getItem(\"schedule\"); \n\n // for (var i = 0 ; i<allSchedules.length; i++){\n // var allSchedules = localStorage.getItem(\"schedule\"); \n // get schedule from Local Storeage to display saved schedule\n allSchedules = JSON.parse(allSchedules);\n $(\"#schedule0\").attr(\"value\", allSchedules.schedule9am);\n $(\"#schedule1\").attr(\"value\", allSchedules.schedule10am);\n $(\"#schedule2\").attr(\"value\", allSchedules.schedule11am);\n $(\"#schedule3\").attr(\"value\", allSchedules.schedule12pm);\n $(\"#schedule4\").attr(\"value\", allSchedules.schedule1pm);\n $(\"#schedule5\").attr(\"value\", allSchedules.schedule2pm);\n $(\"#schedule6\").attr(\"value\", allSchedules.schedule3pm);\n $(\"#schedule7\").attr(\"value\", allSchedules.schedule4pm);\n $(\"#schedule8\").attr(\"value\", allSchedules.schedule5pm);\n $(\"#schedule9\").attr(\"value\", allSchedules.schedule6pm);\n\n\n // }\n}", "function handleSave(){\n localStorage.setItem(\"hour8\", hour8.value);\n localStorage.setItem(\"hour9\", hour9.value);\n localStorage.setItem(\"hour10\", hour10.value);\n localStorage.setItem(\"hour11\", hour11.value);\n localStorage.setItem(\"hour12\", hour12.value);\n localStorage.setItem(\"hour13\", hour13.value);\n localStorage.setItem(\"hour14\", hour14.value);\n localStorage.setItem(\"hour15\", hour15.value);\n localStorage.setItem(\"hour16\", hour16.value);\n}", "function pullActivities() {\n for (i = 0; i < workHours.length; i++) {\n var text = localStorage.getItem(i);\n $(\"#\" + i).val(\"\");\n $(\"#\" + i).val(text);\n }\n}", "function loadSaved() {\n for (i = 0; i < hours.length; i++) {\n var hourPrint = window.localStorage.getItem(keys[i]);\n hours[i].text(hourPrint);\n }\n}", "function myTask() {\n for(i = 9 ; i < 17; i++){\n var time = JSON.parse(localStorage.getItem(`textarea${[i]}`));\n $(`#textarea${[i]}`).text(time);\n }\n}", "function initialSchedule() {\n $(\".timeBlock\").each(function () {\n const thisBlock = $(this);\n const taskKey = parseInt(thisBlock.attr(\"data-hour\"));\n const thisTextArea = thisBlock.find(\"textarea\");\n\n const storedValue = localStorage.getItem(taskKey)\n console.log(\"Stored tasks\", storedValue);\n\n if (storedValue) {\n thisTextArea.val(storedValue);\n }\n\n });\n\n}", "function dataPersist(){\n let AllRowsInScope = $(\".description\");\n for(rowInScope of AllRowsInScope)\n {\n let keyValue = $(rowInScope).siblings(\"#hour\").text();\n keyValue = keyValue+=\"Task\";\n if(localStorage.getItem(keyValue) == null)\n {\n return;\n }\n if (keyValue != null){\n let val = localStorage.getItem(keyValue);\n $(rowInScope).val(val);\n } \n }\n}", "function init(){\n var recordedNine = JSON.parse(localStorage.getItem(\"hourNine\"));\n var recordedTen = JSON.parse(localStorage.getItem(\"hourTen\"));\n var recordedEleven = JSON.parse(localStorage.getItem(\"hourEleven\"));\n var recordedTwelve = JSON.parse(localStorage.getItem(\"hourTwelve\"));\n var recordedThirteen = JSON.parse(localStorage.getItem(\"hourThirteen\"));\n var recordedFourteen = JSON.parse(localStorage.getItem(\"hourFourteen\"));\n var recordedFifteen = JSON.parse(localStorage.getItem(\"hourFifteen\"));\n var recordedSixteen = JSON.parse(localStorage.getItem(\"hourSixteen\"));\n var recordedSeventeen = JSON.parse(localStorage.getItem(\"hourSeventeen\"));\n\n //populate text areas if information was retrieved from local storage\n if(recordedNine != \"\"){\n $(\".inputNine\").val(recordedNine);\n }\n if(recordedTen != \"\"){\n $(\".inputTen\").val(recordedTen);\n }\n if(recordedEleven != \"\"){\n $(\".inputEleven\").val(recordedEleven);\n }\n if(recordedTwelve != \"\"){\n $(\".inputTwelve\").val(recordedTwelve);\n }\n if(recordedThirteen != \"\"){\n $(\".inputThirteen\").val(recordedThirteen);\n }\n if(recordedFourteen != \"\"){\n $(\".inputFourteen\").val(recordedFourteen);\n }\n if(recordedFifteen != \"\"){\n $(\".inputFifteen\").val(recordedFifteen);\n }\n if(recordedSixteen != \"\"){\n $(\".inputSixteen\").val(recordedSixteen);\n }\n if(recordedSeventeen != \"\"){\n $(\".inputSeventeen\").val(recordedSeventeen);\n }\n }", "function onStart(){\n if(document.getElementById(\"t0900\").value){\n }else {\n document.getElementById(\"t0900\").value = window.localStorage.getItem('text1');\n };\n if(document.getElementById(\"t1000\").value){\n }else {\n document.getElementById(\"t1000\").value = window.localStorage.getItem('text2');\n };\n if(document.getElementById(\"t1100\").value){\n }else {\n document.getElementById(\"t1100\").value = window.localStorage.getItem('text3');\n };\n if(document.getElementById(\"t1200\").value){\n }else {\n document.getElementById(\"t1200\").value = window.localStorage.getItem('text4');\n };\n if(document.getElementById(\"t1300\").value){\n }else {\n document.getElementById(\"t1300\").value = window.localStorage.getItem('text5');\n };\n if(document.getElementById(\"t1400\").value){\n }else {\n document.getElementById(\"t1400\").value = window.localStorage.getItem('text6');\n };\n if(document.getElementById(\"t1500\").value){\n }else {\n document.getElementById(\"t1500\").value = window.localStorage.getItem('text7');\n };\n if(document.getElementById(\"t1600\").value){\n }else {\n document.getElementById(\"t1600\").value = window.localStorage.getItem('text8');\n };\n if(document.getElementById(\"t1700\").value){\n }else {\n document.getElementById(\"t1700\").value = window.localStorage.getItem('text9');\n }\n}", "function button(i){\n var times = document.querySelectorAll(\".timeSlot\");\n var text = times[i].childNodes[0].nextSibling.nextElementSibling.childNodes[0].value\n var today = moment().format('L');\n var day = JSON.parse(localStorage.getItem(today));\n day[i] = text;\n localStorage.setItem(today , JSON.stringify(day));\n}", "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}", "function gatherSavedData(){\n \n for(var i =0; i < timeSlots.length; i++){\n apptTime = timeSlots[i];\n \n let info = localStorage.getItem(apptTime);\n desriptDiv.innerHTML+=info;\n console.log(apptTime+ \" time \"+\" desript \" +info);\n }\n\n }", "function getSchedule() {\n\n if (tasks.at7 === \"\") {\n tasks.at7 = JSON.parse(localStorage.getItem(\"7AM\"));\n $(\"#7\").attr(\"placeholder\", tasks.at7)\n }\n if (tasks.at8 === \"\") {\n tasks.at8 = JSON.parse(localStorage.getItem(\"8AM\"));\n $(\"#8\").attr(\"placeholder\", tasks.at8)\n }\n if (tasks.at9 === \"\") {\n tasks.at9 = JSON.parse(localStorage.getItem(\"9AM\"));\n $(\"#9\").attr(\"placeholder\", tasks.at9)\n }\n if (tasks.at10 === \"\") {\n tasks.at10 = JSON.parse(localStorage.getItem(\"10AM\"));\n $(\"#10\").attr(\"placeholder\", tasks.at10)\n }\n if (tasks.at11 === \"\") {\n tasks.at11 = JSON.parse(localStorage.getItem(\"11AM\"));\n $(\"#11\").attr(\"placeholder\", tasks.at11)\n }\n if (tasks.at12 === \"\") {\n tasks.at12 = JSON.parse(localStorage.getItem(\"12PM\"));\n $(\"#12\").attr(\"placeholder\", tasks.at12)\n }\n if (tasks.at13 === \"\") {\n tasks.at13 = JSON.parse(localStorage.getItem(\"1PM\"));\n $(\"#13\").attr(\"placeholder\", tasks.at13)\n }\n if (tasks.at14 === \"\") {\n tasks.at14 = JSON.parse(localStorage.getItem(\"2PM\"));\n $(\"#14\").attr(\"placeholder\", tasks.at14)\n }\n if (tasks.at15 === \"\") {\n tasks.at15 = JSON.parse(localStorage.getItem(\"3PM\"));\n $(\"#15\").attr(\"placeholder\", tasks.at15)\n }\n if (tasks.at16 === \"\") {\n tasks.at16 = JSON.parse(localStorage.getItem(\"4PM\"));\n $(\"#16\").attr(\"placeholder\", tasks.at16)\n }\n if (tasks.at17 === \"\") {\n tasks.at17 = JSON.parse(localStorage.getItem(\"5PM\"));\n $(\"#17\").attr(\"placeholder\", tasks.at17)\n }\n\n}", "function loadScheduleData() {\n $(\"#09AM\").text(localStorage.getItem(\"09AMtext\"));\n $(\"#10AM\").text(localStorage.getItem(\"10AMtext\"));\n $(\"#11AM\").text(localStorage.getItem(\"11AMtext\"));\n $(\"#12PM\").text(localStorage.getItem(\"12PMtext\"));\n $(\"#01PM\").text(localStorage.getItem(\"01PMtext\"));\n $(\"#02PM\").text(localStorage.getItem(\"02PMtext\"));\n $(\"#03PM\").text(localStorage.getItem(\"03PMtext\"));\n $(\"#04PM\").text(localStorage.getItem(\"04PMtext\"));\n $(\"#05PM\").text(localStorage.getItem(\"05PMtext\"));\n }", "function loadScheduleData() {\n $(\"#09AM\").text(localStorage.getItem(\"09AMtext\"));\n $(\"#10AM\").text(localStorage.getItem(\"10AMtext\"));\n $(\"#11AM\").text(localStorage.getItem(\"11AMtext\"));\n $(\"#12PM\").text(localStorage.getItem(\"12PMtext\"));\n $(\"#01PM\").text(localStorage.getItem(\"01PMtext\"));\n $(\"#02PM\").text(localStorage.getItem(\"02PMtext\"));\n $(\"#03PM\").text(localStorage.getItem(\"03PMtext\"));\n $(\"#04PM\").text(localStorage.getItem(\"04PMtext\"));\n $(\"#05PM\").text(localStorage.getItem(\"05PMtext\"));\n }", "function getStored() {\n var citySaved = window.localStorage;\n console.log(citySaved.length)\n for (i=0; i < citySaved.length; i+=1) {\n $(travelOptions[i]).html(window.localStorage.key(i));\n $(travelOptions[i]).css(\"display\", \"block\");\n };\n}", "function displayPlan() {\n for (var i = 0; i < timeBlocks.length; i++) {\n let value = localStorage.getItem(timeBlocks[i].querySelector('.time').innerHTML);\n if (value != null) {\n timeBlocks[i].querySelector(\".input\").value = value;\n } else {\n timeBlocks[i].querySelector(\".input\").value = '';\n }\n }\n}", "function localStorageEntry() {\n localStorage.setItem(\"eventOne\", timeBlock1.text());\n localStorage.setItem(\"eventTwo\", timeBlock2.text());\n localStorage.setItem(\"eventThree\", timeBlock3.text());\n localStorage.setItem(\"eventFour\", timeBlock4.text());\n localStorage.setItem(\"eventFive\", timeBlock5.text());\n localStorage.setItem(\"eventSix\", timeBlock6.text());\n localStorage.setItem(\"eventSeven\", timeBlock7.text());\n localStorage.setItem(\"eventEight\", timeBlock8.text());\n localStorage.setItem(\"eventNine\", timeBlock9.text());\n localStorage.setItem(\"eventTen\", timeBlock10.text());\n localStorage.setItem(\"eventEleven\", timeBlock11.text());\n}", "function retrieveSavedItems() {\r\n\r\n bh = [\"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\"]\r\n\r\n for (bhindex = 0; bhindex < 9; bhindex++) {\r\n\r\n $(\"#\" + bh[bhindex] + \" .text-input\").val(localStorage.getItem(bh[bhindex]));\r\n\r\n }\r\n}", "function setDescFromStorage() {\n for (var i = 0; i < descriptionArr.length; i++) {\n //getItem is i+9 here as the localstorage id is related to\n //the time in the timeSlot, not its position in the descriptionArr array\n descriptionArr[i].value = localStorage.getItem(i+9);\n }\n}", "function nine(){\n var nineAM=localStorage.getItem(\"9AM\");\n //(nineAM);\n if(nineAM != null){\n document.getElementById('9').textContent=nineAM\n }\n \n}", "function setPlans () {\n $(\"#8\").val(localStorage.getItem(\"8\"));\n $(\"#9\").val(localStorage.getItem(\"9\"));\n $(\"#10\").val(localStorage.getItem(\"10\"));\n $(\"#11\").val(localStorage.getItem(\"11\"));\n $(\"#12\").val(localStorage.getItem(\"12\"));\n $(\"#13\").val(localStorage.getItem(\"13\"));\n $(\"#14\").val(localStorage.getItem(\"14\"));\n $(\"#15\").val(localStorage.getItem(\"15\"));\n $(\"#16\").val(localStorage.getItem(\"16\"));\n }", "function retrieveEvent (){\r\n for (var i=9; i <= 17; i++){\r\n localStorage.getItem(i);\r\n\r\n }\r\n}", "function loadTasks() {\n if (currentHourMoment > 17) {\n localStorage.clear();\n window.location.reload;\n };\n\n Object.keys(localStorage).forEach((key) => {\n $('textarea').each(function () {\n if ($(this).attr('id') == key) {\n $(this).val(localStorage.getItem(key));\n }\n });\n });\n}", "function saveEvent() {\n\n $(\".time-block\").each(function () {\n var timeOfday = $(this).attr(\"id\");\n\n //even when user refreshes browser, planner entry remains \n var taskEntry = localStorage.getItem(timeOfday);\n\n if (taskEntry) {\n $(this).children(\".eventLog\").val(taskEntry);\n }\n });\n}", "function storeContent17() {\n var savedContent17 = content17.val(); \n localStorage.setItem(\"5:00pm\", savedContent17);\n}", "function scheduleEvents() {\n var event9 = JSON.parse(localStorage.getItem(\"9:00 AM\"));\n hour9.val(event9);\n var event10 = JSON.parse(localStorage.getItem(\"10:00 AM\"));\n hour10.val(event10);\n var event11 = JSON.parse(localStorage.getItem(\"11:00 AM\"));\n hour11.val(event11);\n var event12 = JSON.parse(localStorage.getItem(\"12:00 PM\"));\n hour12.val(event12);\n var event13 = JSON.parse(localStorage.getItem(\"1:00 PM\"));\n hour13.val(event13);\n var event14 = JSON.parse(localStorage.getItem(\"2:00 PM\"));\n hour14.val(event14);\n var event15 = JSON.parse(localStorage.getItem(\"3:00 PM\"));\n hour15.val(event15);\n var event16 = JSON.parse(localStorage.getItem(\"4:00 PM\"));\n hour16.val(event16);\n var event17 = JSON.parse(localStorage.getItem(\"5:00 PM\"));\n hour17.val(event17);\n var event18 = JSON.parse(localStorage.getItem(\"6:00 PM\"));\n hour18.val(event18);\n}", "function startSchedule() {\n $(\".time-block\").each(function () {\n var id = $(this).attr(\"id\");\n var planner = localStorage.getItem(id);\n\n $(this).find(\".planner\").val(planner);\n console.log(typeof planner)\n });\n}", "function getSavedEvents()\n {\n $(\"textarea\").each(function()\n {\n let hour = $(this).parent().attr(\"data-time\");\n\n if (localStorage.getItem(hour) === null)\n {\n return;\n }\n else\n {\n $(this).val(localStorage.getItem(hour));\n }\n })\n }", "function loadScheduleList (){\n for (i = startHr; i <= endHr; i++) {\n time = i.toString();\n indx = i - startHr;\n scheduleList[indx].task = localStorage.getItem(time);\n if (!scheduleList[indx].task) {\n scheduleList[indx].time = time;\n scheduleList[indx].task = '';\n }\n }\n}", "function storeContent16() {\n var savedContent16 = content16.val(); \n localStorage.setItem(\"4:00pm\", savedContent16);\n}", "function storeContent10() {\n var savedContent10 = content10.val(); \n localStorage.setItem(\"10:00am\", savedContent10);\n}", "function saveLocalStorage() {\n const userInput9 = localStorage.getItem('9');\n $('#9')\n .children('.description')\n .text(userInput9);\n\n const userInput10 = localStorage.getItem('10');\n $('#10')\n .children('.description')\n .text(userInput10);\n\n const userInput11 = localStorage.getItem('11');\n $('#11')\n .children('.description')\n .text(userInput11);\n\n const userInput12 = localStorage.getItem('12');\n $('#12')\n .children('.description')\n .text(userInput12);\n\n const userInput1 = localStorage.getItem('13');\n $('#13')\n .children('.description')\n .text(userInput1);\n\n const userInput2 = localStorage.getItem('14');\n $('#14')\n .children('.description')\n .text(userInput2);\n\n const userInput3 = localStorage.getItem('15');\n $('#15')\n .children('.description')\n .text(userInput3);\n\n const userInput4 = localStorage.getItem('16');\n $('#16')\n .children('.description')\n .text(userInput4);\n\n const userInput5 = localStorage.getItem('17');\n $('#17')\n .children('.description')\n .text(userInput5);\n }", "function onLoad(){\n var currentDayDisplay = $(\"#currentDay\");\n currentDayDisplay.text(moment().format(\"dddd, MMMM Do YYYY\"));\n \n plannerData = JSON.parse(localStorage.getItem(\"plannerDataKey\"));\n \n $(`[data-time=\"${plannerData[0].time}\"]`).val(plannerData[0].currentPlan);\n\n for(let i=0; i<plannerData.length; i++)\n {\n $(`[data-time=\"${plannerData[i].time}\"]`).val(plannerData[i].currentPlan);\n }\n \n updateColors(); \n}", "function createArrayOfHours() {\n // setting variables \n var existingScheduler;\n var scheduleString = localStorage.getItem(\"schedule\")\n // if there is no lovialy stored strings make one \n if (!scheduleString) {\n existingScheduler = []\n }\n else {\n // If one exists convert the existing var into an object\n existingScheduler = JSON.parse(localStorage.getItem(\"schedule\"))\n }\n // Get the hours tagged elements\n var hourElements = $(\".hour\");\n //For eache hour element do somthing \n for (i = 0; i <= hourElements.length - 1; i++) {\n //get the text contenet\n var txtTime = hourElements[i].textContent;\n // Filter \n var matchingItem = existingScheduler.filter(function (rec) {\n // If the time === time then return matching item\n return rec.time === txtTime\n });\n // if the matching item length is 0\n if (matchingItem.length > 0) {\n // add the text conttent from local storage to the display\n hourElements[i].parentElement.children[1].textContent = matchingItem[0].message;\n }\n else {\n // do nothing \n }\n }\n}", "function storeContent15() {\n var savedContent15 = content15.val(); \n localStorage.setItem(\"3:00pm\", savedContent15);\n}", "function saveTask() {\n let currentHour = $(this).data(\"time\");\n let currentTask = $(\"#\" + currentHour).val();\n localStorage.setItem(currentHour, currentTask);\n }", "function getTask() {\n var text = $(\".timeSlot\")\n text.each(function () {\n var task = localStorage.getItem($(this).attr(\"id\"))\n if (task) {\n $(this).children(\".task\").val(task)\n }\n })\n}", "function displayTask(time) {\n $(\"#\" + time).val(localStorage.getItem(time)); \n }", "function storeContent9() {\n var savedContent9 = content9.val();\n console.log(savedContent9); \n localStorage.setItem(\"9:00am\", savedContent9);\n}", "function displaySchedule() {\n savedSchedule = JSON.parse(localStorage.getItem(date));\n $('.input-area').val('');\n for (var i = 0; i < savedSchedule.length; i++) {\n var getKey = Object.keys(savedSchedule[i]);\n var getValue = Object.values(savedSchedule[i]);\n $('#area-' + getKey).val(getValue[0]);\n }\n }", "function storeContent14() {\n var savedContent14 = content14.val(); \n localStorage.setItem(\"2:00pm\", savedContent14);\n}", "function getAll() {\n $(\"#9 .toDo\").val(localStorage.getItem(\"9\"));\n $(\"#10 .toDo\").val(localStorage.getItem(\"10\"));\n $(\"#11 .toDo\").val(localStorage.getItem(\"11\"));\n $(\"#12 .toDo\").val(localStorage.getItem(\"12\"));\n $(\"#1 .toDo\").val(localStorage.getItem(\"13\"));\n $(\"#2 .toDo\").val(localStorage.getItem(\"14\"));\n $(\"#3 .toDo\").val(localStorage.getItem(\"15\"));\n $(\"#4 .toDo\").val(localStorage.getItem(\"16\"));\n $(\"#5 .toDo\").val(localStorage.getItem(\"17\"));\n}", "function storeContent11() {\n var savedContent11 = content11.val(); \n localStorage.setItem(\"11:00am\", savedContent11);\n}", "function storeContent12() {\n var savedContent12 = content12.val(); \n localStorage.setItem(\"12:00pm\", savedContent12);\n}", "function load() {\n colors();\n timeDis();\n timeChange();\n\n var input = JSON.parse(localStorage.getItem(\"input\"));\n\n if (input == null) {\n localStorage.setItem(\"input\", JSON.stringify(schedule));\n input = JSON.parse(localStorage.getItem(\"input\"));\n }\n for (var i = 0; i < time.length; i++) {\n if (input[i] == null) {\n schedule[i] = \"\";\n }\n schedule = input;\n $(\"#\" + i).siblings(\"textarea\").val(schedule[i]);\n }\n}", "function nineAM() {\n var inputNineEl = document.getElementById(\"9am-text\");\n var outputNineEl = document.getElementById(\"9am-text\");\n var buttonNineEl = document.getElementById(\"9am-button\");\n\n buttonNineEl.addEventListener(\"click\", updateOutputNine);\n\n outputNineEl.textContent = localStorage.getItem(\"content9AM\");\n inputNineEl.value = localStorage.getItem(\"content9AM\");\n\n function updateOutputNine() {\n localStorage.setItem(\"content9AM\", inputNineEl.value);\n outputNineEl.textContent = inputNineEl.value;\n }\n}", "function workPlanner() {\n\n $(\".time-block\").each(function () {\n var id = $(this).attr(\"id\");\n console.log(this);\n var event = localStorage.getItem(id);\n console.log(event);\n\n if (event !== null) {\n $(this).children(\".description\").val(event);\n \n }\n });\n}", "function saveBtnHandler (event) {\n var userInput = $(event.target).siblings(\"input\").val();\n var Time = $(event.target).siblings(\"input\").data(\"hour\");\n localStorage.setItem( Time , userInput);\n}", "function init() {\n for (let i = 0; i <= 10; i++) {\n schedule.push(\"\");\n }\n console.log(\"Local storage get item\" + localStorage.getItem(\"schedule\"));\n schedule = JSON.parse(localStorage.getItem(\"schedule\"));\n console.log(\"schedule = \" + schedule);\n for (let i = 8; i <= 18; i++) {\n $(`#${i} > .col-6`).text(content);\n }\n}", "function populateStorage(){\n \t\tconsole.log('-- Populate local storage');\n\n \t\tfor (var level in GameJam.levels) {\n \t\t\tlocalStorage.setItem(level, GameJam.levels[level].time);\n \t\t}\n \t}", "function saveButton(num) { //Passing a number we're going to use to determine the time\n //console.log(this.siblings)\n let timestring = parseTime(num)\n var input = document.getElementById(\"TextField\" + timestring).value;\n localStorage.setItem(timestring, input);\n document.getElementById(\"TextField\" + timestring).value = localStorage.getItem(timestring);\n var testStorage = localStorage.getItem(timestring);\n console.log(\"input: \", input)\n console.log(\"testStorage: \", testStorage)\n\n }", "function getStorage() {\n if (localStorage.getItem(\"calendarObj\") !== null) {\n calendarObj = JSON.parse(window.localStorage.getItem('calendarObj'));\n }\n\n $appt9.text(calendarObj.slot9);\n $appt10.text(calendarObj.slot10);\n $appt11.text(calendarObj.slot11);\n $appt12.text(calendarObj.slot12);\n $appt13.text(calendarObj.slot13);\n $appt14.text(calendarObj.slot14);\n $appt15.text(calendarObj.slot15);\n $appt16.text(calendarObj.slot16);\n $appt17.text(calendarObj.slot17);\n}", "function renderStoredInputs() {\n\n //Here we are targeting each element with the CSS class description\n $(\".description\").each(function () {\n\n //Storing the text values from the index.html file that have the CSS class of hour into a variable\n //We can then use hourToCheck as our key when retrieving from local storage\n let hourToCheck = $(this).siblings(\".hour\").text();\n // console.log(hourToCheck)\n\n //Getting the values from local storage by passing the key\n let inputId = $(this).val(localStorage.getItem(hourToCheck));\n // console.log(inputId)\n });\n }", "function storeContent13() {\n var savedContent13 = content13.val(); \n localStorage.setItem(\"1:00pm\", savedContent13);\n}", "function showTask() {\n for (var i = 9; i < 18; i++) {\n var getTask = localStorage.getItem(i)\n $(\"#\" + i).text(getTask)\n }\n}", "function setTimeBlocks(){\n var setStatus = localStorage.getItem(\"Status\");\n if (setStatus === null){\n //future versions may use a different version of hourArray for tracking.\n for (var i = 0; i < hourArray.length; i++){\n var timeSegment = {hour: hourArray[i], details: \" \"};\n usersTime.push(timeSegment);\n }\n localStorage.setItem(\"Saved Times\", JSON.stringify(usersTime));\n setStatus = \"Saved\";\n localStorage.setItem(\"Status\", setStatus);\n } else{\n usersTime = JSON.parse(localStorage.getItem(\"Saved Times\"));\n }\n\n}", "function dayObject() {\n var today = moment().format('L');\n // if there is no data for the current date, this block creates the objexct that stores that data\n if (localStorage.getItem(today) === null){\n var plan = {};\n for (i = 0; i < 10; i++) {\n plan[i] = \"\" \n localStorage.setItem(today , JSON.stringify(plan));\n } \n }\n // pulls the data from local storage and populates the calander\n var form = document.querySelectorAll(\".form-control\");\n for (i=0 ; i<form.length ;i++){\n form[i].value = JSON.parse(localStorage.getItem(today))[i]; \n }\n}", "function setPlanner() {\n\n $(\"#currentDay\").text(moment().format(\"dddd, MMMM Do YYYY\"));\n\n $(\".time-block\").each(function () {\n const id = $(this).attr(\"id\");\n const schedule = localStorage.getItem(id);\n\n if (schedule !== null) {\n $(this).children(\".schedule\").val(schedule);\n }\n });\n}", "function save() {\n var events = $(\"textArea\");\n for (var i = 0; i < events.length; i++) {\n var time = events[i].getAttribute(\"data-time\");\n allEvents[time] = events[i].value;\n }\n localStorage.setItem(\"allEvents\", JSON.stringify(allEvents));\n alert(\"Schedule saved :)\");\n}", "function saveData(){\n \n plan = $(`[data-time=\"${event.target.dataset.time}\"]`).val();\n\n timeBlock = $(this).attr(\"data-time\");\n\n var plannerData = JSON.parse(localStorage.getItem(\"plannerDataKey\"));\n\n for(i=0;i<plannerData.length;i++)\n {\n if(plannerData[i].time == timeBlock)\n {\n plannerData[i].currentPlan = plan;\n }\n \n }\n \n localStorage.setItem(\"plannerDataKey\", JSON.stringify(plannerData));\n}", "function init() {\n var storedinputData = JSON.parse(localStorage.getItem(\"newData\"))\n if (storedinputData !== null) {\n newData = storedinputData\n }\n for (let i = 0; i < newData.length; i++) {\n var indexData = $(\"#scheduleInput\" + [i]);\n indexData.append(newData[i].value)\n }\n}", "function forecastData() {\n for (let i = 1; i < 6; i++) {\n // convert dt to DD MM YYYY format \n var a = new Date(daily[i].dt * 1000);\n var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var time = month + ' ' + date + ' ' + year; \n\n // save to local storage\n localStorage.setItem(\"date-\"+i, time);\n localStorage.setItem(\"high-\"+i, daily[i].temp.max);\n localStorage.setItem(\"low-\"+i, daily[i].temp.min);\n localStorage.setItem(\"humidity-\"+i, daily[i].humidity); \n localStorage.setItem(\"icon-\"+i, \"http://openweathermap.org/img/wn/\" + daily[i].weather[0].icon + \".png\"); \n }\n displayForecast();\n}", "function saveLocally(){\n//using the button as a reference from where we are at, setting the information as text to save to be stored on the time slot(9AM-6PM)\n var textToSave = $(this).prev().val()\n var time = $(this).prev().prev().text()\n\n localStorage.setItem(time, textToSave)\n}", "function loadTask() {\n var allText = document.querySelectorAll(\".textarea\")\n allText.forEach((val, i)=>{\n val.value = localStorage.getItem(i)\n })\n // for(var i=0; i < 9; i++) {\n\n // $(\"#task\" + i).val(localStorage.getItem(i))\n // }\n\n}", "function loadPreviousEntriesFromStorage()\n{\n\t// Get the data back from local storage\n\ttimeStorage = localStorage.getObject('timeStorage');\n\t\n\tif (timeStorage != null)\n\t{\n\t\t// Update the fields on the page\n\t\tfor (var i=0; i < numOfTimeEntries; i++)\n\t\t{\n\t\t\t// Get items from HTML 5 storage\n\t\t\tvar startHour = timeStorage[i].startHour;\n\t\t\tvar startMin = timeStorage[i].startMin;\n\t\t\tvar endHour = timeStorage[i].endHour;\n\t\t\tvar endMin = timeStorage[i].endMin;\n\t\t\tvar task = timeStorage[i].task;\n\t\t\tvar subTotal = timeStorage[i].subTotal;\n\t\t\tvar totalTimeRow = timeStorage[i].totalTimeRow;\t\t\n\t\t\tvar totalTimeRowHoursMins = timeStorage[i].totalTimeRowHoursMins;\n\n\t\t\t// Unencode html coded ampersands\n\t\t\ttask = task.replace(/&amp;/g, '&');\n\n\t\t\t// Set to fields on the page\n\t\t\t$('#startHour' + i).val(startHour);\n\t\t\t$('#startMin' + i).val(startMin);\n\t\t\t$('#endHour' + i).val(endHour);\n\t\t\t$('#endMin' + i).val(endMin);\n\t\t\t$('#task' + i).val(task);\n\n\t\t\t// Check or uncheck the check boxes\n\t\t\tif (subTotal == true)\n\t\t\t{\n\t\t\t\t$('#subTotal' + i).attr('checked', 'checked');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$('#subTotal' + i).removeAttr('checked');\n\t\t\t}\n\n\t\t\t// Set the total time for each row\n\t\t\tif (totalTimeRow != null)\n\t\t\t{\n\t\t\t\t$('#totalTimeRow' + i).html(totalTimeRow);\n\t\t\t\t$('#totalTimeRowHoursMins' + i).html(totalTimeRowHoursMins);\n\t\t\t}\n\t\t}\n\n\t\t// Set the date and title values\n\t\tvar displayDate = timeStorage['displayDate'];\n\t\tvar backendDate = timeStorage['backendDate'];\n\t\t$('#displayDate').val(displayDate);\n\t\t$('#backendDate').val(backendDate);\n\t\t$('title').text(backendDate + ' Timesheet');\n\n\t\t// Set the overall subtotal and total time\n\t\tvar overallTotalTime = timeStorage['overallTotalTime'];\n\t\tvar overallTotalTimeHoursMins = timeStorage['overallTotalTimeHoursMins'];\n\t\tvar overallSubtotal = timeStorage['overallSubtotalTime'];\n\t\tvar overallSubtotalHoursMins = timeStorage['overallSubtotalTimeHoursMins'];\n\n\t\tif (overallSubtotal != null)\n\t\t{\n\t\t\t$('#overallSubtotalTime').html(overallSubtotal);\n\t\t\t$('#overallSubtotalTimeHoursMins').html(overallSubtotalHoursMins);\n\t\t}\n\n\t\tif (overallTotalTime != null)\n\t\t{\n\t\t\t$('#overallTotalTime').html(overallTotalTime);\n\t\t\t$('#overallTotalTimeHoursMins').html(overallTotalTimeHoursMins);\n\t\t}\n\t}\n\telse {\n\t\t// Set back to empty object\n\t\ttimeStorage = {};\n\t}\n}", "function retrieve_storage() {\n var history = document.getElementById(\"history\");\n\n for(var i = 0; i < localStorage.length; i++) {\n if(JSON.parse(localStorage.getItem(localStorage.key(i))).length == 2) {\n var saved_entry = JSON.parse(localStorage.getItem(localStorage.key(i)));\n var entry = history.insertRow(history.rows.length);\n\n var start_time = entry.insertCell(0);\n start_time.innerHTML = saved_entry[0];\n\n var start_coords = entry.insertCell(1);\n start_coords.innerHTML = saved_entry[1];\n\n time_started = localStorage.getItem(\"time\");\n is_running = true;\n document.getElementById(\"toggle\").innerHTML = \"Stop\";\n document.getElementById(\"reset\").innerHTML = \"Cancel\";\n stopwatch = setInterval(stopwatch_on, 1);\n break;\n }\n\n var saved_entry = JSON.parse(localStorage.getItem(localStorage.key(i)));\n var entry = history.insertRow(history.rows.length);\n\n var start_time = entry.insertCell(0);\n start_time.innerHTML = saved_entry[0];\n\n var start_coords = entry.insertCell(1);\n start_coords.innerHTML = saved_entry[1];\n\n var stop_time = entry.insertCell(2);\n stop_time.innerHTML = saved_entry[2];\n\n var stop_coords = entry.insertCell(3);\n stop_coords.innerHTML = saved_entry[3];\n\n var elapsed_time = entry.insertCell(4);\n elapsed_time.innerHTML = saved_entry[4];\n }\n}", "function savedStuff(){\n $.each(middleFind, (i, v) =>{\n var saved = middleFind.eq(i).attr('data-saved')\n textboxes.eq(i).val(localStorage.getItem(saved))\n \n })\n}", "function storeInformation() {\n localStorage.setItem('todaysTimes', JSON.stringify(todaysTimes));\n}", "function getTasks() {\n getSavedDate()\n\n // getting or setting tasks array\n var tasks = JSON.parse(localStorage.getItem(\"tasks\"||'{}'));\n if (tasks === null) {\n tasks = \n {hour9: \"\",hour10: \"\",hour11: \"\",hour12: \"\",hour13: \"\",\n hour14: \"\",hour15: \"\",hour16: \"\",hour17: \"\"}\n localStorage.setItem('tasks', JSON.stringify(tasks))\n }\n\n // looping through all necessary divs to display html\n for (var i = 0; i < Object.keys(tasks).length; i++) {\n var hourText = \"\";\n var j = i+9\n var hourID = \"hour\" + j\n if (j > 12) {\n hourText = j-12 + \" PM\"\n } else if (j < 11) {\n hourText = j + \" AM\"\n } else {\n hourText = j + \" PM\"\n }\n\n // disable textarea it's id is less than the current time. \n var disableTextarea = \"\";\n if (currentHour > j) {\n disableTextarea = \"disabled=\\\"disabled\\\"\"\n }\n\n // setting past/current/present state to the textarea to change color\n var mcfly = \"\";\n if (j > currentHour) {\n mcfly = \"future\"\n } else if (j < currentHour) { \n mcfly = \"past\"\n } else {\n mcfly = \"present\"\n }\n\n // string interpolation for each hour row\n var textAreas = `\n <div class=\"time-block\"> \n <div class=\"row\">\n <div class=\"hour\">${hourText}</div>\n <textarea class=\"description ${mcfly}\" id=\"${hourID}\" ${disableTextarea}>${tasks[hourID]}</textarea>\n <button class=\"saveBtn\" id=\"${hourID}button\"><i class=\"fas fa-save icon-4x\"></i></button>\n </div>\n </div>`\n $(\".container\").append(textAreas)\n }\n}", "function updateStorage(index) {\n var val = $(`.textarea${index}`)[0].value;\n localStorage.setItem(`timeBlock${index}`,val);\n}", "function work(){\r\n var storedValue = localStorage.getItem('wname');\r\n var storedValue = localStorage.getItem('wdescription');\r\n var storedValue = localStorage.getItem('wdateline');\r\n }", "function loadTimes() {\n\tsessionTimes = JSON.parse(localStorage.getItem('times'))\n\tconsole.log(sessionTimes);\n\tfill()\n\tconsole.log('Times Loaded');\n}", "function getSett() {\n daynight = localStorage.getItem(\"daynight\");\n return daynight;\n}", "function hourTracker() {\n //displays current hour using Moment.js format\n var currentHour = moment().hour();\n\n // Locates the class '.time-block' that is directly connected to the same <div> that also included the 'id' values that were saved in localStorage saveBtn function. Then creating a new function through a '.each' loop. This will ultimate allow us to edit the CSS classes for the <div> sections referenced in localStorage.\n $(\".time-block\").each(function () {\n // Defining the variable 'blockHour' = \n // Next 'parseInt' is designed to turn each loop into a integer. {It does this by taking each loop, converting it to a string, then parses that string and returns an integer.} - It references '$(this)' which is what is pulling from the localStorage. - It then grabs each item in localStorage by the attribute '.attr' via the 'id' it was saved by. - Next it takes the 'id' and '.splits' the id by removing the word \"hour\" {which is referenced as a string}. So it leaves just the hour number within the id name. It needs to split the verbiage off otherwise the 'parseInt' would display 'NaN' information. Because 'hour' is only mentioned once, the split will be seperated into two pieces. Because JS index starts at 0 we will need call the value as [1] to get the second element section after the split.\n var blockHour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n\n // logging the block hour # and current hour #. \n console.log(blockHour, currentHour);\n\n // if loop for all timeblocks to ensure block is showing the correct coloring for past, present, future.\n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).removeClass(\"future\");\n } else if (blockHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n } else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n }", "function exibir(){\n var qtd = document.getElementById('qtd');\n qtd.value=localStorage.qtd;\n var comp = document.getElementById('comp');\n comp.value=localStorage.comp;\n var larg = document.getElementById('larg');\n larg.value=localStorage.larg;\n var desc = document.getElementById('desc');\n desc.value=localStorage.desc;\n}", "function loadSchedule() {\n //If schedule is saved in local storage, set it equal to fullSchedule array\n if (localStorage.getItem('full-schedule') != null) {\n fullSchedule = JSON.parse(localStorage.getItem('full-schedule'))\n }\n\n //Write full schedule array to all time block inputs\n for (let i = 0; i < fullSchedule.length; i++) {\n if (fullSchedule[i] != undefined) {\n timeBlockInputs.eq(i).val(fullSchedule[i]);\n }\n else {\n timeBlockInputs.eq(i).val('');\n }\n }\n }", "function saveEvent(event) {\n event.preventDefault();\n var hour = $(this).siblings(\".hour\").text();\n var userEntry = $(this).siblings(\".description\").val();\n localStorage.setItem(hour, userEntry);\n\n }", "function them(i)\n{\t\n\tvar kq=tim(arr[i].ten);\n\tif(kq==-1)//k thay sp nay\n\n\t{\n\t\tvar c=window.localStorage.getItem(\"count\");\n\t\tc++;\n\t\twindow.localStorage.setItem(c,arr[i].ten+\",\"+arr[i].hinh+\",\"+arr[i].gia+\",\"+1);\n\t\twindow.localStorage.setItem(\"count\",c);\n\n\t}\n\telse //timthay\n\t{\n\t\tvar v=window.localStorage.getItem(kq);\n\t\tif(v!=null)\n\t\t{\n\t\t\tvar tam=v.split(\",\");\t\n\t\t\ttam[3]=parseInt(tam[3])+1;\n\t\t\t//cap nhat tam vao kho\n\t\t\twindow.localStorage.setItem(kq,tam[0]+\",\"+tam[1]+\",\"+tam[2]+\",\"+tam[3]);\n\t\t}\n\t}\n}", "function loadPast() {\n //get info from local storage\n var task9am = localStorage.getItem(9);\n var task10am = localStorage.getItem(10);\n var task11am = localStorage.getItem(11);\n var task12pm = localStorage.getItem(12);\n var task1pm = localStorage.getItem(13);\n var task2pm = localStorage.getItem(14);\n var task3pm = localStorage.getItem(15);\n var task4pm = localStorage.getItem(16);\n var task5pm = localStorage.getItem(17);\n\n//put text into correct spots\n$(\"#9\").children('.task-text').val(task9am);\n$(\"#10\").children('.task-text').val(task10am);\n$(\"#11\").children('.task-text').val(task11am);\n$(\"#12\").children('.task-text').val(task12pm);\n$(\"#13\").children('.task-text').val(task1pm);\n$(\"#14\").children('.task-text').val(task2pm);\n$(\"#15\").children('.task-text').val(task3pm);\n$(\"#16\").children('.task-text').val(task4pm);\n$(\"#17\").children('.task-text').val(task5pm);\n}", "function updateThis() {\n \n dataResults = localStorage.getItem('t4Hours');\n\n return (dataResults ? dataResults : t4Hours);\n\n}", "function save() {\t\n\tlet checkbox1 = document.querySelector(\".checkbox-one\");\n localStorage.setItem(\"checkbox-one\", checkbox1.checked);\t\n let checkbox2 = document.querySelector(\".checkbox-two\");\n localStorage.setItem(\"checkbox-two\", checkbox2.checked);\t\n let select = document.querySelector('#timezone');\n localStorage.setItem(\"timezone\", select.value);\n\n}", "function setLocalStorage() {\r\n localStorage.setItem(\"job\", $(\"#berufe option:selected\").val());\r\n localStorage.setItem(\"class\", $(\"#klassen option:selected\").val());\r\n\r\n initializeCalendar();\r\n}", "function loadText() {\n $(\".time-block\").each(function() {\n //console.log(this);\n //console.log(this.id);\n var recoverText = localStorage.getItem($(this).attr(\"id\"));\n console.log(recoverText);\n $(\"#\" + this.id + \" .info\").val(recoverText); \n })\n}", "function initializeSchedule(){\n// console.log(toDoItems);\n\n//for each time block\n $timeBlocks.each(function(){\n var $thisBlock = $(this);\n var thisBlockHr = parseInt($thisBlock.attr(\"data-hour\"));\n\n var todoObj = {\n //set related todo hour to same as data-hour\n hour: thisBlockHr,\n //get text ready to accept string input\n text: \"\",\n }\n //add this todo object to todoitems array\n toDoItems.push(todoObj);\n });\n\n\n// saving the array of objects to local storage via stringify\n localStorage.setItem(\"todos\", JSON.stringify(toDoItems));\n console.log(toDoItems);\n}", "function returnLocalstorageValues(){\n if (checkLocalStorageError()) {\n if (localStorage.getItem('notify1') !== null) {\n $localEmailNotify.prop('checked',true);\n }\n if (localStorage.getItem('notify2') !== null) {\n $localProfileNotify.prop('checked',true);\n }\n if (localStorage.getItem('timeSelect') !== null) {\n let optionValue = parseInt(localStorage.getItem('timeSelect'));\n $optionZone.val(optionValue);\n }\n }\n}" ]
[ "0.86230123", "0.80268705", "0.7852098", "0.7702467", "0.76558906", "0.7558315", "0.75356066", "0.75214106", "0.7485002", "0.7454084", "0.7450706", "0.7421565", "0.7331226", "0.72987926", "0.72912514", "0.7288431", "0.72093576", "0.71646327", "0.7162778", "0.7157344", "0.71229154", "0.7004428", "0.7002011", "0.69444954", "0.69412214", "0.69407237", "0.6924946", "0.6882399", "0.6882399", "0.68698907", "0.6856726", "0.68359756", "0.6830624", "0.68117315", "0.68105775", "0.67993724", "0.6791397", "0.6766093", "0.67600065", "0.6747183", "0.67450356", "0.6720125", "0.67113334", "0.67091763", "0.6705193", "0.67048657", "0.668178", "0.6666539", "0.6666334", "0.66632354", "0.6659363", "0.66534185", "0.66448504", "0.66309595", "0.6626701", "0.6576847", "0.6553442", "0.6538281", "0.652653", "0.65215194", "0.6520687", "0.6514885", "0.6497493", "0.6495713", "0.6494096", "0.6482117", "0.648107", "0.6479896", "0.6448502", "0.6445616", "0.6442185", "0.6429821", "0.6426246", "0.64216495", "0.6421336", "0.64069426", "0.6399097", "0.63847804", "0.6382279", "0.6361687", "0.635075", "0.6345207", "0.63220125", "0.631514", "0.63072705", "0.62612253", "0.6259195", "0.6257578", "0.6237785", "0.62310064", "0.6230073", "0.6229989", "0.62122357", "0.6207883", "0.6192573", "0.6165357", "0.6162655", "0.61528885", "0.6148125", "0.6145556" ]
0.8944891
0
NEED TO WRITE THIS
function displayAPIError(error) { console.log(error) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "static private internal function m121() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "static final private internal function m106() {}", "static transient final private internal function m43() {}", "static transient private protected internal function m55() {}", "static private protected internal function m118() {}", "static transient final protected internal function m47() {}", "transient private protected public internal function m181() {}", "transient final private protected internal function m167() {}", "obtain(){}", "static transient final private protected internal function m40() {}", "transient final private internal function m170() {}", "static transient private protected public internal function m54() {}", "static transient final protected public internal function m46() {}", "static transient private internal function m58() {}", "static protected internal function m125() {}", "__previnit(){}", "transient private public function m183() {}", "static private protected public internal function m117() {}", "static transient private public function m56() {}", "static transient final protected function m44() {}", "transient final private protected public internal function m166() {}", "function _____SHARED_functions_____(){}", "static final private protected internal function m103() {}", "function ea(){}", "function miFuncion (){}", "static transient protected internal function m62() {}", "static transient final private protected public internal function m39() {}", "static final private public function m104() {}", "apply () {}", "static transient final private public function m41() {}", "static transient final private protected public function m38() {}", "function Hx(a){return a&&a.ic?a.Mb():a}", "static final protected internal function m110() {}", "static final private protected public internal function m102() {}", "function __func(){}", "transient final private public function m168() {}", "function oi(){}", "function TMP(){return;}", "function TMP(){return;}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function TMP() {\n return;\n }", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "static private public function m119() {}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function StupidBug() {}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function fn() {\n\t\t }", "function oi(a){this.Of=a;this.rg=\"\"}", "function i(e,t){return t}", "function wa(){}", "function fm(){}", "function __it() {}", "function a(e){return void 0===e&&(e=null),Object(r[\"p\"])(null!==e?e:i)}", "prepare() {}", "function Ha(){}", "function comportement (){\n\t }", "function Scdr() {\r\n}", "static get END() { return 6; }", "function nd(){}", "_firstRendered() { }", "function DWRUtil() { }", "function l(){t={},u=\"\",w=\"\"}", "function Transform$7() {}", "function ze(a){return a&&a.ae?a.ed():a}", "function SeleneseMapper() {\n}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}" ]
[ "0.69926625", "0.6989841", "0.6688535", "0.646041", "0.636054", "0.62876743", "0.62683284", "0.61563766", "0.603724", "0.5990397", "0.59748524", "0.5955284", "0.5923668", "0.5817267", "0.58090395", "0.57964027", "0.57955754", "0.57710284", "0.570799", "0.57046545", "0.56914514", "0.566964", "0.56497705", "0.5579084", "0.5577165", "0.5549258", "0.55365705", "0.54907316", "0.5430262", "0.54185146", "0.5406471", "0.5401674", "0.5379377", "0.53748065", "0.536756", "0.5337594", "0.5313757", "0.530661", "0.52919877", "0.52838856", "0.5272924", "0.5263686", "0.525398", "0.52377784", "0.5208843", "0.5208843", "0.5195705", "0.5195705", "0.5195705", "0.5188238", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5170925", "0.5161124", "0.5127769", "0.5127769", "0.5127769", "0.51205057", "0.51149815", "0.51149815", "0.51149815", "0.51149815", "0.5110063", "0.51007473", "0.5100195", "0.5087301", "0.50868505", "0.5085604", "0.50802445", "0.50671494", "0.5040099", "0.5035798", "0.5028187", "0.5028147", "0.5025545", "0.50138605", "0.50098014", "0.5007862", "0.50044405", "0.49818352", "0.49774045", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814" ]
0.0
-1
ONLY ALLOW SUBMIT ON VALID FORM
function postcodeValid(postcode) { var regex = /([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))[0-9][A-Za-z]{2})/ var postcode = noSpacesPostcode(postcodeInput.value); if (regex.test(postcode)) { return true } else { throw new Error('Enter a valid postcode & category') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "preventSubmitUnlessValid() {\n }", "function validateForm() {\n isFormValid = true;\n\n validateName();\n validateEmail();\n validateDemand();\n validateOptions();\n\n if (isFormValid) {\n submit.disabled = false;\n } else {\n submit.disabled = true;\n\n }\n}", "function validateForm() {\n\n\tvar valid = true;\n\n\tif (!validateField(\"firstname\"))\n\t\tvalid = false;\n\n\tif (!validateField(\"lastname\"))\n\t\tvalid = false;\n\n\tif (!checkPasswords())\n\t\tvalid = false;\n\n\tif (!checkEmail())\n\t\tvalid = false;\n\n\tif (valid)\n\t\tsubmitForm();\n\n\t// Return false to make sure the HTML doesn't try submitting anything.\n\t// Submission should happen via javascript.\n\treturn false;\n}", "validate_form() {\n\t\tif (this.email_ok && this.email_match_ok && this.username_ok && this.login_ok && this.new_password_match_ok && this.required_ok) {\n\t\t\tthis.submit.classList.remove(\"disabled\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tthis.submit.classList.add(\"disabled\");\n\t\t\treturn true;\n\t\t}\n\t}", "function checkValidity() {\r\n if (test_pass_bis && test_pass) $(\"#submit\").attr(\"disabled\", false);\r\n else $(\"#submit\").attr(\"disabled\", true);\r\n }", "canSubmit() {\n return (\n this.validateOnlyLetterInput(this.state.name)==='' &&\n this.validateTelephone(this.state.telephone)==='' &&\n this.validateAddress(this.state.address)==='' &&\n this.validatePostalCode(this.state.postalCode)==='' &&\n this.validateOnlyLetterInput(this.state.city)===''\n );\n }", "function checkForm(){\n //if all outcomes are true, this means all inputs have correct data\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){ //if all inputs filled correctly, allow user to send form\n btn.disabled = false; //enable submit btn\n }else{\n btn.disabled = true;\n }\n }", "function data_valid() {\n\tif (passName === true && passPrivilege === true) {\n\t\tsubmit.disabled = false;\n\t} else {\n\t\tsubmit.disabled = true;\n\t}\n}", "function validateForm() {\n return true;\n}", "function checkValidity(){\r\n if(test_pass && test_email && test_pass_bis) $(\"#submit\").attr(\"disabled\",false);\r\n else $(\"#submit\").attr(\"disabled\",true)\r\n}", "function validateForm() {\n\t\tvar fieldsWithIllegalValues = $('.illegalValue');\n\t\tif (fieldsWithIllegalValues.length > 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tkenyaui.clearFormErrors('htmlform');\n\n\t\tvar ary = $(\".autoCompleteHidden\");\n\t\t$.each(ary, function(index, value) {\n\t\t\tif (value.value == \"ERROR\"){\n\t\t\t\tvar id = value.id;\n\t\t\t\tid = id.substring(0, id.length - 4);\n\t\t\t\t$(\"#\" + id).focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\n\t\tvar hasBeforeSubmitErrors = false;\n\n\t\tfor (var i = 0; i < beforeSubmit.length; i++){\n\t\t\tif (beforeSubmit[i]() === false) {\n\t\t\t\thasBeforeSubmitErrors = true;\n\t\t\t}\n\t\t}\n\n\t\treturn !hasBeforeSubmitErrors;\n\t}", "function checkForm(){\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){\n btn.disabled = false; //enable submit btn if form filled correctly\n }else{\n btn.disabled = true;\n }\n }", "function verifyForm(form) {\n\tif (!requestValidation(form)) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function validateInput() {\n if (!keyCodeValid || !accountCodeValid || ($(\"#keyCodeCP\").val() == \"\" && isAcctAllEmpty()) ||\n $(\"#desc\").val() == \"\" || $(\"#instruct\").val() == \"\" || $(\"#instruct\").val().length > 65535) {\n $(\"#submitCP\").button(\"option\", \"disabled\", true);\n } else {\n $(\"#submitCP\").button(\"option\", \"disabled\", false);\n }\n }", "function validar(form){\r\n\t\r\n\tif (Spry.Widget.Form.validate(form) == false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\telse{\r\n\t\treturn true;\r\n\t}\r\n}", "function validar(form){\r\n\t\r\n\tif (Spry.Widget.Form.validate(form) == false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\telse{\r\n\t\treturn true;\r\n\t}\r\n}", "function ValidaForm() {\n if ($('#txtTitulo').val() == '') {\n showErrorMessage('El Título es obligatorio');\n return false;\n }\n if ($('#dpFechaEvento').val() == '') {\n showErrorMessage('La Fecha de publicación es obligatoria');\n return false;\n }\n if ($('#txtEstablecimiento').val() == '') {\n showErrorMessage('El Establecimiento es obligatorio');\n return false;\n }\n if ($('#txtDireccion').val() == '') {\n showErrorMessage('La Dirección es obligatoria');\n return false;\n }\n if ($('#txtPrecio').val() == '') {\n showErrorMessage('El Precio es obligatorio');\n return false;\n }\n return true;\n}", "validateForm() {\r\n if(this.getInputVal(this.inputBill) !== \"\" && \r\n this.getInputVal(this.inputPeople) !== \"\" &&\r\n (this.getInputVal(this.inputCustom) !== \"\" || \r\n this.percentageBtns.some(btn => btn.classList.contains(\"active\")))) \r\n {\r\n this.disableReset(false);\r\n return true;\r\n }\r\n else {\r\n this.disableReset(true);\r\n this.displayResult(\"__.__\", \"__.__\");\r\n return false;\r\n }\r\n }", "function validation(ev) {\n ev.preventDefault();\n\n if (\n inputName.value.length > 1 &&\n inputJob.value.length > 1 &&\n inputEmail.value.length > 1 &&\n inputPhone.value.length > 1 &&\n inputLinkedin.value.length > 1 &&\n inputGithub.value.length > 1\n ) {\n textShare.classList.remove('hidden');\n formButton.classList.add('disabled');\n formButton.classList.remove('share__content__button');\n // imgButton.classList.add('img-disabled');\n // imgButton.classList.remove('action__upload-btn');\n } else {\n alert('No has introducido ningún dato');\n }\n\n sendRequest(formData);\n}", "function verifyForm()\n{\n valid = true;\n validFields.forEach(function(element) { valid &= element });\n changeFormState(valid);\n}", "function isValidForm() {\n var mainTextValid = isValidRequiredTextAreaField(\"main_text\");\n var articleKeywordCategoryValid = isValidRequiredField(\"article_keyword_category\");\n var articleKeywordsValid = isValidRequiredKeywordsField(\"article_keywords\");\n var originalSourceURLValid = isValidUrlField(\"original_source_url\");\n return isValidPartialForm() && mainTextValid && articleKeywordCategoryValid && articleKeywordsValid && originalSourceURLValid;\n}", "function checkForm() {\n if (theForm.usernameValid && theForm.passwordValid) {\n document.getElementById(\"submitButton\").disabled = false;\n } else {\n document.getElementById(\"submitButton\").disabled = true;\n }\n}", "function validateForm(event)\n{\n\tevent.preventDefault();\n\n\t//save the selection of the form to a variable\n\tvar form = document.querySelector('form');\n\t//save the selection of the required fields to an array\n\tvar fields = form.querySelectorAll('.required');\n\n\t//set a default value that will be used in an if statement\n\tvar valid = true;\n\n\t//check each box that has the required tag\n\tfor(var i = 0; i < fields.length; i++)\n\t{\n\t\t//check that the field has a value\n\t\t//if it does not\n\t\tif(!fields[i].value)\n\t\t{\n\t\t\t//valid is false\n\t\t\tvalid = false;\n\t\t}\n\t}\n\n\t//if valid is true by the end\n\t//each box should have a value\n\tif(valid == true)\n\t{\n\t\t//remove our disabled class from the button\n\t\tbtn.removeAttribute('class');\n\t\t//set the disabled property to false\n\t\tbtn.disabled = false;\n\t}\n}", "function validateForm() {\n return fields.email.length > 0 && fields.password.length > 0;\n }", "validateForm() {\n\n const singer = this.shadowRoot.getElementById('singer');\n const song = this.shadowRoot.getElementById('song');\n const artist = this.shadowRoot.getElementById('artist');\n const link = this.shadowRoot.getElementById('link');\n\n if(singer && song && artist) {\n return (singer.value != '' && song.value != '' && artist.value != '');\n };\n\n return false;\n }", "function validateAndSubmit() {\r\n var isValid = false;\r\n isValid = validateForm();\r\n if (isValid == true) {\r\n disableButtons() // make sure you can only press the submit button once\r\n document.getElementById('evaluationForm').submit();\r\n }\r\n }", "function getFormIsValid() {\n return interactedWith && !getFieldErrorsString()\n }", "function valid_application_form(){\n\t// Verifies that the name is filled\n\tif(document.getElementById('name').value == \"\"){\n\t\talert('Veuillez saisir le nom.');\n\t\treturn false;\n\t}\n\t// Verifies that the description is filled\n\tif(document.getElementById('description').value == \"\"){\n\t\talert('Veuillez saisir la description.');\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkValidAuthenticationForm() {\n let isValid =\n AuthenticationFormError.length === 0 &&\n AuthenticationForm.elements[\"authentication-code\"].value !== \"\";\n\n if (isValid) {\n AuthenticationFormSubmitButton.style.cursor = \"pointer\";\n AuthenticationFormSubmitButton.style.opacity = \"1\";\n AuthenticationFormSubmitButton.disabled = false;\n } else {\n AuthenticationFormSubmitButton.style.cursor = \"not-allowed\";\n AuthenticationFormSubmitButton.style.opacity = \".3\";\n AuthenticationFormSubmitButton.disabled = true;\n }\n}", "function validateForm() {\n return email.length > 0 && password.length > 0;\n }", "function validateForm() {\n if (email.value && password.value) {\n fieldvalidate = true;\n } else {\n submit.disabled = true\n submit.classList.add('false');\n }\n}", "function validateForm()\n{\n return true;\n}", "function validateForm()\n{\n return true;\n}", "function blockInput() {\n var form = document.getElementById(\"form\");\n if (form != null) {\n var elements = form.elements;\n for (var i = 0, len = elements.length; i < len; ++i) {\n elements[i].disabled = true;\n }\n } else {\n var button = document.getElementById(\"register\");\n if (button != null) {\n button.disabled = true;\n }\n }\n}", "function validateForm() {\n return username.length > 0 && password.length > 0;\n }", "validateForm() {\n return (this.validatePrices()\n && this.validateName() === 'success'\n && this.state.hash !== \"\"\n && this.state.ipfsLocation !== \"\"\n && this.state.fileState === FileStates.ENCRYPTED)\n }", "function isValidForm(){\n\n if(newCatNameField.value.length > 0 && checkDuplicateName(newCatNameField.value) &&\n newCatLimitField.validity.valid && newCatLimitField.value.length > 0){\n createButton.classList.remove('mdl-button--disabled');\n }\n else {\n createButton.classList.add('mdl-button--disabled');\n }\n }", "function validateForm(event){\n event.preventDefault();\n let valid = false;\n\n let confirm = contactForm.querySelector('.confirm');\n if(confirm){\n confirm.parentNode.removeChild(confirm);\n }\n\n //allow submit\n let alertText = contactForm.querySelector('p');\n if (name.validity.valid === true){\n if (email.validity.valid === true){\n if(message.validity.valid === true){\n valid = true;\n }\n }\n }\n\n if(valid){\n contactSubmit.classList.remove(\"disabled\");\n let alert = contactForm.querySelector('.alert');\n if(alert){\n alert.parentNode.removeChild(alert);\n\n }\n }\n\n return valid;\n }", "function validate_form(e) {\n var username = document.getElementById(\"username\").value;\n var password = document.getElementById(\"password\").value;\n if(username.trim() == ''){\n e.preventDefault();\n markAsError(\"username\", true);\n }\n else{\n markAsError(\"username\", false);\n }\n if(password.trim() == ''){\n e.preventDefault();\n markAsError(\"password\", true); \n }\n else{\n markAsError(\"password\", false);\n }\n}", "function validateForm() {\n return username.length > 0 && password.length > 0;\n }", "function validar_add_entregable(){\n\tif(document.getElementById('sel_etapa').value=='-1'){\n\t\tmostrarDiv('error_especie');\n\t\treturn false;\n\t}\n\tif(document.getElementById('txt_entregable').value==''){\n\t\tmostrarDiv('error_entregable');\t\n\t\treturn false;\n\t}\n\tdocument.getElementById('frm_add_entregable').action='?mod=entregables&task=saveAdd';\n\tdocument.getElementById('frm_add_entregable').submit();\n}", "function validateForm() {\r\n let regex = /^\\d*\\.?\\d*$/;\r\n if (\r\n regex.test(people.value) === false ||\r\n regex.test(priceB4Tip.value) === false ||\r\n regex.test(tipChoice.value) === false\r\n ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function checkRequiredFields(){\n\tvar enable = true;\n\tjQuery(':input[required]').each(function(){\n\t\tvar s = jQuery(this).val();\n\t\tif(s == null || s.trim().length == 0){\n\t\t\treturn enable = false;\n\t\t}\n\t});\n\n\tif(typeof sforce != 'undefined'){\n\t\tSfdc.canvas.publisher.publish({name:'publisher.setValidForSubmit', payload: enable});\n\t} else {\n\t\tif(enable){\n\t\t\tjQuery('#submit').removeClass('ui-state-disabled');\n\t\t} else {\n\t\t\tjQuery('#submit').addClass('ui-state-disabled');\n\t\t}\n\t}\n}", "function verifForm() {\n if(document.getElementById(\"prenom\").value != \"\" && \n document.getElementById(\"nom\").value!= \"\" && \n document.getElementById(\"adresse\").value != \"\" && \n document.getElementById(\"ville\").value != \"\" &&\n document.getElementById(\"email\").value != \"\") {\n document.getElementById(\"confirmCommand\").disabled=false;\n } else {\n document.getElementById(\"confirmCommand\").disabled=true;\n }\n}", "function isECourseFormValid(){\r\n return( CourseNameField.isValid() && CourseDaysField.isValid());\r\n }", "function validForm(event) {\n if (firstValid() && lastValid() && emailValid() && msgValid()) {\n modalFormBg.style.display = \"none\";\n event.preventDefault();\n console.log('Prénom: ' + firstName.value);\n console.log('Nom: ' + lastName.value);\n console.log('Email: ' + email.value);\n document.getElementById('form').reset();\n return true;\n } else {\n event.preventDefault();\n return false;\n }\n}", "validateForm() {\r\n\t\treturn this.state.email.length > 0 && this.state.password.length > 0;\r\n\t}", "function isAddFormValid(){\r\n return( FNameField.isValid() && LNameField.isValid() && TitleField.isValid()&& AddField.isValid() && MailField.isValid() && TelephoneField.isValid() && MobileField.isValid());\r\n }", "function validateForm(form) {\n if (form === \"signup\") {\n if (document.getElementById(\"signup_email\").value === \"\" ||\n document.getElementById(\"signup_password\").value === \"\" ||\n document.getElementById(\"signup_client_id\").value === \"\" ||\n document.getElementById(\"signup_client_secret\").value === \"\") {\n alert(\"please fill out all the fields in the form\");\n return false;\n } else {\n return true;\n }\n }\n\n else {\n return false;\n }\n}", "function formIsValid() {\n if (total_loan_box.value === \"\" || isNaN(total_loan_box.value)) {\n speakToUser(\"You must enter a valid decimal number for the <strong>Total Loan Amount</strong>.\");\n focusOnBox(\"total_loan\");\n return false;\n }\n\n if (interest_rate_box.value === \"\" || isNaN(interest_rate_box.value)) {\n speakToUser(\"You must enter a valid decimal number for the <strong>Yearly Interest Rate</strong>.\");\n focusOnBox(\"interest_rate\");\n return false;\n }\n\n if (loan_term_box.value === \"\" || isNaN(loan_term_box.value)) {\n speakToUser(\"You must enter a valid number of years for the <strong>Loan Term</strong>.\");\n focusOnBox(\"loan_term\");\n return false;\n }\n\n return true;\n}", "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 return (true);\n }", "validateForm() {\n return this.validateEmail() === 'success'\n && this.validateEmails() === 'success'\n && this.selectedPatent !== null;\n }", "function checkSubmitButton() {\n if ($('#over18').val() && $('#privacy').val() && $('#name').val() && $('#email').val()) {\n $('#submit').removeAttr('disabled')\n } else {\n $('#submit').attr('disabled', 'disabled')\n }\n}", "function checkForm() {\n var value;\n\n value = document.getElementById(\"ChatLauncherNombre\").value;\n if (value === '') {\n\tdocument.getElementById(\"ChatLauncherStartButton\").disabled = true;\n\treturn;\n }\n \n value = document.getElementById(\"ChatLauncherTelefono\").value;\n if (value === '') {\n\tdocument.getElementById(\"ChatLauncherStartButton\").disabled = true;\n\treturn;\n } \n\n value = document.getElementById(\"ChatLauncherTopicID\").value;\n if (value === '') {\n\tdocument.getElementById(\"ChatLauncherStartButton\").disabled = true;\n\treturn;\n }\n\n \n document.getElementById(\"ChatLauncherStartButton\").disabled = false;\n}", "function formIsValid() {\n\tvar lolUsernameVal = $('#lolUsername').val()\n\tvar lolPasswordVal = $('#lolPassword').val()\n\tvar lolIgnVal = $('#lolIgn').val()\n\n\tconst visibleCategoryId = $('.category-div:visible').attr('id')\n\tif (visibleCategoryId && visibleCategoryId.indexOf('solo') > -1) {\n\t\tvar itemsToCheck = [\n\t\t\tlolUsernameVal,\n\t\t\tlolPasswordVal,\n\t\t\tlolIgnVal\n\t\t\t//boostOrder.roles\n\t\t]\n\t} else {\n\t\tvar itemsToCheck = [lolIgnVal]\n\t}\n\n\tvar isValid = true\n\titemsToCheck.forEach(function(inputVal) {\n\t\tif (\n\t\t\t!inputVal ||\n\t\t\tinputVal == '' ||\n\t\t\tinputVal.length <= 0 ||\n\t\t\tboostOrder.price <= 0\n\t\t) {\n\t\t\tisValid = false\n\t\t}\n\t})\n\n\treturn isValid\n}", "function enabledisablesubmit() {\n if (firstnameinput.value && lastnameinput.value && ageinput.value) {\n if (parseInt(ageinput.value) >= 18 && licenseinput.value) {\n submit.disabled = false;\n } else if (parseInt(ageinput.value) < 18 && !licenseinput.value) {\n submit.disabled = false;\n } else {\n submit.disabled = true;\n }\n } else {\n submit.disabled = true;\n }\n}", "function validate(e){\n\thideErrors();\n\n\tif(formHasErrors()){\n\t\te.preventDefault();\n\n\t\treturn false;\n\t}\n\treturn true;\n}", "function validateForm() {\n return name.length > 0 && phone.length > 0;\n }", "function notValid() {\n if (isValidName() && isValidEmail() && isValidTShirt() && isValidShops()) {\n return false;\n }\n if (jobSelector.value === 'other' && isValidTitle()) {\n return false;\n }\n if (paymentSelector.selectedIndex === 1 && isValidCC() && isValidZip() && isValidCVV()) {\n return false;\n }\n return true;\n}", "function validateForm() {\r\n return validatePassword() && validateState();\r\n}", "function possiblePreventSubmit (event) {\n if (configuration.preventSubmit && !areAll(nod.constants.VALID)) {\n event.preventDefault();\n\n // Show errors to the user\n checkers.forEach(function (checker) {\n checker.performCheck({\n event: event\n });\n });\n\n // Focus on the first invalid element\n for (var i = 0, len = checkHandlers.length; i < len; i++) {\n var checkHandler = checkHandlers[i];\n\n if (checkHandler.getStatus().status === nod.constants.INVALID) {\n checkHandler.element.focus();\n break;\n }\n }\n }\n }", "function validateForm() {\r\n\tif((validateUsername()) && (validatePass()) && (validateRepPass()) && (validateAddress1())&& (validateAddress2()) && (validateZipCode() == true) && (validateCity()) && (validateLast()) && (validateFirst())&& (validatePhone()) && (validateEmail())) \r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n}", "function Validate() {\n var correctForm = true;\n \n if (document.getElementById(\"Name\").value == \"\") {\n \n correctForm = false;\n }\n \n \n if (document.getElementById(\"Email\").value == \"\") {\n \n correctForm = false;\n }\n \n \n if (document.getElementById(\"PhoneNumber\").value == \"\") {\n \n correctForm = false;\n }\n \n if (correctForm == false) {\n \n $(\"#EditBtn\").prop('disabled', true);\n \n\n }\n else {\n $(\"#EditBtn\").prop('disabled', false);\n \n }\n}", "function validate_form(){\n if (is_form_valid(form)) {\n sendForm()\n }else {\n let $el = form.find(\".input:invalid\").first().parent()\n focus_step($el)\n }\n }", "function validarFiltroDepositosFideicomiso(form) {\r\n\tvar periodo = document.getElementById(\"fperiodo\").value;\r\n\tif (periodo == \"\") { alert(\"¡DEBE SELECCIONAR EL PERIODO!\"); return false; }\r\n\telse return true;\r\n}", "function securityValidation(){\n\t\n\tvar security = document.getElementById(\"security\");\n\tif(security.value ===\"\")\n\t{\n\t\tdocument.getElementById(\"security_error\").innerHTML=\"**Please select a security question.\";\n\t\treturn false;\n\t\t\n\t}\n\telse{\n\t\t\n\t\tdocument.getElementById(\"security_error\").innerHTML=\"\";\n\treturn true;\n\t\t\n\t}\n\t\n\t\n}", "function canSubmitForm()\n{\n return !isOriginDecodePending && !isDestinationDecodePending && !isDirectionsPending;\n}", "function validateForm() {\n return (hash.length > 0);\n }", "function validateForm() {\n let userName = document.forms[\"contact-form\"][\"user_name\"].value;\n let userEmail = document.forms[\"contact-form\"][\"user_email\"].value;\n let userMessage = document.forms[\"contact-form\"][\"user_message\"].value;\n\n if (userName === \"\" || userEmail === \"\" || userMessage === \"\") {\n alert(\"Please complete all section of the form.\");\n return false;\n } else {\n alert(\"Thank you. Your message has been sent and we will be in touch as soon as possible\");\n return true;\n }\n }", "function validateFormNoPref(requiredFields)\n{\n\tvar noBadField = true;\n\tfor(var i = 0; i < requiredFields.length; i++)\n\t{\t\t\n\t\tvar field = requiredFields[i];\n\t\t\n\t\tif(isEmpty(field))\n\t\t{\t\t\t\n\t\t\tmarkBadField(field);\n\t\t\tnoBadField = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmarkGoodField(field);\n\t\t}\t\t\t\t\n\t}\n\t\n\t\n\t\n\tif(isEmailRequired())\n\t{\n\t\tvar field = EMAIL_FIELD_NAME;\n\t\tif(isEmpty(field))\n\t\t{\t\t\t\n\t\t\tmarkBadField(field);\n\t\t\tnoBadField = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmarkGoodField(field);\n\t\t}\t\t\n\t}\n\t\n\tif(!noBadField)\n\t{\n\t\thandleErrorDiv(REQ_STRING);\n\t}\n\treturn noBadField;\n}", "function checkForm(){\n\n\tif ((verifyElementWithId(\"name\"))\n\t\t&& (verifyElementWithId(\"name1\"))\n\t\t&& (verifyElementWithId(\"name2\"))\n\n\t\t&& (verifyElementWithId(\"way\"))\n\t\t&& (verifyElementWithId(\"textaddress\"))\n\t\t&& (verifyElementWithId(\"textaddressnumber\"))\n\t\t&& (verifyElementWithId(\"textpostalcode\"))\n\t\t&& (verifyElementWithId(\"city\"))\n\n\t\t&& (verifyElementWithId(\"emailbox\"))\n\t\t&& (verifyElementWithId(\"passwordbox\"))\n\t\t&& (verifyElementWithId(\"passwordrepeatbox\"))\n\n\t\t&& (verifyCheckBoxWithId(\"acceptconditions\"))\n\t\t&& (document.getElementById(\"passwordbox\").value == document.getElementById(\"passwordrepeatbox\").value)) {\n\n\t\talert(\"Su registro se ha enviado con éxito.\");\n\t\treturn true;\n\n\t} else {\n\n\t\treturn false;\n\t}\n\n}", "validateForm() {\n if (!this.event.title) {\n this.formWarning = 'Please enter a title';\n }\n if (!this.event.startTime) {\n this.formWarning = 'Please enter a start time';\n return false;\n }\n if (!this.event.endTime) {\n this.formWarning = 'Please enter an end time';\n return false;\n }\n return true;\n }", "function todoListoParaModi(){\r\n if (($(\"#modiID\").isValid()==true) &&\r\n ($(\"#modiApellidoDr\").checkValidity()==true) &&\r\n ($(\"#modiMatriculaDr\").checkValidity()==true) &&\r\n ($(\"#modiEspecialidad\").checkValidity()==true) &&\r\n ($(\"#modiApellidoPaciente\").checkValidity()==true) &&\r\n ($(\"#modiFechaTurno\").checkValidity()==true) ){\r\n \r\n $(\"#modiValidar\").attr(\"disabled\",false);\r\n }else{\r\n $(\"#modiValidar\").attr(\"disabled\",true);\r\n \r\n }\r\n}", "function validateForm(value) {\n\t\t\tif (status !== \"\") {\n\t\t\t\t// Reset status on input change\n\t\t\t\t$$invalidate(3, status = \"\");\n\t\t\t}\n\n\t\t\treturn validateProvider(value) !== null;\n\t\t}", "function validateRequiredFieldForEdit(){\n\t\t\n//\t\tvar password= $(\"#editUserDialog\").find(\"#txtPassword\").val();\n//\t\tif(password.trim() === '' || password == null)\n//\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "function validateForm() {\n\n if(validPass(passCheck) && validRPass(rPassCheck)){\n return true;\n }else{\n return false;\n }\n }", "assertNoSensitiveFields_() {\n const fields = this.form_.querySelectorAll(\n 'input[type=password],input[type=file]'\n );\n userAssert(\n fields.length == 0,\n 'input[type=password] or input[type=file] ' +\n 'may only appear in form[method=post]'\n );\n }", "function isCourseFormValid(){\r\n return(CAddField.isValid() && CMailField.isValid() && CTitleField.isValid()&& CLNameField.isValid() && CFNameField.isValid() && CTelephoneField.isValid() && CMobileField.isValid());\r\n }", "function isValidFormSubmission(){\n const nameTrueOrFalse = isValidName($('#name').val());\n const emailTrueOrFalse = isValidEmail($('#mail').val());\n const activityFieldTrueOrFalse = isValidActivitiesRegistrationField($('fieldset.activities'));\n \n if ($('#payment').val() === 'Credit Card'){\n const cardNumberTrueOrFalse = isValidCardNumber($('#cc-num').val());\n const zipCodeTrueOrFalse = isValidZipCode($('#zip').val());\n const cvvTrueOrFalse = isValidCVV($('#cvv').val());\n \n return nameTrueOrFalse && \n emailTrueOrFalse && \n cardNumberTrueOrFalse &&\n zipCodeTrueOrFalse && cvvTrueOrFalse && \n activityFieldTrueOrFalse;\n }\n return nameTrueOrFalse && emailTrueOrFalse && activityFieldTrueOrFalse;\n}", "function validateForm () {\n const nameFieldDom = document.getElementById('name');\n const textFieldDom = document.getElementById('message');\n const checkboxDom = document.getElementById('isAttending');\n // console.log('Data within these fields is: ', nameFieldDom.value, textFieldDom.value);\n if (\n nameFieldDom.value.trim() == '' || \n textFieldDom.value.trim() == '' || \n textFieldDom.value.length <= 3 || \n nameFieldDom.value.length < 3\n ) return true;\n else return false;\n }", "function validateForm(){\n // Set error catcher\n var error = 0;\n // Check name\n if(!validateName('reg_name')){\n document.getElementById('nameError').style.display = \"block\";\n error++;\n }\n // Validate email\n var x =document.getElementById('reg_email').value;\n if(!validateEmail(x)){\n document.getElementById('emailError').style.display = \"block\";\n error++;\n }\n // Validate animal dropdown box\n if(!validateSelect('Occupation')){\n document.getElementById('animalError').style.display = \"block\";\n error++;\n }\n if(!validatePassword('reg_pass')){\n document.getElementById('pass_Error').style.display = \"block\";\n error++;\n }\n // Don't submit form if there are errors\n if(error > 0){\n return false;\n }\n else if(error == 0){\n regfun();\n }\n }", "function isFormValid() {\n let result;\n result = isValidName($('#name').val());\n result = isValidEmail($('#mail').val()) && result;\n result = isActivityCheck() && result;\n result = isValidCcNumber($('#cc-num').val()) && result;\n result = isValidZipCode($('#zip').val()) && result;\n result = isValidCvv($('#cvv').val()) && result;\n return result;\n}", "function verify_inputs(){\n if(document.getElementById(\"Split_By\").value == ''){\n return false;\n }\n if(document.getElementById(\"Strength\").value == ''){\n return false;\n }\n if(document.getElementById(\"Venue\").value == ''){\n return false;\n }\n if(document.getElementById(\"season_type\").value == ''){\n return false;\n }\n if(document.getElementById(\"adjustmentButton\").value == ''){\n return false;\n }\n\n return true\n }", "function isValidPartialForm() {\n var authorNicknameValid = isValidRequiredField(\"author_nickname\");\n var titleValid = isValidRequiredField(\"title\");\n var headerTextValid = isValidRequiredField(\"header_text\");\n return authorNicknameValid && titleValid && headerTextValid;\n}", "function validar(e){\r\n borrarError();\r\n if(validaEdad && validaTelefono && ValidaNombre && confirm(\"pulsar aceptar si deseas enviar este formulario\")){\r\n return true;\r\n }else {\r\n e.preventDefault();\r\n return false;\r\n }\r\n}", "function validarFormulario(){\n var txtNombre = document.getElementById('provNombre').value;\n var txtRut = document.getElementById('provRut').value;\n //Test campo obligatorio\n if(txtNombre == null || txtNombre.length == 0 || /^\\s+$/.test(txtNombre)){\n alert('ERROR: El campo nombre no debe ir vacío o con espacios en blanco');\n document.getElementById('provNombre').focus();\n return false;\n }\n if(txtRut == null || txtRut.length == 0 || /^\\s+$/.test(txtRut)){\n alert('ERROR: El campo Rut no debe ir vacío o con espacios en blanco');\n document.getElementById('provRut').focus();\n return false;\n } \n return true;\n }", "formValid() {\n var valid = true;\n var required = this.$form.find(':input[required]');\n\n $.each(required, function(index, el) {\n var value = $(el).val();\n\n if (!value || value == '') {\n valid = false;\n }\n });\n\n return valid;\n }", "function todoListoParaAlta(){\r\n if (($(\"#altaID\").isValid()==true) &&\r\n ($(\"#altaApellidoDr\").isValid()==true) &&\r\n ($(\"#altaMatriculaDr\").isValid()==true) &&\r\n ($(\"#altaEspecialidad\").isValid()==true) &&\r\n ($(\"#altaApellidoPaciente\").isValid()==true) &&\r\n ($(\"#altaFechaTurno\").isValid()==true) ){\r\n \r\n $(\"#altaValidar\").attr(\"disabled\",false);\r\n }else{\r\n $(\"#altaValidar\").attr(\"disabled\",true);\r\n }\r\n}", "function enableSubmitButton() {\n show(\"validate\");\n hide(\"formIsUnvalide\");\n}", "function checkonsubmit(){\n for(j=0;j<=26;j++)\n {\n \n if(reqerror[j]===1)\n {\n missreq(j); \n return false; \n } \n \n }\n \n if(isvalid)\n return false;\n \n return true;\n \n }", "function validateForm() {\n let x = document.forms[\"myForm\"][\"fname\"].value;\n if (x == \"\") {\n alert(\"Name must be filled out\");\n return false;\n }\n}", "function invalidFormInput() {\n return (modalTransfer.form.cusipTr === undefined);\n }", "function validateAddOpForm() {\n // Check inputs\n return pageDialog.amount.value.length > 0 && pageDialog.desc.value.length > 0\n }", "function validateForm() {\r\n var newTitle = document.forms[\"validForm\"][\"btitle\"].value;\r\n var newOwner = document.forms[\"validForm\"][\"bowner\"].value;\r\n var newContent = document.forms[\"validForm\"][\"bcontent\"].value;\r\n var newPublisher = document.forms[\"validForm\"][\"bpublisher\"].value;\r\n if (newTitle == \"\") {\r\n alert(\"Title must be filled out\");\r\n return false;\r\n } else if (newOwner == \"\") {\r\n alert(\"Name Must be filled out\");\r\n return false;\r\n } else if (newContent == \"\") {\r\n alert(\"Content Must be filled out\");\r\n return false;\r\n } else if (newPublisher == \"\") {\r\n alert(\"Publisher Name Must be filled out\");\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function submitForm (isValid){\n // check to make sure the form is completely valid\n if (isValid) {\n alert('our form is valid');\n }\n else\n alert('our form is invalid');\n }", "function checkFormInput( f )\n{\n var v = false;\n\n for( var i = 0; i < f.length; i++ )\n {\n var e = f.elements[i];\n\n if((e.type == \"text\") || ( e.type == \"textarea\" ))\n {\n if( e.value.match( /\\S+/ ))\n {\n v = true;\n }\n else if( e.required )\n {\n return false;\n }\n }\n }\n\n return v;\n}", "function submitForm(e) {\n const userDate = username.value.trim();\n const mailData = mail.value.trim();\n const passData = pass.value.trim();\n\n if (userDate === \"\") {\n inputChecker(username, \"enter you user name\", 1500);\n }\n if (mailData === \"\") {\n inputChecker(mail, \"enter you mail address\", 1500);\n }\n if (passData === \"\") {\n inputChecker(pass, \"enter you passeord\", 1500);\n }\n}", "validateForm() {\n return this.state.signature !== \"\" && this.state.hash !== \"\"\n }", "function registrationSubmit(){\r\n\r\n\tif (validateRegistrationName()&&validateEmail()&&validatePhone()&&validateDate()&&validateVisa()&&validatePass()) {\r\n\r\n\t\talert(\"validation sucessful \");\r\n\t\treturn true;\r\n\r\n\t}\r\n\talert(\"validation unsucessful\");\r\n\treturn false;\r\n}", "function validate(e) {\r\n\tif(formHasErrors())\r\n\t{\r\n\t\te.preventDefault();\r\n\t}\r\n}", "function validate(e) {\n let id = e.attributes[\"id\"].nodeValue;\n let sb = document.getElementById(\"submitButton\");\n\n if (id == \"userName\") {\n userNameError.innerText = isValid(e.value, 0);\n //console.log(e.value);\n }\n if (id == \"password\") {\n passwordError.innerText = isValid(e.value, 1);\n //console.log(e.value);\n }\n if (uFlag && pFlag) {\n sb.disabled = false;\n } else {\n sb.disabled = true;\n }\n}" ]
[ "0.7320016", "0.6967807", "0.68231094", "0.67942876", "0.67665464", "0.67456996", "0.66651106", "0.66377074", "0.6615927", "0.66136545", "0.6575135", "0.65385044", "0.6482504", "0.64814436", "0.64771837", "0.64771837", "0.64767236", "0.6468344", "0.6438692", "0.6426258", "0.6419609", "0.6375909", "0.63657284", "0.6343888", "0.6334314", "0.63319397", "0.63277304", "0.63107187", "0.63072336", "0.6301679", "0.62964374", "0.62798214", "0.62798214", "0.62743694", "0.6271505", "0.62357086", "0.62266237", "0.622503", "0.62219363", "0.62122476", "0.62112546", "0.62031835", "0.61914593", "0.6188308", "0.61861026", "0.61755526", "0.61754143", "0.61712927", "0.61646146", "0.6156885", "0.6156611", "0.6155085", "0.6153031", "0.61509913", "0.61497027", "0.6124502", "0.6124082", "0.61206937", "0.61077815", "0.61001456", "0.6098754", "0.6092635", "0.60924643", "0.6090269", "0.6078752", "0.607729", "0.60708296", "0.6065946", "0.6044384", "0.60441023", "0.6041999", "0.6041874", "0.6038828", "0.6038628", "0.603678", "0.6036571", "0.6033415", "0.60248965", "0.6024536", "0.60175014", "0.601259", "0.60098916", "0.6008994", "0.60002285", "0.59982425", "0.5995497", "0.5994109", "0.5994054", "0.5992384", "0.59899193", "0.5978132", "0.59689534", "0.59678835", "0.5967611", "0.59641594", "0.596067", "0.5959585", "0.5959516", "0.5956074", "0.5955936", "0.59537864" ]
0.0
-1
Set ID (This is not UUID and referenceID). _id(getter/setter) is only used by TomlToolsaveToml().
set _id(value) { this.__id = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set id(newId) {\n this._id = newId;\n }", "set id(id) {\n idMap.set(this, id);\n }", "set id(val) {\n WBORecord.prototype.__lookupSetter__(\"id\").call(this, val);\n return this.cleartext.id = val;\n }", "set id(val) {\n if (this._id) {\n throw new Error(`Can't change id!`);\n }\n this._id = val;\n }", "set id(val) {\n if (this._id) {\n throw new Error(`Can't change id!`);\n }\n this._id = val;\n }", "set id (value) {\n this._id = value; // will be set to new value once invoked below with drone.id = 'B456';\n }", "function setId(id) {\n\t\tthis.id = id;\n\t}", "set id(id) {\n this._id = id;\n }", "set Id(value)\n {\n this.id = value;\n }", "updateId(id) {\n this._id = id;\n }", "setId(id){\n this.id=id;\n }", "function setid(v){\n id = v;\n}", "setID(id = false) {\n if (id) {\n // user input ID\n this.id = id + 1;\n return id;\n } else {\n // system generated ID\n const currentID = this.id;\n this.id++;\n return currentID;\n }\n }", "set id(id) {\n if (this.#el) this.#el.id = id;\n else this.#id = id;\n }", "setId(id) {\n this.id = id;\n return this;\n }", "get id() {\n if (!this._id) {\n this._id = Util.GUID();\n }\n return this._id;\n }", "set id(id){\n const ID_REGEX = /^[1-9]+[0-9]*/\n if(ID_REGEX.test(id)){\n this._id = id\n return;\n }\n else\n throw \"Invalid employeeId\"\n }", "createId () {\n\t\tthis.attributes.id = this.useId || this.collection.createId();\n\t}", "get id() {\n return this._id;\n }", "get id() {\n return this._id;\n }", "get id() {\n return this._id;\n }", "get id() {\n return this._id;\n }", "id(id) {\n // generate new id if no id set\n if (typeof id === 'undefined' && !this.node.id) {\n this.node.id = eid(this.type);\n } // dont't set directly width this.node.id to make `null` work correctly\n\n\n return this.attr('id', id);\n }", "get id() { return this._id; }", "get id() { return this._id; }", "get id() { return this._id; }", "get id () {\n return this._id;\n }", "get id() {\n\t\treturn this.__id;\n\t}", "set id(id) {\n this.root_.id = id;\n }", "function setId( RT, docPath, theElement ) {\n // makes an id out of the docPath and assigns it to the theElement iif it\n // does not have already an id (theElement is always a header)\n var theId = null;\n // check if the element already has an id\n if( !! theElement.id ) {\n theId = theElement.id;\n } else {\n // no id: provide one made after its docPath by prepending \"RT-\" and \n // replacing the toString commas by \"-\", use the first 7 items\n // TODO: should make the id out of the header text better than the docPath (a slug)\n // TODO: must check for uniqueness\n theId = 'RT-' + docPath.slice(0, 7).toString().replace(/,/g, '-');\n theElement.id = theId;\n }\n // store the id in the headersId map indexed by the 1st 7 docPath elements\n RT.data.headerId[docPath.slice(0, 7).toString()] = { id: theId };\n return theId;\n }", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function _fnSetRowIDInAttribute(row, id) {\n row.attr(\"id\", id);\n }", "get id(){\n let id = this.data.id;\n if (id === undefined){\n id = this._id = (this._id || ++idCounter);\n }\n return id;\n }", "get id() {\n return new ElementAttribute(this.get(0), \"id\");\n }", "get id() {\n return new ElementAttribute(this.get(0), \"id\");\n }", "function setRecipeID(id) {\r\n setID(id);\r\n }", "get id() {\n console.log('in id getter');\n return this._id + 'TEMPORARY';\n }", "get id() {\n return this._data.id;\n }", "get id() {\n return this._data.id;\n }", "get _id() {\n return this.__id;\n }", "constructor () {\n this._id = getUniqueId();\n }", "function setPortId(id) {\n\t\tthis.id = PORT + id + this.ne.id;\n\t}", "constructor( id ) {\n this.#id = id;\n }", "get id() {\n return this.id\n }", "get id() {\n return this._data._id;\n }", "get id() {\n return this.getAttributeValue(\"id\");\n }", "function assignId(req, res, next) {\n req.id = uuid.v4();\n next();\n}", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }" ]
[ "0.76849127", "0.7471364", "0.74624246", "0.7422186", "0.7422186", "0.7387025", "0.7381058", "0.73128563", "0.72201145", "0.70381755", "0.6826656", "0.68070596", "0.6764782", "0.6601154", "0.6582511", "0.6549231", "0.65355337", "0.63716114", "0.63267523", "0.6324163", "0.6324163", "0.6324163", "0.62688404", "0.62458456", "0.62458456", "0.62458456", "0.6225756", "0.62233853", "0.61226124", "0.61036277", "0.6089575", "0.6089575", "0.6089575", "0.6089575", "0.6089575", "0.60773724", "0.6052096", "0.5983117", "0.5983117", "0.59660274", "0.59645075", "0.59522486", "0.59522486", "0.59202033", "0.5899318", "0.58938944", "0.58510697", "0.5798712", "0.5797749", "0.57737505", "0.577061", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307", "0.57683307" ]
0.81020015
0
Set ID (This is not UUID and referenceID). _id(getter/setter) is only used by TomlToolsaveToml().
get _id() { return this.__id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set _id(value) {\n this.__id = value;\n }", "set id(newId) {\n this._id = newId;\n }", "set id(id) {\n idMap.set(this, id);\n }", "set id(val) {\n WBORecord.prototype.__lookupSetter__(\"id\").call(this, val);\n return this.cleartext.id = val;\n }", "set id(val) {\n if (this._id) {\n throw new Error(`Can't change id!`);\n }\n this._id = val;\n }", "set id(val) {\n if (this._id) {\n throw new Error(`Can't change id!`);\n }\n this._id = val;\n }", "set id (value) {\n this._id = value; // will be set to new value once invoked below with drone.id = 'B456';\n }", "function setId(id) {\n\t\tthis.id = id;\n\t}", "set id(id) {\n this._id = id;\n }", "set Id(value)\n {\n this.id = value;\n }", "updateId(id) {\n this._id = id;\n }", "setId(id){\n this.id=id;\n }", "function setid(v){\n id = v;\n}", "setID(id = false) {\n if (id) {\n // user input ID\n this.id = id + 1;\n return id;\n } else {\n // system generated ID\n const currentID = this.id;\n this.id++;\n return currentID;\n }\n }", "set id(id) {\n if (this.#el) this.#el.id = id;\n else this.#id = id;\n }", "setId(id) {\n this.id = id;\n return this;\n }", "get id() {\n if (!this._id) {\n this._id = Util.GUID();\n }\n return this._id;\n }", "set id(id){\n const ID_REGEX = /^[1-9]+[0-9]*/\n if(ID_REGEX.test(id)){\n this._id = id\n return;\n }\n else\n throw \"Invalid employeeId\"\n }", "createId () {\n\t\tthis.attributes.id = this.useId || this.collection.createId();\n\t}", "get id() {\n return this._id;\n }", "get id() {\n return this._id;\n }", "get id() {\n return this._id;\n }", "get id() {\n return this._id;\n }", "id(id) {\n // generate new id if no id set\n if (typeof id === 'undefined' && !this.node.id) {\n this.node.id = eid(this.type);\n } // dont't set directly width this.node.id to make `null` work correctly\n\n\n return this.attr('id', id);\n }", "get id() { return this._id; }", "get id() { return this._id; }", "get id() { return this._id; }", "get id () {\n return this._id;\n }", "get id() {\n\t\treturn this.__id;\n\t}", "set id(id) {\n this.root_.id = id;\n }", "function setId( RT, docPath, theElement ) {\n // makes an id out of the docPath and assigns it to the theElement iif it\n // does not have already an id (theElement is always a header)\n var theId = null;\n // check if the element already has an id\n if( !! theElement.id ) {\n theId = theElement.id;\n } else {\n // no id: provide one made after its docPath by prepending \"RT-\" and \n // replacing the toString commas by \"-\", use the first 7 items\n // TODO: should make the id out of the header text better than the docPath (a slug)\n // TODO: must check for uniqueness\n theId = 'RT-' + docPath.slice(0, 7).toString().replace(/,/g, '-');\n theElement.id = theId;\n }\n // store the id in the headersId map indexed by the 1st 7 docPath elements\n RT.data.headerId[docPath.slice(0, 7).toString()] = { id: theId };\n return theId;\n }", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function idGetter() {\n if (this._id != null) {\n return String(this._id);\n }\n\n return null;\n}", "function _fnSetRowIDInAttribute(row, id) {\n row.attr(\"id\", id);\n }", "get id(){\n let id = this.data.id;\n if (id === undefined){\n id = this._id = (this._id || ++idCounter);\n }\n return id;\n }", "get id() {\n return new ElementAttribute(this.get(0), \"id\");\n }", "get id() {\n return new ElementAttribute(this.get(0), \"id\");\n }", "function setRecipeID(id) {\r\n setID(id);\r\n }", "get id() {\n console.log('in id getter');\n return this._id + 'TEMPORARY';\n }", "get id() {\n return this._data.id;\n }", "get id() {\n return this._data.id;\n }", "constructor () {\n this._id = getUniqueId();\n }", "function setPortId(id) {\n\t\tthis.id = PORT + id + this.ne.id;\n\t}", "constructor( id ) {\n this.#id = id;\n }", "get id() {\n return this.id\n }", "get id() {\n return this._data._id;\n }", "get id() {\n return this.getAttributeValue(\"id\");\n }", "function assignId(req, res, next) {\n req.id = uuid.v4();\n next();\n}", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }", "get id() {\n return this.getStringAttribute('id');\n }" ]
[ "0.8099904", "0.7683534", "0.7470728", "0.74606913", "0.74206096", "0.74206096", "0.7385624", "0.73805606", "0.73115206", "0.7219508", "0.7036794", "0.6826004", "0.68052125", "0.6762678", "0.6600304", "0.6581386", "0.65478384", "0.65333813", "0.63705504", "0.6325781", "0.63232565", "0.63232565", "0.63232565", "0.6266829", "0.62451184", "0.62451184", "0.62451184", "0.622486", "0.6222584", "0.6121803", "0.6103887", "0.6087059", "0.6087059", "0.6087059", "0.6087059", "0.6087059", "0.607673", "0.6049727", "0.5982346", "0.5982346", "0.59648037", "0.5962054", "0.59507316", "0.59507316", "0.58992594", "0.58938175", "0.58500284", "0.57977146", "0.57963014", "0.5772639", "0.5769384", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947", "0.5766947" ]
0.59183425
44
Returns annotation object Identifier (Unique in all(highlight and relation) object). For Annoui annoListDropDown. This interface calls `annotation.uuid` as the identifier.
get uuid() { return this._uuid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get id() {\n return this._annotation.id; \n }", "get id() {\n return this._annotation.id; \n }", "make_new_annotation_id() {\n var unq_str = uuidv4();\n return unq_str;\n }", "function getAnnotDomLabelId(annot) {\n return 'ideogramLabel_' + annot.domId;\n}", "get identifier() {\n if (this._uid) {\n return this._uid;\n } else {\n return this._id;\n }\n }", "getIdentifier () {\n return (this._identifier);\n }", "function getIdentifier(gxObject) {\n let id = null;\n if (gxObject.identifiers) {\n id = getFirst(gxObject.identifiers[\"http://gedcomx.org/Persistent\"]);\n if (id === null) {\n id = getFirst(gxObject.identifiers[\"http://gedcomx.org/Primary\"]);\n if (id === null) {\n for (let idType in gxObject.identifiers) {\n if (gxObject.identifiers.hasOwnProperty(idType)) {\n id = getFirst(gxObject.identifiers[idType]);\n if (id !== null) {\n return id;\n }\n }\n }\n }\n }\n }\n return id;\n}", "function getUniqueIdentifier(item) {\n if (item.info) {\n return item.info.id;\n }\n return item.label;\n }", "function firstSelectedAnnotation() {\n if (annotationUI.selectedAnnotationMap) {\n var id = Object.keys(annotationUI.selectedAnnotationMap)[0];\n return threading.idTable[id] && threading.idTable[id].message;\n } else {\n return null;\n }\n }", "getId() {\n return this.user ? this.user[this.config.identifierKey] : null;\n }", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "get identifier() {\n\t\treturn this.__identifier;\n\t}", "getAnnotationById(id){\n\t\tlet anno_list = this.getAnnotations();\n\t\tfor(let i = 0; i < anno_list.length; i++){\n\t\t\tif(anno_list.id === id){\n\t\t\t\treturn anno_list[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "get identifier() { return this._identifier; }", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "get identifier () {\n\t\treturn this._identifier;\n\t}", "id() {\n const model = internal(this).model;\n return internal(model).entities.id(this);\n }", "toAnnotation() {\n return this.annotation;\n }", "function Entity$toIdString(obj) {\n return obj.meta.type.fullName + \"|\" + obj.meta.id;\n}", "_getAriaLabelledby() {\n const formField = this._formField;\n return formField && formField._hasFloatingLabel() ? formField._labelId : null;\n }", "_getAriaLabelledby() {\n const formField = this._formField;\n return formField && formField._hasFloatingLabel() ? formField._labelId : null;\n }", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}" ]
[ "0.6778263", "0.6778263", "0.62571913", "0.6094283", "0.58449215", "0.57478523", "0.5612665", "0.5571824", "0.54780704", "0.5450957", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.54036146", "0.53999496", "0.53750026", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.53537923", "0.5350497", "0.52453965", "0.52362674", "0.5213173", "0.5213173", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076", "0.51847076" ]
0.0
-1
Returns annotation label. For Annoui annoListDropDown.
get text() { return this.content(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get label() {\n if (this.isObject(this.options)) {\n return this.options.label;\n }\n else {\n return '';\n }\n }", "function fieldLabel(field) { return [field, \"Label\"].join(\"\"); }", "function getAnnotationLabel(type) {\n switch (type) {\n case \"hasAuthor\": return (\"Author\");\n case \"hasPublicationYear\": return (\"Publication Year\");\n case \"hasTitle\": return (\"Title\");\n case \"hasDOI\": return (\"DOI\");\n case \"hasURL\": return (\"URL\");\n case \"hasComment\": return (\"Comment\");\n case \"denotesRethoric\":\n case \"denotesRhetoric\": return (\"Rhetorica\");\n case \"cites\": return (\"Citation\");\n default: {\n console.log(\"Something goes wrong with getAnnotationLabel()\");\n return error;\n }\n }\n}", "selectLabel (isNames, f) {\n const dsl = this.$t('Select')\n\n if (!f) return dsl + '\\u2026'\n //\n switch (f.selection.length) {\n case 0: return dsl + ' ' + (isNames ? f.name : f.label) + '\\u2026'\n case 1: return (isNames ? f.selection[0].name : f.selection[0].label)\n }\n return (isNames ? f.selection[0].name : f.selection[0].label) + ', ' + '\\u2026'\n }", "_getAriaLabelledby() {\n const formField = this._formField;\n return formField && formField._hasFloatingLabel() ? formField._labelId : null;\n }", "_getAriaLabelledby() {\n const formField = this._formField;\n return formField && formField._hasFloatingLabel() ? formField._labelId : null;\n }", "function LabelOptions() { }", "function LabelOptions() {}", "_getLabelId() {\n var _a;\n return ((_a = this._parentFormField) === null || _a === void 0 ? void 0 : _a.getLabelId()) || '';\n }", "get label() {\n return this.getLabel();\n }", "getAriaLabel() {\n var states;\n if (this.isDrillable()) {\n states = [this._axis.getOptions().translations.stateDrillable];\n }\n if (this.getDatatip() != null) {\n return dvt.Displayable.generateAriaLabel(this.getDatatip(), states);\n } else if (states != null) {\n return dvt.Displayable.generateAriaLabel(this.getLabel().getTextString(), states);\n }\n }", "getOptionLabel(value) {\n let label = null;\n\n if (this._getProperty('options')) {\n this._getProperty('options').forEach((option) => {\n if (option.value === value) {\n label = option.label;\n }\n });\n }\n\n return label;\n }", "static labelOf(t) {\n const label= !t.desc ? Filters.titlecase(t.name.replace(/[-_]/g, ' ')) /* friendlyish name */ :\n (typeof t.desc === 'string') ? t.desc :\n t.desc.label;\n return label;\n }", "onChangeLabel(oItem, textParent) {\n var c = textParent.childNodes;\n var strList = [];\n oItem.clearAnnotationLabels();\n for (var i=0; i < c.length; i++) {\n if (c[i].value) {\n oItem.addAnnotationLabel(c[i].value); // blanks etc are ignored\n }\n }\n }", "get label() {\n return this.getAttribute(\"name\");\n }", "function getLabelValue(option) {\n\n //Null value?\n if (option === null) {\n return $ctrl.nullLabel;\n }\n\n //Non object? Use its value\n if (!angular.isObject(option)) {\n return option;\n }\n\n //Must have label property\n if (!labelBy) {\n $log.warn('Missing label-by property for selectbox');\n return '';\n }\n\n //Validate property\n if (typeof option[labelBy] === 'undefined') {\n $log.warn('Unknown property `' + labelBy + '` for selectbox label');\n return '';\n }\n\n //Return the property\n return option[labelBy];\n }", "function getLabelText(getSelect) {\n // Trim the text to avoid weird whitespace issues non-label elements being added.\n // For example, the input mirror is an empty span with some whitespace that is\n // nested under the selector but does not show up in the label text.\n return getSelect().find(`.${selectClasses.selector}`).text().trim();\n}", "function getAnnotDomLabelId(annot) {\n return 'ideogramLabel_' + annot.domId;\n}", "function getLabel(t) {\n //console.log(t)\n\n var _label = t.data.label || null;\n\n return _label\n }", "function getLabelOfOptionSet(index, attribute, value) {\n var functionName = \"getLabelOfOptionSet\";\n var label = \"\";\n try {\n if (typeof value === \"undefined\")\n alert('undefined');\n var viewInfo = Tribridge.ViewEditor.CustomViews[index];\n var label = \"\";\n\n if (value != null && !(value === undefined)) {\n var optionSetVal;\n if (value.Value != null && !(value.Value === undefined)) {\n optionSetVal = value.Value;\n }\n else {\n optionSetVal = value;\n }\n\n // Search for the label\n for (var z = 0; z < viewInfo.OptionSets[attribute].length; z++) {\n if (viewInfo.OptionSets[attribute][z].Value == optionSetVal) {\n return viewInfo.OptionSets[attribute][z].Label;\n }\n }\n }\n\n return label;\n }\n catch (e) {\n throwError(e, functionName);\n }\n}", "get label () {\n\t\treturn this._label;\n\t}", "get completeLabel() {\n\t\treturn this.nativeElement ? this.nativeElement.completeLabel : undefined;\n\t}", "function getLabelDefaultText(idx, opt) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }", "function getLabelDefaultText(idx, opt) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }", "function getLabelDefaultText(idx, opt) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }", "function getLabelDefaultText(idx, opt) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }", "function getLabelDefaultText(idx, opt) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }", "function getLabelDefaultText(idx, opt) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }", "getLabel() {\n return this.canvas.getLabel().length > 0\n ? this.canvas.getLabel().getValue()\n : String(this.canvas.index + 1);\n }", "function getLabelDefault() {\n\t\t\treturn this.editor.lang.widget.label.replace( /%1/, this.pathName || this.element.getName() );\n\t\t}", "get label() {\n return this._label;\n }", "function fillLabel(opt) {\n Object(util_model[\"f\" /* defaultEmphasis */])(opt, 'label', ['show']);\n} // { [componentType]: MarkerModel }", "function label(type) {\n return labels[map(type)] || 'Unknown';\n }", "get label() {\n\t\treturn this.nativeElement ? this.nativeElement.label : undefined;\n\t}", "get text(){ return this.__label.text; }", "function getLabel(collapse) {\n\tvar label_name = $(collapse).attr(\"id\").replace(\"collapse\", \"label\");\n\treturn $(\"#\" + label_name);\n }", "function getLabelDefaultText(idx) {\n\t return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n\t }", "formatDefaultLabel(text) {\n const { disabled, onFocus, onBlur, onClick } = this.props\n const { value, open } = this.state\n return (\n disabled ?\n <DropDownLabel disabled>\n {text}\n </DropDownLabel>\n : <DropDownLabel \n onFocus={onFocus} \n onBlur={onBlur} \n isPlaceHolder={value === ''} \n onClick={\n () => {\n this.toggleOpen(!open)\n if (onClick) onClick()\n }\n }>\n {text}\n </DropDownLabel>\n )\n }", "_getOptionLabelValue(option) {\n return option.label || option.value || this.editor.t('Original');\n }", "getVatFieldLabel() {\n const vatLabel = get(\n COUNTRIES_VAT_LABEL,\n this.signUpFormCtrl.model.country.toUpperCase(),\n );\n\n if (vatLabel) {\n return this.$filter('translateDefault')(\n `sign_up_activity_field_vat_${this.signUpFormCtrl.model.legalform}_more`,\n 'sign_up_activity_field_vat_more',\n { vatLabel },\n undefined,\n false,\n 'escapeParameters',\n );\n }\n return this.$filter('translateDefault')(\n `sign_up_activity_field_vat_${this.signUpFormCtrl.model.legalform}`,\n `sign_up_activity_field_vat`,\n { vatLabel },\n undefined,\n false,\n 'escapeParameters',\n );\n }", "function getLabelDefaultText(idx) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }", "getLabelId() {\n return this._hasFloatingLabel() ? this._labelId : null;\n }", "get annotatedName() {\n if (this.annotation) {\n return this.annotation;\n }\n else {\n return `<${this.tagName}>`;\n }\n }", "function selectDataLabel(key) {\n switch (key) {\n case 0:\n return 'Nome';\n case 1:\n return 'Aberto agora?';\n case 2:\n return 'Vagas';\n case 3: \n return 'Iniciar trajeto'; \n default:\n '';\n break;\n }\n}", "function _labelFromDef(dataField, formDef, defaultVal) {\n if (typeof dataField.label !== 'undefined') {\n return dataField.label;\n } else if (typeof formDef.labels !== 'undefined') {\n if (typeof formDef.labels === 'string') {\n return formDef.labels;\n } else {\n return formDef.labels[0];\n }\n } else {\n return defaultVal;\n }\n }", "get label(){ return this.__label; }", "function getLabel(me) {\n\t\treturn +me.parentNode.getAttribute(\"id\").split(\"label\")[1];\n\t}", "function getLabel(key) {\n\t\treturn markers.getLabel(key);\n\t}", "function otuLabelHandler(label){\n return label.split(';').slice(-2).join();\n}", "function getLabel(id){\n\tvar label = jq(\"#\" + id + \"_label\");\n\tif(label){\n\t\treturn label.text();\n\t}\n\telse{\n\t\treturn \"\";\n\t}\n}", "function getLabelType() {\n return properties.label_type;\n }", "async function generateLabel(field, fieldStats) {\n var label = `${field.alias || field.name}`;\n if (!fieldStats) {\n return label;\n } else {\n var min = fieldStats.values.min;\n var max = fieldStats.values.max;\n label += ' <span class=\"attributeRange\">';\n }\n if (fieldStats.values\n && (min && max) != null\n && typeof (min && max) != 'undefined') {\n if (field.simpleType === 'numeric') {\n // vary precision based on value range – round to integers if range is > 100, otherwise\n // find the decimal exponent of the most sigfig of the value range, and truncate two decimal places past that -\n // eg: if the range is .000999999, most sigfig exponent is -4 (.0001), values will be truncated to -6 (.000001)\n // TODO: test if this is actually working (seems to in practice)\n let digits = getDigits(max - min);\n let precision = digits[1] == 1 ? 0 : digits[0] > 3 ? 0 : digits[1];\n min = min.toFixed(precision);\n max = max.toFixed(precision);\n label += `(${min} to ${max})`;\n } else if (field.simpleType === 'date') {\n label += `(${formatDate(min)} to ${formatDate(max)})`;\n }\n } else if (fieldStats.uniqueCount && field.simpleType === 'string') {\n // remove bad values\n var uniqueValues = (await getDatasetFieldUniqueValues(field.name)).values;\n label += `(${uniqueValues.length} value${uniqueValues.length > 1 ? 's)' : ')'}`;\n } else {\n label += `<i>(No values)</i>`;\n }\n return ''+label+'</span>';\n }", "function getTooltipText(d) {\r\n var mainText = '<p><strong>Name: </strong>' + d.label + ' (' + d.abbrev\r\n + ')</p><p><strong>Description: </strong>' + d.description + '</p>';\r\n var classification = '<p><strong>Classification: </strong>'\r\n + d.classification + '</p';\r\n return d.type == \"out\" ? mainText : mainText + classification;\r\n }", "addLabel() {\n this.scope_['value']['value']['label_names'].push(\n {type: 'unicode', value: this.defaultLabel_});\n }", "function Label(opt_options) {\n // Initialization\n this.setValues(opt_options);\n\n // Label specific\n var span = this.span_ = document.createElement('span');\n span.id = \"MapSpan\";\n\n var div = this.div_ = document.createElement('div');\n div.appendChild(span);\n div.style.cssText = 'position: absolute; display: none';\n }", "function getLabelValue(option) {\n\n //Non object? Use its value\n if (!angular.isObject(option)) {\n return option;\n }\n\n //Must have label property\n if (!labelBy) {\n $log.warn('Missing label-by property for check boxes');\n return '';\n }\n\n //Validate property\n if (typeof option[labelBy] === 'undefined') {\n $log.warn('Unknown property `' + labelBy + '` for check box label');\n return '';\n }\n\n //Return the property\n return option[labelBy];\n }", "function getLabelTextValue(a)\n\t{\n\t\tif (a.indexOf(\"label\") != -1)\n\t\t{\n\t\t\t// TODO temp workaround\n\t\t\treturn $(a).find(\"label\").text().trim() || $(a).text().trim();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t}", "_getPanelAriaLabelledby() {\n if (this.ariaLabel) {\n return null;\n }\n const labelId = this._getLabelId();\n return this.ariaLabelledby ? labelId + ' ' + this.ariaLabelledby : labelId;\n }", "function getAreaLabel(id) {\n for (var i = 0; i < Data.areas.length; i++) {\n if (Data.areas[i].id === id) {\n return Data.areas[i].title;\n }\n }\n return;\n }", "function getSelectedLabel(selectId){\n\t\t\t\tvar e = document.getElementById(selectId);\n\t\t\t\tif(e.options[e.selectedIndex] === undefined){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn e.options[e.selectedIndex].value;\n\t\t\t}", "getLabel() {\n return this.viewValue;\n }", "getLabel() {\n return this.viewValue;\n }", "getLabel() {\n return this.viewValue;\n }", "getLabel() {\n return this.viewValue;\n }", "function lblForName(text){\n\t\trandom = random+1;\n\t\tvar lblBasicConf1 = { id:\"lblForNm\"+random,text :text,isVisible:true,skin: \"lblBlackBold\"};\n\t\tvar lbllayoutConf1 = {containerWeight:40,hExpand:true,margin:[0,0,0,0],widgetAlignment:constants.WIDGET_ALIGN_MIDDLE_LEFT,contentAlignment :constants.CONTENT_ALIGN_MIDDLE_LEFT,padding:[2,0,0,0],vExpand: false,hExpand: true};//,percent:true\n\t\treturn new kony.ui.Label(lblBasicConf1, lbllayoutConf1, {});\t\n\t}", "_getLabelLatlng(geometry) {\n const coords = geometry.coordinates;\n let biggestRing;\n\n if (geometry.type === 'Point') {\n return [coords[1], coords[0]];\n } else if (geometry.type === 'Polygon') {\n biggestRing = coords;\n } else if (geometry.type === 'MultiPolygon') {\n biggestRing = coords[0];\n\n // If more than one polygon, place the label on the polygon with the biggest area\n if (coords.length > 1) {\n let biggestSize = 0;\n\n coords.forEach((ring) => {\n const size = geojsonArea.ring(ring[0]); // Area calculation\n\n if (size > biggestSize) {\n biggestRing = ring;\n biggestSize = size;\n }\n });\n }\n }\n\n // Returns pole of inaccessibility, the most distant internal point from the polygon outline\n return polylabel(biggestRing, 2).reverse();\n }", "function getLabelFromColumnName(colName)\n{\n return colName.charAt(0).toUpperCase() + colName.substring(1) + MM.LABEL_Delimiter; \n}", "function label(node) {\n var type = node.referenceType;\n var value = type === 'full' ? node.identifier : '';\n\n return type === 'shortcut' ? value : '[' + value + ']';\n}", "label (valueName, postValue, postLabel) {\n let value = ''\n\n try {\n value = this.tags[valueName]\n } catch (error) {\n\n }\n\n if (!value) { return '' }\n // look for any overrides or improvements and apply them if found\n let dataImprovement = dataImprover[valueName]\n let prettyLabel, prettyValue\n // let improverType = typeof (dataImprovement)\n switch (typeof (dataImprovement)) {\n case 'string':\n prettyLabel = dataImprovement\n prettyValue = value\n break\n case 'object':\n prettyLabel = dataImprovement.label\n prettyValue = dataImprovement.value(value)\n break\n default:\n prettyLabel = titleCase(valueName.replace(/[:|-|_]/gi, ' '))\n prettyValue = value\n }\n\n // console.log(prettyLabel,prettyValue);\n let ret =\n ((prettyLabel) ? `<strong>${prettyLabel}:</strong>&nbsp;` + (postLabel || '') : '') +\n prettyValue +\n ((postValue) || '')\n\n return ret\n }", "function getAxisLabel(axis) {\n\t\t\treturn axis.userOptions && axis.userOptions.description || axis.axisTitle && axis.axisTitle.textStr ||\n\t\t\t\t\taxis.options.id || axis.categories && 'categories' || 'Undeclared';\n\t\t}", "function teamOptionLabel(element) {\n\tvar ddData = [];\n\tfor (var i in teams) {\n\t\tif (teams[i].id == 7)\n\t\t\tddData.push( { text: teams[i].name, value: teams[i].id, imageSrc: \"assets/images/external/flags/\" + teams[i].logo, selected: true } );\n\t\telse \n\t\t\tddData.push( { text: teams[i].name, value: teams[i].id, imageSrc: \"assets/images/external/flags/\" + teams[i].logo } );\n\t}\n\t\n\telement.ddslick({\n\t\tdata: ddData,\n\t\twidth: 300,\n\t\timagePosition: \"left\"\n\t});\n}", "function getAxisLabel(axis) {\n return axis.userOptions && axis.userOptions.description || axis.axisTitle && axis.axisTitle.textStr ||\n axis.options.id || axis.categories && 'categories' || 'Undeclared';\n }", "function getAnnotLabelLayout(annot, ideo) {\n var annotDom, annotRect, ideoRect, width, height, top, bottom, left, right,\n config = ideo.config;\n\n annotDom = document.querySelector('#' + annot.domId);\n\n // Handles cases when annotation is not yet in DOM\n if (annotDom === null) return null;\n\n annotRect = annotDom.getBoundingClientRect();\n\n ideoRect =\n document.querySelector('#_ideogram').getBoundingClientRect();\n\n const textSize = getTextSize(annot.name, ideo);\n width = textSize.width;\n\n // `pad` is a heuristic that accounts for:\n // 1px left pad, 1px right pad, 1px right border, 1px left border\n // as set in renderLabel\n const pad = (config.fontFamily) ? 9 : 7;\n width += pad;\n\n const labelSize = config.annotLabelSize ? config.annotLabelSize : 13;\n // console.log('height, labelSize', height, labelSize);\n\n // Accounts for 1px top border, 1px bottom border as set in renderLabel\n height = labelSize;\n\n top = annotRect.top - ideoRect.top + height - 1;\n bottom = top + height;\n left = annotRect.left - ideoRect.left - width;\n right = left + width;\n\n return {top, bottom, right, left, width, height};\n}", "function getName()\n\t{\n\t\treturn objThis.selectorElt.tagSuggest().getName();\n\t}", "function MarkerLabel(opt_options) {\n this.setValues(opt_options);\n var span = this.span_ = document.createElement('span');\n span.style.cssText = 'position: relative; font-size: 10px; left: -50%; top: -42px; z-index:900; white-space: nowrap; padding: 2px; color: white;';\n var div = this.div_ = document.createElement('div');\n div.appendChild(span);\n div.style.cssText = 'position: absolute; display: none;';\n}", "function updateDropdownLabel() {\n // code goes here\n semesterDropLabel.innerHTML = semester\n}", "function getSelectedOrgType() {\n return $('#adminCode :selected')\n .parent()\n .attr('label')\n .toLowerCase();\n}", "function get_new_label() {\n // Assign the value of the dropdown menu option to a variable\n lat_list = [];\n lon_list = [];\n var label = labelElement.property(\"value\");\n\n console.log(label.replace(/_/g, \" \").toUpperCase());\n // Empty the table data before query\n d3.select(\"tbody\").html(\"\");\n buildTable(label);\n buildMap(label, lat_list, lon_list);\n console.log(lat_list);\n console.log(lon_list);\n}", "function getLangNameByInd(ind) {\n return langDropdown.find(\"option[value='\" + ind + \"']\").text();\n }", "function countryLabel(dot){\n dot.append(\"text\")\n .attr(\"class\", function(d){return \"country topleftlabel \"+d.name;})\n .attr(\"text-anchor\", \"start\")\n .attr(\"x\", 24)\n .attr(\"y\", 135)\n .text(function(d) {return d.name; })\n .style(\"fill\", function(d){return colorScale(d.region);});\n }", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.adm1_code + \"_label\")\n .html(labelAttribute)\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html((props.NAME_1 + \" Region\").bold());\n }", "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "get hintLabel() { return this._hintLabel; }", "function setupLabel(selection, l) {\n const setup = selection.attr('text-anchor', 'middle')\n .style('font', '12px sans-serif')\n .text(l);\n return setup;\n }", "function K(t){i.annotations.custom=t;for(var e=0;e<t.length;e++)t[e].type=\"custom\";if(c){var n={type:\"button\",id:_._id+\"_toolbar_Button_Custom\",icon:\"image\",tooltip:\"Draw Custom\",text:\"\"},a=_.createDropDownButton(n);n.onclick=_.drawAnnotation,_.createDropDownMenu(a,n,t)}return s}", "set _label(value) {\n Helper.UpdateInputAttribute(this, \"label\", value);\n }", "set _label(value) {\n Helper.UpdateInputAttribute(this, \"label\", value);\n }", "function minGPALabel(item) {\n var gpa = {\n \"0\": \"Not Specified\",\n \"1\": \"1.0\",\n \"2\": \"2.0\",\n \"3\": \"3.0\",\n \"4\": \"4.0\",\n };\n\n item.name = gpa[item.name] ? gpa[item.name] : item.name;\n item.highlighted = item.name;\n \n return item;\n}", "function tokenLabel(tokType) {\n if (hasTokenLabel(tokType)) {\n return tokType.LABEL;\n }\n else {\n return tokType.name;\n }\n}", "function addlbl() {\n}", "get itemLabel() {\r\n return this.i.itemLabel;\r\n }", "get labelPosition() {\n return this.getLabelPosition();\n }", "function getDefaultLabel(data, dataIndex) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n var len = labelDims.length; // Simple optimization (in lots of cases, label dims length is 1)\n\n if (len === 1) {\n var rawVal = Object(dataProvider[\"e\" /* retrieveRawValue */])(data, dataIndex, labelDims[0]);\n return rawVal != null ? rawVal + '' : null;\n } else if (len) {\n var vals = [];\n\n for (var i = 0; i < labelDims.length; i++) {\n vals.push(Object(dataProvider[\"e\" /* retrieveRawValue */])(data, dataIndex, labelDims[i]));\n }\n\n return vals.join(' ');\n }\n}", "function getAnnotation() {\n var at;\n var position = -10;\n\n if(x_time) {\n position = getTimeString(at_value);\n }else{\n position = at_value;\n }\n\n at = {\n drawTime: 'afterDatasetsDraw',\n type: 'line',\n mode: 'veritical',\n scaleID: 'x-axis-0',\n value: position,\n borderColor: at_colour,\n borderWidth: 2,\n borderDash: [10,5],\n label: {\n yAdjust: -100,\n fontSize: 14,\n fontColor: 'black',\n backgroundColor: 'white',\n content: \"AT\",\n enabled: show_AT\n }\n }\n\n return at;\n}", "function getShippingLabel () {\n\n\t}", "addLabel(component) {\nthis\n.addInfoToComponent(component, formEditorConstants.COMPONENT_TYPE_LABEL)\n.addProperty(component, 'name', this._componentList.findComponentText(component.type, 'name', 'Label'))\n.addProperty(component, 'zIndex', 0)\n.addProperty(component, 'fontSize', 16)\n.addProperty(component, 'text', component.text || component.name)\n.addProperty(component, 'hAlign', 'left');\nreturn component;\n}", "@api get value() {\n let returnArr = [];\n for(let si of this.getSelectedItems()) {\n returnArr.push(si.label);\n }\n return returnArr.join(', ');\n }", "function fLabel(result) {\n \tif(result != null){\n \t\tif(result.length > 7) result = result.substring(0,7);\n \t\tresult = result.toUpperCase();\n \t\tclickedCell.text(result);\n \t\tclickedCell.css(\"color\",\"black\");\n \t\tlabels.push(result);\n \t\tthis.edited = true;\n \t}\n }", "function printLabel(labeledObj) {\n console.log(labeledObj.label);\n}", "function createLabel(xmlWriter, mug) {\n var labelItext = mug.p.labelItext,\n labelRef;\n if (labelItext && labelItext.id) {\n labelRef = \"jr:itext('\" + labelItext.id + \"')\";\n // iID is optional so by extension Itext is optional.\n if (labelItext.isEmpty() &&\n mug.getPresence(\"labelItext\") === 'optional') {\n labelRef = '';\n }\n }\n if (labelRef || mug.p.label) {\n xmlWriter.writeStartElement('label');\n if (labelRef) {\n xmlWriter.writeAttributeString('ref', labelRef);\n }\n if (mug.p.label) {\n xmlWriter.writeString(mug.p.label);\n }\n xmlWriter.writeEndElement(); // close label\n }\n }" ]
[ "0.6301896", "0.62988013", "0.62872624", "0.6115363", "0.608621", "0.608621", "0.60073674", "0.59397244", "0.591458", "0.5904751", "0.58789295", "0.58787245", "0.58555835", "0.58535427", "0.58475655", "0.5830161", "0.58241767", "0.58131635", "0.579886", "0.5786961", "0.5742183", "0.5739895", "0.5737445", "0.5737445", "0.5737445", "0.5737445", "0.5737445", "0.5737445", "0.57309544", "0.5720499", "0.5707253", "0.5693816", "0.56672806", "0.56587875", "0.56554466", "0.56416816", "0.562936", "0.5625206", "0.56221694", "0.55614585", "0.5535142", "0.55117106", "0.55027634", "0.54543775", "0.5451304", "0.5445291", "0.54442215", "0.5438889", "0.541622", "0.54141617", "0.5376635", "0.5372122", "0.5353588", "0.5353332", "0.5349201", "0.5346486", "0.5323015", "0.5320056", "0.531286", "0.5312677", "0.53106713", "0.53106713", "0.53106713", "0.53106713", "0.5298193", "0.5296996", "0.5294105", "0.52929616", "0.52820975", "0.52818465", "0.5276843", "0.52595127", "0.5253682", "0.5246059", "0.52455926", "0.5224108", "0.5195788", "0.5188517", "0.51822484", "0.517142", "0.5143032", "0.5135119", "0.5135119", "0.511446", "0.5086368", "0.5085125", "0.50791115", "0.50791115", "0.50745624", "0.50650513", "0.5054896", "0.5046017", "0.5042996", "0.50338995", "0.5032941", "0.5030236", "0.5015965", "0.50150543", "0.50128204", "0.5012125", "0.50021064" ]
0.0
-1
Returns the Y coordinate of the annotation object. this method expects ths subclass to override.
get scrollTop() { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getY() {\n return this.getLocation().y;\n }", "function getY() {\n\n\t\treturn this.y;\n\n\t}", "getY() {\r\n return this.y;\r\n }", "getY() { return this.y; }", "get yPosition() { return this._yPosition; }", "y() {\n\t\t\treturn this.data.y;\n\t\t}", "get y()\n\t{\n\t\treturn this._obj.y;\n\t}", "function getOriginY() {\n\t\treturn Math.min(this.originY, this.finalY);\n\t}", "getY() {\n return this._bgY\n }", "get getBodyY(){\n\t\treturn this.body.y;\n\t}", "getPoint2Y() {\n\n return this.point2.getY();\n }", "get cursorY() {\n\t\treturn this._cursorPos[1];\n\t}", "get yAxisAnnotationPaddingTop() {\r\n return this.i.no;\r\n }", "get posY(){\n return this._posY;\n }", "get adjustedY() { return this.y - this.originY }", "getY() {\n\t\treturn ( 800 - this.ty ) * 32 + terrain.getYOffset( game.tyoff );\n\t}", "get y() {\n return this._y;\n }", "get yAxisAnnotationPaddingBottom() {\r\n return this.i.nl;\r\n }", "getPoint1Y() {\n\n return this.point1.getY();\n }", "gety()\n\t{\n\t\treturn this.y;\n\t}", "get y() { return this._y; }", "_getScaleY() {\n\t\t\t\treturn this.scale;\n\t\t\t}", "function labelY() {\n const l = d3.select(this.parentNode).select('line');\n return parseInt(l.attr('y1')) - 20;\n}", "__calculateY(position) {\n\t\treturn (gap + (tileSize + gap) * Math.floor(position / this.cols));\n\t}", "get y()\n\t{\n\t\tif (this._y != null)\n\t\t\treturn this._y;\n\n\t\t/*\n\t\tlet list = this.isInput ?\n\t\t\tthis.node.inputPlugs : this.node.outputPlugs;\n\n\t\treturn this.node.posSmooth.y\n\t\t\t+ this.node.height / 2\n\t\t\t+ (list.indexOf(this) + 1)\n\t\t\t* this.node.tree.theme.plugSpacing\n\t\t\t- (list.length + 1)\n\t\t\t* this.node.tree.theme.plugSpacing / 2;\n\t\t*/\n\n\t\treturn this.node.input.plugPositions()[this.isInput ? 'inputs'\n\t\t\t: 'outputs'].filter(o => o.plug === this)[0].y;\n\t}", "get yAxisAnnotationPaddingRight() {\r\n return this.i.nn;\r\n }", "get yRange() {\n return this.getYRange();\n }", "__calculateY(position) {\n\t\treturn (gap + (tileSize + gap) * Math.floor(position / dimensions));\n\t}", "y(y) {\n return y == null ? this.bbox().y : this.move(this.bbox().x, y);\n }", "setY(y) {\n this.setXY(this.position[0], toInt(y));\n }", "function getFinalY() {\n\t\treturn Math.abs(this.finalY - this.originY);\n\t}", "get y() {\n return this._y;\n }", "pageY() {\n return ELEM._getVisibleTopPosition(this.elemId);\n }", "get yAxisAnnotationPaddingLeft() {\r\n return this.i.nm;\r\n }", "function getUpperY()/*:Number*/ {\n return com.coremedia.cms.studio.imageeditor.util.ImageEditorUtil.getY(this.getPercentageRectangle(), this.getAdjustedImageBounds());\n }", "function getYOffset() {\n return container.offsetHeight + containerBottomMargin + containerTopMargin + canvasBorderTop + canvasBorderBottom;\n}", "function computeY (y) {\n const mag = me.magnification / 100\n return decimalRound((-y + me.element.el.offsetTop + (me.height / 2)) / mag, 2)\n }", "getCoords(){\n return this.ballY;\n }", "get yAxisAnnotationStrokeThickness() {\r\n return this.i.np;\r\n }", "function getY(cell) {\n return cell[1];\n }", "function getPositionY(obj)\n{\n var curtop = 0;\n if (document.getElementById || document.all)\n {\n while (obj.offsetParent)\n {\n \t curtop += obj.offsetTop\n \t obj = obj.offsetParent;\n }\n }\n else if (document.layers)\n curtop += obj.y;\n\n return curtop;\n}", "get y() {return this._y;}", "function get_point_y(c) {\n\treturn 94 + c * 75;\n}", "get displayY() {\n\t\treturn this.__Internal__Dont__Modify__.dispY;\n\t}", "get yMax() {\n return this.yRange.max;\n }", "function xl_FindPosY(obj)\n{\n\tvar curtop = 0;\n\tif (obj.offsetParent)\n\t{\n\t\twhile (obj.offsetParent)\n\t\t{\n\t\t\tcurtop += obj.offsetTop;\n\t\t\tobj = obj.offsetParent;\n\t\t}\n\t\tcurtop += obj.offsetTop; // added in Version 1.90 - ESDIAPI010.js\n\t}\n\telse if (obj.y)\n\t\tcurtop += obj.y;\n\treturn curtop;\n}", "function getPosYCanvas() {\n return canvas.offsetTop;\n }", "get top() {\n // origin is at top left so just return y\n return this.y\n }", "get offsetY() {\n return this._offsetY;\n }", "get offsetY() {\n return this._offsetY;\n }", "function getCenterY()/*:Number*/ {\n return this.getUpperY() + this.getMyHeight() / 2;\n }", "get panOffsetY() {\n return this.transformationMatrix.f;\n }", "top() {\n return this.y;\n }", "function obtenerPosInicialY(){\n return (parseFloat(ball.style.top)*tablero.clientHeight/100);\n}", "setY(val) {\r\n this.y=val;\r\n }", "function findPosY(obj) {\n var top = 0;\n while (obj.offsetParent) {\n top += obj.offsetTop;\n obj = obj.offsetParent;\n }\n\n if (obj.y) {\n top += obj.y;\n }\n\n return top;\n }", "function CalculateOffsetY(){\n\t//first store the objects position in grid coordinates\n\tvar gridPosition : Vector3 = grid.WorldToGrid(cachedTransform.position);\n\t//then change only the Y coordinate\n\tgridPosition.y = 0.5f * cachedTransform.lossyScale.y;\n\t\n\t//convert the result back to world coordinates\n\treturn grid.GridToWorld(gridPosition);\n}", "get offsetY() { return this._offsetY; }", "mapYPos(num) {\n return this.startingHeight + (num * this.squareSize);\n }", "get dragY() {\n return Utils.RTD(this.rotation.y);\n }", "function lastY() {\n return (segments.length === 0) ? 0 : segments[segments.length - 1].p2.world.y;\n}", "function lastY() { return (segments.length == 0) ? 0 : segments[segments.length-1].p2.world.y; }", "function d4_svg_lineY(d) {\n return d[1];\n}", "function getY(sprite) {\n\treturn sprite.y + background.y;\n}", "get y() {\n return this.yIn;\n }", "get yAxisAnnotationOutline() {\r\n return brushToString(this.i.ph);\r\n }", "function getEvtY(evt){\r\n\treturn ((evt) ? (evt.clientY) : 0);\r\n}", "function getYPos(event) {\n\tmouseYPos = event.clientY;\n}", "function d3_v3_svg_lineY(d) {\n return d[1];\n}", "function d3_svg_lineY(d) {\n return d[1];\n}", "function d3_svg_lineY(d) {\n return d[1];\n}", "function d3_svg_lineY(d) {\n return d[1];\n}", "_yPx( yLogical ) {\n var val = yLogical*this.scale.y+this.transform.y;\n return !isFinite(val) ? 0+this.transform.y : val;\n }", "function _scrollToY() {\r\n return scrollToObjY(this);\r\n}", "function getPageY(){\n var yScroll;\n if(self.pageYOffset){\n yScroll = self.pageYOffset;\n }\n else if (document.documentElement && document.documentElement.scrollTop) {\n yScroll = document.documentElement.scrollTop;\n } else if (document.body) {// all other Explorers\n yScroll = document.body.scrollTop;\n }\n return yScroll;\n}", "pointerY(e) {\n if (/touch/.test(e.type)) {\n return e.changedTouches[0].pageY;\n }\n else {\n return (e.pageY || e.clientY);\n }\n }", "get yMin() {\n return this.yRange.min;\n }", "function getYMax() {\n\t/* jshint validthis: true */ // TODO: eslint\n\treturn this._yMax;\n} // end FUNCTION getYMax()", "get cursorDeltaY() {\n\t\treturn this._cursorDeltaPos[1];\n\t}", "get startY() {\n if(!this._startY) {\n if(this.isVertical)\n this._startY = UNIT_PIXELS_V_START_Y;\n else\n this._startY = UNIT_PIXELS_H_START_Y;\n this._startY *= this.scale;\n }\n return this._startY;\n }", "function lastY() { return (segments.length == 0) ? 0 : segments[segments.length-1].p2.w.y; }", "set y(ny){\n\t\tthis.position.ny = ny;\n\t}", "set posY(value){\n this._posY = value;\n }", "set y(value) {this._y = value;}", "set setY (y) {\n this.y = y;\n }", "function findPosY(obj) {\n\tvar curtop = 0;\n\tif (obj.offsetParent) while (1) {\n\t\tcurtop += obj.offsetTop;\n\t\tif (!obj.offsetParent) break;\n\t\tobj = obj.offsetParent;\n\t} else if (obj.y) curtop += obj.y;\n\treturn curtop;\n}", "function GetEventPosY(event) {\n if(IsNetscape()) return event.layerY;\n return event.offsetY;\n}", "function GetNodeY() {\r\n\r\n\t\tvar CrossY = (kHatSrcX);\r\n\t\tvar NodeY = (CrossY / (Math.sin(BigTheta)));\r\n\r\n\t\treturn NodeY;\r\n\t}", "get _verticalAlignTargetValue() {\n var target;\n\n if (this.verticalAlign === 'bottom') {\n target = document.documentElement.clientHeight - this._positionRect.bottom;\n } else {\n target = this._positionRect.top;\n }\n\n target += this.verticalOffset;\n\n return Math.max(target, 0);\n }", "get radiusY() {\r\n return this.i.pp;\r\n }", "function findYCoord(y){\n var yCoord;\n var yAdjustment = y - firstDotYPos;\n \n //if y touch coord is equal to or less than firstDotYPos y coord is 0\n if(yAdjustment <= 0){\n yCoord = 0;\n }\n //else if y coord is equal to or greater than last row y coord is the last row\n else if(yAdjustment / yDistBetweenDots >= (numOfRows - 1) ){\n yCoord = numOfRows -1;\n }\n //else work out the value for the y coord based on the touch coord given\n else {\n yCoord = yAdjustment / yDistBetweenDots;\n }\n \n //return the xCoord value\n return yCoord;\n}", "function getYPosition(rank) {\n // Decrement the rankings so that it is 0-based rather than 1-based.\n rank = rank - 1;\n return (rank * spacingPerRank) + paddingTop;\n }", "function currentYPosition() {\n // Firefox, Chrome, Opera, Safari\n if (self.pageYOffset) {\n return self.pageYOffset;\n }\n // Internet Explorer 6 - standards mode\n if (document.documentElement && document.documentElement.scrollTop) {\n return document.documentElement.scrollTop;\n }\n // Internet Explorer 6, 7 and 8\n if (document.body.scrollTop) {\n return document.body.scrollTop;\n }\n return 0;\n}", "function getYPixel(val) {\n return canvas2.height - (((canvas2.height - yPadding) / getMax()) * val) - yPadding;\n }", "function getYPositionFromIndex(index) {\n\t\t\tvar indexAdjusted = index+1;\n\t\t\tvar val = Math.ceil(indexAdjusted / G.cols );\n\t\t\treturn val * G.boxHeight - G.boxHeight;\n\t\t}", "get targetTranslateY() {\n return +this.getAttribute('target-translate-y') || 0;\n }", "function _yValue(d) {\n return _.get(d, labelField);\n }", "function Y(d) {\n return yScale(d[1]);\n }", "function corner_y(_ref2) {\n\tvar sprite_size = _ref2.sprite_size,\n\t y = _ref2.y,\n\t sprite_scale = _ref2.sprite_scale;\n\n\treturn sprite_size * y;\n}", "get cursorPrevY() {\n\t\treturn this._cursorPrevPos[1];\n\t}", "gridY(){\n\t\tif(this.path !== null && this.path[this.pathIter] !== undefined){\n\t\t\treturn (this.path[this.pathIter].y - this.mapContainer.y) / \n\t\t\t\t\tthis.room.tileSize\n\t\t}\n\t\treturn this.inRoomY\n\t}" ]
[ "0.7557413", "0.74654126", "0.74554354", "0.7351826", "0.7262106", "0.6817039", "0.6802404", "0.67948943", "0.67748374", "0.6756833", "0.67024595", "0.66239476", "0.6620285", "0.6562736", "0.65587634", "0.6535927", "0.65312093", "0.6529185", "0.6520481", "0.6487486", "0.64446837", "0.64432603", "0.6429854", "0.638943", "0.63891304", "0.6374218", "0.6366325", "0.63464946", "0.6334917", "0.6329501", "0.6318817", "0.6199879", "0.6182743", "0.6165872", "0.6154042", "0.6152767", "0.6149198", "0.61467326", "0.6142935", "0.614195", "0.6141294", "0.61404264", "0.6126923", "0.61256486", "0.6124593", "0.61119133", "0.6107808", "0.6106336", "0.61056817", "0.61056817", "0.60997874", "0.60767037", "0.6054981", "0.6050507", "0.6047398", "0.6045116", "0.6024041", "0.6023481", "0.60169864", "0.6006515", "0.599419", "0.5989215", "0.59693235", "0.59513897", "0.5949835", "0.5904853", "0.5901222", "0.5889636", "0.5882217", "0.58740574", "0.58740574", "0.58740574", "0.5872707", "0.58613074", "0.58430624", "0.5833615", "0.58240736", "0.5817721", "0.5816502", "0.5814236", "0.5810889", "0.5809211", "0.5800061", "0.5799171", "0.57967836", "0.57953745", "0.5792997", "0.57928854", "0.5790233", "0.5788704", "0.5767705", "0.57676125", "0.5759905", "0.5752169", "0.57520586", "0.57517", "0.5746256", "0.57430804", "0.5738772", "0.57122153", "0.57120234" ]
0.0
-1
Set annotation selected status (on GUI)
set selected(value) { this._selected = value; this._selectedTimestamp = value ? new Date() : undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleAnnotationSelected (annotation) {\n if (_getSelectedAnnotations().length === 1) {\n core.enable({ uuid : annotation.uuid, text : annotation.text })\n } else {\n core.disable()\n }\n}", "function handleAnnotationDeselected () {\n const annos = _getSelectedAnnotations()\n if (annos.length === 1) {\n core.enable({ uuid : annos[0].uuid, text : annos[0].text })\n } else {\n core.disable()\n }\n}", "setActiveAnnotation(annotation) {\n\t\tthis.setState({\n\t\t\tactiveAnnotation : annotation\n\t\t})\n\t}", "update_annotation_mode() {\n jquery_default()(\"a.md-btn.sel\").attr(\"href\", \"#\");\n jquery_default()(\"a.md-btn.sel\").removeClass(\"sel\");\n jquery_default()(\"a#md-btn--\" + this.subtasks[this.state[\"current_subtask\"]][\"state\"][\"annotation_mode\"]).addClass(\"sel\");\n jquery_default()(\"a#md-btn--\" + this.subtasks[this.state[\"current_subtask\"]][\"state\"][\"annotation_mode\"]).removeAttr(\"href\");\n this.show_annotation_mode();\n }", "selectionChanged(selected) {\n const vizConf = this.visualConfig;\n this.selected = selected;\n if (selected) {\n this.label.tint = vizConf.ui.label.font.highlight;\n this.labelBgContainer.forEach((labelBg) => {\n labelBg.tint = vizConf.ui.label.background.highlight;\n });\n } else {\n this.label.tint = vizConf.ui.label.font.color;\n this.labelBgContainer.forEach((labelBg) => {\n labelBg.tint = vizConf.ui.label.background.color;\n });\n }\n }", "function handleAnnotationTypeChange() {\n gAnnotationType = parseInt($('#annotation_type_id').val());\n globals.currentAnnotationsOfSelectedType = gCurrentAnnotations.filter(function(e) {\n return e.annotation_type.id === gAnnotationType;\n });\n setTool();\n setupCBCheckboxes();\n }", "_updateOverviewSelection() {\n if (this.overview) {\n var ovChart = this.overview.getBackgroundChart();\n ovChart.getOptions()['selection'] = DvtChartDataUtils.getCurrentSelection(this);\n ovChart.render(); // rerender because unselected markers were not rendered\n }\n }", "function setAnnotationPosition(//it is in dedicated line here.\n annotation, offsetX, offsetY, vAlignment, hAlignment, target) {\n annotation.offset.x = offsetX;\n annotation.offset.y = offsetY;\n annotation.verticalAlignment = vAlignment;\n annotation.horizontalAlignment = hAlignment;\n if (vAlignment === \"Top\" && hAlignment === \"Left\") {\n annotation.margin = { left: 3, top: 3 };\n }\n else if (vAlignment === \"Top\" && hAlignment === \"Right\") {\n annotation.margin = { right: 3, top: 3 };\n }\n else if (vAlignment === \"Bottom\" && hAlignment === \"Left\") {\n annotation.margin = { left: 3, bottom: 3 };\n }\n else if (vAlignment === \"Bottom\" && hAlignment === \"Right\") {\n annotation.margin = { right: 3, bottom: 3 };\n }\n target.classList.add(\"e-selected-style\");\n}", "function handleShowAnnotationsToggle(event) {\n globals.drawAnnotations = $('#draw_annotations').is(':checked');\n if (globals.drawAnnotations) {\n tool.drawExistingAnnotations(globals.currentAnnotationsOfSelectedType);\n } else {\n tool.clear();\n }\n }", "function setStatus(status) {\n\t\t\t state = status;\n\t\t\t \n\t\t\t\t$(\"div.left a.select\").removeClass('selected');\n\t\t\t\t$(\"div.left a.add\").removeClass('selected');\n\t\t\t\t$(\"div.left a.remove\").removeClass('selected');\n\t\t\t\t$(\"div.left a.selection\").removeClass('selected');\n\t\t\t\t$(\"div.left a.\"+status).addClass('selected');\n \n // Remove double click zoom when app is in 'add' status\n if (status != \"add\") {\n\t\t\t\t map.setOptions({disableDoubleClickZoom:false});\n\t\t\t\t} else {\n\t\t\t\t map.setOptions({disableDoubleClickZoom:true});\n\t\t\t\t}\n\t\t\t\n if (status == \"selection\") {\n map.setOptions({draggable:false});\n } else {\n map.setOptions({draggable:true});\n }\n\n\t\t\t\t//Remove selection tool addons\n\t\t\t\tgoogle.maps.event.clearListeners(map, 'mousemove');\n\t\t\t\tremoveSelectionPolygon();\n\t\t\t\t\n\t\t\t\tactiveMarkersProperties();\n\t\t\t}", "function setSelected(value)\n{\n\tif(value){\n\t\t$.label.color = Alloy.Globals.Colors.TEXT_PRIMARY;\n\t\t$.label.text = value;\n\t}\n\telse{\n\t\t$.label.color = Alloy.Globals.Colors.TEXT_HINT;\n\t\t$.label.text = L('ch_kolonko_hashtagmagic_hint_favorites').toUpperCase();\n\t}\n}", "setActiveAnnotationTarget(annotationTarget) {\n\t\tthis.setState(\n\t\t\t{annotationTarget : annotationTarget},\n\t\t\t() => {\n\t\t\t\tAnnotationActions.changeTarget(annotationTarget)\n\t\t\t}\n\t\t);\n\t}", "function canvasSelectRowAnnotation(row_uuid) {\n this.last_active_annotation = this.active_row = this.annotations.rows.find(function (item) {\n return item.uuid === row_uuid;\n });\n}", "select() { this.selected = true; }", "setAnnotation(text) {\n this.annotation = text;\n }", "function cervantesAnnotationSelected(event)\r\n{\r\n let coordinate = new mapkit.Coordinate(this.spatial.latitude, this.spatial.longitude);\r\n map.setCenterAnimated(coordinate, true);\r\n\r\n element(\"information\").style.visibility = \"visible\";\r\n\r\n element(\"venueTitle\").innerHTML = this.title;\r\n element(\"venueDescription\").innerHTML = this.description;\r\n}", "selectMarkers() {\n const coordList = this.model.get('coordinateList');\n\n this.mapControl.getLayers().item(1).getSource().getFeatures().forEach((feature, i) => {\n const coordItem = coordList.at(i);\n\n if (coordItem.get('selected')) {\n feature.setStyle(new ol.style.Style({\n image: new ol.style.Icon({\n anchorXUnits: 'fraction',\n anchorYUnits: 'pixels',\n src: SELECTED_MARKER_SRC\n })\n }));\n } else if (feature.getStyle() !== null) {\n feature.setStyle(null);\n }\n });\n }", "function handleAnnotationHoverIn (annotation) {\n if (_getSelectedAnnotations().length === 0) {\n core.enable({ uuid : annotation.uuid, text : annotation.text, disable : true })\n }\n}", "editAnnotation(annotation, subAnnotation) {\n\t\t//TODO this should simply always just set the active annotation\n\t\t//an annotation ALWAYS has a target, but not always a body or ID (in case of a new annotation)\n\t\tif(annotation.target) {\n\t\t\tthis.setState({\n\t\t\t\tshowModal: true,\n\t\t\t\tannotationTarget: annotation.target,\n\t\t\t\tactiveAnnotation: annotation,\n\t\t\t\tactiveSubAnnotation : subAnnotation\n\t\t\t});\n\t\t}\n\t}", "select () {\n this.selected = true;\n }", "function setSelection(shape) {\n clearSelection();\n selectedShape = shape;\n if (shape.type != google.maps.drawing.OverlayType.MARKER) {\n selectedShape.setEditable(true);\n }\n}", "function setSelection(area){\n\t\t\tclearSelection();\n\t\t\t\t\t\t\n\t\t\tselection.first.y = (options.selection.mode == \"x\") ? 0 : (yaxis.max - area.y1) * vertScale;\n\t\t\tselection.second.y = (options.selection.mode == \"x\") ? plotHeight : (yaxis.max - area.y2) * vertScale;\t\t\t\n\t\t\tselection.first.x = (options.selection.mode == \"y\") ? 0 : (area.x1 - xaxis.min) * hozScale;\n\t\t\tselection.second.x = (options.selection.mode == \"y\") ? plotWidth : (area.x2 - xaxis.min) * hozScale;\n\t\t\t\n\t\t\tdrawSelection();\n\t\t\tfireSelectedEvent();\n\t\t}", "function highlight() {\n d3.select(this).classed('selected', true)\n }", "function annotationStyle(label) {\n if( debug ) console.log(\"> changing annotation style\");\n\n annotationColorLabel = label;\n var alpha = label.alpha;\n $('#alphaSlider').val(alpha*100);\n $('#alphaFill').val(parseInt(alpha*100));\n\n var hexColor = '#' + pad(( parseInt(label.color.red) ).toString(16),2) + pad(( parseInt(label.color.green) ).toString(16),2) + pad(( parseInt(label.color.blue) ).toString(16),2);\n if( debug ) console.log(hexColor);\n\n $('#fillColorPicker').val( hexColor );\n\n if( $('#colorSelector').css('display') == 'none' ) {\n $('#colorSelector').css('display', 'block');\n }\n else {\n $('#colorSelector').css('display', 'none');\n }\n}", "function highlightSelected(rect) {\n\n barChart.infoPanel.updateInfo(rect);\n barChart.worldMap.updateMap(rect);\n\n d3.select('.selected')\n .classed('selected', false)\n .classed('bar', true)\n .style('fill', function(d){ return color(d[selectedDimension])});\n\n d3.select(this)\n .classed('selected', true)\n .style('fill', '#d20a11');\n\n\n }", "function toggleAnnotation() {\n\t\tif (Aloha.activeEditable) {\n\t\t\tvar range = Selection.getRangeObject();\n\t\t\tif (findWaiLangMarkup(range)) {\n\t\t\t\tremoveMarkup(range);\n\t\t\t} else {\n\t\t\t\taddMarkup(range);\n\t\t\t\tfocusOn(FIELD);\n\t\t\t}\n\t\t}\n\t}", "function setSelection() {\n var bbox = $('#bounding-box');\n \n optimalApp.selectionWidth = bbox.width();\n optimalApp.selectionHeight = bbox.height();\n \n optimalApp.selectionBaseWidth = bbox.width();\n optimalApp.selectionBaseHeight = bbox.height();\n \n optimalApp.selectionPosition[0] = bbox.position().left;\n optimalApp.selectionPosition[1] = bbox.position().top;\n \n optimalApp.selectionBasePosition[0] = bbox.position().left;\n optimalApp.selectionBasePosition[1] = bbox.position().top;\n \n optimalApp.selectionOffset[0] = event.offsetX;\n optimalApp.selectionOffset[1] = event.offsetY;\n \n optimalApp.selectionOrigin[0] = event.pageX;\n optimalApp.selectionOrigin[1] = event.pageY;\n \n optimalApp.selectionRotation = 0;\n // since the box is redrawn after being rotated, it should start vertically aligned\n \n optimalApp.resizingFrom = event.target.id;\n}", "highlight_correct() {\n\t\t\tthis.selection_board.get_shape(this.shape).set_highlight('green');\n\t\t\tthis.selection_board.draw();\n\t\t}", "async function flag(annotation) {\n await api.annotation.flag({ id: annotation.id });\n store.updateFlagStatus(annotation.id, true);\n }", "function selectArrowType() {\n window.currentAnnotationObjectType = 'arrow';\n\n deactivateAnnotationObjectButtons();\n\n document.getElementById('arrow-button').classList.add('active');\n }", "function MatSelectConfig() {}", "function onSelect()\n\t{\n\t\tunit.div.toggleClass(\"selected\", unit.movePoints > 0);\n\t}", "function completeSelection(codice, tipo, oggetto, data) {\n if (fragmentselection === '') {\n avviso(\"Attenzione! Nessun frammento selezionato.\");\n } \n else {\n if (codice < 0) {\n var target = numeroAnnEsterne - 1;\n numeroAnnEsterne--;\n } else {\n var target = numeroAnnotazioni + 1;\n }\n var numero = numeroAnnotazioni;\n newAnnotation();\n // Se e' stato selezionato qualcose e dunque creato lo span\n if (numeroAnnotazioni > numero) {\n // Modifico il nuovo span appena creato in base alle vecchie informazioni\n var modifyedAnn = $(\"span[codice='\"+target+\"']\");\n modifyedAnn.attr('codice', codice);\n modifyedAnn.attr('data-toggle', 'tooltip');\n modifyedAnn.attr('username', username);\n modifyedAnn.attr('email', email);\n modifyedAnn.attr('tipo', tipo);\n modifyedAnn.attr('class', 'annotation ' + tipo);\n modifyedAnn.attr(tipo, oggetto);\n modifyedAnn.attr('title', 'Clicca per visualizzare i dettagli dell\\'annotazione');\n modifyedAnn.attr('data', data);\n modifyedAnn.attr('onclick', 'displayAnnotation(\\''+username+'\\', \\''+email+'\\', \\''+tipo+'\\', \\''+oggetto+'\\', \\''+data+'\\');');\n modifyedAnn.attr('new', 'true');\n modifyedAnn.attr(\"graph\", \"Heisenberg\");\n onHover();\n // Una volta creato la nuova annotazione ripristino la schermata con le interazioni di default\n $(\"#bartab1, #bartab2, #bartab3, #bartab5\").fadeIn();\n $(\"#bartab4\").fadeOut();\n $(\"#search\").attr('disabled', false);\n $(\"#home\").attr('disabled', false);\n $(\"#invia\").attr('disabled', false);\n numeroAnnotazioni--;\n\n arrayAnnotazioni.push({\n code : codice,\n username : username.trim(),\n email : email.trim(),\n id : id,\n start : startFrag,\n end : endFrag,\n type : tipo.trim(),\n content : oggetto.trim(),\n date : data\n });\n databaseAnnotations.push({\n code : codice,\n username : username.trim(),\n email : email.trim(),\n id : id,\n start : startFrag,\n end : endFrag,\n type : tipo.trim(),\n content : oggetto.trim(),\n date : data\n });\n }\n }\n}", "Set()\n {\n this.changed = true;\n this.indicator.style.backgroundColor = 'red';\n }", "function updateStatus() {\nconst defaultStatus = \"Click on Palette to Start\";\n\t//\tse non è attiva nessuna modalità, mostro il testo predefinito\n\tif (mode == \"\")\n\t\td3.select('#statusline').text(defaultStatus);\n\t//\taltrimenti stampo la modalità e il tipo di shape correnti\n\telse if (mode == \"draw\")\n\t\td3.select('#statusline').text(\"draw \" + shapeType);\n\telse\n\t\td3.select('#statusline').text(mode + \" \" + active.shape);\n}", "function fillMyAnnotations() {\r\n\t\t$('#annMy').html('<ul/>');\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tsets.annotations.each(function(i,item) {\r\n\t\t\tvar theClass = 'class = \"' + item.className;\r\n\t\t\tvar active = '';\r\n\t\t\tvar subtract = '';\r\n\t\t\tvar subtractClass = '';\r\n\t\t\tif(!item.isactive()) active = ' inactive'; \r\n\t\t\tif(item.className == 'Polygons') {\r\n\t\t\t\tif(item.isSubtract()) { subtractClass = ' selected'; }\r\n\t\t\t\tif(item.isSelected()) { theClass += ' selected'; subtract = '<li class = \"subtract'+subtractClass+'\" id = \"subtract'+i+'\">Subtraction.</li>'; }\r\n\t\t\t} else if(item.className == 'Polyline') {\r\n\t\t\t\tif(item.isSelected()) { theClass += ' selected'; }\r\n\t\t\t}\r\n\t\t\t$('#annMy ul').append('<li id = \"annotation' + i + '\"' + theClass + '\"><span class = \"color\" style = \"background-color:#' + item.getHexColor() + '\"></span><h2>' + item.name + '</h2><a href = \"#\" class = \"annShow' + active +'\" id = \"annShow' + i + '\">show</a></li>' + subtract);\r\n\t\t});\r\n\t\t\r\n\t\t// Select annotation action\r\n\t\t$('#annMy li').click(function(e){\r\n\t\t\tif($(this).hasClass('subtract')) {\r\n\t\t\t\t$['mapsettings'].annotations.selectSubtract();\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$['mapsettings'].annotations.deselectSubtract();\t\t\t\t\r\n\t\t\t\tvar id = $(this).attr('id').replace('annotation','');\r\n\t\t\t\t$['mapsettings'].annotations.select(id);\r\n\t\t\t}\r\n\t\t\tfillMyAnnotations();\r\n\t\t\t$['mapsettings'].annotations.draw();\r\n\t\t});\r\n\t\t\r\n\t\t// Show/Hide annotation action\r\n\t\t$('.annShow').click(function(e) {\r\n\t\t\te.preventDefault();\r\n\t\t\tvar id = $(this).attr('id').replace('annShow','');\r\n\t\t\tif($(this).hasClass('inactive')) {\r\n\t\t\t\t$['mapsettings'].annotations.getAnnotation(id).activate();\r\n\t\t\t} else {\r\n\t\t\t\t$['mapsettings'].annotations.getAnnotation(id).deactivate();\r\n\t\t\t}\r\n\t\t\tfillMyAnnotations();\r\n\t\t\t$['mapsettings'].annotations.draw();\r\n\t\t});\r\n\t\t\r\n\t\t// Color Selector action\r\n\t\t$('.color').click(function() {\r\n\t\t\tmapColorPicker();\r\n\t\t\tvar colorFunc = function(){\r\n\t\t\t\t$['mapsettings'].element.unbind('finishPrompt', colorFunc);\r\n\t\t\t\tvar i = $['mapsettings'].value;\r\n\t\t\t\t$['mapsettings'].annotations.getSelected().setFromColors(i);\r\n\t\t\t\tfillMyAnnotations();\r\n\t\t\t};\r\n\t\t\t$['mapsettings'].element.bind('finishPrompt', colorFunc);\r\n\t\t\t\r\n\t\t});\r\n\t}", "function MUPM_set_selected(tblRow, is_selected){\n //console.log( \" --- MUPM_set_selected --- \", is_selected);\n// --- put new value in tblRow, show/hide tickmark\n if(tblRow){\n tblRow.setAttribute(\"data-selected\", ( (is_selected) ? 1 : 0) )\n const img_class = (is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\"\n const el = tblRow.cells[0].children[0];\n //if (el){add_or_remove_class(el, \"tickmark_2_2\", is_selected , \"tickmark_0_0\")}\n if (el){el.className = img_class}\n }\n } // MUPM_set_selected", "function select () {\r\n\t\t\t\tthis.tool.select();\r\n\t\t\t}", "function selFeature(value){\r\n //...\r\n }", "function createAnnotation(event, successCallback, markForRestore, reload_list) {\n if (event !== undefined) {\n // triggered using an event handler\n event.preventDefault();\n }\n\n var annotationTypeId = parseInt($('#annotation_type_id').val());\n var vector = null;\n\n if (isNaN(annotationTypeId)) {\n displayFeedback($('#feedback_annotation_type_missing'));\n return;\n }\n let blurred = $('#blurred').is(':checked');\n let concealed = $('#concealed').is(':checked');\n if (!$('#not_in_image').is(':checked')) {\n vector = {};\n for (let i = 1; $('#x' + i + 'Field').length; i++) {\n vector[\"x\" + i] = parseInt($('#x' + i + 'Field').val());\n vector[\"y\" + i] = parseInt($('#y' + i + 'Field').val());\n }\n // Swap points if the second one is left of the first one\n if (Object.keys(vector).length == 4) {\n if (vector.x1 > vector.x2 || vector.x1 === vector.x2 && vector.y1 > vector.y2) {\n let tmp_x1 = vector.x2;\n let tmp_y1 = vector.y2;\n vector.x2 = vector.x1;\n vector.y2 = vector.y1;\n vector.x1 = tmp_x1;\n vector.y1 = tmp_y1;\n }\n }\n }\n\n let selected_annotation = $('#annotation_type_id').children(':selected').data();\n let vector_type = selected_annotation.vectorType;\n let node_count = selected_annotation.nodeCount;\n if (!validate_vector(vector, vector_type, node_count)) {\n displayFeedback($('#feedback_annotation_invalid'));\n return;\n }\n\n if (markForRestore === true) {\n globals.restoreSelection = vector;\n globals.restoreSelectionVectorType = vector_type;\n globals.restoreSelectionNodeCount = node_count;\n }\n\n var action = 'create';\n var data = {\n annotation_type_id: annotationTypeId,\n image_id: gImageId,\n vector: vector,\n concealed: concealed,\n blurred: blurred\n };\n var editing = false;\n if (globals.editedAnnotationsId !== undefined) {\n // edit instead of create\n action = 'update';\n data.annotation_id = globals.editedAnnotationsId;\n editing = true;\n }\n\n $('.js_feedback').stop().addClass('hidden');\n $('.annotate_button').prop('disabled', true);\n $.ajax(API_ANNOTATIONS_BASE_URL + 'annotation/' + action + '/', {\n type: 'POST',\n headers: gHeaders,\n dataType: 'json',\n data: JSON.stringify(data),\n success: function(data, textStatus, jqXHR) {\n if (jqXHR.status === 200) {\n if (editing) {\n if (data.detail === 'similar annotation exists.') {\n displayFeedback($('#feedback_annotation_exists_deleted'));\n $('#annotation_edit_button_' + globals.editedAnnotationsId).parent().parent(\n ).fadeOut().remove();\n } else {\n displayFeedback($('#feedback_annotation_updated'));\n displayExistingAnnotations(data.annotations);\n if (reload_list === true) {\n loadImageList();\n }\n tool.drawExistingAnnotations(globals.currentAnnotationsOfSelectedType);\n }\n } else {\n displayFeedback($('#feedback_annotation_exists'));\n }\n } else if (jqXHR.status === 201) {\n displayFeedback($('#feedback_annotation_created'));\n displayExistingAnnotations(data.annotations);\n if (reload_list === true) {\n loadImageList();\n }\n }\n // update current annotations\n gCurrentAnnotations = data.annotations;\n globals.currentAnnotationsOfSelectedType = gCurrentAnnotations.filter(function(e) {\n return e.annotation_type.id === gAnnotationType;\n });\n\n tool.drawExistingAnnotations(globals.currentAnnotationsOfSelectedType);\n\n globals.editedAnnotationsId = undefined;\n $('.annotation').removeClass('alert-info');\n globals.editActiveContainer.addClass('hidden');\n tool.resetSelection(true);\n\n if (typeof(successCallback) === \"function\") {\n successCallback();\n }\n $('.annotate_button').prop('disabled', false);\n },\n error: function() {\n $('.annotate_button').prop('disabled', false);\n displayFeedback($('#feedback_connection_error'));\n }\n });\n }", "function setStatusForAllTests(_status) {\r\n\troot.setNodesProperty (\"highlightState\", _status, true); \r\n}", "function toggleAnnotations() {\n\n // Transition annotations from 40% to 20%\n if(gui.annotations == 2) {\n\n // Code -> 80%\n $('#row-code')\n .removeClass('pane-row-6')\n .addClass('pane-row-8');\n\n // Annotations -> 20%\n $('#row-annotations')\n .removeClass('pane-row-4')\n .addClass('pane-row-2');\n\n gui.annotations = 1;\n\n // Transition annotations from 20% to hidden\n } else if(gui.annotations == 1) {\n\n // Code -> 100%\n $('#row-code')\n .removeClass('pane-row-8')\n .addClass('pane-row-10');\n\n // Annotations -> hidden\n $('#row-annotations')\n .removeClass('pane-row-2')\n .hide();\n\n gui.annotations = 0;\n\n // Transition annotations from hidden to 40%\n } else if(gui.annotations == 0) {\n\n // Code -> 60%\n $('#row-code')\n .removeClass('pane-row-10')\n .addClass('pane-row-6');\n\n // Annotations -> 40%\n $('#row-annotations')\n .addClass('pane-row-4')\n .show();\n\n gui.annotations = 2;\n }\n}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function highlightShip(mmsi){\n selectedFeature.setInt32(0, mmsi);\n selectedMmsi = mmsi;\n}", "function highlightSelected()\n\t{\n\t\t// selected pileups (mutations) on the diagram\n\t\tvar selected = getSelectedPileups();\n\n\t\t// highlight residues\n\t\thighlight3dResidues(selected);\n\t}", "function toggleAnnotations(){\n if(annotFlag){\n $('#anoToggle i').removeClass('icon-edit');\n $('#anoToggle i').addClass('icon-pencil');\n addConsoleMessage(\"Showing all annotations.\");\n hideAllAnnotations();\n }\n else{\n $('#anoToggle i').removeClass('icon-pencil');\n $('#anoToggle i').addClass('icon-edit');\n addConsoleMessage(\"Hide all annotations\");\n showAllAnnotations();\n }\n}", "function setClimateSelected(){\n el.climate_selected = $('.climate-variables-map :selected:first').val();\n console.log(\"setClimateSelected - mapui is:\", el.climate_selected);\n $(\"select\").material_select();\n }", "function selFeature(value){\n //...\n }", "function selFeature(value){\n //...\n }", "function handleAnnotation(){\n\n var sel = editor.getSession().selection.getRange();\n\n if(!sel.isEmpty()){\n //Sanitize.\n $(\"#annot_text\").val(\"\");\n $(\"#annotModal\").modal({show: true, backdrop: false});\n\n }else{\n showMessage(\"No selection found.\", true);\n }\n}", "function setectionModeClick() {\n if (document.getElementById(\"rbSetectionModeAdd\").checked) {\n gImageInfoViewer.setSelectionMode(SelectionModeEnum.ADD);\n } else {\n gImageInfoViewer.setSelectionMode(SelectionModeEnum.REMOVE);\n }\n}", "setMarkEvent(e)\n {\n e.currentTarget.classList.toggle(\"selected\");\n this.props.toggleMarkMode();\n }", "function setMarkerSelected(item){\n if(item.selected){\n vm.map.markers[String(item.id)]['icon']['extraClasses'] = 'selected';\n }else{\n vm.map.markers[String(item.id)]['icon']['extraClasses'] = '';\n }\n }", "function selectBox(e) {\n selectedBox = this\n\n setSelectedAppear(selectedBox, {\n 'stroke': 'black',\n 'stroke-width': '3'\n })\n}", "function createSettingAnnotation(annoType) {\n\n switch (annoType) {\n case annoTypes.LINE:\n $(iv.svg.svgId).css('cursor', 'auto');\n iv.settingAnno = iv.svg.line().stroke(propertiesType.penColor).stroke({\n width: propertiesType.lineSize\n });\n break;\n case annoTypes.RECTANGLE:\n $(iv.svg.svgId).css('cursor', 'auto');\n iv.settingAnno = iv.svg.rect().stroke(propertiesType.penColor).fill(propertiesType.fillColor).stroke({\n width: propertiesType.lineSize\n });\n break;\n case annoTypes.TEXT:\n $(iv.svg.svgId).css('cursor', 'auto');\n iv.settingAnno = \"text\";\n break;\n case annoTypes.HIGHLIGHT:\n $(iv.svg.svgId).css('cursor', 'url(' + getResource(cursorImage) + '), auto');\n iv.settingAnno = iv.svg.rect().fill(propertiesType.highlightColor).fill({\n opacity: 0.4\n });\n break;\n case annoTypes.COMMENT:\n $(iv.svg.svgId).css('cursor', 'auto');\n iv.settingAnno = \"comment\";\n break;\n }\n\n // not set if text and comment\n if (iv.settingAnno != \"text\" && iv.settingAnno != \"comment\") {\n setAttribute(iv.settingAnno.node.id, \"pointer-events\", \"all\");\n }\n}", "function SelectionChange() { }", "function SelectionChange() { }", "enableObjectSelection() {\n const state = this.canvasStates[this.currentStateIndex];\n const scribbles = this.getFabricObjectsFromJson(state);\n\n this.rehydrateCanvas(scribbles, (scribble) => {\n if (scribble.type === 'i-text') {\n scribble.setControlsVisibility({\n bl: false,\n br: false,\n mb: false,\n ml: false,\n mr: false,\n mt: false,\n tl: false,\n tr: false,\n });\n }\n });\n }", "function setDrawFlgWhenClick() {\n console.log(\"setDrawFlgWhenClick\");\n for (var i in selectedAnnos) {\n var e = SVG.get(selectedAnnos[i]);\n if (hasIntersection(iv.sMultipleSvg, e)) {\n return false;\n }\n }\n\n if (clickOnSelectedBound) {\n return false;\n }\n return true;\n}", "function selectPoint(){\n//alert(this.id + \" - \" + this.selectedIndex);\n// var circle = paper.circle(320, 240, 90).attr({ fill: '#3D6AA2', stroke: '#000000', 'stroke-width': 8 });\n \n var ID = this.selectedIndex;\nif (text[ID] == null) {\n\n\t//to highlight, I also want to redraw the dot...\n\t//circle[ID].hide();\n\tvar cir_x = circle[ID].attr('cx');\n\tvar cir_y = circle[ID].attr('cy');\n\tvar cir_r = circle[ID].attr('r');\t\n\tvar cir_opa = circle[ID].attr(\"fill-opacity\");\n\tvar cir_title = circle[ID].attr(\"title\");\n\t\n\t\n\tvar anim = Raphael.animation({r: cir_r*3, \"fill-opacity\":0.25}, 300);\n\tcircle[ID].animate(anim);\n\tvar anim2 = Raphael.animation({r: cir_r, \"fill-opacity\":cir_opa}, 600);\n\tcircle[ID].animate(anim2.delay(300));\n\n\tcircle[ID].toFront();\n\t\n\tif(isCircleColorAnnotated ==0){\n\tcircle[ID].attr({fill: AnnotationColor});//don't change the color to read\n\t}\n \t//text[ID] = paper.text(cir_x - 5, cir_y - 10, data[0][1 + 2 * cir_title] ).attr({'font-size': 12,fill: '#003300', cursor: 'pointer'});\n \ttext[ID] = paper.text(cir_x - 5, cir_y - 10, virusName[cir_title] ).attr({'font-size': textSizeLabel,fill: '#003300', cursor: 'pointer'});\n\ttext[ID].drag(move, start, up);\n\ttext[ID].dblclick(promptRename);\n\t//\n}\n\n\n\n\n}", "_updateAutoHighlight(info) {\n const pickingModuleParameters = {\n pickingSelectedColor: info.picked ? info.color : null\n };\n const {highlightColor} = this.props;\n if (info.picked && typeof highlightColor === 'function') {\n pickingModuleParameters.pickingHighlightColor = highlightColor(info);\n }\n this.setModuleParameters(pickingModuleParameters);\n // setModuleParameters does not trigger redraw\n this.setNeedsRedraw();\n }", "function regionSourceClick() {\n if (document.getElementById(\"rbManual\").checked) {\n gImageInfoViewer.setSource(RegionInfoSourceEnum.MANUAL);\n gImageRegionListViewer.setSource(RegionInfoSourceEnum.MANUAL);\n } else {\n gImageInfoViewer.setSource(RegionInfoSourceEnum.LOADED);\n gImageRegionListViewer.setSource(RegionInfoSourceEnum.LOADED);\n }\n}", "function handleAnnotationHoverOut (annotation) {\n if (_getSelectedAnnotations().length === 0) {\n core.disable()\n }\n}", "triggerSelected() {\n let cachedValues = this.cachedValues\n let self = this\n let values = new Array()\n this.iterateChecks((index, line, box, span) => {\n if (box.prop(\"checked\")) {\n // Update the \"selected\" property\n cachedValues[index][1] = true\n values.push(cachedValues[index])\n }\n })\n this.model.SetSelected(values)\n super.triggerSelected()\n }", "function MatSelectConfig() { }", "active() {\n this.text.style.fill = \"yellow\";\n }", "function labelActive(event) {\n characters.forEach((arr) => {\n arr.changeActive(event);\n })\n}", "function isSelected(p) {\n return p.selected == PathPointSelection.ANCHORPOINT;\n}", "function activeMarkersProperties() {\n\t\t\t _.each(occurrences, function(element){\n \t\t if (state=='add') {\n element.setClickable(false);\n element.setCursor('hand');\n } else {\n element.setCursor('pointer');\n }\n \n if (state=='remove') {\n element.setClickable(true);\n }\n \n if (state=='select') {\n element.setClickable(true);\n element.setDraggable(true);\n } else {\n element.setDraggable(false);\n }\n\t\t\t });\n\t\t\t}", "function UISelection(){\n\n }", "function select() {\n var el = d3.select(this);\n var thislabel = el.node().__data__;\n var indx = _.indexOf(data.columnLabels, thislabel);\n var indy = _.indexOf(data.rowLabels, thislabel);\n if (indx > -1) {\n selectedx = getselected(selectedx, indx)\n }\n if (indy > -1) {\n selectedy = getselected(selectedy, indy)\n }\n draw()\n }", "function NavBar_UpdateSelection(theHTML, theObject)\n{\n\t//has buttons?\n\tvar cButtons = theHTML.Buttons ? theHTML.Buttons.length : 0;\n\t//valid?\n\tif (cButtons > 0)\n\t{\n\t\t//get the selection number\n\t\tvar nSelection = Get_Number(theObject.Properties[__NEMESIS_PROPERTY_SELECTION], -1);\n\t\t//loop through them\n\t\tfor (var i = 0; i < cButtons; i++)\n\t\t{\n\t\t\t//ease of use\n\t\t\tvar button = theHTML.Buttons[i];\n\t\t\t//this selected?\n\t\t\tbutton.IsSelected = i == nSelection;\n\t\t\t//update look\n\t\t\tbutton.style.backgroundPosition = button.IsSelected ? button.Style_Selected : button.Style_Unselected;\n\t\t}\n\t}\n}", "highlight(on) { }", "function setPathColor(path, annotation_type, annotation) {\n if (annotation_type === 'row' || annotation_type === 'rows') {\n var is_focused = this.active_row && annotation.uuid === this.active_row.uuid;\n var conf = (annotation.confidence - this.worst_confidence) / (1 - this.worst_confidence);\n var fill_opacity = 0.1;\n var stroke_opacity = 0.5;\n var stroke_width = 2.5;\n\n if (is_focused) {\n fill_opacity = 0.15;\n stroke_opacity = 1;\n stroke_width = 3;\n }\n\n var fill_color = \"rgba(\".concat((1 - conf) * 255, \", \", 16, \", \").concat(conf * 255, \", \").concat(fill_opacity, \")\");\n var stroke_color = \"rgba(\".concat((1 - conf) * 255, \", \", 16, \", \").concat(conf * 255, \", \").concat(stroke_opacity, \")\");\n\n if (!annotation.is_valid) {\n fill_color = \"rgba(16, 16, 16, \".concat(fill_opacity, \")\");\n stroke_color = \"rgba(16, 16, 16, \".concat(stroke_opacity, \")\");\n } else if (annotation.edited) {\n fill_color = \"rgba(255, 204, 84, \".concat(fill_opacity, \")\");\n stroke_color = \"rgba(255, 204, 84, \".concat(stroke_opacity, \")\");\n } else if (annotation.annotated) {\n fill_color = \"rgba(2, 135, 0, \".concat(fill_opacity, \")\");\n stroke_color = \"rgba(2, 135, 0, \".concat(stroke_opacity, \")\");\n }\n\n path.strokeScaling = false;\n path.fillColor = fill_color;\n path.strokeColor = stroke_color;\n path.strokeWidth = stroke_width;\n } else {\n // Region\n path.strokeWidth = 2;\n path.fillColor = 'rgba(0,0,0,0.01)'; // Stroke\n\n if (this.active_region && annotation.uuid === this.active_region.uuid) {\n // Active\n path.strokeColor = 'rgba(231,160,8,0.8)';\n } else {\n // In-active\n path.strokeColor = 'rgba(34,43,68,0.8)';\n } // path.fillColor = 'rgba(34,43,68,1)';\n // path.fillColor = 'rgba(34,43,68,0.2)';\n\n }\n\n return path;\n}", "function selFeature(value){\r\n map.selectCountry(value.properties.name);\r\n sp1.selectDot(value.properties.name);\r\n pc1.selectLine(value.properties.cluster);\r\n donut.selectPie(value.properties.name);\r\n }", "function setSelection(cm, anchor, head, bias, checkAtomic) {\n cm.view.goalColumn = null;\n var sel = cm.view.sel;\n // Skip over atomic spans.\n if (checkAtomic || !posEq(anchor, sel.anchor))\n anchor = skipAtomic(cm, anchor, bias, checkAtomic != \"push\");\n if (checkAtomic || !posEq(head, sel.head))\n head = skipAtomic(cm, head, bias, checkAtomic != \"push\");\n\n if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return;\n\n sel.anchor = anchor; sel.head = head;\n var inv = posLess(head, anchor);\n sel.from = inv ? head : anchor;\n sel.to = inv ? anchor : head;\n\n cm.curOp.updateInput = true;\n cm.curOp.selectionChanged = true;\n }", "function setSelection(cm, anchor, head, bias, checkAtomic) {\n cm.view.goalColumn = null;\n var sel = cm.view.sel;\n // Skip over atomic spans.\n if (checkAtomic || !posEq(anchor, sel.anchor))\n anchor = skipAtomic(cm, anchor, bias, checkAtomic != \"push\");\n if (checkAtomic || !posEq(head, sel.head))\n head = skipAtomic(cm, head, bias, checkAtomic != \"push\");\n\n if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return;\n\n sel.anchor = anchor; sel.head = head;\n var inv = posLess(head, anchor);\n sel.from = inv ? head : anchor;\n sel.to = inv ? anchor : head;\n\n cm.curOp.updateInput = true;\n cm.curOp.selectionChanged = true;\n }", "function setSelection(cm, anchor, head, bias, checkAtomic) {\n cm.view.goalColumn = null;\n var sel = cm.view.sel;\n // Skip over atomic spans.\n if (checkAtomic || !posEq(anchor, sel.anchor))\n anchor = skipAtomic(cm, anchor, bias, checkAtomic != \"push\");\n if (checkAtomic || !posEq(head, sel.head))\n head = skipAtomic(cm, head, bias, checkAtomic != \"push\");\n\n if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return;\n\n sel.anchor = anchor; sel.head = head;\n var inv = posLess(head, anchor);\n sel.from = inv ? head : anchor;\n sel.to = inv ? anchor : head;\n\n cm.curOp.updateInput = true;\n cm.curOp.selectionChanged = true;\n }", "_updateTrackedSelection(buildHighlight) {\n var trackedSelection = this._computeTrackedSelection(buildHighlight);\n\n this.setState({\n trackedSelection\n });\n }", "function MultipleSelectAnnotation(obj, annotationType) {\n var self = this;\n\n obj = obj || {};\n Annotation.call(this, obj, annotationType);\n\n self.values = initializeMultipleSelect();\n self.valueType = 'MultipleSelect';\n\n function initializeMultipleSelect() {\n var result = _.map(annotationType.options, function (opt) {\n return { name: opt, checked: false };\n });\n _.each(obj.selectedValues, function (sv) {\n var value = _.find(result, { name: sv });\n value.checked = true;\n });\n return result;\n }\n }", "function annotation(){\n\t// console.log(document.getElementsByClassName('annotation-main'));\n\tvar surround = document.createElement(\"span\");\n\tsurround.setAttribute(\"class\", \"annotation-target\");\n\t// Open up Sidebar\n\tshowSidebar();\n\t//IF Editor is not opened\n\tif(document.getElementsByClassName('annotation-main').length == 0){\n\t\t// console.log(\"dada\");\n\t\t//Annotation Inside Header\n\t\tvar content = document.getElementById(\"annotation-container\");\n\t\tvar container = document.createElement(\"div\");\n\t\tcontainer.setAttribute(\"class\",\"annotation-main\");\n\t\tcontainer.setAttribute(\"id\",\"annotation-main\");\n\t\tcontent.appendChild(container);\n\n\t\tvar context = document.createElement(\"div\");\n\t\tcontext.setAttribute(\"class\",\"annotation-text\");\n\t\tcontext.setAttribute(\"id\",\"annotation-text\");\n\t\tcontainer.appendChild(context);\n\n\t\tvar userSelection = window.getSelection().toString();\n\t\tvar textNode = document.createTextNode(userSelection);\n\t\tcontext.appendChild(textNode);\n\n\t\t// generateEditor();\n\t\ttempEditor();\n\t\t//使用span标签包裹被选中的对象\n\t\twindow.getSelection().getRangeAt(0).surroundContents(surround);\n\t}else{\n\t\t// console.log(\"didi\");\n\t\tif(document.getElementById(\"annotation-main\")){\n\t\t\tdocument.getElementById(\"annotation-main\").remove();\n\t\t}\n\t\t//替换掉当前的annotation内容\n\t\tvar content = document.getElementById('annotation-container');\n\t\tvar container = document.createElement(\"div\");\n\t\tcontainer.setAttribute(\"class\",\"annotation-main\");\n\t\tcontainer.setAttribute(\"id\",\"annotation-main\");\n\t\tcontent.appendChild(container);\n\n\t\tvar context = document.createElement(\"div\");\n\t\tcontext.setAttribute(\"class\",\"annotation-text\");\n\t\tcontext.setAttribute(\"id\",\"annotation-text\");\n\t\tcontainer.appendChild(context);\n\n\t\tvar userSelection = window.getSelection().toString();\n\t\tvar textNode = document.createTextNode(userSelection);\n\t\tcontext.appendChild(textNode);\n\n\t\t// generateEditor();\n\t\ttempEditor();\n\t\t//使用span标签包裹被选中的对象\n\t\twindow.getSelection().getRangeAt(0).surroundContents(surround);\n\t}\n}", "function SelectCanvas() {\n\n // *******************************************\n // Private variables:\n // *******************************************\n\n this.annotation = null; // includes name, deleted, verified info\n this.isEditingControlPoint = 0;\n this.isMovingCenterOfMass = 0;\n this.editedControlPoints = 0; // whether the control points were edited\n \n // *******************************************\n // Public methods:\n // *******************************************\n\n this.GetAnnotation = function () {\n return this.annotation;\n };\n\n this.GetAnnoID = function () {\n if(this.annotation) return this.annotation.GetAnnoID();\n return -1;\n }\n\n this.didEditControlPoints = function () {\n return this.editedControlPoints;\n }\n\n // Attach the annotation to the canvas.\n this.AttachAnnotation = function (anno) {\n this.editedControlPoints = 0;\n this.annotation = anno;\n this.annotation.SetDivAttach('select_canvas');\n\n if(username_flag) submit_username();\n\n // Make edit popup appear.\n var pt = anno.GetPopupPoint();\n if(anno.GetVerified()) {\n this.annotation.DrawPolygon(main_image.GetImRatio());\n this.annotation.FillPolygon();\n pt = main_image.SlideWindow(pt[0],pt[1]);\n mkVerifiedPopup(pt[0],pt[1]);\n main_image.ScrollbarsOff();\n }\n else {\n this.DrawPolygon();\n main_image.SlideWindow(this.annotation.center_x,this.annotation.center_y);\n }\n };\n\n // Detach the annotation from the canvas.\n this.DetachAnnotation = function () {\n var anno = this.annotation;\n this.annotation = null;\n anno.DeletePolygon();\n\n WriteLogMsg('*Closed_Edit_Popup');\n CloseEditPopup();\n main_image.ScrollbarsOn();\n\n return anno;\n };\n\n this.ClearAnnotation = function () {\n if(this.annotation) this.annotation.DeletePolygon();\n return this.annotation;\n };\n\n this.RedrawAnnotation = function () {\n if(this.annotation) {\n this.annotation.DeletePolygon();\n this.DrawPolygon();\n }\n };\n\n // Move this canvas to the front.\n this.MoveToFront = function () {\n document.getElementById('select_canvas').style.zIndex = 0;\n document.getElementById('select_canvas_div').style.zIndex = 0;\n };\n\n // Move this canvas to the back.\n this.MoveToBack = function () {\n document.getElementById('select_canvas').style.zIndex = -2;\n document.getElementById('select_canvas_div').style.zIndex = -2;\n };\n\n // Handles when the annotation gets deleted.\n this.DeleteAnnotation = function () {\n var idx = this.annotation.GetAnnoID();\n// if(IsUserAnonymous() && (idx<num_orig_anno)) {\n if((IsUserAnonymous() || (!IsCreator(this.annotation.GetUsername()))) && (!IsUserAdmin()) && (idx<num_orig_anno) && !action_DeleteExistingObjects) {\n alert('You do not have permission to delete this polygon');\n return;\n }\n\n this.annotation.SetDeleted(1);\n\n if(idx>=num_orig_anno) {\n anno_count--;\n global_count--;\n setCookie('counter',anno_count);\n UpdateCounterHTML();\n }\n\n if(view_ObjList) {\n RemoveAnnotationList();\n LoadAnnotationList();\n }\n\n submission_edited = 0;\n old_name = this.annotation.GetObjName();\n new_name = this.annotation.GetObjName();\n WriteLogMsg('*Deleting_object');\n\n main_canvas.SubmitAnnotations(0);\n main_canvas.unselectObjects(); // Perhaps this should go elsewhere...\n main_handler.SelectedToRest();\n };\n\n this.MouseDown = function (x,y,button) {\n if(button>1) return;\n if(!this.isEditingControlPoint && this.annotation.StartMoveControlPoint(x,y,main_image.GetImRatio())) {\n this.isEditingControlPoint = 1;\n this.editedControlPoints = 1;\n }\n else if(!this.isMovingCenterOfMass && this.annotation.StartMoveCenterOfMass(x,y,main_image.GetImRatio())) {\n this.isMovingCenterOfMass = 1;\n this.editedControlPoints = 1;\n }\n else main_handler.SubmitEditLabel();\n };\n\n this.MouseMove = function (x,y,button) {\n if(button>1) return;\n if(this.isEditingControlPoint) {\n this.annotation.MoveControlPoint(x,y,main_image.GetImRatio());\n return;\n }\n if(this.isMovingCenterOfMass) {\n this.annotation.MoveCenterOfMass(x,y,main_image.GetImRatio());\n }\n };\n\n this.MouseUp = function (x,y,button) {\n if(button>1) return;\n if(this.isEditingControlPoint) {\n this.annotation.MoveControlPoint(x,y,main_image.GetImRatio());\n this.annotation.FillPolygon();\n// this.annotation.ShowControlPoints();\n this.annotation.ShowCenterOfMass(main_image.GetImRatio());\n this.isEditingControlPoint = 0;\n return;\n }\n if(this.isMovingCenterOfMass) {\n this.annotation.MoveCenterOfMass(x,y,main_image.GetImRatio());\n this.annotation.FillPolygon();\n// this.annotation.ShowControlPoints();\n this.isMovingCenterOfMass = 0;\n }\n };\n\n this.AllowAdjustPolygon = function () {\n var im_ratio = main_image.GetImRatio();\n this.annotation.ShowControlPoints();\n this.annotation.ShowCenterOfMass(im_ratio);\n };\n\n // *******************************************\n // Private methods:\n // *******************************************\n\n // Draw the polygon.\n this.DrawPolygon = function () {\n if(!this.annotation) return;\n var im_ratio = main_image.GetImRatio();\n this.annotation.DrawPolygon(im_ratio);\n this.annotation.FillPolygon();\n\n // If point has been labeled, then make autocomplete have \"point\"\n // be option:\n var isPoint = 0;\n if((this.annotation.GetPtsX().length==1) && (object_choices=='...')) {\n object_choices = 'point';\n object_choices = object_choices.split(/,/);\n isPoint = 1;\n }\n\n // If line has been labeled, then make autocomplete have \"line\"\n // and \"horizon line\" be options:\n var isLine = 0;\n if((this.annotation.GetPtsX().length==2) && (object_choices=='...')) {\n object_choices = 'line,horizon line';\n object_choices = object_choices.split(/,/);\n isLine = 1;\n }\n\n var m = main_image.GetFileInfo().GetMode();\n// if((m=='im') || (m=='mt')) {\n // Popup edit bubble:\n var pt = this.annotation.GetPopupPoint();\n pt = main_image.SlideWindow(pt[0],pt[1]);\n main_image.ScrollbarsOff();\n WriteLogMsg('*Opened_Edit_Popup');\n mkEditPopup(pt[0],pt[1],this.annotation.GetObjName());\n// }\n// else {\n// this.annotation.ShowControlPoints();\n// this.annotation.ShowCenterOfMass(im_ratio);\n// }\n\n if(isPoint || isLine) object_choices = '...';\n };\n\n}", "@computed\n get hasSelectedAnnotations() {\n return uiState.selectedAnnotationIds.length != 0;\n }", "get shapeSelectionEnabled(){return true;}", "function highlight(props){\n //change stroke\n var selected = d3.selectAll(\".\" + props.adm1_code)\n .style(\"stroke\", \"#62030F\")\n .style(\"stroke-width\", \"3\");\n\n setLabel(props);\n } //last line of highlight function", "init() {\n let printSelection = (s) => {\n if (s.selection.length==0) {\n this._selection = \"nothing selected\";\n this._emptySelection = true;\n }\n else if (s.selection.length==1) {\n this._selection = \"1 item selected\";\n this._emptySelection = false; \n }\n else {\n this._selection = s.selection.length + \" items selected\";\n this._emptySelection = false;\n }\n let count = selectedTriangles(s);\n if (count) {\n this._selection += `, ${ count } triangles selected.`;\n }\n }\n\n app.render.Scene.Get().selectionManager.selectionChanged(\"statusBar\",(s) => {\n printSelection(s);\n this.notifyStatusChanged();\n });\n\n app.render.Scene.Get().sceneChanged(\"statusBar\",() => {\n printSelection(app.render.Scene.Get().selectionManager);\n this.notifyStatusChanged();\n });\n\n app.render.Scene.Get().selectionController.gizmoUpdated(\"statusBar\",() => {\n printSelection(app.render.Scene.Get().selectionManager);\n this.notifyStatusChanged();\n });\n\n app.ui.Log.Get().logChanged(\"statusBar\",() => {\n this.notifyStatusChanged();\n });\n }", "async handleClick() {\n await this.setState({\n showAnnotation: !this.state.showAnnotation,\n bookmarkRegionOn: !this.state.bookmarkRegionOn\n });\n this.colorBorder();\n }", "function toggle_currently_selected(old_index, cur_index){ \n if (old_index != cur_index){\n coord_array[6*old_index] = 0; //turn off old index\n coord_array[6*cur_index] = 1; //turn on new index\n } else {\n coord_array[6*cur_index] = (coord_array[6*cur_index] == 1) ? 0 : 1; //toggle old index\n };\n saved_index = cur_index;\n // context.fillText(coord_array[6*old_index], 10+160*foobar, 10);\n // context.fillText(coord_array[6*cur_index], 40+160*foobar, 10);\n // context.fillText(old_index, 70+160*foobar, 10);\n // context.fillText(cur_index, 100+160*foobar, 10);\n // foobar++;\n}", "function selectEvent(abbr) {\n\teventSelected = abbr;\t// Save the event selection\n\tevents.forEach(evt => {\t// remove all selected borders\n\t\tdocument.getElementById(\"event-\"+evt.abbr).setAttribute(\"selected\", \"false\");\n\t});\n\tdocument.getElementById(\"event-\"+abbr).setAttribute(\"selected\", \"true\");\t// add a selected border to the clicked on element\n\n\trefreshIFrame();\t// Refresh the preview with the new variables\n}", "selectedClickListener(d, i){\n var self = this;\n // ID Is selected from the the element tag field\n var id = self.selectedExtractID(d).split(\" \").join(\"-\");\n self.boxZoom(self.path.bounds(d), self.path.centroid(d), 20);\n self.applyStateSelection(id);\n self.ui.setDistrictInfo(id);\n self.ui.addLabel(); \n self.ui.retrievePoliticianImages(id);\n }", "function modifyAnnotation() {\n var tipo = $(\"#hiddenTip\").val();\n var cod = $(\"#hiddenCod\").val();\n var tar = $(\"#hiddenTg\").val();\n var newTipo = $(\"#changeType\").val();\n var newOggetto = $(\"#changeObj\").val();\n var questoSpan = $(\"span[codice='\"+cod+\"']\");\n\n if(newOggetto !== '') {\n if (newTipo === 'autore' && !hasWhiteSpace(newOggetto.trim())) {\n $('#errorAuthor4').css(\"display\", \"block\");\n $('#changeObj').parent().addClass('has-error has-feedback');\n $('#changeObj').parent().append('<span class=\"glyphicon glyphicon-remove form-control-feedback\" aria-hidden=\"true\">' +\n '</span><span id=\"inputErrorStatus\" class=\"sr-only\">(error)</span>');\n } else {\n questoSpan.attr('tipo', newTipo);\n var oldEmail = questoSpan.attr('email'); // Vecchia email di provenance\n questoSpan.attr('username', username);\n questoSpan.attr('email', email);\n // Setto nuova annotazione come annotazione da inviare\n questoSpan.attr('new', 'true');\n questoSpan.attr(\"graph\", \"Heisenberg\");\n \n // Cancella la vecchia annotazione dagli array d'appoggio\n reprocessArray(cod);\n\n if(tar === 'doc') {\n var value = questoSpan.attr(\"value\"); // Vecchio valore\n // Modifica dei valori dello span\n questoSpan.attr('value', newOggetto.trim());\n questoSpan.attr('class', 'annotation ' + newTipo);\n questoSpan.attr('onclick', 'displayAnnotation(\"'+questoSpan.attr(\"username\")+'\", \"'+questoSpan.attr(\"email\")+'\", ' +\n '\"'+newTipo+'\", \"'+newOggetto+'\", \"'+questoSpan.attr(\"data\")+'\")');\n questoSpan.text(newOggetto);\n // Rimozione del vecchio punto e aggiunta del nuovo nel caso di ann su documento\n var punto = $(\"li[codice='\"+cod+\"']\").html();\n $(\"li[codice='\"+cod+\"']\").remove();\n\n var tipoStatement;\n switch(newTipo) {\n case 'autore':\n $('#lista-autore').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"Autore\";\n break;\n case 'pubblicazione':\n $('#lista-pubblicazione').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"AnnoPubblicazione\";\n break;\n case 'titolo':\n $('#lista-titolo').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"Titolo\";\n break;\n case 'doi':\n $('#lista-doi').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"DOI\";\n break;\n case 'url':\n $('#lista-url').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"URL\";\n break;\n }\n\n arrayAnnotazioni.push({\n code : cod,\n username : username,\n email : email,\n type : questoSpan.attr(\"tipo\"),\n content : questoSpan.attr(\"value\"),\n date : questoSpan.attr(\"data\")\n });\n databaseAnnotations.push({\n code : cod,\n username : username,\n email : email,\n type : questoSpan.attr(\"tipo\"),\n content : questoSpan.attr(\"value\"),\n date : questoSpan.attr(\"data\")\n });\n } else {\n var value = questoSpan.attr(tipo); // Vecchio valore\n // Modifica dei valori dello span\n questoSpan.removeAttr(tipo);\n questoSpan.attr(newTipo, newOggetto);\n questoSpan.attr('class', 'annotation ' + newTipo);\n questoSpan.attr('onclick', 'displayAnnotation(\"'+questoSpan.attr(\"username\")+'\", \"'+questoSpan.attr(\"email\")+'\", ' +\n '\"'+newTipo+'\", \"'+newOggetto+'\", \"'+questoSpan.attr(\"data\")+'\")');\n\n var start;\n var end;\n var idFrag;\n // Cerco nell'array che contiene lo storico delle annotazioni lo start e end del frammento dell'annotazione che sto modificando\n for (var i = 0; i < databaseAnnotations.length; i++) {\n if(databaseAnnotations[i].code == cod) {\n idFrag = databaseAnnotations[i].id;\n start = databaseAnnotations[i].start;\n end = databaseAnnotations[i].end;\n }\n }\n \n arrayAnnotazioni.push({\n code : cod,\n username : username,\n email : email,\n id : idFrag,\n start : start,\n end : end,\n type : questoSpan.attr(\"tipo\"),\n content : questoSpan.attr(questoSpan.attr(\"tipo\")),\n date : questoSpan.attr(\"data\")\n });\n databaseAnnotations.push({\n code : cod,\n username : username,\n email : email,\n id : idFrag,\n start : start,\n end : end,\n type : questoSpan.attr(\"tipo\"),\n content : questoSpan.attr(questoSpan.attr(\"tipo\")),\n date : questoSpan.attr(\"data\")\n });\n }\n deleteSingleAnnotation(tipo, value, activeURI, questoSpan.attr('data'));\n $(\"#modalModificaAnnotazione\").modal(\"hide\");\n $(\"#modalGestioneAnnotazioni\").modal(\"hide\");\n }\n } else {\n // Messaggio d'errore\n $('#errorType4').css(\"display\", \"block\");\n $('#errorAuthor4').css(\"display\", \"none\");\n $('#changeObj').parent().addClass('has-error has-feedback');\n $('#changeObj').parent().append('<span class=\"glyphicon glyphicon-remove form-control-feedback\" aria-hidden=\"true\">' +\n '</span><span id=\"inputErrorStatus\" class=\"sr-only\">(error)</span>');\n }\n // Chiamata funzione che gestisce l'onhover\n onHover();\n}", "function showHighlight() {\n hideHighlight();\n var annotation = annotations[this.annotationIndex];\n var className = annotation.isError ?\n 'chrome-comp-highlight-error' : 'chrome-comp-highlight-warning';\n for (var i = 0, c = annotation.rectangles.length; i < c; ++i) {\n var rect = annotation.rectangles[i];\n var highlightDiv;\n if (i < highlightDivs.length) {\n highlightDiv = highlightDivs[i];\n } else {\n highlightDiv = document.createElement('div');\n annotationsDiv.appendChild(highlightDiv);\n highlightDivs.push(highlightDiv);\n }\n highlightDiv.style.display = 'block';\n highlightDiv.className = className;\n highlightDiv.style.left = rect.left + 'px';\n highlightDiv.style.top = rect.top + 'px';\n highlightDiv.style.width = rect.width + 'px';\n highlightDiv.style.height = rect.height + 'px';\n }\n}", "function resetpumpstaHighlight(e) {\r\n if (!e.target.feature.properties.selected){\r\nvar layer = e.target;\r\n\r\nlayer.setStyle({\r\n\tradius: 5,\r\n\tfillColor: \"#ff9933\",\r\n\tcolor: \"#ff9933\",\r\n\tweight: 1,\r\n\topacity: 1,\r\n\tfillOpacity: 1\r\n });};\t\r\n\r\n\r\n\r\n}", "function setSelectedSymbol(map, geometry) {\n var selected = new ol.Feature({\n geometry: geometry\n });\n\n var style = {};\n if (geometry.getType() === 'Point') {\n style = new ol.style.Style({\n image: new ol.style.Circle({\n radius: 40,\n stroke: new ol.style.Stroke({\n color: 'white',\n width: 2\n }),\n fill: new ol.style.Fill({\n color: [245, 121, 0, 0.6]\n })\n })\n });\n }\n else if (geometry.getType() === 'LineString' || geometry.getType() === 'MultiLineString') {\n style = new ol.style.Style({\n stroke: new ol.style.Stroke({\n color: [245, 121, 0, 0.6],\n width: 4\n })\n })\n }\n else {\n style = new ol.style.Style({\n stroke: new ol.style.Stroke({\n color: 'white',\n width: 2\n }),\n fill: new ol.style.Fill({\n color: [245, 121, 0, 0.6]\n })\n })\n }\n\n var selectedHighlightSource = new ol.source.Vector({\n features: [selected]\n });\n\n selectedHighlightLayer = new ol.layer.Vector({\n name: 'selectedHighlightLayer',\n source: selectedHighlightSource,\n style: style\n });\n\n map.addLayer(selectedHighlightLayer);\n }", "selectAll () { this.toggSelAll(true); }", "function handleMouseClick(e) {\n if (e && (e.target.id === 'image' || e.target.id === 'image_canvas')) {\n var position = globals.image.offset();\n globals.mouseClickX = Math.round((e.pageX - position.left));\n globals.mouseClickY = Math.round((e.pageY - position.top));\n tool.handleMouseClick(e);\n }\n\n // remove any existing highlight\n if (e.target.className !== 'annotation_edit_button') {\n $('.annotation').removeClass('alert-info');\n if (gHighlightedAnnotation) {\n tool.unsetHighlightColor(gHighlightedAnnotation, globals.currentAnnotationsOfSelectedType.filter(function(element) {\n return element.id === gHighlightedAnnotation;\n }));\n gHighlightedAnnotation = undefined;\n }\n } else {\n // when the click was on the annotation edit button corresponding to the\n // currently highlighted annotation, do not remove the blue highlight\n if (gHighlightedAnnotation && gHighlightedAnnotation !== $(e.target).parent().data('annotationid')) {\n tool.unsetHighlightColor(gHighlightedAnnotation, globals.currentAnnotationsOfSelectedType.filter(function(element) {\n return element.id === gHighlightedAnnotation;\n }));\n gHighlightedAnnotation = undefined;\n }\n }\n\n // create a new highlight if the click was on an annotation\n if (e.target.className === 'annotation') {\n let editButton = $(e.target).find('.annotation_edit_button').parent();\n $('#annotation_type_id').val(editButton.data('annotationtypeid'));\n handleAnnotationTypeChange();\n tool.setHighlightColor(editButton.data('annotationid'));\n gHighlightedAnnotation = editButton.data('annotationid');\n $(e.target).addClass('alert-info');\n }\n }", "function setSelected(index) {\n for (let i = 0; i < timelineitems.length; i++) {\n timelineitems[i].classList.remove('selected');\n }\n timelineitems[index].classList.add('selected');\n }" ]
[ "0.73485893", "0.696681", "0.65656424", "0.6559516", "0.64885503", "0.638613", "0.61712563", "0.6130372", "0.6099815", "0.6093777", "0.60884976", "0.6076604", "0.6060837", "0.5995455", "0.5978938", "0.5919111", "0.5896099", "0.58631575", "0.5861555", "0.58434194", "0.5803437", "0.5796592", "0.57839483", "0.5766625", "0.5764132", "0.5744275", "0.5737379", "0.56898516", "0.5679645", "0.5667374", "0.56538886", "0.56375635", "0.56375253", "0.5621536", "0.56100076", "0.5607758", "0.5605504", "0.5577106", "0.55769134", "0.557671", "0.55754864", "0.5573131", "0.5565893", "0.5565893", "0.5565893", "0.5565893", "0.55422026", "0.5540615", "0.5534321", "0.552584", "0.55225134", "0.55225134", "0.55207735", "0.5517775", "0.5516155", "0.5509229", "0.55021524", "0.5501319", "0.5500473", "0.5500473", "0.5493464", "0.54932135", "0.54634273", "0.5458735", "0.54562014", "0.5455141", "0.5452246", "0.54498136", "0.54458857", "0.54424155", "0.5434526", "0.54236495", "0.54151815", "0.5397245", "0.5383302", "0.53825104", "0.5375195", "0.5368484", "0.536467", "0.536467", "0.536467", "0.5356101", "0.53516084", "0.53355473", "0.5329471", "0.53267425", "0.53132004", "0.5307828", "0.53073984", "0.53068805", "0.5298711", "0.52955824", "0.52935857", "0.5290272", "0.5288663", "0.52879786", "0.52873915", "0.5280371", "0.52729416", "0.52724093" ]
0.54909724
62
true is Primary annotation Note: _fileContent.primary can not use for primary/reference check, because that is shared between primary and reference.
isPrimary() { return undefined == this.referenceId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasPrimaryConstraint () {\n\t\treturn this.primary;\n\t}", "get isPrimary(){\n return ( 0 != ( ( this.kind ) & 1 ) );\n }", "isMasterFile(filePath) {\n if (!fs.existsSync(filePath)) { return false; }\n\n const rawFile = fs.readFileSync(filePath, {encoding: \"utf-8\"});\n return masterFilePattern.test(rawFile);\n }", "isFile() {\n return this.file;\n }", "isFile() {\n return this.filename != null;\n }", "getPrimaryAnnotations() {\n const list = [];\n this.set.forEach((annotation) => {\n if (annotation.isPrimary()) {\n list.push(annotation);\n }\n });\n return list;\n }", "hasExistingPDF(){\n return $.find('#primary_file_name').length > 0\n }", "isActive() {\n let propertyList = this.getPropertyList();\n return ByteFormat.fromByte(this.identityFlag, propertyList.identityFlag).isActive;\n }", "function isMetadataFile(filePath) {\n const appDirRelativePath = appDirPath ? filePath.replace(appDirPath, \"\") : filePath;\n return isMetadataRouteFile(appDirRelativePath, pageExtensions, true);\n }", "canTransform(filename) {\n const entry = this.findTransformer(filename);\n return !!entry;\n }", "isReference() {\n return undefined != this.referenceId;\n }", "isInitialContent() {\n return get(this, '_isInitialContent');\n }", "@computed\n get needDataFiles() {\n const { TEXT_FILE, ANNOTATION_FILE } = config;\n const { textFile, annotationFile } = uiState;\n if (\n textFile == '' &&\n annotationFile == '' &&\n TEXT_FILE == '' &&\n ANNOTATION_FILE == ''\n ) {\n return true;\n } else {\n return false;\n }\n }", "onRead(fileId, file, request, response){\n return true;\n }", "hasFile(file) {\n let files = this.getOwnFiles();\n let hasFile = files.includes(file);\n return hasFile;\n }", "function shouldFetchContent(file) {\n if (!file) return false;\n if (file.mimetype && file.mimetype.indexOf(\"image/\") === 0) return true;\n return false;\n}", "function checkAcknowLedgement(file) {\n _.each(file.activities, function(activity) {\n if (activity.type === \"upload-reversion\" || activity.type === \"upload-file\") {\n if (_.findIndex(activity.acknowledgeUsers, function(item) {\n if (item._id) {\n return item._id._id == $rootScope.currentUser._id && item.isAcknow;\n }\n }) !== -1) {\n activity.isAcknow = true;\n } else {\n activity.isAcknow = false;\n }\n if (activity.activityAndHisToryId) {\n var index = _.findIndex(file.fileHistory, function(history) {\n return history.activityAndHisToryId==activity.activityAndHisToryId;\n });\n if (index !== -1) {\n activity.element.link = file.fileHistory[index].link;\n activity.element.fileType = (activity.element.link.substr(activity.element.link.length-3, activity.element.link.length).toLowerCase()===\"pdf\") ? \"pdf\" : \"image\";\n }\n }\n }\n });\n }", "isAPdf(){\n if( $('#fileupload p.name span').text().includes('.pdf')){\n $(\"#pdf-format-error\").addClass('hidden')\n return true\n } else {\n $(\"#pdf-format-error\").removeClass('hidden')\n $('#fileupload tbody.files').empty()\n return false\n }\n }", "validatePDF() {\n if (this.hasExistingPDF()) {\n this.requiredPDF.check()\n return true\n } else if (this.primary_pdf_upload.hasFiles && this.onlyOnePdfAllowed() && this.isAPdf()) {\n this.requiredPDF.check()\n return true\n } else {\n this.requiredPDF.uncheck()\n return false\n }\n }", "static _isLicenseFile(file) {\n return file.token && DefinitionService._isInCoreFacet(file) && (file.natures || []).includes('license')\n }", "fileIsPath () {\n return this.target.file && /[/\\\\]/.test(this.target.file)\n }", "function CanAddNonAttributed()\n{\n\ttry\n\t{\n\t\tvar oProj = window.external.ProjectObject;\n\t\t// check for IDL file\n\t\tvar bIDL = false;\n\t\tvar oFiles = oProj.Object.Files;\n\t\tfor (var nCntr = 1; nCntr <= oFiles.Count; nCntr++)\n\t\t{\n\t\t\tvar strFileName = oFiles(nCntr).Name.toUpperCase();\n\t\t\tvar nPos = strFileName.lastIndexOf(\".\");\n\t\t\tif (nPos>0 && strFileName.substr(nPos) == \".IDL\")\n\t\t\t{\n\t\t\t\tbIDL = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tcatch(e)\n\t{ \n\t\tthrow e;\n\t}\n}", "isFile() {\n return (this.#type & IFMT) === IFREG;\n }", "get isFile() {\n return this.stats.isFile()\n }", "function isMetadata(flags) {\n return (flags & FLAGS.METADATA) === FLAGS.METADATA;\n }", "get hasData(){ return this._rawARData !== null }", "isSaveable() {\n for (let i = 0; i < this.pages.length; i++) {\n if (this.pages[i].content.length > 0) {\n return true\n }\n }\n return false\n }", "static isSourceFile(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.SourceFile;\r\n }", "function is_primary (stream) {\n\t\tvar conn_id = stream.connection.connectionId;\n\t\treturn (conn_map[conn_id].primary ? true : false);\n\t}", "resourceAnnotation(id) {\n return this.resourceAnnotations.find(\n anno => anno.getResource().id === id || flatten(\n new Array(anno.getBody()),\n ).some(body => body.id === id),\n );\n }", "isImage(filename){\n return filename.split('.').pop()==\"pdf\"\n }", "get isLeaf() {\n return this.contentMatch == ContentMatch.empty;\n }", "is_claim_flag(f) {\n return f.name === 'Claim';\n }", "function atomHasContent(atom) {\n if (!atom)\n return false;\n if (atom.attributes.length > 0)\n return true;\n if (atom.definitions.length > 0)\n return true;\n if (atom.relationships.length > 0)\n return true;\n return false;\n }", "get allow_external() {\n return this.args.allow_external || !this.inline;\n }", "static canHandle(file, offset, length) {\n\t\tlet isApp13 = file.getUint8(offset + 1) === MARKER\n\t\t\t\t && file.getString(offset + 4, 9) === PHOTOSHOP\n\t\tif (!isApp13) return false\n\t\tlet i = this.containsIptc8bim(file, offset, length)\n\t\treturn i !== undefined\n\t}", "function isLoaderDescription(value) {\n return 'filetypes' in value;\n}", "function CanUseFileName(strFileName, bCheckIfMidlHeader, bCannotExist, bSetMergeFlag)\n{\n\ttry\n\t{\n\t\tif (bCheckIfMidlHeader)\n\t\t{\n\t\t\tvar oMidlTool = window.external.ProjectObject.Object.Configurations(1).Tools(\"VCMidlTool\");\n\t\t\tvar strHeadFile = window.external.ProjectObject.Object.Configurations(1).Evaluate(oMidlTool.HeaderFileName);\n\t\t\tif (strHeadFile.toLowerCase() == strFileName.toLowerCase())\n\t\t\t{ \n\t\t\t\tvar L_CanUseFileName_Text = \" is generated by MIDL and cannot be used.\";\n\t\t\t\twindow.external.ReportError(strFileName + L_CanUseFileName_Text);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (window.external.DoesFileExist(strFileName))\n\t\t{\n\t\t\tif (bCannotExist)\n\t\t\t{ \n\t\t\t\tvar L_CanUseFileName2_Text = \" is already in use.\";\n\t\t\t\twindow.external.ReportError(strFileName + L_CanUseFileName2_Text);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar L_CanUseFileName3_Text = \" already exists. Do you want to merge this class into the same file?\";\n\t\t\t\tvar bRet = window.external.YesNoAlert(strFileName + L_CanUseFileName3_Text);\n\t\t\t\tif (bRet && bSetMergeFlag)\n\t\t\t\t\twindow.external.AddSymbol(\"MERGE_FILE\", true);\n\t\t\t\treturn bRet;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}\n\tcatch(e)\n\t{\n\t\tthrow e;\n\t}\n}", "get isInline() {\n return this.type.isInline;\n }", "isValid() {\n return (this.folder);\n }", "_contentAttributeApplies(attribute) {\n return applicableTypesForContentAttribute[attribute].has(this.type);\n }", "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId,internalReference,documentType,description,dateCreated,diffusionDate,externalReference,localization,form,status);\n //Internal Reference as Full\n } else if (projectType == \"Full\") {\n internalReference = documentType + \"-\" + padToFour(projectCode) + \"-\" + padToTwo(avenant) + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n //Internal Reference as Full Without Project \n } else {\n\n internalReference = documentType + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n }\n }", "isValid() {\n\t\treturn this.ref_id !== 'null' && this.ref_id !== undefined;\n\t}", "get Primary() {\n return this.Form.get('primary');\n }", "hasUserMediaApproval() {\n return this.userMediaApproval || false;\n }", "function _filter(file) {\n return !LanguageManager.getLanguageForPath(file.fullPath).isBinary() ||\n MainViewFactory.findSuitableFactoryForPath(file.fullPath);\n }", "function checkFile( file){\n\n if (file == \"\"){\n\n return false;\n }\n return true;\n }", "is_valid() {\n return this.meta !== null;\n }", "get primaryId() {\n return this.table.primary || DEFAULT_PRIMARY_ID;\n }", "hasDetail() {\n return this.key !== null;\n }", "hasAvatar() {\n return true;\n //return this.humanoid && this.mesh;\n }", "exists() {\n return this.filePointer.exists();\n }", "exists() {\n return this.filePointer.exists();\n }", "_isOwner() {\n return this.record && (this.record.userId == this.user.id);\n }", "get isOpen() {\n return this.content.isPresent;\n }", "isWithJournalFields() {}", "isActiveFieldDirty() {\r\n if (this.slides && this.slides.length > this.activeIndex) {\r\n let activeField = this.slides[this.activeIndex].items[0];\r\n if ([FormFieldType.information.toString(), FormFieldType.image.toString()].indexOf(activeField.type) >= 0) {\r\n return true;\r\n }\r\n return this.currentData[activeField.name] && this.currentData[activeField.name].value;\r\n }\r\n return false;\r\n }", "get mandatory() {\n return this._mandatory;\n }", "function checkAllSuccess(file, index, array) {\n return file.status === 'success';\n }", "get isComplete() {\n return self.step.isComplete(self.annotations)\n }", "isEditable() {\n return !this.isReference();\n }", "_isOwner() {\n return this.record && (this.record.userId == this.user.id);\n }", "function isDefinitionFile(fileName) {\n const lowerFileName = fileName.toLowerCase();\n for (const definitionExt of DEFINITION_EXTENSIONS) {\n if (lowerFileName.endsWith(definitionExt)) {\n return true;\n }\n }\n return false;\n}", "function hasAnnotation() {\n if (document.getElementById('ImageAnnotationAddButton')) {\n return true;\n } else {\n return false;\n }\n}", "hasFileAreaRead(area) {\n return this.check(area.acs, 'read', ACS.Defaults.FileAreaRead);\n }", "isSubmodel(filename) {\n\t\t\treturn api.partDictionary[filename].isSubModel;\n\t\t}", "function isJpg(file) {\n const jpgMagicNum = 'ffd8ffe0';\n var magicNumInFile = file.toString('hex',0,4);\n //console.log(\"magicNumInFile: \" + magicNumInFile);\n \n if (magicNumInFile === jpgMagicNum) {\n return true;\n } else {\n return false;\n }\n}", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function detectImport() {\n\tvar line;\n\tvar i = 0;\n\twhile ((line = Zotero.read()) !== false) {\n\t\tline = line.replace(/^\\s+/, \"\");\n\t\tif (line != \"\") {\n\t\t\t//Actual MEDLINE format starts with PMID\n\t\t\tif (line.substr(0, 6).match(/^PMID( {1, 2})?- /)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tif (i++ > 3) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "isComplete() {\n return (this.title === this.titleComplete) &&\n (this.labo === this.laboComplete) &&\n (this.univ === this.univComplete) &&\n (this.coAuthor === this.coAuthorComplete)\n }", "isAccessibleHTMLFile(filePath) {\n let file = this.accessibleHTMLFiles[filePath];\n if (file === undefined) {\n return false;\n } else {\n return file;\n }\n }", "static masterFileContent(optionalMasterFilePath, encoding) {\r\n if (optionalMasterFilePath) {\r\n const masterXmlContent = xml_reader_1.XmlReader.readXmlFileContent(optionalMasterFilePath, encoding);\r\n return {\r\n xmlContent: masterXmlContent.content,\r\n path: optionalMasterFilePath,\r\n encoding: masterXmlContent.encoding\r\n };\r\n }\r\n else {\r\n return null;\r\n }\r\n }", "function apply_autodetected(m, ast, inheritable) {\n docset = find_docset(ast);\n var inheritable = inheritable || true;\n \n if (!docset || docset[\"type\"] != \"doc_comment\") {\n if (inheritable)\n m[\"inheritdoc\"] = {};\n else\n m[\"private\"] = true;\n \n m[\"autodetected\"] = true;\n }\n\n if (docset) {\n docset[\"code\"] = m;\n return false;\n }\n else {\n // Get line number from third place at range array.\n // This third item exists in forked EsprimaJS at\n // https://github.com/nene/esprima/tree/linenr-in-range\n m[\"linenr\"] = ast[\"range\"][2];\n return true;\n }\n}", "get isAtom() {\n return this.isLeaf || !!this.spec.atom;\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "getDocType(file) {\n this._docType = file.Templates.map(template => template.DocumentType + template.SubDocumentType);\n }", "get includePublicInput() {\n return this._includePublic;\n }", "isOriginal(){\r\n return this.isOriginalBool;\r\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "get success() {\n return this.principalStatement !== undefined || this.resourceStatement !== undefined;\n }", "static get isResourceModel() {\n return true;\n }", "allowAttachment(attachment) {\n if(_.any(this.allowedAttachmentTraits, trait => attachment.hasTrait(trait))) {\n return true;\n }\n\n return (\n this.isBlank() ||\n this.allowedAttachmentTraits.length === 0\n );\n }", "canEdit() {\n return ['jpg', 'jpeg', 'png'].indexOf(this.item.extension.toLowerCase()) > -1;\n }", "get isAtom() {\n return this.type.isAtom;\n }", "function co_IsPrimaryKey(columnTr) {\r\n\r\n\tvar pKeyTd = columnTr.firstChild;\t\r\n\tvar object = pKeyTd.firstChild;\r\n\t\r\n\tvar columnTd = pKeyTd.nextSibling;\r\n\tvar text = columnTd.firstChild;\r\n\t\r\n\tif (object.checked == true || object.data == PRIMARY_EKY_MARK)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "isExisting(): boolean {\n return this.existing;\n }", "function _shouldProcessFile(relativePath) {\n\treturn _matchingFileExtension(relativePath);\n}", "isTextFile(file) {\n let extensions = [\"doc\", \"docx\", \"odt\", \"pdf\", \"rtf\", \"txt\"];\n return extensions.includes(file.extension);\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "function isReference(c) {\n return Object(_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__[\"is\"])(c, 'bpmn:SequenceFlow');\n }", "function check(file) {\n const { meta } = file;\n\n if (meta.baseURL === undefined) {\n return 'No base URL specified';\n } else if (meta.layout === undefined) {\n return 'No layout specified';\n }\n\n const ext = path.extname(meta.layout);\n if (ext === '.html') {\n if (meta.title === undefined) {\n return 'No title specified';\n } else if (meta.description === undefined) {\n return 'No description specified';\n } else if (meta.keywords === undefined) {\n return 'No keywords specified';\n }\n\n if (meta.entry === true) {\n if (meta.uid === undefined) {\n return 'No unique id specified';\n } else if (meta.dateCreated === undefined) {\n return 'No creation date specified';\n }\n }\n }\n\n return null;\n}", "shouldTrackFile(filePath) {\n if (!this.includeFileMatcher.match(filePath)) {\n return false;\n }\n if (this.shouldExcludeFileOrFolder(filePath)) {\n return false;\n }\n return true;\n }", "static get properties(){return{source:{name:\"source\",type:\"String\"},hasSource:{name:\"hasSource\",type:\"Boolean\",computed:\"_calculateHasSource(source)\"},markdown:{name:\"markdown\",type:\"String\"}}}", "function checkFileType(file, cb) {\n if(file.fieldname==='nicPhoto' || file.fieldname === 'profilePicture' || file.fieldname === 'uni_id_photo' || file.fieldname === 'profile_picture') {\n if ( file.mimetype === 'image/png' || file.mimetype === 'image/jpg' || file.mimetype === 'image/jpeg') { // check file type to be pdf, doc, or docx\n cb(null, true);\n } \n else {\n console.log('only jpg , jpeg & png file supported');\n cb(null, false);\n }\n }\n else if(file.fieldname === 'proofDocument'||file.fieldname === 'submission') {\n if ( file.mimetype === 'image/png' || file.mimetype === 'image/jpg' || file.mimetype === 'image/jpeg' || file.mimetype === 'application/pdf') { // check file type to be pdf, doc, or docx\n cb(null, true);\n } \n else {\n console.log('only jpg , jpeg , png & pdf file supported');\n cb(null, false);\n }\n }\n else {\n console.log('no such field found');\n cb(null, false);\n }\n}" ]
[ "0.5884931", "0.5697689", "0.5275228", "0.5264234", "0.5197476", "0.50885594", "0.5078971", "0.5072613", "0.5071844", "0.5070136", "0.5059471", "0.5041854", "0.49961802", "0.49455085", "0.49119756", "0.48955786", "0.48535967", "0.48521483", "0.48089176", "0.47884634", "0.47833133", "0.4776837", "0.4740171", "0.4729209", "0.4688333", "0.46827975", "0.46799743", "0.46790007", "0.466457", "0.4643386", "0.4641427", "0.46307653", "0.4596517", "0.45962965", "0.4584164", "0.45716655", "0.45637107", "0.45534575", "0.45525804", "0.45498222", "0.45381233", "0.4533455", "0.45325634", "0.45299554", "0.45259434", "0.45208755", "0.45170277", "0.44942394", "0.44923812", "0.4485958", "0.4481122", "0.44699055", "0.44699055", "0.44693387", "0.44682938", "0.44659835", "0.4460337", "0.4458328", "0.44475853", "0.44465163", "0.44456244", "0.44375756", "0.443436", "0.44321707", "0.4430853", "0.4419225", "0.44115797", "0.44089332", "0.44089332", "0.44035134", "0.4402433", "0.4390975", "0.43793124", "0.43786865", "0.43766", "0.43729118", "0.43729118", "0.43729118", "0.43729118", "0.43709365", "0.43709365", "0.43641806", "0.43624783", "0.43532577", "0.43525243", "0.43518677", "0.43409234", "0.4333042", "0.43312067", "0.4331106", "0.43305057", "0.4329014", "0.43276685", "0.43180627", "0.43133244", "0.43123597", "0.43075296", "0.43066198", "0.4305854", "0.43028638" ]
0.622368
0
true is Reference annotation Note: _fileContent.primary can not use for primary/reference check, because that is shared between primary and reference.
isReference() { return undefined != this.referenceId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isPrimary() {\n return undefined == this.referenceId;\n }", "function isReference(schema) {\n var refd_type;\n // simple reference\n if ((refd_type = schema.options.ref)) return refd_type;\n // array of references\n if ((refd_type = schema.options.type && schema.options.type[0] && schema.options.type[0].ref)) return refd_type;\n return false;\n}", "function isReference(c) {\n return Object(_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__[\"is\"])(c, 'bpmn:SequenceFlow');\n }", "function ReferenceAttr(ocbAttr) {\n var re = /ref(.+)/\n\n //return ocbAttr.replace(re, '$1')\n return re.test(ocbAttr)\n}", "function isReferenceInRecommendation(reference) {\n for (var i = $scope.recommendation.references.length - 1; i >= 0; i--) {\n if($scope.recommendation.references[i].referenceId == reference.referenceId){\n return true;\n }\n }\n }", "isValid() {\n\t\treturn this.ref_id !== 'null' && this.ref_id !== undefined;\n\t}", "isEditable() {\n return !this.isReference();\n }", "function isReferenceType(type) {\n return ['Reference', 'CodeableReference'].includes(type);\n}", "function hasRefOrSpread(attrs) {\n\t for (var i = 0; i < attrs.length; i++) {\n\t var attr = attrs[i];\n\t if (t.isJSXSpreadAttribute(attr)) return true;\n\t if (isJSXAttributeOfName(attr, \"ref\")) return true;\n\t }\n\t return false;\n\t}", "function hasRefOrSpread(attrs) {\n\t for (var i = 0; i < attrs.length; i++) {\n\t var attr = attrs[i];\n\t if (t.isJSXSpreadAttribute(attr)) return true;\n\t if (isJSXAttributeOfName(attr, \"ref\")) return true;\n\t }\n\t return false;\n\t}", "function isReference(path) {\n return path.isReferenced() || path.parentPath.isAssignmentExpression({\n left: path.node\n });\n }", "function hasRefOrSpread(attrs) {\n for (var i = 0; i < attrs.length; i++) {\n var attr = attrs[i];\n if (t.isJSXSpreadAttribute(attr)) return true;\n if (isJSXAttributeOfName(attr, \"ref\")) return true;\n }\n return false;\n}", "fileIsPath () {\n return this.target.file && /[/\\\\]/.test(this.target.file)\n }", "function isReferenceEqual(a, b) {\n if (!isSymbolEqual(a.symbol, b.symbol)) {\n // If the reference's target symbols are different, the reference itself is different.\n return false;\n }\n // The reference still corresponds with the same symbol, now check that the path by which it is\n // imported has not changed.\n return a.importPath === b.importPath;\n }", "function getAlbumReference() {\n return true;\n}", "isFile() {\n return this.file;\n }", "function isReference(path) {\n\t return path.isReferenced() || path.parentPath.isAssignmentExpression({ left: path.node });\n\t}", "function isReference(path) {\n\t return path.isReferenced() || path.parentPath.isAssignmentExpression({ left: path.node });\n\t}", "isFile() {\n return this.filename != null;\n }", "function resourceIsNew(element) {\n if (!suppressDoubleIncludes) {\n return true;\n }\n const tagName = element.tagName.value;\n if (!tagName) {\n // text node they do not have tag names, so we can process them as they are without\n // any further ado\n return true;\n }\n let reference = element.attr(\"href\")\n .orElseLazy(() => element.attr(\"src\").value)\n .orElseLazy(() => element.attr(\"rel\").value);\n if (!reference.isPresent()) {\n return true;\n }\n return !head.querySelectorAll(`${tagName}[href='${reference.value}']`).length &&\n !head.querySelectorAll(`${tagName}[src='${reference.value}']`).length &&\n !head.querySelectorAll(`${tagName}[rel='${reference.value}']`).length;\n }", "function isReferenceField(snapshot, path) {\n var references = snapshot['outbound'];\n if (!references)\n return false;\n var index = references.findIndex(function (reference) {\n return apollo_utilities_1.isEqual(reference.path, path);\n });\n return (index >= 0);\n}", "function checkAcknowLedgement(file) {\n _.each(file.activities, function(activity) {\n if (activity.type === \"upload-reversion\" || activity.type === \"upload-file\") {\n if (_.findIndex(activity.acknowledgeUsers, function(item) {\n if (item._id) {\n return item._id._id == $rootScope.currentUser._id && item.isAcknow;\n }\n }) !== -1) {\n activity.isAcknow = true;\n } else {\n activity.isAcknow = false;\n }\n if (activity.activityAndHisToryId) {\n var index = _.findIndex(file.fileHistory, function(history) {\n return history.activityAndHisToryId==activity.activityAndHisToryId;\n });\n if (index !== -1) {\n activity.element.link = file.fileHistory[index].link;\n activity.element.fileType = (activity.element.link.substr(activity.element.link.length-3, activity.element.link.length).toLowerCase()===\"pdf\") ? \"pdf\" : \"image\";\n }\n }\n }\n });\n }", "hasPrimaryConstraint () {\n\t\treturn this.primary;\n\t}", "getReference() {\n mustInherit();\n }", "onRead(fileId, file, request, response){\n return true;\n }", "isMasterFile(filePath) {\n if (!fs.existsSync(filePath)) { return false; }\n\n const rawFile = fs.readFileSync(filePath, {encoding: \"utf-8\"});\n return masterFilePattern.test(rawFile);\n }", "function CanAddNonAttributed()\n{\n\ttry\n\t{\n\t\tvar oProj = window.external.ProjectObject;\n\t\t// check for IDL file\n\t\tvar bIDL = false;\n\t\tvar oFiles = oProj.Object.Files;\n\t\tfor (var nCntr = 1; nCntr <= oFiles.Count; nCntr++)\n\t\t{\n\t\t\tvar strFileName = oFiles(nCntr).Name.toUpperCase();\n\t\t\tvar nPos = strFileName.lastIndexOf(\".\");\n\t\t\tif (nPos>0 && strFileName.substr(nPos) == \".IDL\")\n\t\t\t{\n\t\t\t\tbIDL = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tcatch(e)\n\t{ \n\t\tthrow e;\n\t}\n}", "function isReference(path) {\n return path.isReferenced() || path.parentPath.isAssignmentExpression({left: path.node});\n}", "hasFile(file) {\n let files = this.getOwnFiles();\n let hasFile = files.includes(file);\n return hasFile;\n }", "static get __resourceType() {\n\t\treturn 'DocumentReferenceContent';\n\t}", "isREF()\r\n {\r\n // check if all zero rows are at the bottom\r\n var zeroFlag = false;\r\n for (var r = 0; r < this.m; r++)\r\n {\r\n if (this.isZeroRow(r))\r\n zeroFlag = true;\r\n if (zeroFlag)\r\n {\r\n // check if a nonzero row is found after a zero row\r\n if (!this.isZeroRow(r))\r\n return false;\r\n }\r\n }\r\n\r\n // check if each leading variable is to the right of the one above it\r\n var prevLeadingVar = this.indexOfLeadingVar(0);\r\n for (var r = 1; r < this.m; r++)\r\n {\r\n if (!this.isZeroRow(r))\r\n {\r\n if (this.indexOfLeadingVar(r) > prevLeadingVar)\r\n prevLeadingVar = this.indexOfLeadingVar(r)\r\n else\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "canTransform(filename) {\n const entry = this.findTransformer(filename);\n return !!entry;\n }", "get references() { return check(referencesWasm); }", "canReadlink() {\n if (this.#linkTarget)\n return true;\n if (!this.parent)\n return false;\n // cases where it cannot possibly succeed\n const ifmt = this.#type & IFMT;\n return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n this.#type & ENOREADLINK ||\n this.#type & ENOENT);\n }", "function includesPhysicalResourceIdRef(obj) {\n if (obj === undefined) {\n return false;\n }\n let foundRef = false;\n // we use JSON.stringify as a way to traverse all values in the object.\n JSON.stringify(obj, (_, v) => {\n if (v === runtime_1.PHYSICAL_RESOURCE_ID_REFERENCE) {\n foundRef = true;\n }\n return v;\n });\n return foundRef;\n}", "function shouldFetchContent(file) {\n if (!file) return false;\n if (file.mimetype && file.mimetype.indexOf(\"image/\") === 0) return true;\n return false;\n}", "isIndexReference() {\n return this.isIndex() || this.isRange();\n }", "hasExistingPDF(){\n return $.find('#primary_file_name').length > 0\n }", "get isPrimary(){\n return ( 0 != ( ( this.kind ) & 1 ) );\n }", "get reference () {\r\n\t\treturn this._reference;\r\n\t}", "function isReferenceElement(value) {\n return !!(value && value._tippy && value._tippy.reference === value);\n}", "static isLinkRelevant(link) {\n // exclude file protocol links -> they are not working with the office URI protocols\n if (link.startsWith('file://')) {\n return false;\n }\n\n if (LinkUtil.isWopiFrameLink(link)) {\n // check if the file ending is relevant\n let linkInfo = LinkUtil.getLinkInfo(link);\n return linkInfo.type !== '';\n }\n // only consider segment after last slash\n const lastSlashSegment = link.substr(link.lastIndexOf('/'), link.length);\n if (!lastSlashSegment || lastSlashSegment === '') {\n return false;\n }\n\n // test if it as a link which points to a file\n const regexResult = lastSlashSegment.match(/(.*\\.[a-zA-Z]{3,4})($|\\?|#)+/);\n if (regexResult === null || regexResult.length < 2) {\n return false;\n }\n // test if the link points to an ms office document\n return new RegExp(\n `\\\\.(${OfficeFileEnding.getAllFileEndings().join('|')})(^\\\\.|([\\\\?#&].*)|$)`\n ).test(lastSlashSegment);\n }", "get isDynamic(){\n return !this.boundary\n && !this.isRule\n && this.backReferences.length > 0;\n }", "isReferenceToDirective(directive) {\n return splitExportAs(directive.exportAs).indexOf(this.value) !== -1;\n }", "isReferenceToDirective(directive) {\n return splitExportAs(directive.exportAs).indexOf(this.value) !== -1;\n }", "isReferenceToDirective(directive) {\n return splitExportAs(directive.exportAs).indexOf(this.value) !== -1;\n }", "isReferenceToDirective(directive) {\n return splitExportAs(directive.exportAs).indexOf(this.value) !== -1;\n }", "get allow_external() {\n return this.args.allow_external || !this.inline;\n }", "function isResolvedDeclaration(declaration){if(Array.isArray(declaration)){return declaration.every(isResolvedDeclaration);}return!!resolveForwardRef(declaration);}", "static isLinkRelevant(link) {\n // exclude file protocol links -> they are not working with the office URI protocols\n if (link.startsWith('file://')) {\n return false;\n }\n\n if (LinkUtil.isWopiFrameLink(link)) {\n return true;\n }\n // only consider segment after last slash\n const lastSlashSegment = link.substr(link.lastIndexOf('/'), link.length);\n if (!lastSlashSegment || lastSlashSegment === '') {\n return false;\n }\n\n // test if it as a link which points to a file\n const regexResult = lastSlashSegment.match(/(.*\\.[a-zA-Z]{3,4})($|\\?|#)+/);\n if (regexResult === null || regexResult.length < 2) {\n return false;\n }\n // test if the link points to an ms office document\n return new RegExp(\n `\\\\.(${OfficeFileEnding.getAllFileEndings().join('|')})(^\\\\.|([\\\\?#&].*)|$)`\n ).test(lastSlashSegment);\n }", "get reference () {\n\t\treturn this._reference;\n\t}", "get reference () {\n\t\treturn this._reference;\n\t}", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "function isReferenceToImport(typeChecker, node, importSpecifier) {\n var _a, _b;\n const nodeSymbol = typeChecker.getTypeAtLocation(node).getSymbol();\n const importSymbol = typeChecker.getTypeAtLocation(importSpecifier).getSymbol();\n return !!(((_a = nodeSymbol === null || nodeSymbol === void 0 ? void 0 : nodeSymbol.declarations) === null || _a === void 0 ? void 0 : _a[0]) && ((_b = importSymbol === null || importSymbol === void 0 ? void 0 : importSymbol.declarations) === null || _b === void 0 ? void 0 : _b[0])) &&\n nodeSymbol.declarations[0] === importSymbol.declarations[0];\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri);\r\n }", "function isDeepLikHref(uri) {\n\n var fileName = uri.filename();\n return fileName && ReadiumSDK.Helpers.EndsWith(fileName, \".opf\");\n }", "function getReference(){\n\t\treturn this.reference;\n\t}", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n }", "function isImportedReference(node) {\n var declaration = resolver.getReferencedImportDeclaration(node);\n return declaration && (declaration.kind === 231 /* ImportClause */ || declaration.kind === 234 /* ImportSpecifier */);\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\r\n }", "function isDeepLikHref(uri) {\n\n var fileName = uri.filename();\n return fileName && helpers.EndsWith(fileName, \".opf\");\n }", "function isTextuallyComplexReference(node, fnReferences) {\n var gobj;\n if (node.type !== 'reference')\n return false;\n if (!fnReferences) {\n throw new GSP.createError(\"reference without parents!\");\n }\n gobj = fnReferences[node.name];\n // Scalar parameters are not parenthesized unless their labels require it.\n if (isParameter(gobj) || isLabeledExpressionOrMeasure(gobj)) {\n return gobj.label ? isCompoundString(gobj.label) : false;\n }\n\n // Leave blanks blank.\n if( gobj.parsedInfix && gobj.parsedInfix.type === 'blank') {\n return false;\n } \n \n if( gobj.parsedInfix) {\n throw new GSP.createError(\"non-blank parsed infix not expected in isTextuallyComplexReference\");\n }\n // All other references are parenthesized\n return true;\n}", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }", "static _isLicenseFile(file) {\n return file.token && DefinitionService._isInCoreFacet(file) && (file.natures || []).includes('license')\n }", "function containsMatchingReferenceDiscriminant(source, target) {\n return target.kind === 172 /* PropertyAccessExpression */ &&\n containsMatchingReference(source, target.expression) &&\n isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text);\n }", "function isDeepLikHref(uri) {\n\n var fileName = uri.filename();\n return fileName && Helpers.EndsWith(fileName, \".opf\");\n }", "function isDeepLikHref(uri) {\n\n var fileName = uri.filename();\n return fileName && Helpers.EndsWith(fileName, \".opf\");\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }", "exists() {\n return this.filePointer.exists();\n }", "exists() {\n return this.filePointer.exists();\n }", "isFile() {\n return (this.#type & IFMT) === IFREG;\n }", "isRREF()\r\n {\r\n if (!this.isREF())\r\n return false;\r\n\r\n // check if each leading variable is the only nonzero entry in that column\r\n for (var r = 0; r < this.m; r++)\r\n {\r\n if (this.isZeroRow(r))\r\n break;\r\n\r\n // find column with leading variable to check\r\n var c = this.indexOfLeadingVar(r);\r\n\r\n // search through entries of this column for any other nonzero entries\r\n var varCount = 0;\r\n for (var j = 0; j < this.m; j++)\r\n {\r\n if (this.matrix[j][c] != 0)\r\n varCount++;\r\n }\r\n if (varCount > 1)\r\n return false;\r\n }\r\n\r\n // check if every leading variable is 1\r\n for (var r = 0; r < this.m; r++)\r\n {\r\n if (this.isZeroRow(r))\r\n break;\r\n if (this.matrix[r][this.indexOfLeadingVar(r)] != 1)\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\n }", "function isDocumentRef(o) {\r\n return o && o.onSnapshot;\r\n}", "function HasTheseRefs(obj,refs){\n console.log(\"Se va a comprobar si en el objeto aparecen las referencias \", refs);\n let referencesFound = new Array();\n FindReferences(obj,referencesFound);\n\n for (let i = 0; i < refs.length; i++) {\n if (referencesFound.includes(refs[i])){\n console.log(\"El objeto incluye la referencia \" + refs[i]);\n return true;\n }\n }\n\n console.log(\"Ninguna de esas referencias aparece en el objeto\");\n return false;\n}", "function $Ref () {\n /**\n * The file path or URL of the referenced file.\n * This path is relative to the path of the main JSON schema file.\n *\n * This path does NOT contain document fragments (JSON pointers). It always references an ENTIRE file.\n * Use methods such as {@link $Ref#get}, {@link $Ref#resolve}, and {@link $Ref#exists} to get\n * specific JSON pointers within the file.\n *\n * @type {string}\n */\n this.path = undefined;\n\n /**\n * The resolved value of the JSON reference.\n * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).\n * @type {?*}\n */\n this.value = undefined;\n\n /**\n * The {@link $Refs} object that contains this {@link $Ref} object.\n * @type {$Refs}\n */\n this.$refs = undefined;\n\n /**\n * Indicates the type of {@link $Ref#path} (e.g. \"file\", \"http\", etc.)\n * @type {?string}\n */\n this.pathType = undefined;\n}", "isActive() {\n let propertyList = this.getPropertyList();\n return ByteFormat.fromByte(this.identityFlag, propertyList.identityFlag).isActive;\n }", "isInitialContent() {\n return get(this, '_isInitialContent');\n }", "resourceAnnotation(id) {\n return this.resourceAnnotations.find(\n anno => anno.getResource().id === id || flatten(\n new Array(anno.getBody()),\n ).some(body => body.id === id),\n );\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri);\r\n }", "function isExportReference(node) {\n var container = resolver.getReferencedExportContainer(node);\n return !!container;\n }", "function checkSchemaHasReferences(schema) {\n if (schema.$ref) {\n return true;\n }\n\n return Object.values(schema).some((value) => {\n if (_.isArray(value)) {\n return value.some(checkSchemaHasReferences);\n } else if (_.isObject(value)) {\n return checkSchemaHasReferences(value);\n }\n\n return false;\n });\n}", "function $Ref$4 () {\n /**\n * The file path or URL of the referenced file.\n * This path is relative to the path of the main JSON schema file.\n *\n * This path does NOT contain document fragments (JSON pointers). It always references an ENTIRE file.\n * Use methods such as {@link $Ref#get}, {@link $Ref#resolve}, and {@link $Ref#exists} to get\n * specific JSON pointers within the file.\n *\n * @type {string}\n */\n this.path = undefined;\n\n /**\n * The resolved value of the JSON reference.\n * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).\n * @type {?*}\n */\n this.value = undefined;\n\n /**\n * The {@link $Refs} object that contains this {@link $Ref} object.\n * @type {$Refs}\n */\n this.$refs = undefined;\n\n /**\n * Indicates the type of {@link $Ref#path} (e.g. \"file\", \"http\", etc.)\n * @type {?string}\n */\n this.pathType = undefined;\n}", "hasIntermediateRef( size ){\n\t\twhile(size){\n\t\t\tlet addr = this.index + size;\n\t\t\tif( this.ROMRefs.has( addr ) ){\n\t\t\t\tlet type = this.ROMRefs.get(addr);\n\t\t\t\t\n\t\t\t\t// If the addr is already known to be faulty, then do nothing\n\t\t\t\tif( Ref.isFaulty(type) ){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// If the addr is MAYBE, upgrade it to a Faulty Maybe and continue\n\t\t\t\telse if( type === Ref.MAYBE ){\n\t\t\t\t\tthis.ROMRefs.setFaulty( addr, type );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Otherwise, stop parsing\n\t\t\t\tlet thisName = this.getDesc( this.Head.addr ),\n\t\t\t\t\totherName = this.getDesc( addr );\n\t\t\t\t\t\t\n\t\t\t\tWarning('Unable to finish parsing ' + thisName + ' because known address ' + otherName + ' intersects an opcode');\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tsize--;\n\t\t}\n\t\treturn false;\n\t}", "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\r\n }" ]
[ "0.59585893", "0.58717", "0.5810642", "0.5454659", "0.54032135", "0.53507644", "0.53270566", "0.5291847", "0.51848084", "0.51848084", "0.51796234", "0.51642704", "0.5157608", "0.515552", "0.51153517", "0.5100766", "0.5075157", "0.5075157", "0.50634056", "0.5057964", "0.5045685", "0.5025884", "0.50165737", "0.5000552", "0.49943066", "0.49941805", "0.497225", "0.49689114", "0.4965981", "0.49610358", "0.49441245", "0.49370283", "0.493011", "0.49253577", "0.49118125", "0.4901584", "0.48730993", "0.48693153", "0.48501286", "0.4844547", "0.48376858", "0.4818795", "0.48156422", "0.48151973", "0.48151973", "0.48151973", "0.48151973", "0.4802454", "0.47999427", "0.47688192", "0.47672826", "0.47672826", "0.4758166", "0.4758166", "0.4748359", "0.4748359", "0.47335333", "0.4729983", "0.4729983", "0.47276795", "0.47254792", "0.47217166", "0.47217166", "0.47217166", "0.47217166", "0.47031388", "0.4700874", "0.4699647", "0.4699647", "0.46974415", "0.4696459", "0.46837354", "0.46830148", "0.4682073", "0.4674745", "0.4674745", "0.46727917", "0.46693164", "0.46693164", "0.46693164", "0.46669272", "0.46669272", "0.46653742", "0.46626773", "0.46618217", "0.46616197", "0.4660627", "0.46605226", "0.4655748", "0.4654655", "0.46509367", "0.46473065", "0.46473065", "0.46473065", "0.46473065", "0.4647037", "0.46457952", "0.46427307", "0.46418893", "0.46342537" ]
0.6586814
0
set fileContent that is created by FileContainerloadFiles(), other name is "AnnotationFileObj".
setFileContent(newValue) { this._fileContent = newValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set file(value) { this._file = value; }", "setContent(content) {\r\n return this.clone(File, \"$value\", false).postCore({\r\n body: content,\r\n headers: {\r\n \"X-HTTP-Method\": \"PUT\",\r\n },\r\n }).then(_ => new File(this));\r\n }", "setFile(file) {\n this.file = file;\n }", "set file(value) {\n this._file = value;\n this.renderImage();\n }", "setContent(content) {\r\n return this.clone(AttachmentFile, \"$value\", false).postCore({\r\n body: content,\r\n headers: {\r\n \"X-HTTP-Method\": \"PUT\",\r\n },\r\n }).then(_ => new AttachmentFile(this));\r\n }", "static initialize(obj, file) {\n obj['file'] = file;\n }", "addFile() {\n this.addCustom('type', {\n inputLabel: 'Property value'\n });\n const index = this.model.length - 1;\n const item = this.model[index];\n item.schema.isFile = true;\n item.schema.inputType = 'file';\n this.requestUpdate();\n }", "addFileX(event) {\n let aFile = event.target.files[0];\n if (aFile.type === \"text/plain\"){\n this.files[0] = aFile;\n } \n }", "setFileDetector() {}", "setFileBuffer(fileBuffer) {\n this.fileBuffer = fileBuffer;\n }", "setFile(blob, filename) {\n this.props.callSetFile(blob, filename);\n }", "setFileApi(v) {\n this.fileApi_ = v;\n }", "getDocType(file) {\n this._docType = file.Templates.map(template => template.DocumentType + template.SubDocumentType);\n }", "constructor(fileJSON) {\n this.name = fileJSON.name;\n this.instructions = fileJSON.instructions;\n }", "static initialize(obj, files) { \n obj['files'] = files;\n }", "get file () {\n return this._file\n }", "add(name, content) {\r\n return this.clone(AttachmentFiles_1, `add(FileName='${name}')`, false).postCore({\r\n body: content,\r\n }).then((response) => {\r\n return {\r\n data: response,\r\n file: this.getByName(name),\r\n };\r\n });\r\n }", "toggleFileType() {\n let content = this.model.get(\"content\"),\n title = \"<title>\",\n startTag = 'xml:id=\"',\n fromIndex = 0,\n HTML = \"<h1>\"\n\n HTML += content.substring(content.indexOf(title) + title.length, content.indexOf(\"</title>\")) + \"</h1>\"\n content = content.substring(this.model.get(\"content\").indexOf(\"<text>\"))\n\n while (content.indexOf(startTag, fromIndex) != -1) {\n let endTag = \"</\" + content.substring(0, content.indexOf(startTag, fromIndex)).substring(content.substring(0, content.indexOf(startTag, fromIndex)).lastIndexOf('<') + 1).replaceAll(' ', '').replaceAll(`\n`, '') + '>',\n tag = content.substring(content.indexOf(startTag, fromIndex), content.indexOf(endTag, fromIndex))\n\n let xmlID = content.substring(fromIndex).substring(content.substring(fromIndex).indexOf(startTag) + startTag.length)\n HTML += '<span id=\"' + xmlID.substring(0, xmlID.indexOf('\"')) + '\" class=\"span\">' + tag.substring(tag.indexOf('>') + 1)\n\n fromIndex = content.indexOf(endTag, fromIndex) + endTag.length\n HTML += \"</span>\" + content.substring(fromIndex).substring(0, content.substring(fromIndex).indexOf('<'))\n }\n\n if (!this.$el[0].children[2]) {\n let newChild = document.createElement(\"div\")\n newChild.innerHTML = HTML\n this.$el[0].children[1].parentNode.insertBefore(newChild, this.$el[0].children[1].nextSibling)\n this.$el[0].children[2].style.height = this.$el[0].children[1].offsetHeight + \"px\"\n this.$el[0].children[2].style.overflow = \"auto\"\n this.$el[0].children[2].style.background = \"white\"\n this.$el[0].children[2].style.textAlign = \"justify\"\n this.$el[0].children[2].style.fontFamily = \"roman, 'times new roman', times, serif\"\n }\n\n let filename = this.$el[0].children[0].children[0].children[0].innerText\n if (this.$el[0].children[0].children[0].children[1].children[1].innerText == \"HTML\") {\n this.$el[0].children[0].children[0].children[0].innerText = filename.substring(0, filename.lastIndexOf('.')) + \".html\"\n this.$el[0].children[0].children[0].children[1].children[1].innerText = \"XML\"\n for (let i = 0; i < 2; i++)\n this.$el[0].children[0].children[1].children[i].style.display = \"none\"\n this.$el[0].children[1].style.display = \"none\"\n this.$el[0].children[2].style.display = \"block\"\n }\n else {\n this.$el[0].children[0].children[0].children[0].innerText = filename.substring(0, filename.lastIndexOf('.')) + \".xml\"\n this.$el[0].children[0].children[0].children[1].children[1].innerText = \"HTML\"\n for (let i = 0; i < 2; i++)\n this.$el[0].children[0].children[1].children[i].style.display = \"block\"\n this.$el[0].children[1].style.display = \"block\"\n this.$el[0].children[2].style.display = \"none\"\n }\n }", "function setFileNameWith(file) {\n $(file).parent().parent().find(\".jancyFileWrapTexts\").find(\"span\").width($(file).parent().parent().width() - 197);\n}", "function setFileNameWith(file) {\n $(file).parent().parent().find(\".jancyFileWrapTexts\").find(\"span\").width($(file).parent().parent().width() - 197);\n}", "constructor () {\n this._file = []\n }", "setSourceContent(aSourceFile, aSourceContent) {\n let source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n }", "setFileContents(files) {\n for(let entry of files) {\n this.stream.writeFixedString(entry.data, false);\n }\n }", "setFileID(e) {\n this.fileID = e.target.value;\n this.contenBodyId=this.fileDetails[e.target.value+'contenBodyId'];\n this.versionId=this.fileDetails[e.target.value+'versionId'];\n this.fileExtension=this.fileDetails[e.target.value+'fileExtension'];\n this.versionData=this.fileDetails[e.target.value+'versionData'];\n\n }", "function setData(fileData) {\n if (Object(fileData) === fileData) {\n var propertyValue;\n\n for (var p in fileData) {\n if (fileData.hasOwnProperty(p)) {\n propertyValue = fileData[p];\n\n switch (p) {\n case \"id\":\n case \"fileId\":\n if (id && propertyValue !== id)\n throw new Error(\"Can't change ID for a FileData object.\");\n\n id = propertyValue;\n break;\n case \"file\":\n this.cloudUrl = propertyValue.url();\n case \"thumbnail\":\n this.cloudThumbnailUrl = propertyValue.url();\n case \"file\":\n case \"thumbnail\":\n this.requireDownload = true;\n break;\n case \"mimeType\":\n if (Object(propertyValue) === propertyValue)\n this.mimeType = propertyValue;\n else\n this.mimeType = FileData.mimeTypes.index[propertyValue];\n\n break;\n default:\n this[p] = propertyValue;\n }\n }\n }\n\n if (this.localUrl === undefined) {\n this.localUrl = null;\n this.localThumbnailUrl = null;\n }\n }\n else if (typeof(fileData) === \"string\") {\n id = fileData;\n this.fillData(id);\n }\n else\n throw new Error(\"Invalid data for FileData, must be either object or string representing the FileData's ID.\");\n }", "get file() {\r\n return new File(this, \"file\");\r\n }", "function File() {\n this.lastFileName = \"untitled.map\";\n}", "get filePath() {\n return this.doc.path;\n }", "editorContentCallback(initContent: string, filePath: string) {\n const { setEditorContent } = this.props;\n setEditorContent(initContent, filePath);\n }", "get fileName() {\n return this._fileName;\n }", "saveContentToFile() {\n const newFileName = this.uuidv4() + \".txt\";\n return this.utility.saveToFile(newFileName, this.fileContent);\n }", "static fileWithInfo (fileInfo) {\n switch (fileInfo.extension) {\n case 'json':\n return MoveAnnotated.json(fileInfo)\n case 'txt':\n return MoveAnnotated.txt(fileInfo)\n default:\n throw new Error('unrecognized filetype')\n }\n }", "function processFile(contents,fullFileName) {\n let splitter = \"Instance:\"\n //let arResults = []\n let arInstances = contents.split(splitter); //the instances defined in this file\n\n arInstances.forEach(function(i) { //check each instance\n\n let fileContents = splitter + i //add back in the splitter\n //arResults.push(splitter + i)\n //console.log(fileContents)\n let summary = {description:\"\",title:\"\"}\n let ar = fileContents.split('\\n')\n ar.forEach(function(lne){\n lne = lne.replace(/['\"]+/g, ''); //get rid of all the quotes\n if (lne.substr(0,11) == 'InstanceOf:') {\n summary.type = lne.substr(12)\n } else if (lne.substr(0,9) == 'Instance:') {\n summary.id = lne.substr(10)\n } else if (lne.substr(0,11) == '//BaseType:') {\n summary.baseType = lne.substr(12).trim();\n }else if (lne.substr(0,6) == 'Title:') {\n summary.title = lne.substr(7)\n } else if (lne.substr(0,12) == 'Description:') {\n summary.description = lne.substr(13)\n }\n })\n\n if (summary.type && summary.id) {\n //summary.content = fileContents;\n \n summary.fileName = fullFileName\n if (summary.baseType) {\n summary.link = summary.baseType + \"-\" + summary.id + \".json.html\"\n }\n \n hashExamples[summary.type] = hashExamples[summary.type] || []\n hashExamples[summary.type].push(summary);\n }\n\n\n console.log(summary.id)\n\n })\n \n\n\n}", "constructor(source = {}) {\n super(source, schema_1.ServiceTypes.File);\n }", "getDefaultFileData () {\n return this.getFileData(EXAMPLE_PATH)\n }", "function openFile(content, fileExtension) {\n var counter = 1;\n var doc = DocumentManager.createUntitledDocument(counter, fileExtension);\n doc.setText(content);\n }", "function fileData(file, id) {\n return {\n id: id,\n storage: 'cache',\n metadata: {\n size: file.size,\n filename: file.name,\n mime_type: file.type,\n }\n }\n}", "saveContentToFile() {\n return this.file.saveContentToFile();\n }", "constructor(file) {\n this._file = file\n this.size = file.size\n }", "function setFile(url){\n\tfile = url;\n}", "readin () {\n this.content = readFile(this.path);\n }", "function getFileContent(extension){\n if( $scope[extension+'_file'] )\n {\n File.index({ mode: 'editfile', 'path': $scope[extension+'_file'] }).then(function (resp) {\n if( extension == \"html\" ) {\n $scope.editHtml = filterHtml(ProjectObject, resp.result, $config, user_id, organization_id);\n setTimeout(function(){\n generatePreview();\n },100);\n }\n else\n $scope['edit'+capitalizeFirstLetter(extension)] = resp.result;\n },function(){\n toastr.error(\"Unable to load file\");\n });\n }\n else{\n $scope['edit'+ capitalizeFirstLetter(extension)] = \"\";\n }\n }", "static io_setfile(filename, base64ContentStr, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.io_setfile({0},{1})\".format(filename, base64ContentStr));\n Database.setfile(filename, base64ContentStr, fcn);\n }", "_save() {\n let content = this.input.getContent().split(\"</div>\").join(\"\")\n .split(\"<div>\").join(\"\\n\");\n this.file.setContent(content);\n\n // create new file\n if (this.createFile)\n this.parentDirectory.addChild(this.file);\n }", "viderLaFile(){\n this.file = [];\n }", "function isFile(obj) {\n return isBlob(obj) && isString(obj.name);\n }", "function pbxBuildFileObj(file) {\n var obj = Object.create(null);\n\n obj.isa = 'PBXBuildFile';\n obj.fileRef = file.fileRef;\n obj.fileRef_comment = file.basename;\n if (file.settings) obj.settings = file.settings;\n\n return obj;\n}", "function pbxBuildFileObj(file) {\n var obj = Object.create(null);\n\n obj.isa = 'PBXBuildFile';\n obj.fileRef = file.fileRef;\n obj.fileRef_comment = file.basename;\n if (file.settings) obj.settings = file.settings;\n\n return obj;\n}", "getFileContents() {\n for (let entry of this.files) {\n entry.data = this.stream.getFixedString(entry.size);\n }\n }", "get fileFormat() {\n return 'json';\n }", "setFiles(files) {\n // last entry is an empty file to signal the end of the header\n files.push({});\n for (let entry of files) {\n this.stream.writeString(entry.name);\n this.stream.writeInt(entry.packing);\n this.stream.writeInt(entry.originalSize);\n\n // reserved 4 null bytes\n this.stream.writeInt(0);\n\n this.stream.writeInt(entry.timestamp);\n this.stream.writeInt(entry.size);\n }\n }", "get originalFileName() {\n return this._obj.originalFileName;\n }", "get format(){return this._format||defP(this,'_format',IOFile.getFormatFromExt(this.path))}", "function isFile(obj) {\n return isBlob(obj) && isString(obj.name);\n }", "apply(contents) {\n this.filePointer.apply(contents);\n return this;\n }", "function handleFileChange(event) {\n file.current = event.target.files[0];\n }", "getByName(name) {\r\n const f = new File(this);\r\n f.concat(`('${name}')`);\r\n return f;\r\n }", "function File() {\n\t/**\n\t * The data of a file.\n\t */\n\tthis.data = \"\";\n\t/**\n\t * The name of the file.\n\t */\n\tthis.name = \"\";\n}", "function File() {\n\t/**\n\t * The data of a file.\n\t */\n\tthis.data = \"\";\n\t/**\n\t * The name of the file.\n\t */\n\tthis.name = \"\";\n}", "function File(info) {\n this.name = info.name;\n this.kind = info.kind;\n this.genre = info.genre;\n this.size = info.size;\n this.last_revision = info.commit_revision;\n this.author = info.commit_author;\n this.last_date = info.commit_date;\n this.id = info.index;\n this.commit_history = {};\n this.comments = [];\n}", "set store_file(file_or_fullPath) {\n //\n // file_or_fullPath is a Json file\n if (file_or_fullPath) {\n // ignore if already set\n if (this._store === file_or_fullPath) {\n return;\n }\n this._store = file_or_fullPath;\n return;\n }\n //\n // Else file_or_fullPath is a string full_path\n // ignore if already set\n if (this._store.full_path === file_or_fullPath) {\n return;\n }\n this._store = new Json_File({\n full_path: file_or_fullPath,\n });\n }", "_$name() {\n super._$name();\n\n if (this._node.id) {\n this._value.name = this._node.id.name;\n } else {\n this._value.name = NamingUtil.filePathToName(this._pathResolver.filePath);\n }\n }", "constructor( content, )\n\t{\n\t\tthis.#content= `${content}`;\n\t}", "function uploadFiles() {\n let fileToUpload = document.getElementById(\"myFile\").files;\n samples = []\n\n for (var i = 0; i < fileToUpload.length; i++) {\n if (fileToUpload[i].type.includes('image')) {\n\n let temp = {\n imageUrl: URL.createObjectURL(fileToUpload[i]),\n }\n samples.push(temp)\n\n }\n else if (fileToUpload[i].type.includes('text') && fileToUpload.length === 1) {\n let fileReader = new FileReader();\n fileReader.onload = function (fileLoadedEvent) {\n let textFromFileLoaded = fileLoadedEvent.target.result.split('\\n')\n textFromFileLoaded.forEach(function (element) {\n let temp = {\n document: element,\n annotation: []\n }\n samples.push(temp)\n })\n\n };\n\n fileReader.readAsText(fileToUpload[i], \"UTF-8\");\n\n }\n else {\n window.alert('Välj endast en textfil eller flera bilder')\n break\n }\n }\n}", "function saveAnnDataFileHelper(file, fileToSave) {\n if (file.data_type) {\n const AnnDataFile = formState.files.find(AnnDataFileFilter)\n\n if (file.data_type === 'cluster') {\n AnnDataFile.ann_data_file_info.data_fragments['cluster_form_info'] = file\n }\n if (file.file_type === 'expression') {\n AnnDataFile.ann_data_file_info.data_fragments['extra_expression_form_info'] = file\n }\n fileToSave = AnnDataFile\n } else {\n // enable ingest of data by setting reference_anndata_file = false\n if (fileToSave.file_type === 'AnnData') {fileToSave['reference_anndata_file'] = false}\n formState.files.forEach(fileFormData => {\n if (fileFormData.file_type === 'Cluster') {\n fileToSave = formState.files.find(f => f.file_type === 'AnnData')\n fileFormData.data_type = 'cluster'\n\n // multiple clustering forms are allowed so add each as a fragment to the AnnData file\n fileToSave?.ann_data_file_info ? '' : fileToSave['ann_data_file_info'] = {}\n const fragments = fileToSave.ann_data_file_info?.data_fragments || []\n fragments.push(fileFormData)\n fileToSave.ann_data_file_info.data_fragments = fragments\n }\n if (fileFormData.file_type === 'Expression Matrix') {\n fileToSave['extra_expression_form_info'] = fileFormData\n }\n if (fileFormData.file_type === 'Metadata') {\n fileToSave['metadata_form_info'] = fileFormData\n }\n })\n }\n return fileToSave\n }", "get files() {\r\n return new Files(this);\r\n }", "createFile(text){\n this.model.push({text});\n\n // This change event can be consumed by other components which\n // can listen to this event via componentWillMount method.\n this.emit(\"change\")\n }", "getOriginalFilename () {\n if (!this.originalFilename) {\n this.originalFilename = this.getDoc().originalFilename\n }\n\n return this.originalFilename\n }", "function textContent(source){\n this.contentTitre = source.contentTitre;\n this.contentPara = source.contentPara;\n this.isImage = source.isImage;\n}", "function showFileContent(file) {\n filewrapper.style.display = 'block'\n filename.innerHTML = file.name\n filewrapper.style.color = 'green'\n filewrapper.classList.add('animation');\n}", "setPath(path) {\n this.filePath = path;\n }", "function openSchemaFile()\r\n{\r\n jsonFileOpener.showOpenDialog();\r\n\r\n let fileContentString = jsonFileOpener.getJsonFileContentString();\r\n if (fileContentString) jsonEditorHandler.setJsonEditorSchemaString(fileContentString);\r\n}", "setContent(content) {\r\n return this.clone(Photo_1, \"$value\", false).patchCore({\r\n body: content,\r\n });\r\n }", "function handleFileSelect(evt){\n var f = evt.target.files[0]; // FileList object\n window.reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function(theFile){\n return function(e){\n editor.setData(e.target.result);\n evt.target.value = null; // allow reload\n };\n })(f);\n // Read file as text\n reader.readAsText(f);\n thisDoc = f.name;\n }", "setJSCADData(data, fileName) {\n this.processor.setJsCad(data);\n // save current settings (if a file is loaded)\n if (this.currentFileName) {\n console.log('saving viewport settings');\n this.settingsCache[this.currentFileName] = this.getViewportSettings();\n // and store entire state in VSCode\n this.vscode.setState(this.settingsCache);\n }\n // restore settings for new file\n if (typeof this.settingsCache[fileName] !== 'undefined') {\n this.setViewportSettings(this.settingsCache[fileName]);\n }\n this.currentFileName = fileName;\n // update class so we know we have content\n this.container.classList.add('jscad-viewer-has-file');\n }", "getRenameContent(newScreenName) {\n const newContent = Object.assign({}, this.content)\n newContent.Properties['$Name'] = newScreenName\n const result = TAG_BEGIN + TAG_NEWLINE + TAG_CONTENT_TYPE + TAG_NEWLINE +\n JSON.stringify(newContent) +\n TAG_NEWLINE + TAG_END\n return result\n }", "static initialize(obj, file, thumbnail, title, description, subjectId) { \n obj['file'] = file;\n obj['thumbnail'] = thumbnail;\n obj['title'] = title;\n obj['description'] = description;\n obj['subject_id'] = subjectId;\n }", "constructor (...args) {\n super(...args)\n\n this.editorText = new EditorText(this)\n this.terminal = new Terminal(this)\n this.title = $('<h1></h1>').text('file')\n\n this.dragRemove = dragDrop('body', (files) => {\n if (this.ide.currentPage !== this) return false\n if (!files || files.length < 1) return false\n\n const file = files[0]\n const code = new TextDecoder('utf-8').decode(file)\n\n this.editorText.setCode(code)\n })\n\n this.file = {\n filepath: null,\n filename: null,\n content: null\n }\n }", "setToRemoteFile(file, originalFileName = origFileNameDefault) {\n let [ssName, storageService] = getStorageService();\n this._obj.state = remote_file;\n this._obj.location = file;\n this._obj.originalFileName = originalFileName;\n this._obj.ss = ssName;\n }", "function FileRef(fileURL, docURL) {\r this.file = new File(fileURL, docURL);\r this.refs = new Array();\r}", "function onArtifactFileChange() {\n // Show the name of the file\n if (this.files.length > 0) {\n $('#labelArtifactFile').text(this.files[0].name);\n }\n}", "async setFile(output, path) {\n const type = Path.extname(path).substring(1);\n const file = Path.join(this.settings.directory, path);\n const mime = this.settings.strict ? this.settings.types[type] : this.settings.types[type] || 'application/octet-stream';\n if (!mime || !Fs.existsSync(file) || !Fs.lstatSync(file).isFile()) {\n response_1.Response.setStatus(output, 404);\n }\n else {\n response_1.Response.setStatus(output, 200);\n response_1.Response.setContent(output, await Util.promisify(Fs.readFile)(file), mime);\n }\n }", "function TuningFileModule()\n{\n this.mFile = \"\";\n}", "get name() {\n return this.fileName;\n }", "function customFileUpload(obj, opt) {\r\n\tif(obj) {\r\n\t\tthis.options = {\r\n\t\t\tjsActiveClass:'file-input-js-active',\r\n\t\t\tfakeClass:'file-input-value',\r\n\t\t\thoverClass:'hover'\r\n\t\t}\r\n\t\tthis.fileInput = obj;\r\n\t\tthis.fileInput.custClass = this;\r\n\t\tthis.init();\r\n\t}\r\n}", "constructor(id=0,name = '',text='No text added',position=0, files = []) {\n this.id = id;\n this.name = escapeTags(name);\n this.text = escapeTags(text);\n this.position =position;\n this.files = files;\n }", "function changeInputTypeFile(){\n\n //show loaded file name\n\n $('.blog-form input[type=\"file\"]').change(function(){\n\n var formWrap = $(this).parents('.blog-form');\n\n formWrap.find('.load-file-text').text($(this)[0].files[0].name);\n\n formWrap.find('.remove-file').addClass('show');\n\n trueBlogItemHeight();\n\n });\n\n //remove loaded file\n\n $(document).on('click', '.blog-form .remove-file.show', function(){\n\n var formWrap = $(this).parents('.blog-form');\n formWrap.find('input[type=\"file\"]').val('');\n formWrap.find('.remove-file.show').removeClass('show');\n formWrap.find('.load-file-text').text('');\n trueBlogItemHeight();\n\n });\n\n }", "setAnnotation(text) {\n this.annotation = text;\n }", "SetContentPipeline(content){\n\t\tthis._content = content;\n\t}", "fileString() {\n return this.id + \" \" + this.type + \" \" + this.note + \" \" + this.amount;\n }", "function FileHandler() {\r\n\t\r\n\t// ******************************************************************************\r\n\t// Properties\r\n\t// ******************************************************************************\t\r\n var m_enabled=false;\r\n var m_codification=\"UTF-8\";\r\n var m_error=null;\r\n \r\n var m_contents=null;\r\n var m_type=null;\r\n var m_size=null;\r\n var m_name=null;\r\n \r\n\t// ******************************************************************************\r\n\t// Constructor\r\n\t// ****************************************************************************** \r\n \r\n if (window.File && window.FileReader && window.FileList && window.Blob) {\r\n m_enabled=true;\r\n }else{\r\n \t\r\n \tif (debug && console){\r\n \t\tconsole.error(\"File FileReader FileList Blob not Enabled!\");\t\r\n \t}\r\n \r\n m_error=languageModule.getCaption(\"FH_ERROR_BROWSER_NOT_HTML5\");\r\n }\r\n \r\n\t// ******************************************************************************\r\n\t// Private Methods\r\n\t// ******************************************************************************\r\n \r\n \r\n\t// ******************************************************************************\r\n\t// Public Methods Publication\r\n\t// ****************************************************************************** \r\n this.isEnabled=isEnabled;\r\n this.setCodification=setCodification;\r\n this.openJsonFile=openJsonFile;\r\n this.openImageFile=openImageFile;\r\n this.getName=getName;\r\n this.getType=getType;\r\n this.setType=setType;\r\n this.getSize=getSize;\r\n this.getError=getError; \r\n \r\n\t// ******************************************************************************\r\n\t// Public Methods Definition\r\n\t// ******************************************************************************\r\n\r\n function isEnabled() {\r\n return m_enabled;\r\n }\r\n \r\n function setCodification(arg) {\r\n m_codification=arg;\r\n }\r\n \r\n /* The parameter must be an input file html element */\r\n /* Returns true or false according to result */\r\n function openJsonFile(fHandler, readCallback) {\r\n \t\r\n \t\ttry {\r\n m_type=fHandler.type;\r\n m_size=fHandler.size;\r\n m_name=fHandler.name;\r\n \r\n var fReader = new FileReader();\r\n \r\n fReader.onerror = function (e){\r\n \t \r\n \t if (debug && console){\r\n \t\t console.log(\"Error code %s\", e.target.error.code);\r\n \t }\r\n \r\n m_error=e.target.error;\r\n };\r\n \r\n fReader.onload = readCallback;\r\n \r\n fReader.readAsText(fHandler, m_codification);\r\n \r\n if (debug && console){\r\n \tconsole.log(\"FileHandler, file type: \"+ fHandler.type);\r\n }\r\n } catch(e) {\r\n console.error(e);\r\n m_error=e.message;\r\n alert(e);\r\n return false;\r\n }\r\n \r\n return true;\r\n }\r\n \r\n /* The parameter must be an input file html element */\r\n /* Returns true or false according to result */\r\n function openImageFile(fHandler) {\r\n \t\ttry {\r\n \t\t\tif (debug && console){\r\n \t\t\t\tconsole.log(\"FileHandler, process file : \"+ fHandler.name);\r\n \t\t\t}\r\n \r\n // Read the image using FileReader\r\n readImage(fHandler, fHandler.name);\r\n \r\n }catch(e) {\r\n \tif (debug && console){\r\n \t\tconsole.error(e);\t\r\n \t}\r\n \r\n m_error=e.message;\r\n return false;\r\n }\r\n \r\n return true;\r\n }\r\n \r\n function readImage(fHandler, file_name){\r\n var fReader = new FileReader();\r\n \r\n fReader.onerror = function (e){\r\n \t\r\n \tif (debug && console){\r\n \tconsole.log(\"Local Image loading error: \", file_name);\r\n console.log(\"Error code %s\", e.target.error.code);\r\n \t}\r\n \r\n \t\t\tvar event = $.Event( \"LocalScenarioImageLoadingError\" );\r\n event.imageError=e.target.error.code;\r\n \t\t\tevent.imageName=file_name; \t\t\t\r\n \t\t\t\r\n \t\t\t$(window).trigger( event );\r\n };\r\n \r\n fReader.onload = function (e){\r\n \t//console.log(\"Local Image succesfuly read: \", file_name);\r\n \t \r\n \t\t\tvar event = $.Event( \"LocalScenarioImageLoaded\" );\r\n \t\t\tevent.imageData=e.target.result;\r\n \t\t\tevent.imageName=file_name;\r\n \t\t\t\r\n \t\t\t$(window).trigger( event ); \t \r\n };\r\n \r\n fReader.readAsDataURL(fHandler); \t\r\n }\r\n \r\n function getName() {\r\n return m_name;\r\n }\r\n \r\n function getType() {\r\n return m_type;\r\n }\r\n \r\n function setType(arg) {\r\n m_type=arg;\r\n }\r\n \r\n function getSize() {\r\n return m_size;\r\n }\r\n \r\n function getError() {\r\n return m_error;\r\n }\r\n}", "function objToSaveFormat(obj, parent) {\n const parentId = parent === null ? null : parent.id;\n const type = isFolder(obj) ? \"folder\" : \"file\";\n var element = {id: obj.id, parent: parentId, name: obj.name, type: type};\n if (obj.content != undefined) {\n element.content = obj.content;\n }\n return element;\n }", "loadfile() {\n if (!this.file) return 0;\n if (!fs.existsSync(this.file)) return 0;\n\n try {\n var chardata = JSON.parse(fs.readFileSync(this.file));\n Object.assign(this, chardata);\n } catch (err) {\n console.log(\"ERROR - Reading character file:\", err);\n return 0;\n }\n return 1;\n }", "function gotFile(file) {\n createDiv(\"<h1>\"+file.name+\"</h1>\").class(tabNumber).parent(\"left\");\n\n // Handle image and text differently\n if (file.type === 'image') {\n createImg(file.data);\n } \n else if (file.type === 'text') {\n tabs[file.name] = new Tab(file.name, tabNumber);\n switchTab(file.name, tabNumber);\n analyzeText(file, tabNumber);\n }\n}", "function addMetadata(vFile, destinationFilePath) {\n vFile.data = {\n destinationFilePath,\n destinationDir: path.dirname(destinationFilePath),\n };\n}", "function addMetadata(vFile, destinationFilePath) {\n vFile.data = {\n destinationFilePath,\n destinationDir: path.dirname(destinationFilePath),\n };\n}", "function addMetadata(vFile, destinationFilePath) {\n vFile.data = {\n destinationFilePath,\n destinationDir: path.dirname(destinationFilePath),\n };\n}", "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId,internalReference,documentType,description,dateCreated,diffusionDate,externalReference,localization,form,status);\n //Internal Reference as Full\n } else if (projectType == \"Full\") {\n internalReference = documentType + \"-\" + padToFour(projectCode) + \"-\" + padToTwo(avenant) + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n //Internal Reference as Full Without Project \n } else {\n\n internalReference = documentType + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n }\n }", "function changeFile(event){\n const file = event.target.files[0]\n if(file){\n setFile({file})\n }\n }", "static json ({ filepath, newFilepath, fileInfo }) {\n return fs.readJson(filepath)\n .then(json => {\n json['file_info'] = fileInfo\n return fs.writeJson(newFilepath, json)\n })\n }" ]
[ "0.65016633", "0.61474425", "0.5982911", "0.58341795", "0.57520753", "0.5708736", "0.5687193", "0.56840855", "0.55140245", "0.54164326", "0.53752667", "0.537014", "0.53221846", "0.5307187", "0.52614194", "0.5253248", "0.5249531", "0.5239421", "0.5221207", "0.5221207", "0.52205044", "0.51658154", "0.51349926", "0.51150936", "0.50586784", "0.5055862", "0.5046675", "0.50427544", "0.5012887", "0.5003993", "0.49917233", "0.49618867", "0.49617288", "0.49504063", "0.49425477", "0.49407122", "0.49339134", "0.49323502", "0.49265063", "0.49212798", "0.49056044", "0.4902015", "0.48978537", "0.48789477", "0.48665684", "0.48658442", "0.48502398", "0.48502398", "0.4842349", "0.48338404", "0.48279297", "0.48276344", "0.4820448", "0.48148334", "0.4809666", "0.48036873", "0.47884208", "0.47830155", "0.47830155", "0.47809187", "0.47763985", "0.47747424", "0.47655818", "0.47495916", "0.47491068", "0.47343162", "0.47326887", "0.47206947", "0.47159547", "0.47132522", "0.47111556", "0.4709857", "0.47098112", "0.4705504", "0.46957758", "0.46930638", "0.4692964", "0.4687501", "0.46826002", "0.46687803", "0.46479833", "0.46441796", "0.46430132", "0.46317998", "0.46254525", "0.46133697", "0.4613173", "0.46129096", "0.460808", "0.46077976", "0.46060318", "0.46056363", "0.46042824", "0.45995873", "0.45964667", "0.45964667", "0.45964667", "0.45957935", "0.45950505", "0.4590279" ]
0.6707207
0
true is the annotation can edit and delete.(reference annotation can not editable)
isEditable() { return !this.isReference(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEditAllowed()\n {\n return activeInitData.editAllowed === true;\n }", "isDeletePermitted() {\n return this.checkAdminPermission('delete')\n }", "function enableEdit() {\n\t if (_enabled) {\n\t return;\n\t }\n\t\n\t _enabled = true;\n\t (0, _event.addEventListener)('annotation:click', handleAnnotationClick);\n\t}", "function flagToDelete() {\n _this.canDelete = true;\n }", "canEdit(record) {\n return false;\n }", "get canEdit() {\n return this.isEditable && !this.alwaysEditing && !!this.recordFields.length;\n }", "get isEditable() {\n return this.options.editable && this.view && this.view.editable;\n }", "canEdit(record) {\n return record.isLeaf;\n }", "isEditable() {\n if (!this.user) {\n return false;\n }\n // If the comment has been deleted, it should only be editable\n // by site admins or the user who deleted it.\n if (this.activity.deleted_by) {\n return this.user.is_admin || this.activity.deleted_by === this.user.email;\n }\n // If the comment is not deleted, site admins or the author can edit.\n return this.user.email === this.activity.author || this.user.is_admin;\n }", "function canDelete (user) {\n if (user && _.contains(user.roles, 'paste-delete')) {\n return true\n } else { \n return false;\n }\n}", "function setCanEdit(value) {\n\t _canEdit = value;\n\t}", "function toggleAnnotation() {\n\t\tif (Aloha.activeEditable) {\n\t\t\tvar range = Selection.getRangeObject();\n\t\t\tif (findWaiLangMarkup(range)) {\n\t\t\t\tremoveMarkup(range);\n\t\t\t} else {\n\t\t\t\taddMarkup(range);\n\t\t\t\tfocusOn(FIELD);\n\t\t\t}\n\t\t}\n\t}", "function toggleAnnotations(){\n if(annotFlag){\n $('#anoToggle i').removeClass('icon-edit');\n $('#anoToggle i').addClass('icon-pencil');\n addConsoleMessage(\"Showing all annotations.\");\n hideAllAnnotations();\n }\n else{\n $('#anoToggle i').removeClass('icon-pencil');\n $('#anoToggle i').addClass('icon-edit');\n addConsoleMessage(\"Hide all annotations\");\n showAllAnnotations();\n }\n}", "static _canModify(user, doc, data) {\n if (user.isGM) return true; // GM users can do anything\n return doc.data.author === user.id; // Users may only update their own created drawings\n }", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "function allowedToEdit() {\n\t\treturn role === 'farm_admin' || role === 'farmer';\n\t}", "get editable() {}", "edit() {\n return this._isAdmin();\n }", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "function hasAnnotation() {\n if (document.getElementById('ImageAnnotationAddButton')) {\n return true;\n } else {\n return false;\n }\n}", "function canDelete(obj, name) {\n if (obj === void 0 || obj === null) { return false; }\n return obj[name + '_canDelete___'] === obj;\n }", "function handleDelete(event) {\n if (globals.editedAnnotationsId === undefined)\n return;\n\n deleteAnnotation(event, globals.editedAnnotationsId);\n }", "isEdited() {\n return this._canvas.getObjects().length > 0;\n }", "canEdit() {\n return ['jpg', 'jpeg', 'png'].indexOf(this.item.extension.toLowerCase()) > -1;\n }", "function isEditor() {\n var user = Session.getActiveUser().getEmail();\n return EDITORS.indexOf(user) >= 0;\n}", "function editClicked() {\n edit = true;\n}", "function canEdit(editor, editee){\n return isAncestor(editee, editor);\n}", "_supports(attribute, subject) {\n\n if (attribute !== this.EDIT) {\n return false;\n }\n\n // only vote on Post objects inside this voter\n if (false === (subject.getDomainObjectName() === 'posts')) {\n return false;\n }\n\n return true;\n }", "function De(){return!1===B.allowannotations&&L(\"InitError\",'The \"allowannotations\" property in the WebDocumentViewer config is set to false.'),B.allowannotations}", "function handleShowAnnotationsToggle(event) {\n globals.drawAnnotations = $('#draw_annotations').is(':checked');\n if (globals.drawAnnotations) {\n tool.drawExistingAnnotations(globals.currentAnnotationsOfSelectedType);\n } else {\n tool.clear();\n }\n }", "toggleEdit() {\n this.editing = !this.editing;\n }", "function removeButtonDisabled() {\n return (vm.annotType.options.length <= 1);\n }", "function disallowEdit() {\n setAllowEdit(false);\n }", "isDeleting() {\n return (this.deleteDiscountId != null);\n }", "function addPermissionsCheckboxes(editor, ident, authz) {\n function createLoadCallback(action) {\n return function loadCallback(field, annotation) {\n field = util.$(field).show();\n\n var u = ident.who();\n var input = field.find(\"input\");\n\n // Do not show field if no user is set\n if (typeof u === \"undefined\" || u === null) {\n field.hide();\n }\n\n // Do not show field if current user is not admin.\n if (!authz.permits(\"admin\", annotation, u)) {\n field.hide();\n }\n\n // See if we can authorise without a user.\n if (authz.permits(action, annotation, null)) {\n input.attr(\"checked\", \"checked\");\n } else {\n input.removeAttr(\"checked\");\n }\n };\n }\n\n function createSubmitCallback(action) {\n return function submitCallback(field, annotation) {\n var u = ident.who();\n\n // Don't do anything if no user is set\n if (typeof u === \"undefined\" || u === null) {\n return;\n }\n\n if (!annotation.permissions) {\n annotation.permissions = {};\n }\n if (util.$(field).find(\"input\").is(\":checked\")) {\n delete annotation.permissions[action];\n } else {\n // While the permissions model allows for more complex entries\n // than this, our UI presents a checkbox, so we can only\n // interpret \"prevent others from viewing\" as meaning \"allow\n // only me to view\". This may want changing in the future.\n annotation.permissions[action] = [authz.authorizedUserId(u)];\n }\n };\n }\n\n editor.addField({\n type: \"checkbox\",\n label: _t(\"Allow anyone to <strong>view</strong> this annotation\"),\n load: createLoadCallback(\"read\"),\n submit: createSubmitCallback(\"read\"),\n });\n\n editor.addField({\n type: \"checkbox\",\n label: _t(\"Allow anyone to <strong>edit</strong> this annotation\"),\n load: createLoadCallback(\"update\"),\n submit: createSubmitCallback(\"update\"),\n });\n }", "function n(e){return e&&null!=e.applyEdits}", "function enableParaAnnotating_Danno()\r\n{\r\n //\r\n //return; // off for now\r\n // High para\r\n var annotations = {}\r\n var annotationComments = {}\r\n var bodyDiv = jQ(\"div.body > div:first\");\r\n var last = null;\r\n var annotateDiv = \"<div class='annotate-form' style='background-color: transparent;'><textarea cols='80' rows='8'></textarea><br/>\";\r\n annotateDiv += \"<button class='cancel'>Cancel</button>&#160;\"\r\n annotateDiv += \"<button class='submit'>Submit</button> <span class='info'></span>\"\r\n annotateDiv += \"</div>\";\r\n annotateDiv = jQ(annotateDiv);\r\n var textArea = annotateDiv.find(\"textarea\");\r\n var unWrapLast = function() { if(last!=null){last.parent().replaceWith(last); last=null;} }\r\n //\r\n var decorateAnnotation = function(anno) {\r\n var d;\r\n if (anno.hasClass(\"closed\")) d = jQ(\"<span>&#160; <span class='delete-annotate command'> Delete</span></span>\");\r\n else d = jQ(\"<span>&#160;<span class='close-annotate command'>Close</span>&#160;<span class='annotate-this command'>Reply</span></span>\");\r\n anno.find(\"div.anno-info:first\").append(d);\r\n var deleteClick = function(e) {\r\n var id = anno.attr(\"id\");\r\n jQ.post(window.location+\"?\", {ajax:\"annotea\", id:id, method:\"delete\"},\r\n function(rt){if(rt==\"Deleted\") {anno.remove(); } }, \"text\");\r\n }\r\n var closeClick = function(e) {\r\n var id = anno.attr(\"id\");\r\n var callback = function(responseText, statusCode) {\r\n var updatedAnno = jQ(responseText);\r\n decorateAnnotation(updatedAnno);\r\n anno.replaceWith(updatedAnno);\r\n updatedAnno.find(\"div.inline-annotation\").each(function(c){ var anno=jQ(this); decorateAnnotation(anno); });\r\n }\r\n jQ.post(window.location+\"?\", {ajax:\"annotea\", id:id, method:\"close\"},\r\n callback, \"text\");\r\n }\r\n var replyClick = function(e) {\r\n var id = anno.attr(\"id\");\r\n annotate(anno);\r\n }\r\n d.find(\"span.close-annotate\").click(closeClick);\r\n d.find(\"span.annotate-this\").click(replyClick);\r\n d.find(\"span.delete-annotate\").click(deleteClick);\r\n }\r\n //\r\n var annotate = function(me) {\r\n if(last!=null) { annotateDiv.find(\"button.close\").click(); unWrapLast(); }\r\n var id = me.attr(\"id\");\r\n if(typeof(id)==\"undefined\") { return; }\r\n var closeClick = function() { annotationComments[id] = jQ.trim(textArea.val()); unWrapLast(); }\r\n var submitClick = function() {\r\n unWrapLast();\r\n annotationComments[id] = \"\";\r\n var url = window.location;\r\n var text = jQ.trim(textArea.val());\r\n if(text==\"\") return;\r\n var html = me.wrap(\"<div/>\").parent().html(); // Hack to access the outerHTML\r\n me.parent().replaceWith(me);\r\n var d = {ajax:\"annotea\", paraId:id,\r\n html:html, text:text, method:\"add\" };\r\n var callback = function(responseText, statusCode) {\r\n jQ.get(\"\", {\"ajax\":\"annotea\", \"method\":\"getAnnos\", \"url\":responseText}, callback_j, \"json\");\r\n }\r\n selfUrl = me.find(\"input[name='selfUrl']\").val() || \"\";\r\n rootUrl = me.find(\"input[name='rootUrl']\").val() || \"\";\r\n d[\"inReplyToUrl\"] = selfUrl;\r\n d[\"rootUrl\"] = rootUrl;\r\n url += \"?\" // work around a jQuery bug\r\n jQ.post(url, d, callback, \"text\");\r\n }\r\n var restore = function() {\r\n if(id in annotationComments) {textArea.val(annotationComments[id]);} else {textArea.val(\"\");}\r\n }\r\n restore();\r\n // wrap it\r\n me.wrap(\"<div class='inline-annotation-form'/>\");\r\n me.parent().append(annotateDiv);\r\n annotateDiv.find(\"button.clear\").click(function(){textArea.val(\"\");});\r\n annotateDiv.find(\"button.cancel\").click(function(){textArea.val(annotationComments[id]); closeClick();});\r\n annotateDiv.find(\"button.close\").click(closeClick);\r\n annotateDiv.find(\"button.submit\").click(submitClick);\r\n me.parent().prepend(\"<div class='app-label'>Comment on this:</div>\");\r\n unWrapLast();\r\n last = me;\r\n textArea.focus();\r\n }\r\n \r\n //\r\n var click = function(e) {\r\n var t = e.target;\r\n var me = jQ(t).parent();\r\n var name = me[0].tagName;\r\n if (name==\"P\" || name==\"DIV\" || name.substring(0,1)==\"H\"){\r\n removePilcrow();\r\n // me\r\n annotate(me);\r\n } else {\r\n alert(name);\r\n }\r\n return false;\r\n }\r\n //\r\n var getSelectedText = function(){\r\n if(window.getSelection) return window.getSelection();\r\n if(document.getSelection) return document.getSelection();\r\n if(document.selection) return document.selection.createRange().text;\r\n return \"\";\r\n }\r\n\r\n var pilcrowSpan = jQ(\"<span class='pilcrow command'> &#xb6;</span>\");\r\n var prTimer = 0;\r\n var addPilcrow = function(jqe) { if(prTimer)clearTimeout(prTimer); jqe.append(pilcrowSpan);\r\n pilcrowSpan.unbind(); pilcrowSpan.click(click);\r\n pilcrowSpan.mousedown(function(e){ return false; });\r\n pilcrowSpan.mouseup(click); // for I.E.\r\n }\r\n var removePilcrow = function() { prTimer=setTimeout(function(){prTimer=0; pilcrowSpan.remove();}, 100); }\r\n bodyDiv.mouseover(function(e) {\r\n var t = e.target;\r\n var name = t.tagName;\r\n if(name!=\"P\" && name.substring(0,1)!=\"H\") { if(t.parentNode.tagName==\"P\") t=t.parentNode; else return;}\r\n {\r\n var me = jQ(t);\r\n if(me.html()==\"\") return;\r\n me.unbind();\r\n me.mouseover(function(e) { if(getSelectedText()==\"\") addPilcrow(me); return false;} );\r\n me.mouseout(function(e) { removePilcrow(); } );\r\n me.mousedown(function(e) { removePilcrow(); } );\r\n me.mouseover();\r\n }\r\n });\r\n\r\n // enable annotations for the Title as well\r\n var titles = jQ(\"div.title\");\r\n var title1 = titles.filter(\":eq(0)\");\r\n var title2 = titles.filter(\":eq(1)\");\r\n var titleId = title2.attr(\"id\");\r\n if(typeof(titleId)==\"undefined\") titleId=\"h_titleIdt\";\r\n titleId = titleId.toLowerCase();\r\n title2.attr(\"id\", \"_\" + titleId);\r\n title1.attr(\"id\", titleId);\r\n title1.mouseover(function(e) {\r\n var pilcrow = jQ(\"<span class='pilcrow command'> &#xb6;</span>\");\r\n var me = jQ(e.target);\r\n me.unbind();\r\n\r\n me.mouseover(function(e) { if(getSelectedText()==\"\") addPilcrow(me); return false;} );\r\n me.mouseout(function(e) { removePilcrow(); } );\r\n me.mousedown(function(e) { removePilcrow(); } );\r\n me.mouseover();\r\n });\r\n //\r\n var commentOnThis = jQ(\"div.annotateThis\");\r\n commentOnThis.find(\"span\").addClass(\"command\");\r\n commentOnThis.find(\"span\").click(click);\r\n function hideShowAnnotations() {\r\n var me = jQ(this);\r\n var text = me.text();\r\n var inlineAnnotations = jQ(\"div.inline-annotation\");\r\n var l = inlineAnnotations.size();\r\n var h = inlineAnnotations.filter(\".closed\").size();\r\n if(text.substring(0,1)==\"H\") {\r\n me.text(\"Show comments (\"+(l-h)+\" opened, \"+h+\" closed)\");\r\n inlineAnnotations.hide();\r\n }\r\n else {\r\n me.text(\"Hide comments (\"+(l-h)+\" opened, \"+h+\" closed)\");\r\n inlineAnnotations.show();\r\n }\r\n }\r\n\r\n jQ(\"div.ice-toolbar .hideShowAnnotations\").click(hideShowAnnotations).text(\"S\").click();\r\n \r\n var attachAnnotation = function(anno, para) {\r\n if(typeof(para)!=\"undefined\" && para.size()>0) {\r\n if(para.hasClass(\"inline-annotation\")) {\r\n para.find(\">div.anno-children\").prepend(anno);\r\n } else {\r\n if(!para.parent().hasClass(\"inline-anno\")) {\r\n para.wrap(\"<div class='inline-anno'/>\");\r\n }\r\n para.after(anno);\r\n para.css(\"margin\", \"0px\");\r\n }\r\n }\r\n }\r\n //\r\n // Show inline annotations\r\n //\r\n \r\n function positionAndDisplay(inlineAnnotation){\r\n var me = jQ(inlineAnnotation);\r\n // add close and reply buttons\r\n //decorateAnnotation(me.find(\"div.inline-annotation\").andSelf()); // and children\r\n decorateAnnotation(me); \r\n var parentId = me.find(\"input[@name='parentId']\").val();\r\n var p = bodyDiv.find(\"#\" + parentId);\r\n if(parentId in annotations) p = annotations[parentId];\r\n if(parentId==titleId) p = title1;\r\n if(p.size()==0) { // if orphan\r\n me.find(\"div.orig-content\").show();\r\n bodyDiv.append(me);\r\n }\r\n attachAnnotation(me, p);\r\n var id = me.attr(\"id\");\r\n annotations[id] = me;\r\n }\r\n\r\n if(true) {\r\n var createAnnoDiv = function(d, callback){\r\n var s = \"<div class='inline-annotation' id='\" + d.selfUrl + \"'>\"\r\n s += \"<input name='parentId' value='\" + d.annotates + \"' type='hidden'><!-- --></input>\";\r\n s += \"<input name='rootUrl' value='\" + d.rootUrl + \"' type='hidden'><!-- --></input>\";\r\n s += \"<input name='selfUrl' value='\" + d.selfUrl + \"' type='hidden'><!-- --></input>\";\r\n s += \" <div class='orig-content' style='display:none;'> </div>\";\r\n s += \" <div class='anno-info'>Comment by: <span>\" + d.creator + \"</span>\";\r\n s += \" &nbsp; <span>\" + d.created + \"</span></div>\";\r\n s += \" <div class='anno-children'><!-- --></div>\";\r\n s += \"</div>\";\r\n var div = jQ(s);\r\n // Get and add the comment text(body)\r\n jQ.get(\"\", {ajax:\"annotea\", method:\"get\", url: d.bodyUrl},\r\n function(data) {div.find(\">div:last\").before(jQ(data).text());});\r\n // If we are a root annotation get any/all of our children (replies)\r\n if(d.rootUrl==d.selfUrl){\r\n var rUrl = \"?w3c_reply_tree=\" + escape(d.rootUrl);\r\n jQ.get(\"\", {ajax:\"annotea\", method:\"getAnnos\", url: rUrl}, callback, \"json\");\r\n }\r\n return div;\r\n }\r\n function callback_j(dList){\r\n //selfUrl, bodyUrl, rootUrl, inReplyToUrl, annotates, creator, created\r\n if(typeof(dList)==\"string\") { alert(\"string and not a list\"); return;}\r\n jQ.each(dList, function(c, d){\r\n var div = createAnnoDiv(d, callback_j);\r\n positionAndDisplay(div);\r\n });\r\n }\r\n// function callback_t(data){\r\n// jQ.each(data.firstChild.childNodes, function(c, x) {\r\n// if(x.localName==\"Description\") {\r\n// var creator = \"\"; var created = \"\";\r\n// var id = \"\"; var bodyUrl = \"\"; var selfUrl = \"\";\r\n// var rootUrl = \"\"; inReplyToUrl = \"\";\r\n// selfUrl = jQ(x).attr(\"rdf:about\");\r\n// jQ.each(x.childNodes, function(cc, n){\r\n// var lName = n.localName;\r\n// if(lName==\"creator\"){\r\n// creator = n.textContent;\r\n// } else if(lName==\"created\") {\r\n// created = n.textContent;\r\n// } else if(lName==\"context\"){\r\n// var xp = n.textContent.split(\"#\")[1]\r\n// id = xp.split('id(\"')[1].split('\")')[0]\r\n// } else if(lName==\"body\"){\r\n// bodyUrl = jQ(n).attr(\"rdf:resource\");\r\n// } else if(lName==\"root\"){\r\n// rootUrl = jQ(n).attr(\"rdf:resource\");\r\n// } else if(lName==\"inReplyTo\"){\r\n// inReplyToUrl = jQ(n).attr(\"rdf:resource\");\r\n// }\r\n// });\r\n// if(inReplyToUrl!=\"\") id = inReplyToUrl;\r\n// if(rootUrl==\"\") rootUrl = selfUrl;\r\n//\r\n// var createAnnoDiv = function(){\r\n// var d = \"<div class='inline-annotation' id='\" + selfUrl + \"'>\"\r\n// d += \"<input name='parentId' value='\" + id + \"' type='hidden'><!-- --></input>\";\r\n// d += \"<input name='rootUrl' value='\" + rootUrl + \"' type='hidden'><!-- --></input>\";\r\n// d += \"<input name='selfUrl' value='\" + selfUrl + \"' type='hidden'><!-- --></input>\";\r\n// d += \" <div class='orig-content' style='display:none;'> </div>\";\r\n// d += \" <div class='anno-info'>Comment by: <span>\" + creator + \"</span> &nbsp; <span>\" + created + \"</span></div>\";\r\n// d += \" <div class='anno-children'><!-- --></div>\";\r\n// d += \"</div>\";\r\n// d = jQ(d);\r\n// // Get and add the comment text(body)\r\n// jQ.get(\"\", {ajax:\"annotea\", method:\"get\", url: bodyUrl},\r\n// function(data) {d.find(\">div:last\").before(jQ(data).text());});\r\n// // If we are a root annotation get any/all of our children (replies)\r\n// if(rootUrl==selfUrl){\r\n// rUrl = \"?w3c_reply_tree=\" + escape(rootUrl);\r\n// jQ.get(\"\", {ajax:\"annotea\", method:\"get\", url: rUrl}, callback_t);\r\n// }\r\n// return d;\r\n// }\r\n// d = createAnnoDiv();\r\n// positionAndDisplay(d);\r\n// }\r\n// });\r\n// }\r\n var query = \"?w3c_annotates=\" + escape(window.location);\r\n //jQ.get(\"x\", {ajax:\"annotea\", method:\"get\", url:query}, callback_t);\r\n jQ.get(\"x\", {ajax:\"annotea\", method:\"getAnnos\", url:query}, callback_j, \"json\");\r\n }\r\n}", "get canSave() {\n return (this.canEdit || this.alwaysEditing) && this.isEditing && this.hasChanged && !!this.recordFields.length;\n }", "function handleAnnotationDeleted ({ uuid }) {\n if (core.isCurrent(uuid)) {\n core.disable(...arguments)\n }\n}", "function deleteAnnotation(ann) {\n delete annotations[ann];\n // Flag as deleted so update events are sent appropriately\n dirtyNodes[ann] = \"delete\";\n that.trigger('annotations:changed');\n renderAnnotations();\n }", "applyPermission() {\n if (this.permission[2] == 0) {\n this.showEditColumn(false);\n }\n if (this.permission[3] == 0) {\n this.showDeleteColumn(false);\n }\n }", "function annotationTooltipCallback(annotation) {\n const deleteAnnotation = {\n type: \"custom\",\n title: \"Delete\",\n onPress: () => {\n if (confirm(\"Do you really want to delete the annotation?\")) {\n instance.delete(annotation.id);\n }\n },\n };\n\n return [deleteAnnotation];\n}", "function promptDeleteAnnotation(annotation){\n\t\tif (!annotation || annotation.type !== \"annotation\"){\n\t\t\treturn false;\n\t\t}\n\t\tif (confirm(\"Are you sure you want to delete this annotation?\")){\n\t\t\tannotation.delete();\n\t\t}\n\t}", "onEditComplete_() {\n this['editing'] = false;\n }", "function edit(){\n\t\treturn M.status == 'edit';\n\t}", "get editable() {\n return this._editable;\n }", "function EnableEdit(element) \n{\n\tdocument.getElementById(element + \"_ro\").toggle(); \n\tdocument.getElementById(element + \"_rw\").toggle();\n}", "function Q(t,e){var n=x.annos[e].splice(t,1)[0];x.activepage&&x.activepage._paper&&x.activepage._paper._annos.exclude(n.getObject()),x.activeanno===n&&(x.activeanno=null),n.dispose(),x.activepage&&x.activepage._grips&&x.activepage._grips.repaint(),s.trigger({type:\"annotationdeleted\",page:e,index:t})}", "get editing() {\n return this._editingTd ? true : false;\n }", "function SRC_verifyEditArea()\r\n{\r\n if (SRC_findResourceSearchBase().inTextMode()) {\r\n alert(\"Unable to add this link (the editor is in text mode)\");\r\n return false;\r\n }\r\n\r\n if (!SRC_findResourceSearchBase().inEditArea()) {\r\n alert(\"Unable to add this link (cursor focus is not in an edit area)\");\r\n return false;\r\n }\r\n\r\n return true;\r\n}", "function isCollectionEditing(){\r\n\t\t\treturn loadingData.EDITING_COLLECTION;\r\n\t\t}", "isEditor(value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__[\"a\" /* default */])(value) && typeof value.addMark === 'function' && typeof value.apply === 'function' && typeof value.deleteBackward === 'function' && typeof value.deleteForward === 'function' && typeof value.deleteFragment === 'function' && typeof value.insertBreak === 'function' && typeof value.insertFragment === 'function' && typeof value.insertNode === 'function' && typeof value.insertText === 'function' && typeof value.isInline === 'function' && typeof value.isVoid === 'function' && typeof value.normalizeNode === 'function' && typeof value.onChange === 'function' && typeof value.removeMark === 'function' && (value.marks === null || Object(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__[\"a\" /* default */])(value.marks)) && (value.selection === null || Range.isRange(value.selection)) && Node.isNodeList(value.children) && Operation.isOperationList(value.operations);\n }", "function disableEdit() {\n\t destroyEditOverlay();\n\t\n\t if (!_enabled) {\n\t return;\n\t }\n\t\n\t _enabled = false;\n\t (0, _event.removeEventListener)('annotation:click', handleAnnotationClick);\n\t}", "get deletedAcross() {\n return (this.delInfo & DEL_ACROSS) > 0;\n }", "function habilitarEdicion (){\n\t\t\t$scope.modificar = true;\n\t\t}", "function actionsThatRequireDelete(action) {\n if (action !== 'delete' || this.getCurrentUser().canDelete(this.getModelDefinitionByName(this.props.params.modelType))) {\n return true;\n }\n return false;\n}", "function updateAnnotation(annotation, update){\n\t\tif (Object.keys(update || {}).length === 0 || !annotation){\n\t\t\t// No updates to be made\n\t\t\treturn false;\n\t\t}\n\t\tupdate.title ? annotation.setTitle(update.title) : null;\n\t\tupdate.text ? annotation.setText(update.text) : null;\n\t\tupdate.public ? annotation.setPublic() : annotation.setPrivate();\n\t\tannotation.save();\n\t}", "static isEditable(evt) {\n if (process.env.NODE_ENV === 'dev') {\n return true;\n }\n\n const rx = /INPUT|SELECT|TEXTAREA/i;\n if (evt.target.hasAttribute('contenteditable')) {\n return true;\n }\n if (rx.test(evt.target.tagName) && !evt.target.disabled && !evt.target.readOnly) {\n return true;\n }\n return false;\n }", "function editable(esEditable) {\n return function (target, nombrePropiedad, descriptor) {\n descriptor.writable = esEditable;\n };\n}", "get editable() {\n return this.#editable;\n }", "function handleAnnotationSelected (annotation) {\n if (_getSelectedAnnotations().length === 1) {\n core.enable({ uuid : annotation.uuid, text : annotation.text })\n } else {\n core.disable()\n }\n}", "function modifyAnnotation() {\n var tipo = $(\"#hiddenTip\").val();\n var cod = $(\"#hiddenCod\").val();\n var tar = $(\"#hiddenTg\").val();\n var newTipo = $(\"#changeType\").val();\n var newOggetto = $(\"#changeObj\").val();\n var questoSpan = $(\"span[codice='\"+cod+\"']\");\n\n if(newOggetto !== '') {\n if (newTipo === 'autore' && !hasWhiteSpace(newOggetto.trim())) {\n $('#errorAuthor4').css(\"display\", \"block\");\n $('#changeObj').parent().addClass('has-error has-feedback');\n $('#changeObj').parent().append('<span class=\"glyphicon glyphicon-remove form-control-feedback\" aria-hidden=\"true\">' +\n '</span><span id=\"inputErrorStatus\" class=\"sr-only\">(error)</span>');\n } else {\n questoSpan.attr('tipo', newTipo);\n var oldEmail = questoSpan.attr('email'); // Vecchia email di provenance\n questoSpan.attr('username', username);\n questoSpan.attr('email', email);\n // Setto nuova annotazione come annotazione da inviare\n questoSpan.attr('new', 'true');\n questoSpan.attr(\"graph\", \"Heisenberg\");\n \n // Cancella la vecchia annotazione dagli array d'appoggio\n reprocessArray(cod);\n\n if(tar === 'doc') {\n var value = questoSpan.attr(\"value\"); // Vecchio valore\n // Modifica dei valori dello span\n questoSpan.attr('value', newOggetto.trim());\n questoSpan.attr('class', 'annotation ' + newTipo);\n questoSpan.attr('onclick', 'displayAnnotation(\"'+questoSpan.attr(\"username\")+'\", \"'+questoSpan.attr(\"email\")+'\", ' +\n '\"'+newTipo+'\", \"'+newOggetto+'\", \"'+questoSpan.attr(\"data\")+'\")');\n questoSpan.text(newOggetto);\n // Rimozione del vecchio punto e aggiunta del nuovo nel caso di ann su documento\n var punto = $(\"li[codice='\"+cod+\"']\").html();\n $(\"li[codice='\"+cod+\"']\").remove();\n\n var tipoStatement;\n switch(newTipo) {\n case 'autore':\n $('#lista-autore').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"Autore\";\n break;\n case 'pubblicazione':\n $('#lista-pubblicazione').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"AnnoPubblicazione\";\n break;\n case 'titolo':\n $('#lista-titolo').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"Titolo\";\n break;\n case 'doi':\n $('#lista-doi').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"DOI\";\n break;\n case 'url':\n $('#lista-url').append(\"<li codice='\"+cod+\"'>\"+punto+\"</li>\");\n tipoStatement = \"URL\";\n break;\n }\n\n arrayAnnotazioni.push({\n code : cod,\n username : username,\n email : email,\n type : questoSpan.attr(\"tipo\"),\n content : questoSpan.attr(\"value\"),\n date : questoSpan.attr(\"data\")\n });\n databaseAnnotations.push({\n code : cod,\n username : username,\n email : email,\n type : questoSpan.attr(\"tipo\"),\n content : questoSpan.attr(\"value\"),\n date : questoSpan.attr(\"data\")\n });\n } else {\n var value = questoSpan.attr(tipo); // Vecchio valore\n // Modifica dei valori dello span\n questoSpan.removeAttr(tipo);\n questoSpan.attr(newTipo, newOggetto);\n questoSpan.attr('class', 'annotation ' + newTipo);\n questoSpan.attr('onclick', 'displayAnnotation(\"'+questoSpan.attr(\"username\")+'\", \"'+questoSpan.attr(\"email\")+'\", ' +\n '\"'+newTipo+'\", \"'+newOggetto+'\", \"'+questoSpan.attr(\"data\")+'\")');\n\n var start;\n var end;\n var idFrag;\n // Cerco nell'array che contiene lo storico delle annotazioni lo start e end del frammento dell'annotazione che sto modificando\n for (var i = 0; i < databaseAnnotations.length; i++) {\n if(databaseAnnotations[i].code == cod) {\n idFrag = databaseAnnotations[i].id;\n start = databaseAnnotations[i].start;\n end = databaseAnnotations[i].end;\n }\n }\n \n arrayAnnotazioni.push({\n code : cod,\n username : username,\n email : email,\n id : idFrag,\n start : start,\n end : end,\n type : questoSpan.attr(\"tipo\"),\n content : questoSpan.attr(questoSpan.attr(\"tipo\")),\n date : questoSpan.attr(\"data\")\n });\n databaseAnnotations.push({\n code : cod,\n username : username,\n email : email,\n id : idFrag,\n start : start,\n end : end,\n type : questoSpan.attr(\"tipo\"),\n content : questoSpan.attr(questoSpan.attr(\"tipo\")),\n date : questoSpan.attr(\"data\")\n });\n }\n deleteSingleAnnotation(tipo, value, activeURI, questoSpan.attr('data'));\n $(\"#modalModificaAnnotazione\").modal(\"hide\");\n $(\"#modalGestioneAnnotazioni\").modal(\"hide\");\n }\n } else {\n // Messaggio d'errore\n $('#errorType4').css(\"display\", \"block\");\n $('#errorAuthor4').css(\"display\", \"none\");\n $('#changeObj').parent().addClass('has-error has-feedback');\n $('#changeObj').parent().append('<span class=\"glyphicon glyphicon-remove form-control-feedback\" aria-hidden=\"true\">' +\n '</span><span id=\"inputErrorStatus\" class=\"sr-only\">(error)</span>');\n }\n // Chiamata funzione che gestisce l'onhover\n onHover();\n}", "function handleAnnotationDeselected () {\n const annos = _getSelectedAnnotations()\n if (annos.length === 1) {\n core.enable({ uuid : annos[0].uuid, text : annos[0].text })\n } else {\n core.disable()\n }\n}", "editAnnotation(annotation, subAnnotation) {\n\t\t//TODO this should simply always just set the active annotation\n\t\t//an annotation ALWAYS has a target, but not always a body or ID (in case of a new annotation)\n\t\tif(annotation.target) {\n\t\t\tthis.setState({\n\t\t\t\tshowModal: true,\n\t\t\t\tannotationTarget: annotation.target,\n\t\t\t\tactiveAnnotation: annotation,\n\t\t\t\tactiveSubAnnotation : subAnnotation\n\t\t\t});\n\t\t}\n\t}", "get deleted() {\n return (this.delInfo & DEL_SIDE) > 0;\n }", "function allow_modif(id){\n $(\"#nom\"+id).attr(\"contenteditable\",\"true\").css(\"background\",\"#eee\");\n $(\"#desc\"+id).attr(\"contenteditable\",\"true\").css(\"background\",\"#eee\");\n $(\"#action\"+id).hide();\n $(\"#edit\"+id).show();\n}", "_editModeChanged(newValue, oldValue) {\n if (typeof newValue !== typeof undefined) {\n this._itemsChanged(this.items);\n for (var i in this.items) {\n if (this.items[i].metadata) {\n this.items[i].metadata.canEdit = newValue;\n this.notifyPath(`items.${i}.metadata.canEdit`);\n }\n }\n }\n }", "isEditing(wizardStep) {\n return wizardStep.editing;\n }", "isEditing(wizardStep) {\n return wizardStep.editing;\n }", "function toggleEditMode() {\n for (var i = 0; i < a.length; i++) {\n \n a[i].classList.toggle(\"hidden\");\n a[i].classList.toggle(\"whatBox\"[i]);\n b[i].toggleAttribute('contenteditable');\n \n }\n //EDITMODE ON CUSTOMER DATA INDEPENDENT OF COMMENTS:\n for (var i = 0; i < c.length; i++) {\n c[i].toggleAttribute('contenteditable');\n }\n }", "get deletable()\n\t{\n\t\treturn true;\n\t}", "doEditMode() {\n\n }", "toggleEditMode() {\n event.preventDefault();\n this.editMode = !this.editMode;\n }", "function handleIsEdit(property) {\n setIsEdit(property)\n }", "editarFalse1() {\n this.activarPersonal = true;\n }", "isWritePermitted() {\n return this.checkAdminPermission('add')\n }", "isReadOnly(editor) {\n return !!IS_READ_ONLY.get(editor);\n }", "isReadOnly(editor) {\n return !!IS_READ_ONLY.get(editor);\n }", "isReadOnly(editor) {\n return !!IS_READ_ONLY.get(editor);\n }", "static get properties() {\n return {\n hasActiveEditingElement: {\n type: Boolean,\n },\n };\n }", "is_claim_flag(f) {\n return f.name === 'Claim';\n }", "isUpdatePermitted() {\n return this.checkAdminPermission('update')\n }", "set editable(value) {}", "get editing() {\n\t\treturn this.classList.contains('editing');\n\t}", "function removeAnnotation(uuid) {\n var prompt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n // Delete region\n var region_idx = this.annotations.regions.findIndex(function (item) {\n return item.uuid === uuid;\n });\n\n if (region_idx !== -1) {\n // Confirm removing\n if (prompt) {\n var num_child_rows = this.annotations.rows.filter(function (item) {\n return item.region_annotation_uuid === uuid;\n }).length;\n if (!confirm('Opravdu smazat odstavec i s řádky (' + num_child_rows + ')')) return;\n } // Emit event\n\n\n this.$emit('region-deleted-event', serializeAnnotation(this.annotations.regions[region_idx])); // Disable active region\n\n if (this.annotations.regions[region_idx] === this.active_region) this.active_region = null;\n this.annotations.regions[region_idx].view.path.remove();\n this.annotations.regions[region_idx].view.group.remove(); // Unregister region\n\n this.annotations.regions.splice(region_idx, 1); // Delete region rows\n\n var row;\n\n while (row = this.annotations.rows.find(function (item) {\n return item.region_annotation_uuid === uuid;\n })) {\n this.removeAnnotation(row.uuid);\n }\n\n return;\n } // Delete row\n\n\n var row_idx = this.annotations.rows.findIndex(function (item) {\n return item.uuid === uuid;\n });\n\n if (row_idx !== -1) {\n // Confirm removing\n if (prompt) {\n if (!confirm('Opravdu smazat řádek?')) return;\n } // Emit event\n\n\n this.$emit('row-deleted-event', serializeAnnotation(this.annotations.rows[row_idx])); // Disable active row\n\n if (this.annotations.rows[row_idx] === this.active_row) this.active_row = null; // Remove view items\n\n var ann_view = this.annotations.rows[row_idx].view;\n\n if (ann_view.baseline) {\n ann_view.baseline.baseline_path.remove();\n ann_view.baseline.baseline_left_path.remove();\n ann_view.baseline.baseline_right_path.remove();\n }\n\n ann_view.path.remove();\n ann_view.group.remove(); // Check if parent region has no rows => delete entire region\n\n var parent_region_uuid = this.annotations.rows[row_idx].region_annotation_uuid;\n\n if (parent_region_uuid) {\n /** Delete parent region **/\n var rows = this.annotations.rows.filter(function (item) {\n return item.region_annotation_uuid === parent_region_uuid;\n });\n if (rows.length === 0) this.removeAnnotation(parent_region_uuid);\n } // Unregister row\n\n\n this.annotations.rows.splice(row_idx, 1);\n }\n}", "function confirmAnnotation() {\n var polygon = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var baseline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var annotation_data = {\n points: polygon ? getPathPoints(polygon.path) : null,\n is_valid: false,\n baseline: baseline ? getPathPoints(baseline.baseline) : null,\n heights: baseline ? {\n down: baseline.down.length,\n up: baseline.up.length\n } : null\n };\n var annotation_view = this.createAnnotationView(annotation_data, this.creating_annotation_type);\n var active_region_uuid = this.active_region ? this.active_region.uuid : null;\n var annotation = this.createAnnotation(annotation_view, this.creating_annotation_type, active_region_uuid); // Push region to annotations\n\n this.annotations[this.creating_annotation_type].push(annotation); // Set this annotation to active\n\n if (this.creating_annotation_type === 'regions') this.active_region = annotation;else {\n this.active_row = annotation;\n this.active_row.is_valid = false;\n }\n return annotation;\n}", "function DocumentEditor({annotation, dirty, saving, changeAnnotation}) {\n return [\n <Prompt\n key=\"document-dirty-prompt\"\n when={dirty}\n message=\"You have unsaved annotation changes, are you sure you want to abandon them?\" />,\n annotation != null ?\n <AceEditor\n key=\"document-editor\"\n mode=\"scheme\"\n theme=\"xcode\"\n width=\"100%\"\n height=\"600px\"\n tabSize={2}\n wrapEnabled={true}\n readOnly={saving}\n value={annotation}\n onChange={changeAnnotation}\n editorProps={{$blockScrolling: Infinity}} /> :\n <div key=\"document-loading\" className=\"text-muted text-center\">Loading annotation...</div>,\n ]\n}", "check(user, document) {\n if (options.editCheck) {\n return options.editCheck(user, document);\n }\n\n if (!user || !document) return false;\n // check if user owns the document being edited. \n // if they do, check if they can perform \"foo.edit.own\" action\n // if they don't, check if they can perform \"foo.edit.all\" action\n return Users.owns(user, document) ? Users.canDo(user, `${collectionName.toLowerCase()}.edit.own`) : Users.canDo(user, `${collectionName.toLowerCase()}.edit.all`);\n }", "function _isEditing(flowInfo){\n\t\tvar isEditing = editingFlow != null;\n\t\tif(isEditing && flowInfo){\n\t\t\tisEditing &= (toolkit.getValue(flowInfo.categories) == toolkit.getValue(editingFlow.categories));\n\t\t\tisEditing &= (flowInfo.id == editingFlow.id);\n\t\t}\n\t\treturn isEditing;\n\t}", "function toggleEdit() {\n setEdit(prevStatus => {\n return !prevStatus\n })\n }", "_checkDeleteIsAble () {\n function error (parameter) {\n throw new Error (`Parameter '${parameter}' is forbidden in DELETE query`)\n }\n if (this._selectStr.length > 1) error('only')\n if (this._orderStr) error('orderBy')\n if (this._limitStr) error('limit')\n if (this._offsetStr) error('offset')\n return true\n }", "function sketchAllowsEditing() {\n return sketch.currentTouchRegime().name !== \"BackClickRegime\";\n }", "_setToEditingMode() {\n this._hasBeenEdited = true\n this._setUiEditing()\n }", "function isEditable(type, tags) {\n if (!isInteractive(tags)) {\n return false\n }\n if (type === BLOCK_TYPES.OUTPUT) {\n return false\n }\n if (tags.includes(STATIC_TAG_TYPES.READ_ONLY)) {\n return false\n }\n return true\n}", "_supports(attribute, subject) {\n\n if ((attribute !== this.VIEW) &&\n (attribute !== this.EDIT)) {\n return false;\n }\n\n // only vote on Post objects inside this voter\n if (false === (subject.getDomainObjectName() === 'posts')) {\n return false;\n }\n\n return true;\n }", "_supports(attribute, subject) {\n\n if ((attribute !== this.VIEW) &&\n (attribute !== this.EDIT)) {\n return false;\n }\n\n // only vote on Post objects inside this voter\n if (false === (subject.getDomainObjectName() === 'posts')) {\n return false;\n }\n\n return true;\n }", "_supports(attribute, subject) {\n\n if ((attribute !== this.VIEW) &&\n (attribute !== this.EDIT)) {\n return false;\n }\n\n // only vote on Post objects inside this voter\n if (false === (subject.getDomainObjectName() === 'posts')) {\n return false;\n }\n\n return true;\n }", "_supports(attribute, subject) {\n\n if ((attribute !== this.VIEW) &&\n (attribute !== this.EDIT)) {\n return false;\n }\n\n // only vote on Post objects inside this voter\n if (false === (subject.getDomainObjectName() === 'posts')) {\n return false;\n }\n\n return true;\n }", "_supports(attribute, subject) {\n\n if ((attribute !== this.VIEW) &&\n (attribute !== this.EDIT)) {\n return false;\n }\n\n // only vote on Post objects inside this voter\n if (false === (subject.getDomainObjectName() === 'posts')) {\n return false;\n }\n\n return true;\n }", "_supports(attribute, subject) {\n\n if ((attribute !== this.VIEW) &&\n (attribute !== this.EDIT)) {\n return false;\n }\n\n // only vote on Post objects inside this voter\n if (false === (subject.getDomainObjectName() === 'posts')) {\n return false;\n }\n\n return true;\n }" ]
[ "0.6486427", "0.62201023", "0.61864936", "0.6171139", "0.6167592", "0.6165052", "0.6141391", "0.6068531", "0.59469014", "0.5883192", "0.58586323", "0.5834798", "0.58292973", "0.5796771", "0.5766032", "0.57651377", "0.57182676", "0.57016087", "0.5696573", "0.5664246", "0.56029063", "0.55571795", "0.5538786", "0.5503151", "0.54873747", "0.54868364", "0.5471062", "0.54666924", "0.545725", "0.54464954", "0.54423505", "0.5400035", "0.5391728", "0.53837883", "0.5377767", "0.5362788", "0.5353443", "0.53511816", "0.533923", "0.5324772", "0.53229624", "0.53168637", "0.53166384", "0.53079796", "0.5307147", "0.5301234", "0.52828753", "0.52807295", "0.52649474", "0.5264147", "0.52560717", "0.5248624", "0.523192", "0.5219051", "0.52144295", "0.5213263", "0.51976264", "0.5193557", "0.5175761", "0.51757187", "0.5160732", "0.51583964", "0.51546204", "0.51445806", "0.51415807", "0.5135002", "0.5127125", "0.5096796", "0.5096796", "0.50962996", "0.50955063", "0.5091319", "0.5089018", "0.5086209", "0.50792396", "0.5069114", "0.5061524", "0.5061524", "0.5061524", "0.50559396", "0.50467676", "0.50326824", "0.50289017", "0.5019588", "0.5009952", "0.50074047", "0.50068885", "0.50067145", "0.5005517", "0.49989867", "0.49920693", "0.49864644", "0.4971216", "0.49696666", "0.49654952", "0.49654952", "0.49654952", "0.49654952", "0.49654952", "0.49654952" ]
0.6775833
0
Common function to call the Get services
function doGet($q, $http, url) { var def = $q.defer(); $http({ method: "GET", url: url, headers : { 'Content-Type': 'application/json; charset=UTF-8', 'token' : token} }).then(function (data) { def.resolve(data); },function (error) { validateResponse(error); def.reject(error); }); return def.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getServicesList() {\n\t\t\tcustApi.getServices().\n\t\t\tsuccess(function (data, status, header, config) {\n\t\t\t\tconsole.log(\"Services retrieved successfully\");\n\t\t\t\tvm.apptCost = data.payload[0].rate;\n\t\t\t\tvar serviceMap = buildServicesMap(data.payload);\n\t\t\t\tvm.physiotherapyId = serviceMap[\"physiotherapy\"];\n\t\t\t\tcustportalGetSetService.setPhysioId({\"physioId\": vm.physiotherapyId, \"apptCost\": vm.apptCost});\n\t\t\t}).\n\t\t\terror(function (data, status, header, config) {\n\t\t\t\tconsole.log(\"Error in retrieving services\");\n\t\t\t});\n\t\t}", "function fetchServices() {\n var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';\n return services_k8s.getServices(namespace).done(function (serviceDataArray) {\n src_reactor[\"a\" /* default */].dispatch(SITE_RECEIVE_SERVICES, serviceDataArray);\n });\n}", "function getServicesList() {\n\t\tcustApi.getServices().\n\t\tsuccess(function (data, status, header, config) {\n\t\t\tconsole.log(\"Services retrieved successfully\");\n\t\t\tvar serviceMap = buildServicesMap(data.payload);\n\t\t\tvm.model.physiotherapyId = serviceMap[\"physiotherapy\"];\n\t\t}).\n\t\terror(function (data, status, header, config) {\n\t\t\tconsole.log(\"Error in retrieving services\");\n\t\t});\n\t}", "function getServices() {\n bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes = {\n \"Pickup\": \"PIC\",\n \"Delivery\": \"DLV\",\n \"FactoryStuffing\": \"FAS\",\n \"ExportClearance\": \"EXC\",\n \"ImportClearance\": \"IMC\",\n \"CargoInsurance\": \"CAI\"\n }\n\n var _input = {\n \"EntityRefKey\": bkgBuyerSupplierDirectiveCtrl.ePage.Entities.Header.Data.UIJobPickupAndDelivery.PK,\n };\n\n var inputObj = {\n \"FilterID\": appConfig.Entities.JobService.API.FindAll.FilterID,\n \"searchInput\": helperService.createToArrayOfObject(_input)\n }\n if (!bkgBuyerSupplierDirectiveCtrl.obj.isNew) {\n apiService.post('eAxisAPI', appConfig.Entities.JobService.API.FindAll.Url, inputObj).then(function (response) {\n if (response.data.Response) {\n bkgBuyerSupplierDirectiveCtrl.ePage.Entities.Header.Data.UIJobServices = response.data.Response\n if (bkgBuyerSupplierDirectiveCtrl.ePage.Entities.Header.Data.UIJobServices.length != 0) {\n for (var i in bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes) {\n var tempObj = _.filter(bkgBuyerSupplierDirectiveCtrl.ePage.Entities.Header.Data.UIJobServices, {\n 'ServiceCode': bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes[i]\n })[0];\n if (tempObj == undefined) {\n bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes[i] = 'false'\n } else {\n bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes[i] = tempObj.ServiceCode\n }\n }\n } else {\n for (var i in bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes) {\n bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes[i] = \"false\"\n }\n }\n }\n });\n } else {\n for (var i in bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes) {\n bkgBuyerSupplierDirectiveCtrl.ePage.Masters.serviceTypes[i] = \"false\"\n }\n }\n\n }", "async readServices() {\n let response = await fetch(url + 'get/services')\n let data = await response.json();\n return data\n }", "getall(){\nreturn this.get(Config.API_URL + Constant.AGENT_GETALL);\n}", "function initialServiceLoad(isNewInstall) {\n\n lastUpdateTimePrefix = SUConsts[getServicesKey()].prefixKey;\n lastUpdateDataPrefix = SUConsts[getServicesKey()].prefixDataKey;\n updateServiceMap();\n\n serviceRequest(SUConsts[getServicesKey()].serviceMap).then(function(response) {\n SULogger.logDebug(\"Success getting ServiceMap! \" + response);\n // Alive Usage\n SUUsages.init();\n //Get IP2Location service\n return serviceRequest(SUConsts[getServicesKey()].IP2location);\n }, function(error) {\n SULogger.logError(\"Failed!\", error);\n // Alive Usage\n SUUsages.init();\n //Get IP2Location service\n return serviceRequest(SUConsts[getServicesKey()].IP2location);\n\n }).then(function(response) {\n SULogger.logDebug(\"Success getting IP2Location \" + response);\n\n if (isNewInstall) {\n\n // Set smaller timeout to get install date\n SUConsts[getServicesKey()].SearchAPIwithCCForNewInstall.reload_interval_sec = SUConsts.SearchAPIForNewInstallIntervalInSec;\n\n //Get SearchAPIwithCCForNewInstall service\n return serviceRequest(SUConsts[getServicesKey()].SearchAPIwithCCForNewInstall);\n } else {\n\n //Get SearchAPIwithCC service\n var currInstallDate = localStorage.getItem(SUConsts.installDateKey);\n return serviceRequest(SUConsts[getServicesKey()].SearchAPIwithCC, currInstallDate);\n }\n }, function(error) {\n SULogger.logError(\"Failed getting IP2Location \", error);\n\n if (isNewInstall) {\n\n SUConsts[getServicesKey()].SearchAPIwithCCForNewInstall.reload_interval_sec = SUConsts.SearchAPIForNewInstallIntervalInSec;\n\n return serviceRequest(SUConsts[getServicesKey()].SearchAPIwithoutCCForNewInstall);\n } else {\n var currInstallDate = localStorage.getItem(SUConsts.installDateKey);\n\n return serviceRequest(SUConsts[getServicesKey()].SearchAPIwithoutCC, currInstallDate);\n }\n\n }).then(function(response) {\n SULogger.logDebug(\"Success getting SearchAPI \" + response);\n }, function(error) {\n SULogger.logError(\"Failed!\", error);\n });\n }", "fetchServicesFromApi()\n {\n //all paths are configurable in 'config.js'\n const serviceCatalogAPI = bcConfig.urlBase + bcConfig.urlPathToREDCap + bcConfig.serviceCatalogApi;\n\n fetch(serviceCatalogAPI)\n .then(response => response.json())\n .then(jsondata => {\n this._jsondata = jsondata;//need this for searches\n this.parseJsonListOfServices(jsondata);\n if (this.fullServiceList) \n {\n this.setStateData(this.fullServiceList);\n }\n else\n {\n this.setStateData([]);\n }\n }).catch(err => this.setStateData([]));\n }", "async getServices (req, res) {\n console.log('getting services')\n\n const user = await jwt.getUser(req, res)\n const services = await user.getServices()\n\n if (!services.length > 0) return res.status(204).send([])\n\n res.status(200).send(services)\n }", "function get(callback) {\n \n webService.get(apiUrl , callback);\n }", "async getService (req, res) {\n console.log('getting services')\n const user = await jwt.getUser()\n const service = await Services.findById(req.params.service)\n\n if (!service) return res.status(204).send('No service found with that ID')\n\n res.status(200).send(service)\n }", "function getServices(){\n self.services = servicesService.getServices();\n $log.debug(self.services);\n }", "GET() {\n }", "async getAllServices() {\n debug('get Dot4 service IDs from dot4SaKpiRepository');\n this.allServices = await this.request({\n method: 'get',\n url: '/api/service',\n });\n debug(`loaded ${this.allServices.length} services`);\n }", "function loadAll() {\n console.log('load all function fired from service');\n return $http\n .get('/api/items');\n }", "function CallGetService (data, url, async, callBack) {\n\n\t\t$.ajax ({\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\turl: url,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg) {\n\n\t\t\t\treturn callBack(msg);\n\n\t\t\t},\n\t\t\terror: function(error) {\n\n\t\t\t\tconsole.log(error);\n\n\t\t\t}\n\t\t});\n\n\t}", "function getWatsonQAServices(onSuccessCallback,onFailCallback){\n\tvar invocationData = {\n\t adapter : 'WatsonQA',\n\t procedure : 'getServices',\n\t parameters : []\n\t };\n\t\n\tvar options = {\n\t\tonSuccess : onSuccessCallback,\n\t\tonFailure : onFailCallback,\n\t};\n\n\tWL.Client.invokeProcedure(invocationData,options);\n}", "ListAvailableServices() {\n let url = `/hosting/reseller`;\n return this.client.request('GET', url);\n }", "function getServices(parentEl) {\n // API Fetch\n fetch(\n \"https://cdn.contentful.com/spaces/9635uuvwn9dq/environments/master/entries?access_token=cgtQv23ag7qZw92QlPnJwslq6vWfK8sDwB8fNk62QTI&content_type=service\"\n )\n .then((resp) => resp.json())\n .then((data) => processServices(data, parentEl));\n}", "call(moduleName, functionName, params) {\n const override = this.runtime.config(['services', moduleName, 'url'].join('.'));\n const token = this.runtime.service('session').getAuthToken();\n let client;\n if (override) {\n client = new GenericClient({\n module: moduleName,\n url: override,\n token: token\n });\n } else {\n client = new DynamicService({\n url: this.runtime.config('services.service_wizard.url'),\n token: token,\n module: moduleName\n });\n }\n return client.callFunc(functionName, [params]).catch((err) => {\n console.error(\n 'err',\n err instanceof Error,\n err instanceof exceptions.CustomError,\n err instanceof exceptions.AjaxError,\n err instanceof exceptions.ServerError\n );\n if (err instanceof exceptions.AjaxError) {\n console.error('AJAX Error', err);\n throw new utils.JGISearchError('ajax', err.code, err.message, null, {\n originalError: err\n });\n } else if (err instanceof exceptions.RpcError) {\n console.error('RPC Error', err);\n throw new utils.JGISearchError('ajax', err.name, err.message, null, {\n originalError: err\n });\n } else {\n throw new utils.JGISearchError('rpc-call', err.name, err.message, null, {\n originalError: err\n });\n }\n });\n }", "ListAvailableServices() {\n let url = `/hpcspot`;\n return this.client.request('GET', url);\n }", "async function getServiceCalls() {\n const data = await API.get(\"instapostservicecallsapi\", `/service-calls`);\n updateServiceCalls(data.service_calls_count[\"service-calls\"]);\n setLoading(true);\n }", "getProducts() {\n return this.http.get(\"\".concat(this.uri2));\n }", "getProducts() {}", "init() {\n this._SfService.do('ProductController.getProducts', 'SRV-234', 34)\n .then( console.log )\n .catch( console.log )\n }", "setupForMultiGet(responses) {\n\t\tthis.get = (url, success, error) => {\n\t\t\tfor (var response in responses) {\n\t\t\t\tif (url.contains(response)) {\n\t\t\t\t\tsuccess(response);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getAllServiceTypes() {\r\n return get('/servicetype/getall').then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "get(apiPath, parameters, options, callback) {\n let send = callback ? result.send : result.sendPromised\n return send(apiPath, parameters, 'GET', options, callback)\n }", "function JsonService(url)\n{\n this[\"GetUserSummary\"] = function(userDate, callback)\n {\n return call(\"GetUserSummary\", [ userDate ], callback);\n }\n\n this[\"DeleteCategory\"] = function(categoryID, callback)\n {\n return call(\"DeleteCategory\", [ categoryID ], callback);\n }\n\n this[\"InsertCategory\"] = function(category, callback)\n {\n return call(\"InsertCategory\", [ category ], callback);\n }\n\n this[\"UpdateCategory\"] = function(category, callback)\n {\n return call(\"UpdateCategory\", [ category ], callback);\n }\n\n this[\"InsertSubCategory\"] = function(subCategory, callback)\n {\n return call(\"InsertSubCategory\", [ subCategory ], callback);\n }\n\n this[\"UpdateSubCategory\"] = function(subCategory, callback)\n {\n return call(\"UpdateSubCategory\", [ subCategory ], callback);\n }\n\n this[\"DeleteSubCategory\"] = function(subCategoryID, callback)\n {\n return call(\"DeleteSubCategory\", [ subCategoryID ], callback);\n }\n\n this[\"InsertTrans\"] = function(trans, callback)\n {\n return call(\"InsertTrans\", [ trans ], callback);\n }\n\n this[\"DeleteTrans\"] = function(transID, callback)\n {\n return call(\"DeleteTrans\", [ transID ], callback);\n }\n\n this[\"UpdateTrans\"] = function(trans, callback)\n {\n return call(\"UpdateTrans\", [ trans ], callback);\n }\n\n this[\"SearchTrans\"] = function(startDate, endDate, categoryType, catIDString, amountOperator, amount, callback)\n {\n return call(\"SearchTrans\", [ startDate, endDate, categoryType, catIDString, amountOperator, amount ], callback);\n }\n\n this[\"GetTransPieGraphForDefaultDateRange\"] = function(defaultDateRange, categoryType, currentUserDate, callback)\n {\n return call(\"GetTransPieGraphForDefaultDateRange\", [ defaultDateRange, categoryType, currentUserDate ], callback);\n }\n\n this[\"GetTransPieGraphForCustomDateRange\"] = function(categoryType, startDate, endDate, callback)\n {\n return call(\"GetTransPieGraphForCustomDateRange\", [ categoryType, startDate, endDate ], callback);\n }\n\n /* Returns an array of method names implemented by this service. */\n\n this[\"system.listMethods\"] = function(callback)\n {\n return call(\"system.listMethods\", [ ], callback);\n }\n\n /* Returns the version server implementation using the major, minor, build and revision format. */\n\n this[\"system.version\"] = function(callback)\n {\n return call(\"system.version\", [ ], callback);\n }\n\n /* Returns a summary about the server implementation for display purposes. */\n\n this[\"system.about\"] = function(callback)\n {\n return call(\"system.about\", [ ], callback);\n }\n\n var serviceURL = \"https://\" + window.location.host + \"/Service/ExpJSONService.ashx\";\n var url = typeof (url) === 'string' ? url : serviceURL;\n\n var self = this;\n var nextId = 0;\n\n function call(method, params, callback)\n {\n var request = { id : nextId++, method : method, params : params };\n return callback == null ?\n callSync(method, request) : callAsync(method, request, callback);\n }\n\n function callSync(method, request)\n {\n var http = newHTTP();\n http.open('POST', url, false, self.httpUserName, self.httpPassword);\n setupHeaders(http, method);\n http.send(JSON.stringify(request));\n if (http.status != 200)\n throw { message : http.status + ' ' + http.statusText, toString : function() { return message; } };\n var response = JSON.eval(http.responseText);\n if (response.error != null) throw response.error;\n return response.result;\n }\n\n function callAsync(method, request, callback)\n {\n var http = newHTTP();\n http.open('POST', url, true, self.httpUserName, self.httpPassword);\n setupHeaders(http, method);\n http.onreadystatechange = function() { http_onreadystatechange(http, callback); }\n http.send(JSON.stringify(request));\n return request.id;\n }\n\n function setupHeaders(http, method)\n {\n http.setRequestHeader('Content-Type', 'text/plain; charset=utf-8');\n http.setRequestHeader('X-JSON-RPC', method);\n }\n\n function http_onreadystatechange(sender, callback)\n {\n if (sender.readyState == /* complete */ 4)\n {\n var response = sender.status == 200 ?\n JSON.eval(sender.responseText) : {};\n\n response.xmlHTTP = sender;\n\n callback(response);\n }\n }\n\n function newHTTP()\n {\n if (typeof(window) != 'undefined' && window.XMLHttpRequest)\n return new XMLHttpRequest(); /* IE7, Safari 1.2, Mozilla 1.0/Firefox, and Netscape 7 */\n else\n return new ActiveXObject('Microsoft.XMLHTTP'); /* WSH and IE 5 to IE 6 */\n }\n}", "getVehicles(params) {\n \tvar deferred = $q.defer(), \n url = baseUrl+params.makes+'?state='+params.state+'&year='+params.year+'&view=basic&fmt=json&api_key='+apiKey;\n console.log(\"in the Services\\n \" + url);\n $http({\n method: 'GET',\n url: url \n })\n .then(function successHandler(response) {\n deferred.resolve(response.data);\n\n }, function errorHandler() {\n deferred.reject();\n });\n return deferred.promise;\n }", "getServiceInfos(service) {\n return this.OvhHttp.get(\n `${service.path}/${window.encodeURIComponent(\n service.serviceName,\n )}/serviceInfos`,\n {\n rootPath: 'apiv6',\n },\n ).then(\n (serviceInfos) =>\n new BillingService({\n ...service,\n ...serviceInfos,\n }),\n );\n }", "function getProductsCall(){\n\t\t\tvar request = $http({method: 'GET', url: 'static/json/products-list.json'});\n\t\t\treturn request;\n\t\t}", "function callbackGetGenericApi(req, res) {\n var apiConfig=\n (req.method==\"GET\")?getConfig\n :(req.method==\"POST\")?postConfig:[];\n /* check first if services is not loaded */\n if (apiConfig.length==0)\n return res.json({statusCode: 404, message: \"Missing API configuration\", Data: []});\n\n ///api/:type/:path?\n /* decouple request api */\n var request = {\n type:req.params.type,\n t_type:req.params.type+\".\"+req.method,\n header:req.headers||{},\n body:req.body,\n path:req.params.path||\"\",\n query:req.query||{}\n };\n\n requestApi(apiConfig,request,function(d) {\n return res.json(d);\n })\n }", "getClientCalls() {\n\n }", "function GET(){\n \n}", "get(callback) {\n const uri = buildUri()\n log(uri)\n api.get(\n uri,\n null,\n null,\n result.$createListener(callback)\n )\n }", "reqGet(api, sucfn, errfn) { \n let url = this.url+api;\n return axios.get(url)\n \t.then(sucfn)\n .catch(errfn) \n }", "run(callback, context) {\n //调用service的reques方法,获取相应属性后设置进service\n this.request(function (error, response) {\n let resp = this._resolveResponse(response);\n callback.call(context, resp);\n }, this)\n }", "_callMethod(service, call) {\n const services = ContainerBuilder.getServiceConditionals(call[1]);\n\n for (const service of services) {\n if (! this.has(service)) {\n return;\n }\n }\n\n call = getCallableFromArray([ service, call[0] ]);\n call.apply(service, this._resolveServices(this.parameterBag.unescapeValue(this.parameterBag.resolveValue(call[1]))));\n }", "function callGetServiceINTERNAL (state, URLPath, callback, authkey) {\n var config = {\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': authkey\n }\n }\n // console.log('Making call the config is:')\n // console.log(config)\n axios.get(\n state.corsproxyprefix + state.host + URLPath,\n config\n ).then(function (response) {\n // console.log('callGetServiceINTERNAL response')\n // console.log(response)\n if (response.status < 200) {\n callback.FAILcallback.method({msg: 'Bad status', response: response}, callback.FAILcallback.params)\n }\n else {\n if (response.status > 299) {\n callback.FAILcallback.method({msg: 'Bad status', response: response}, callback.FAILcallback.params)\n }\n else {\n callback.OKcallback.method(response, callback.OKcallback.params)\n }\n }\n })\n .catch(function (response) {\n if (typeof (response.response) === 'undefined') {\n if (typeof (response.message) === 'undefined') {\n callback.FAILcallback.method({msg: 'Bad Response UNKNOWN', response: response}, callback.FAILcallback.params)\n }\n else {\n console.log(response)\n callback.FAILcallback.method({msg: 'Bad Response ' + response.message, response: response}, callback.FAILcallback.params)\n }\n }\n else if (typeof (response.response.data) !== 'undefined') {\n if (typeof (response.response.data.errorMessages) !== 'undefined') {\n callback.FAILcallback.method({msg: 'Bad Response(' + response.response.data.errorMessages.length + ') ' + response.response.data.errorMessages, response: response.response}, callback.FAILcallback.params)\n }\n else {\n callback.FAILcallback.method({msg: 'Data Bad Response ' + response.response.status, response: response.response}, callback.FAILcallback.params)\n }\n }\n else {\n callback.FAILcallback.method({msg: 'Nested Bad Response ' + response.response.status, response: response.response}, callback.FAILcallback.params)\n }\n })\n}", "get(apiData = {}) {\n return this._api(apiData, 'get');\n }", "get (path, params) { return this.request(path, 'get', null, params) }", "doGetAll() {\n this.doInit();\n }", "ListAvailableServices() {\n let url = `/saas/csp2`;\n return this.client.request('GET', url);\n }", "function getAPI(username, service, callback){\n //var serviceName = \"APIs.\"+service;\n basic.findData(database,'Users',{\n \"user.username\" : username\n },function(err,result){\n if (err){\n callback(err);\n }else{\n if (result.length===0){\n callback(\"User not found\");\n }else{\n if (typeof(service)==='function'){\n callback(undefined,results[0].APIs);\n }else{\n //console.log(result[0].exists.length);\n if (result[0].exists.length===0){\n callback(\"It looks like you haven't authenticated any services. To do so, go to your Profile.\");\n }else{\n var data = getAPIhelper(result[0].APIs,service);\n if (!data) callback(\"Service undefined or not supported\");\n callback(undefined,data);\n }\n }\n }\n }\n });\n}", "callService(endpoint, question, top) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.queryQnaService(endpoint, question, { top });\n });\n }", "function getProducts () {\n getRequest('products', onGetProducts);\n }", "initGetAllEndpoint() {\n this.router.get('/', (req, res) => this.getDAO()\n .getAll({ user: req.user })\n .then(users => res.status(200).send(users))\n .catch(err => {\n debug('[getAll]', err.message);\n return this.sendErr(res, 400, err.message);\n }));\n }", "function makeServiceGetRequestAsync(method, params, cache) {\n var url = serviceUrl + method,\n allParams = mergeObjects(templateQueryParams, params || {});\n\n return makeGetRequestAsync(url, allParams, cache);\n }", "function getCalls() {\n return $http.get(baseUrl+\"calls\",{headers:setHeaders()});\n }", "function getServicesForNearestDealer(req,res){\n\n\n\n\n}", "getServices() {\n // This accessory only provides one service - a switch\n return [this.service];\n }", "async request() {\n if (this.isTest()) { console.log(\"in getAllCalls\"); }\n // GET first page (and number of pages)\n await this.getCallsPage();\n \n if (this.isTest()) { console.log(`getLastPage = ` + this.getLastPage()); }\n // GET the remaining pages\n for (let pageNum = 2; pageNum <= this.getLastPage(); pageNum++) {\n await Util.throttle(this.#config.throttle);\n await this.getCallsPage(pageNum);\n }\n }", "getList() { return this.api(); }", "callShoppingCart() {\n const requestConfig = {};\n this.manageShoppingCartService.getFullCartService(requestConfig, this.handleShoppingCartResponse, this.handleShoppingCartError);\n this.$refs.spinner.showSpinner();\n }", "function getUsers() {\r\n console.log(\"getUsers called...\");\r\n doAjaxCall(`${apiURL}/users`,'GET'); \r\n\r\n}", "function getServices(category) {\n\t// Previous DOM content is cleared from the page\n\t$(\"#serviceCard\").hide();\n\t$(\"#serviceList\").html(\"\");\n\n\t// JSON file is called here\n\t$.getJSON(`/api/services/bycategory/${category}`, services => {\n\t\t$.each(services, (index, service) => {\n\t\t\t// Services are appended to the page on an unordered list\n\t\t\t$(\"#serviceList\").append(\n\t\t\t\t$(\"<li />\")\n\t\t\t\t\t.attr(\"class\", \"list-group-item border-dark list-group-item-action\")\n\t\t\t\t\t.text(service.ServiceName)\n\t\t\t\t\t.on(\"click\", e => {\n\t\t\t\t\t\t// click event is added to the anchors\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tgetService(service.ServiceID);\n\t\t\t\t\t})\n\t\t\t);\n\t\t\t\n\t\t});\n\t\t$(\"#servicesContainer\").show();\n\t});\n}", "generateGetAll() {\n\n }", "function GetJsonService(){\n\t\n\tvar service = this;\n\tservice.getSightJson = function (category){\n\t\treturn myJson[category];\n\t\t\n\t};\n\t\n\t\n\t/*service.getSightJson = function (category){\n\t\tvar promise = AjaxService.checkjson(category);\n\t\t\n\t\tpromise\n\t\t.then(function(response){\n\t\t\tconsole.log(myJson[category]);\n\t\t\treturn myJson[category];\n\t\t\t\n\t\t}, function(error){\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t});\n\t\t\n\t\t\n\t\t\n\t}*/\n\t service.getCountryJson = function(){\n\t\t \n\t\t \n\t\t \n\t\t return myJson;\n\t }\n\t\n\n\n\n\n\n}", "fetchSuppliers(){\r\n return Api().get('/suppliers')\r\n }", "getAll() {\n return axios.get(BuildUrl(this.apiPath)).pipe(ErrorOnBadStatus);\n }", "function makeServiceCall(searchTerm, callback, recsToIgnore) {\n var pagePathComponents = location.pathname.split('/'),\n pageKey = '',\n apiUrl;\n\n recsToIgnore = recsToIgnore ? ',' + recsToIgnore : '';\n apiUrl = configuration.apiEndpointBases.SearchPage + '?No=0&Ns=&N=0&Ntk=' + searchTerm.ntk + '&Ntx=mode+matchany&Dx=mode+matchany&Ntt=' + searchTerm.ntt;\n apiUrl = Utility.handleUserConfiguration(apiUrl, $.cookie('UserSegment'));\n\n //Make sure the current record is not returned in the results\n if (pagePathComponents.length >= 1) {\n pageKey = _.last(pagePathComponents);\n pageKey = pageKey.replace('R-', '');\n }\n\n apiUrl = Utility.updateQueryString(apiUrl, 'HideRecord', 'NOT(P_Primary_Key:' + pageKey + '),NOT(ContentTypes:Definition)' + recsToIgnore);\n\n $.getJSON(apiUrl)\n .done(function (json) {\n if (Utility.checkNested(json, 'mainContent[0].contents[0].records') && (json.mainContent[0].contents[0].records.length || json.mainContent[0].contents[0].totalNumRecs === 0)) {\n callback(json);\n }\n });\n\n }", "function getAlgoList(getAlgoListUrl){\n apiServiceCustom.makeGenericGetAPICall(getAlgoListUrl)\n .then(function(response){\n $scope.algoNames = response.data;\n }, function(err){\n console.log(err);\n });\n }", "get(id, params) {}", "function _usersServices() {\n\tlet baseUrl = 'http://localhost:5050/users'\n\n\tthis.get = function($http) {\n\t\treturn $http.get(baseUrl)\n\t}\n}", "function getSearch() {\n\n\t\t\t\t\tvar request = $http({\n\t\t\t\t\t\tmethod: \"get\",\n\t\t\t\t\t\turl: \"http://tmb_rpc.qa.pdone.com/search_processor.php?mode=SEARCH&page=1&phrase=e&page_length=100&type=news\",\n\t\t\t\t\t});\n\n\t\t\t\t\treturn( request.then( handleSuccess, handleError ) );\n\n\t\t\t\t}", "function callService(start, end, callback) {\n console.log('calling', start, end);\n globalTries++;\n request.get(`http://34.209.24.195/facturas?id=${id}&start=${start}&finish=${end}`, function (error, response) {\n if (Number.isInteger(parseInt(response.body))) {\n globalBills = globalBills + parseInt(response.body);\n }\n return callback(error, response);\n });\n}", "function _init() {\n vm.service.tncGetAll()\n .then(_tncGetAllSuccess, _tncGetAllError);\n }", "HubicPersoServices(packName) {\n let url = `/pack/xdsl/${packName}/hubic/services`;\n return this.client.request('GET', url);\n }", "async function callStatic(func, args) {\n //Create a new contract instance that we can interact with\n const contract = await client.getContractInstance(contractSource, {\n contractAddress\n });\n //Make a call to get data of smart contract func, with specefied arguments\n console.log(\"Contract : \", contract)\n const calledGet = await contract.call(func, args, {\n callStatic: true\n }).catch(e => console.error(e));\n //Make another call to decode the data received in first call\n console.log(\"Called get found: \", calledGet)\n const decodedGet = await calledGet.decode().catch(e => console.error(e));\n console.log(\"catching errors : \", decodedGet)\n return decodedGet;\n}", "function get(req, res, next) {\n cartService.get()\n .then(results =>{\n res.send(200, results);\n })\n next();\n }", "instancesGet(incomingOptions, cb) {\n const Rollbar = require('./dist');\n\n let apiInstance = new Rollbar.OccurrenceApi(); // String | Use a project access token with 'read' scope\n /*let xRollbarAccessToken = \"xRollbarAccessToken_example\";*/ let opts = {\n page: 1, // Number | Page number to return, starting at 1. 20 occurrences are returned per page.\n };\n\n if (incomingOptions.opts)\n Object.keys(incomingOptions.opts).forEach(\n (key) =>\n incomingOptions.opts[key] === undefined &&\n delete incomingOptions.opts[key]\n );\n else delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.instancesGet(\n incomingOptions.xRollbarAccessToken,\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data.result, response);\n }\n }\n );\n }", "async function callStatic(func, args) {\n //Create a new contract instance that we can interact with\n const contract = await client.getContractInstance(contractSource, {contractAddress});\n //Make a call to get data of smart contract func, with specefied arguments\n console.log(\"Contract : \", contract)\n const calledGet = await contract.call(func, args, {callStatic: true}).catch(e => console.error(e));\n //Make another call to decode the data received in first call\n console.log(\"Called get found: \", calledGet)\n const decodedGet = await calledGet.decode().catch(e => console.error(e));\n console.log(\"catching errors : \", decodedGet)\n return decodedGet;\n}", "getWebApi() {\n if (!this.active) {\n return;\n }\n this.library.set(\n this.library.getNode('webApiSync'),\n true,\n {'force': true}\n );\n this.library.set(\n this.library.getNode('webApiLast'),\n new Date().toISOString().substring(0, 19) + '+00:00'\n );\n\n // get nukis\n this.adapter.log.silly('getWebApi(): Retrieving from Nuki Web API..');\n this.api.getSmartlocks()\n .then(this.processSmartLocksResponse.bind(this))\n .catch(err => {\n this.adapter.log.warn('getWebApi(): Error retrieving smartlocks: ' + err.message);\n });\n\n // get notifications\n this.api.getNotification().then(notifications => {\n this.library.readData('notifications', notifications, 'info');\n }).catch(err => {\n this.adapter.log.warn('getWebApi(): Error retrieving notifications: ' + err.message);\n });\n }", "ExchangeServices(packName) {\n let url = `/pack/xdsl/${packName}/exchangeIndividual/services`;\n return this.client.request('GET', url);\n }", "get(url, params) {\n\t\treturn request.get(this.proxy + url).query(params).then((response) => response.data);\n\t}", "async get() {\n\t\treturn await this._run('GET');\n\t}", "getTasks() {\n var self = this;\n\n // Get data from server\n getAPITasks(self);\n }", "async fromSireneRequestOtherAPIs(dispatch, siret) {\n if (getters.idAssociationFromSirene()) {\n await store.dispatch('executeSearchByIdAssociation', { id: getters.idAssociationFromSirene(), api: 'RNA' })\n } else {\n await store.dispatch('executeSearchBySiret', { siret: siret, api: 'RNA' })\n }\n }", "function getAllServiceName() {\n var services = Array();\n\n $.ajax({\n url: OVEconfig.BASEURL + '/practitioner/getspservices/',\n type: 'POST',\n async: false,\n data: {all: true, sp_id: $('input#sp_id').val()},\n dataType: 'json',\n success: function(data) {\n services = data.services_list;\n },\n error: function(xhr, errorType, errorMsg) {\n console.log(errorMsg)\n }\n });\n\n var servicename = 'No Services';\n\n if (services != null && services.length > 0) {\n var servicename = '';\n for (var i = 0; i < services.length; i++)\n {\n servicename += (services[i].name) ? ((i < services.length - 1) ? (services[i].name + \",\") : services[i].name) : (servicename);\n }\n }\n $('#servicename').html(servicename);\n}", "SitebuilderFullServices(packName) {\n let url = `/pack/xdsl/${packName}/siteBuilderFull/services`;\n return this.client.request('GET', url);\n }", "function getAllModuleService(tick) {\n try {\n return baseSvc.executeQuery(getModuleUrl, { tick: tick });\n } catch (e) {\n throw e;\n }\n }", "function wrapGet(get){\n\t return function(context){\n\t return get.call(context, context.data );\n\t }\n\t }", "ListAvailableServices() {\n let url = `/pack/xdsl`;\n return this.client.request('GET', url);\n }", "get(endpoint) {\n\t\treturn this.fetchData(`${API_BASE_URL}/${endpoint}`, { \n\t\t\tmethod: 'GET', \n\t\t\theaders: this.getHeaders(),\n\t\t});\n\t}", "function ApiServiceRegistry() {\n\t }", "async function getCurrencyList() {\n let url = \"http://localhost:8080/getCurrencyList\";\n let response = await GetData(url);\n return response;\n}", "function _getServices() {\n if (!_isReady()) {\n return;\n }\n if (!_sonosSystem.availableServices) {\n _services = {};\n log.warn(LOG_PREFIX, 'No services available...');\n return;\n }\n try {\n const stringified = JSON.stringify(_sonosSystem.availableServices);\n const services = JSON.parse(stringified);\n if (diff(_services, services)) {\n log.verbose(LOG_PREFIX, 'Services changed.', services);\n _services = services;\n _self.emit('services-changed', services);\n }\n } catch (ex) {\n log.exception(LOG_PREFIX, 'Unable to get services', ex);\n }\n }", "static get(endpoint) {\n return Api.sendJson(`GET`, endpoint);\n }", "getAll() {\n let urlFull = this.controler;\n return BaseAPIConfig.get(urlFull);\n }", "function getProvis(){ \n services.get('components', 'search','firstdrop').then(function (response) {\n $scope.provinces = response;\n \n }); \n }", "function main() {\n var client = new Client(argv.username, argv.key, argv.region, {'url': argv.url, 'debug': true, 'authUrl': argv['auth-url']}),\n startTs = Date.now() - 1000;\n\n async.waterfall([\n function initialListEvents(callback) {\n var ts = Date.now(),\n from = highUUIDFromTimestamp(ts).toString();\n\n log.info('Initially listing events...');\n client.events.list(from, {}, function(err, data, nextMarker) {\n if (err) {\n callback(err);\n return;\n }\n\n if (data.length !== 0) {\n callback(new Error('Events list should have no events'));\n return;\n }\n\n callback();\n });\n },\n\n function createService(callback) {\n var serviceId = argv.prefix + 'serviceId';\n\n log.infof('Creating service...');\n client.services.create(serviceId, SERVICE_TIMEOUT, {}, function(err, data, hb) {\n if (err) {\n callback(err);\n return;\n }\n\n callback(null, serviceId, data.token);\n });\n },\n\n function initialGetService(serviceId, initialToken, callback) {\n log.infof('Getting service ${serviceId}... ', {'serviceId': serviceId});\n client.services.get(serviceId, function(err, data) {\n if (data.last_seen !== null) {\n callback(new Error('last_seen must be null initially'));\n return;\n }\n\n callback(err, serviceId, initialToken);\n });\n },\n\n function listEventsAfterServiceCreate(serviceId, initialToken, callback) {\n var from = highUUIDFromTimestamp(startTs).toString();\n\n log.info('Listing events...');\n client.events.list(from, {}, function(err, data, nextMarker) {\n if (err) {\n callback(err);\n return;\n }\n\n if (data.length !== 1) {\n callback(new Error('Events list should have a single entry'));\n return;\n }\n\n if (data[0].type !== 'service.join') {\n callback(new Error('Event type should be service.join'));\n return;\n }\n\n callback(null, serviceId, initialToken);\n });\n },\n\n function heartbeatService(serviceId, initialToken, callback) {\n var ts = Date.now();\n\n log.infof('Heartbeating service ${serviceId}... ', {'serviceId': serviceId});\n client.services.heartbeat(serviceId, initialToken, function(err, nextToken) {\n callback(err, serviceId, nextToken, ts);\n });\n },\n\n function getServiceLastSeenUpdated(serviceId, nextToken, ts, callback) {\n log.infof('Checking last_seen for service ${serviceId}... ', {'serviceId': serviceId});\n client.services.get(serviceId, function(err, data) {\n if (err) {\n callback(err);\n return;\n }\n\n if (data.last_seen < ts) {\n callback(new Error('service last_seen was not updated'));\n return;\n }\n\n callback(null, serviceId, nextToken, ts);\n });\n },\n\n function heartbeatSession(serviceId, nextToken, ts, callback) {\n log.infof('Heartbeating service ${serviceId}...', {'serviceId': serviceId});\n client.services.heartbeat(serviceId, nextToken, function(err, nextToken) {\n callback(err, ts, serviceId);\n });\n },\n\n function wait(ts, serviceId, callback) {\n log.info('Waiting for service to timeout...');\n callback = callback.bind(null, null, ts, serviceId);\n setTimeout(callback, (SERVICE_TIMEOUT + 2) * 1000);\n },\n\n function listEventsAfterTimeout(ts, serviceId, callback) {\n var from = highUUIDFromTimestamp(ts).toString();\n\n log.info('Checking events list for service.timeout event...');\n client.events.list(from, {}, function(err, data, nextMarker) {\n var timeoutEvent;\n\n if (err) {\n callback(err);\n return;\n }\n\n if (data.length < 1) {\n callback(new Error('Events list should have a services.timeout event: ' + data));\n return;\n }\n\n timeoutEvent = data.pop();\n if (timeoutEvent.type !== 'service.timeout') {\n callback(new Error('Event payload did not have correct type after ' +\n 'service timed out: ' +\n timeoutEvent));\n return;\n }\n\n if (timeoutEvent.payload.id !== serviceId) {\n callback(new Error(sprintf('Service IDs do not match: %s, %s',\n serviceId,\n timeoutEvent.payload.id)));\n return;\n }\n\n callback();\n });\n },\n\n function initialConfigurationValueUpdate(callback) {\n var from = highUUIDFromTimestamp(Date.now()).toString(),\n configurationId = argv.prefix + 'my-value-1', value;\n\n log.infof('Setting configuration ${configurationId}...',\n {'configurationId': configurationId});\n\n value = 'test value ' + misc.randstr(10);\n client.configuration.set(configurationId, value, function(err, data) {\n callback(err, from, configurationId, value);\n });\n },\n\n function checkEventCreated(from, configurationId, expectedValue, callback) {\n var updatedEvent;\n\n log.info('Checking events list for configuration_value.update event...');\n client.events.list(from, {}, function(err, data, nextMarker) {\n if (err) {\n callback(err);\n return;\n }\n\n if (data.length < 1) {\n callback(new Error('Events list should have a configuration_value.update event'));\n return;\n }\n\n updatedEvent = data.pop();\n if (updatedEvent.type !== 'configuration_value.update') {\n callback(new Error('Event payload did not have correct type after ' +\n 'configuration_value was updated: ' +\n updatedEvent));\n return;\n }\n\n if (updatedEvent.payload.configuration_value_id !== configurationId) {\n callback(new Error('Event payload did not have correct id after ' +\n 'configuration value was updated: ' +\n updatedEvent));\n return;\n }\n\n if (updatedEvent.payload.new_value !== expectedValue) {\n callback(new Error('Event payload did not have correct value after ' +\n 'configuration_value was updated: ' +\n updatedEvent));\n return;\n }\n\n callback(null, configurationId, expectedValue);\n });\n },\n\n function removeConfigurationValue(configurationId, expectedValue, callback) {\n var from = highUUIDFromTimestamp(Date.now()).toString();\n\n log.infof('Removing configuration ${configurationId}...',\n {'configurationId': configurationId});\n client.configuration.remove(configurationId, function(err, value) {\n callback(err, from, configurationId, expectedValue);\n });\n },\n\n function checkRemovedEventCreated(from, configurationId, expectedValue, callback) {\n var removedEvent;\n\n log.info('Checking events list for configuration_value.remove event...');\n client.events.list(from, {}, function(err, data, nextMarker) {\n if (err) {\n callback(err);\n return;\n }\n\n if (data.length < 1) {\n callback(new Error('Events list should have configuration_value.remove event: ' + data));\n return;\n }\n\n removedEvent = data.pop();\n if (removedEvent.type !== 'configuration_value.remove') {\n callback(new Error('Event payload did not have correct type after ' +\n 'configuration_value was removed: ' +\n removedEvent));\n return;\n }\n\n if (removedEvent.payload.configuration_value_id !== configurationId) {\n callback(new Error('Event payload did not have correct id after ' +\n 'configuration value was removed: ' +\n removedEvent));\n return;\n }\n\n if (removedEvent.payload.old_value !== expectedValue) {\n callback(new Error('Event payload did not have correct value after ' +\n 'configuration value was removed: ' +\n removedEvent));\n return;\n }\n\n callback();\n });\n },\n\n function setConfigurationValueWithNamespace(callback) {\n var from = highUUIDFromTimestamp(Date.now()).toString(),\n configurationId = sprintf('/%s/namespace/%s', argv.prefix, 'my-value-2'), value;\n\n log.infof('Setting configuration with a namespace ${configurationId}...',\n {'configurationId': configurationId});\n\n value = 'test value with namespace' + misc.randstr(10);\n client.configuration.set(configurationId, value, function(err, data) {\n callback(err, from, configurationId, value);\n });\n },\n\n function checkEventCreated(from, configurationId, expectedValue, callback) {\n var updatedEvent;\n log.info('Checking events list for configuration_value.update event...');\n\n client.events.list(from, {}, function(err, data, nextMarker) {\n if (err) {\n callback(err);\n return;\n }\n\n if (data.length < 1) {\n callback(new Error('Events list should have a configuration_value.update event'));\n return;\n }\n\n updatedEvent = data.pop();\n\n if (updatedEvent.type !== 'configuration_value.update') {\n callback(new Error('Event payload did not have correct type after ' +\n 'configuration_value was updated: ' +\n updatedEvent));\n return;\n }\n\n if (updatedEvent.payload.configuration_value_id !== configurationId) {\n callback(new Error('Event payload did not have correct id after ' +\n 'configuration value was updated: ' +\n updatedEvent));\n return;\n }\n\n if (updatedEvent.payload.new_value !== expectedValue) {\n callback(new Error('Event payload did not have correct value after ' +\n 'configuration_value was updated: ' +\n updatedEvent));\n return;\n }\n\n callback();\n });\n }\n ],\n\n function(err) {\n if (err) {\n log.errorf('Error: ${err}', {'err': err});\n setTimeout(process.exit.bind(null, 1), 500);\n return;\n }\n\n log.info('Verification successful');\n setTimeout(process.exit.bind(null, 0), 500);\n return;\n });\n}", "fetch(callback) {\n let proc = cp.spawnSync(this._serviceCmd, [\"list\"]);\n let firstline = true;\n let lines = proc.stdout.toString().split(/\\n/);\n let services = new Map();\n\n lines.forEach((line) => {\n if (!firstline && line) {\n let s = this._parseLine(line);\n services.set(s.name, s);\n }\n\n firstline = false;\n });\n\n let serviceList = new ServiceList(services);\n\n if (callback) callback(serviceList);\n\n return serviceList;\n }", "async get (method, query = {}, uniq=false, wait=true) {\n console.log('[API] call get to ', method)\n return new Promise(async (resolve, reject) => {\n let [url, data] = await this.prepareData(method, query, uniq);\n return this.makeQuery(url, data, wait).then(resolve, reject);\n });\n }", "Exchange2013Services(packName) {\n let url = `/pack/xdsl/${packName}/exchangeAccount/services`;\n return this.client.request('GET', url);\n }", "function main() {\n setReqURL()\n startMicroservice()\n registerWithCommMgr()\n}", "getServiceData(tenant, servicename, callback)\n\t{\n\t\tif(!r3IsSafeTypedEntity(callback, 'function')){\n\t\t\tconsole.error('callback parameter is wrong.');\n\t\t\treturn;\n\t\t}\n\t\tlet\t_callback\t= callback;\n\t\tlet\t_error;\n\t\tif(r3IsEmptyStringObject(tenant, 'name') || r3IsEmptyString(servicename, true)){\n\t\t\t_error = new Error('tenant(' + JSON.stringify(tenant) + ') or service(' + JSON.stringify(servicename) + ') parameters are wrong.');\n\t\t\tconsole.error(_error.message);\n\t\t\t_callback(_error);\n\t\t\treturn;\n\t\t}\n\t\tlet\t_tenant\t\t= tenant.name;\n\t\tlet\t_service\t= servicename.trim();\n\t\tlet\t_url\t\t= '/v1/service/' + _service;\n\n\t\tthis.startProgress();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// start progressing\n\n\t\tthis._get(_url, null, null, _tenant, (error, resobj) =>\n\t\t{\n\t\t\tthis.stopProgress();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// stop progressing\n\n\t\t\tif(null !== error){\n\t\t\t\tconsole.error(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(true !== resobj.result){\n\t\t\t\terror = new Error(resobj.message);\n\t\t\t\tconsole.error(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(r3IsEmptyEntity(resobj.service)){\n\t\t\t\t_callback(null, null);\n\t\t\t}else{\n\t\t\t\t_callback(null, resobj.service);\n\t\t\t}\n\t\t});\n\t}", "function service(mongoURL, request, response) {\r\n\r\n const search = request.params[0]; // user's search text.\r\n const apikey = '<GOOGLE-CUSTOM-SEARCH-API-KEY>'; // google search api key.\r\n const searchengineID = '<GOOGLE-CUSTOM-SEARCH-ENGINE-ID>'; // google search engine ID.\r\n const offset = (request.query.offset); // assign value of parameter 'offset' to the offset variable.\r\n let url = createURL(search, apikey, searchengineID, offset); // pass all above variables into createURL function to generate the appropriate URL.\r\n \r\n addToSearchHistory(mongoURL, search, new Date); // adds search query, along with search date, to the mongo database.\r\n\r\n performGET(url, response); // performs the get request.\r\n \r\n}", "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 read the Account Type Amounts by Company Code\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Calculate Values\n\t\t\t\tvar records = getEntries();\n\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\tdata: records\n\t\t\t\t}));\n\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\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\terror: err.message\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}", "Product_GetAll(req, res) {\n const fName = 'Product_GetAll()';\n logger.debug(logPrefix, fName, 'In function.');\n\n let skip = null,\n limit = null;\n\n try {\n skip = req.params.skip;\n limit = req.params.limit;\n\n logger.debug(logPrefix, fName, 'Skip:', skip);\n logger.debug(logPrefix, fName, 'Limit:', limit);\n\n this.validateParameter(skip, 'Skip');\n this.validateParameter(limit, 'Limit');\n }\n catch (err) {\n return this.sendResponse_Err(fName, err, res, err.message, true);\n }\n\n try {\n const isActive = true;\n\n productRepo\n .Product_GetAll(skip, limit, isActive)\n .then((response) => {\n return this.sendResponse_Model(fName, response, res, false);\n })\n .catch((err) => {\n return this.sendResponse_Err(fName, err, res, 'Retrieval failed');\n });\n }\n catch (err) {\n return this.sendResponse_Err(fName, err, res, 'Retrieval failed');\n }\n }", "function getSITable(PSCIP,PSCPort,PSCProtocol,PSCUser,PSCPassword,SITableName,filter){\n\tif (PSCProtocol == \"http\"){\n\t\tvar httpsClient = new HttpClient();\n\t\thttpsClient.getHostConfiguration().setHost(PSCIP, 80, \"http\");\n\t}else{\n\t\tvar httpsClient = CustomEasySSLSocketFactory.getIgnoreSSLClient(PSCIP,PSCPort);\n\t}\n\thttpsClient.getParams().setCookiePolicy(\"default\");\n\tif(SITableName.indexOf(\"Si\")!=0){\n\t\tSITableName = \"Si\" + SITableName;\n\t}\n\tvar tableURL = \"/RequestCenter/nsapi/serviceitem/\" + SITableName;\n\tif (filter !=\"\"){\n\t\ttableURL = tableURL + \"/\" + filter;\n\t}\n\tvar httpMethod = new GetMethod(tableURL);\n\thttpMethod.addRequestHeader(\"username\", PSCUser);\n\thttpMethod.addRequestHeader(\"password\", PSCPassword);\n\thttpMethod.addRequestHeader(\"Content-type\", \"application/json\");\n\thttpsClient.executeMethod(httpMethod);\n\tvar statuscode = httpMethod.getStatusCode();\n\tif (statuscode != 200)\n\t{\n\t\tlogger.addError(\"Unable to get the table data with name \" + SITableName + \". HTTP response code: \" + statuscode);\n\t\tlogger.addError(\"Response = \"+httpMethod.getResponseBodyAsString());\n\t \thttpMethod.releaseConnection();\n\t // Set this task as failed.\n\t\tctxt.setFailed(\"Request failed.\");\n\t\tctxt.exit()\n\t} else {\n\t\tlogger.addInfo(\"Table \" + SITableName + \" retrieved successfully.\");\n\t\tvar responseBody = String(httpMethod.getResponseBodyAsString());\n httpMethod.releaseConnection();\n\t\t//logger.addInfo(responseBody)\n\t\treturn responseBody;\n\n\t}\n}" ]
[ "0.6364921", "0.6284468", "0.62560415", "0.6241337", "0.6175913", "0.61678267", "0.61564416", "0.61005366", "0.59716976", "0.59592485", "0.59331256", "0.59169436", "0.58721495", "0.58526474", "0.58176726", "0.58158094", "0.5809898", "0.5781479", "0.575934", "0.5754267", "0.57211196", "0.5720852", "0.5716043", "0.5685775", "0.5683779", "0.56752855", "0.5672892", "0.56619954", "0.5635904", "0.56302905", "0.56141275", "0.5604718", "0.55876833", "0.5578255", "0.5574153", "0.5568542", "0.55568784", "0.5547069", "0.55355823", "0.55325365", "0.5526376", "0.55237067", "0.5512808", "0.55004823", "0.54977447", "0.5497211", "0.54967785", "0.54897124", "0.54871994", "0.5463399", "0.5456299", "0.54250944", "0.54182976", "0.5417568", "0.54065466", "0.53970325", "0.53717095", "0.5363196", "0.535753", "0.53532815", "0.5352153", "0.5342491", "0.53423446", "0.5338412", "0.53334767", "0.5329844", "0.53292954", "0.5320694", "0.53167504", "0.5313936", "0.53135806", "0.5299965", "0.52963895", "0.52952886", "0.529479", "0.5290312", "0.5289471", "0.52854085", "0.52771044", "0.52731204", "0.52667814", "0.52613556", "0.525997", "0.5253158", "0.52519506", "0.52469105", "0.5243888", "0.5241487", "0.52358335", "0.52347404", "0.5232296", "0.5231061", "0.52303326", "0.5228909", "0.5226173", "0.5226013", "0.52179015", "0.5210252", "0.52014226", "0.5194963", "0.51822054" ]
0.0
-1
================== Private functions ================== Draws a single segment of the circle, together with its assigned icon
function drawSegment(i, color) { var centerAngle = i * segmentAngle + Math.PI / 2;; var startAngle = centerAngle - segmentAngle / 2; var endAngle = centerAngle + segmentAngle / 2 var img; // Draw the segment ctx.strokeStyle = "#000000"; ctx.lineWidth = 5; ctx.fillStyle = color; ctx.beginPath(); ctx.arc(centerX, centerY, innerRadius, -startAngle, -endAngle, true); ctx.arc(centerX, centerY, outerRadius, -endAngle, -startAngle, false); ctx.closePath(); ctx.stroke(); ctx.fill(); // If the icon has not finished loading yet, return if (i >= icons.length) { return; } // Draw icons icon = icons[i]; // @TODO: Enable different widths on icons var iconHeight = (outerRadius - innerRadius) / 2; var iconOffset = iconHeight; icon.x = centerX + (outerRadius - iconOffset) * Math.cos(centerAngle) - iconHeight / 2; icon.y = centerY - (outerRadius - iconOffset) * Math.sin(centerAngle) - iconHeight / 2; //ctx.drawImage(icon, iconX, iconY, iconHeight, iconHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawIcon()\n\t{\n\t\tlet size = this.size / 2\n\t\tthis.iconHeight = size\n\t\tthis.iconWidth = size\n\t\tconst circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle')\n\t\tcircle.setAttribute('cx', this.x + size / 2)\n\t\tcircle.setAttribute('cy', this.y + size / 2)\n\t\tcircle.setAttribute('r', size / 2)\n\t\tcircle.setAttribute('fill', this.color)\n\t\treturn circle\n\t}", "function drawCircle(idx, size, col){\n\t\t\tvar c = new Path.Circle(new Point(spaces[idx].pos_x,(spaces[idx].pos_y)),size).fillColor = col;\n\t\t\treturn c;\n\t\t}", "draw () {\n this.dotCircle.remove()\n this.dotCircle = this.getDotCircle(this.point, this.thickness, this.color)\n\n this.dotToLine.removeSegments()\n this.dotToLine.add(this.point, this.iPoint)\n\n this.fillingDotToLine.removeSegments()\n this.fillingDotToLine.add(this.point)\n\n const point = this.dotToLine.getLocationAt(this.dotToLine.length * this.fillingProgress)\n this.fillingDotToLine.add(point)\n }", "drawLineSegment(line, circle){\n // this.lineGraphics.lineStyle(10, 0xfdfd96, 0.7);\n // this.lineGraphics.strokeLineShape(line);\n // this.lineGraphics.fillStyle(0xfdfd96, 0.7);\n // this.lineGraphics.fillCircleShape(circle);\n\n\n }", "function drawCircleOutline(idx, size, col){\n\t\t\tvar c = new Path.Circle(new Point(spaces[idx].pos_x, (spaces[idx].pos_y)),size).strokeColor =col;\n\t\t\tvar c = new Path.Circle(new Point(spaces[idx].pos_x, (spaces[idx].pos_y)),size+2).strokeColor =col;\n\t\t\tvar c = new Path.Circle(new Point(spaces[idx].pos_x, (spaces[idx].pos_y)),size+4).strokeColor =col;\n\t\t\treturn c;\n\t\t}", "draw() {\n\t\tnoStroke();\n\t\tfill('rgba(255,255,255,0.5)');\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "draw() {\n\t\tnoStroke();\n\t\tfill(\"rgba(255, 255, 255, 0.1)\");\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "function makeCircle(segment, path, radius) {\n \n var segments = new Array(segment);\n\n // Calculate path points locations (position & angle)\n for (i = 0; i < segment; i++) {\n var angle = 2 * Math.PI / segment * i;\n segments[i] = new Array(Math.cos(angle) * radius / 2, Math.sin(angle) * radius / 2);\n }\n\n // Draw path from array of points\n path.setEntirePath(segments);\n}", "function animateCircle(line) \n {\n var count = 0;\n window.setInterval(function() \n {\n count = (count + 1) % 200;\n var icons = line.get('icons');\n icons[0].offset = (count / 2) + '%';\n line.set('icons', icons);\n }, 20);\n }", "drawIcon()\n\t{\n\t\tlet size = this.size / 2\n\t\tthis.iconHeight = size\n\t\tthis.iconWidth = size\n\t\tconst diamond = document.createElementNS('http://www.w3.org/2000/svg', 'polygon')\n\t\tlet xMid = this.x + (size / 2)\n\t\tlet yMid = this.y + (size / 2)\n\t\tlet xLong = this.x + size\n\t\tlet yLong = this.y + size\n\t\tlet str = String(xMid) + ' ' + String(this.y) + ', ' + String(xLong) + ' ' + String(yMid) + ', ' + String(xMid) + ' ' + String(yLong) + ', ' + String(this.x) + ' ' + String(yMid)\n\t diamond.setAttribute('points', str) \n\t\tdiamond.setAttribute('fill', this.color)\n\t\treturn diamond\n\t}", "function drawCircle(){\n //ctx.beginPath();\n ctx.arc(100, 75, 50, 0, 2 * Math.PI);\n ctx.stroke();\n }", "function drawPieSlice(ctx, centerX, centerY, radius, startAngle, endAngle, color, lineWidth) {\n ctx.beginPath();\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n //ctx.moveTo(centerX, centerY);\n ctx.arc(centerX, centerY, radius, startAngle, endAngle);\n //ctx.closePath();\n ctx.stroke();\n }", "function drawCircle(radius, x, y) { svg.append(\"circle\").attr(\"fill\", \"red\").attr(\"r\", radius).attr(\"cx\", x).attr(\"cy\", y); }", "display(){\n\n push();\n\n fill(this.color);\n noStroke();\n\n for(let i = 0; i < this.numOfSegs; i++){\n ellipse(this.segments[i].x,this.segments[i].y,this.segments[i].width);\n }\n pop();\n\n }", "function Segment(i,e,t,n){this.path=i,this.length=i.getTotalLength(),this.path.style.strokeDashoffset=2*this.length,this.begin=\"undefined\"!=typeof e?this.valueOf(e):0,this.end=\"undefined\"!=typeof t?this.valueOf(t):this.length,this.circular=\"undefined\"!==n?n:!1,this.timer=null,this.animationTimer=null,this.draw(this.begin,this.end,0,{circular:this.circular})}", "function animateCircle(line) {\n var count = 0;\n window.setInterval(function() {\n count = (count + 1) % 200;\n\n var icons = line.get('icons');\n icons[0].offset = (count / 2) + '%';\n line.set('icons', icons);\n }, 20);\n }", "function drawAcircle(x, y, u, w, radius, cell) {\r\n\t\r\n\t// Si armure on met une bordure plus épaisse\r\n\tvar sw = 0;\r\n\tif(cell.isArmored) sw = 3;\r\n\t// On dessine le soldat\r\n\t$canvas.addLayer({\r\n\t\ttype: 'arc',\r\n\t\tgroups: [cell.legionId],\r\n\t\tbringToFront: true,\r\n\t\tfillStyle: tabCouleurs[cell.legionId],\r\n\t\tstrokeWidth : sw,\r\n\t\tstrokeStyle: '#000',\r\n\t\tx: x, y: y,\r\n\t\tradius: radius/100*60,\r\n\t\tname: 's'+u+','+w,\r\n\t\tlayer : true,\r\n\t\tclick : function(layer){\r\n\t\t\tif(!spectateur && moi.playerLegionId.indexOf(cell.legionId) != -1) clickAsolder(layer);\r\n\t\t},\r\n\t\ttouchend : function(layer){\r\n\t\t\tif(!spectateur && moi.playerLegionId.indexOf(cell.legionId) != -1) clickAsolder(layer);\r\n\t\t},\r\n\t}).addLayerToGroup('s'+u+','+w, 'plateau');\r\n}", "function draw_circle(x,y,i,indicator){ \r\n\r\n\t\tvar radius=30;\r\n\t\tctx.beginPath();\r\n\t\tctx.arc(x,y,radius,0,7);\r\n\t\t\r\n\t\tif(indicator==0)\r\n\t\t ctx.fillStyle=\"#FF8A65\";\r\n\t else\r\n\t\t\tctx.fillStyle=\"#4A8\";\r\n ctx.fill();\r\n\t\t\r\n\t\t // to write node number\r\n\t\t ctx = canvas.getContext(\"2d\");\r\n ctx.font = '20pt Calibri';\r\n ctx.fillStyle = 'white';\r\n ctx.textAlign = 'center';\r\n ctx.fillText(i, x, y); \r\n\t }", "function drawDot(){\n clear();\n ctx.beginPath();\n ctx.moveTo(width/2,height/2);\n ctx.arc(width/2,height/2,radius,0,Math.PI*2);\n ctx.stroke();\n ctx.fillStyle=\"#0000ff\";\n ctx.fill();\n ctx.closePath();\n}", "function createCircle(x,y)\n{\n\t//each segment of the circle is its own circle svg, placed in an array\n\tvar donuts = new Array(9)\n\t\n\t//loop through the array\n\tfor (var i=0;i<9;i++){\n\t\tdonuts[i]=document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\");\n\t\tdonuts[i].setAttributeNS(null,\"id\",\"d\".concat(i.toString()));\n\t\tdonuts[i].setAttributeNS(null,\"cx\",parseInt(x));\n donuts[i].setAttributeNS(null,\"cy\",parseInt(y));\n\t\tdonuts[i].setAttributeNS(null,\"fill\",\"transparent\");\n\t\tdonuts[i].setAttributeNS(null,\"stroke-width\",3);\n\t\t//each ring of circles has different radius values, and dash-array values\n\t\t//dash array defines what percentage of a full circle is being drawn\n\t\t//for example the inner circle has a radius of 15.91549, 2*pi*15.91549\n\t\t//gives a circumfrence of 100 pixels for the circle, so defining the dasharray as 31 69 means that 31% of 100 pixels is drawn, and 69% is transparent.\n\t\tif (i<3){\n\t\t\t\t\tdonuts[i].setAttributeNS(null,\"r\",15.91549);\n\t\t\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"31 69\");\n\t\t}\n\t\t//middle ring\n\t\telse if (i<6){\n\t\t\tdonuts[i].setAttributeNS(null,\"r\",19.853);\n\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"39.185019 85.555059\");\n\t\t}\n\t\t//outer ring\n\t\telse{\n\t\t\tdonuts[i].setAttributeNS(null,\"r\",23.76852);\n\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"47.335504 102.006512\");\n\t\t}\n\t\t//each point is added to the points SVGs, use insertBefore so that it is drawn below the points rather than above, which allows for click events to still occur\n\t\t document.getElementById(\"points\").insertBefore(donuts[i],document.getElementById(\"points\").childNodes.item(0));\n\t}\n\t//each point has its own colour, dash offset and class. Dash offset is how far from the starting point (top of the circle) to begin drawing the segment\n\t//each class relates to a different css animation because each animation has a different starting point. Animations are defined in component.css\ndonuts[0].setAttributeNS(null,\"stroke-dashoffset\",\"58.33333\" );\n\t\t\t\t\t\tdonuts[0].setAttributeNS(null,\"class\",\"spin1\");\ndonuts[1].setAttributeNS(null,\"stroke-dashoffset\",\"25\");\n\t\t\t\t\t\t\tdonuts[1].setAttributeNS(null,\"class\",\"spin2\");\ndonuts[2].setAttributeNS(null,\"stroke-dashoffset\",\"91.66667\" );\n\t\t\t\t\t\t\tdonuts[2].setAttributeNS(null,\"class\",\"spin3\");\ndonuts[3].setAttributeNS(null,\"stroke-dashoffset\",\"41.18502\" );\n\tdonuts[3].setAttributeNS(null,\"class\",\"spin4\");\ndonuts[4].setAttributeNS(null,\"stroke-dashoffset\",\"82.76505\" );\n\tdonuts[4].setAttributeNS(null,\"class\",\"spin5\");\ndonuts[5].setAttributeNS(null,\"stroke-dashoffset\",\"124.34508\");\n\tdonuts[5].setAttributeNS(null,\"class\",\"spin6\");\ndonuts[6].setAttributeNS(null,\"stroke-dashoffset\",\"56.3355\");\n\tdonuts[6].setAttributeNS(null,\"class\",\"spin7\");\ndonuts[7].setAttributeNS(null,\"stroke-dashoffset\",\"106.11618\");\n\tdonuts[7].setAttributeNS(null,\"class\",\"spin8\");\ndonuts[8].setAttributeNS(null,\"stroke-dashoffset\",\"155.89685\");\n\tdonuts[8].setAttributeNS(null,\"class\",\"spin9\");\ndonuts[0].setAttributeNS(null,\"stroke\",\"#115D6B\");\ndonuts[1].setAttributeNS(null,\"stroke\",\"#D90981\");\ndonuts[2].setAttributeNS(null,\"stroke\",\"#4A3485\");\ndonuts[3].setAttributeNS(null,\"stroke\",\"#F51424\");\ndonuts[4].setAttributeNS(null,\"stroke\",\"#0BA599\");\ndonuts[5].setAttributeNS(null,\"stroke\",\"#1077B5\");\ndonuts[6].setAttributeNS(null,\"stroke\",\"#FA893D\");\ndonuts[7].setAttributeNS(null,\"stroke\",\"#87C537\");\ndonuts[8].setAttributeNS(null,\"stroke\",\"#02B3EE\");\n}", "function drawCircle(x,y,radius,color)\r\n{\r\n\tdrawArc(x, y, radius, 0, Math.PI * 2, color);\r\n}", "function animateSegment()\n{\n /*\n * Canvas objects consist of circle, line, circle groups in each segment\n */\n if(index < canvas.getObjects().length-2)\n {\n /*\n *Compute delay for next line segment from distance between circles\n */\n var sideA = Math.abs(canvas.item(index).left - canvas.item(index+2).left);\n var sideB = Math.abs(canvas.item(index).top - canvas.item(index+2).top);\n var length = Math.sqrt((sideA*sideA) + (sideB*sideB));\n /*\n * Delay is shifted based on a set rate of animation (100px/second)\n */\n var rate = 100;\n var delta = length/rate;\n var delay = 1000*delta;\n /*\n * Show the circle from which the line will start\n */\n canvas.item(index).animate(\"opacity\", 1.0,\n {\n duration: 1,\n onChange: canvas.renderAll.bind(canvas)\n });\n /*\n * Reveal the line \n */\n canvas.item(index+1).animate(\"opacity\", 1.0,\n {\n duration: 1,\n onChange: canvas.renderAll.bind(canvas)\n });\n /*\n * Animate the line to the second circle\n */\n canvas.item(index+1).animate(\"x2\", canvas.item(index+2).left,\n {\n duration: delay,\n onChange: canvas.renderAll.bind(canvas),\n onComplete: function()\n {\n /*\n * Reveal the finishing circle when complete \n */\n alpha = !alpha;\n if(alpha && omega)\n {\n canvas.item(counter).animate(\"opacity\", 1.0,\n {\n duration: 1,\n onChange: canvas.renderAll.bind(canvas)\n });\n }\n }\n });\n canvas.item(index+1).animate(\"y2\", canvas.item(index+2).top,\n {\n duration: delay,\n onChange: canvas.renderAll.bind(canvas),\n onComplete: function()\n {\n /*\n * Reveal the finishing circle when complete \n */\n omega = !omega;\n if(alpha && omega)\n {\n canvas.item(counter).animate(\"opacity\", 1.0,\n {\n duration: 1,\n onChange: canvas.renderAll.bind(canvas)\n });\n }\n }\n });\n /*\n * Continue animation in a daisy chain fashion\n */\n setTimeout(function()\n {\n animateSegment()\n }, delay);\n /*\n * Increment by three because a segment is a group of circle, line, circle objects\n */\n index += 3;\n }\n else if(index == canvas.getObjects().length-1)\n {\n /*\n * On final segment reveal finish arrow\n */\n canvas.item(index).animate(\"opacity\", 1.0,\n {\n duration: delay/2,\n onChange: canvas.renderAll.bind(canvas)\n });\n /*\n * If coordinates are set create and display the infobox\n */\n if(!isNaN(coordinates.x) && !isNaN(coordinates.y))\n {\n /*\n * Open the infobox with some settings\n */\n infobox.open(\n {\n header: company+\" <br> \"+suite,\n status: \"success\",\n left: coordinates.x+\"px\",\n top: coordinates.y+\"px\"\n });\n /*\n * Reveal infobox\n */\n $(\"#infobox-wrapper\").animate(\n {\n opacity: 1.0\n }, 2000);\n }\n /*\n * Init the tracer function by resetting the index and delay\n */\n index = 1;\n pathTrace();\n }\n}", "draw(s) {\n s.strokeWeight(1);\n if (this.isDragging(s)) {\n s.stroke(255, 0, 0);\n s.circle(this.x, this.y, this.r);\n s.stroke(255);\n } else {\n s.circle(this.x, this.y, this.r);\n }\n }", "draw() {\n const {STROKE_WIDTH, STROKE_COLOR} = constants\n const {graphics, x, y, radius} = this\n\n graphics.lineStyle(STROKE_WIDTH, STROKE_COLOR)\n graphics.drawCircle(\n getDispersedPosition(x),\n getDispersedPosition(y),\n radius,\n )\n\n return graphics\n }", "function DrawCircle(SArray) {\n\tvar cmd = [];\n\tcmd[0] = '<circle cx=\"' + SArray[0].ox + '\" cy=\"' + SArray[0].oy + '\" r=\"' + SArray[0].plasmidradius +\n\t\t'\" style=\"fill:none;stroke:' + SArray[0].bbcolor + ';stroke-width:' + SArray[0].bbwidth + '\"/>\\n';\n\tcmd[1] = newSVG(\"circle\");\n\tcmd[1].setAttribute(\"cx\", SArray[0].ox);\n\tcmd[1].setAttribute(\"cy\", SArray[0].oy);\n\tcmd[1].setAttribute(\"r\", SArray[0].plasmidradius);\n\tvar stylePara = \"fill:none;stroke:\" + SArray[0].bbcolor + \";stroke-width:\" + SArray[0].bbwidth;\n\tcmd[1].setAttribute(\"style\", stylePara);\n\treturn cmd;\n}", "function drawCircularOutline(context, centerX, centerY, radius, color) {\r\n\tcontext.beginPath();\r\n\tcontext.arc(centerX, centerY, radius, 0, Math.PI * 2, false);\r\n\tcontext.closePath();\r\n\tcontext.strokeStyle = \"#000000\";\r\n\tcontext.stroke();\r\n}", "function drawcircle()\n{\n\tctx.fillStyle='#0079B8';\n\tctx.beginPath();\n\tctx.arc(x1,y1,20,0,2*Math.PI);\n\tctx.fill();\n\tctx.strokeStyle=\"white\"\n\tctx.stroke();\n}", "function draw(segment) {\n if (segment.type === 'line') {\n ctx.strokeStyle = segment.colour;\n ctx.lineWidth = 3;\n ctx.beginPath();\n ctx.moveTo(segment.from_x, segment.from_y);\n ctx.lineTo(segment.x, segment.y);\n ctx.stroke();\n } else if (segment.type === 'dot') {\n ctx.fillStyle = segment.colour;\n ctx.fillRect(segment.x - (3/2), segment.y - (3/2), 3, 3);\n }\n forceRepaint(cv);\n }", "function drawCircle(item) {\n\n //current canvas being clicked on\n var canvas = item;\n\n //set the elemen data attr to the current counter\n $(item).attr(\"data-counter\", \"O\");\n\n //get the rendering context\n var ctx = canvas.getContext('2d');\n\n ctx.lineWidth = 8;\n ctx.strokeStyle = '#536dfe';\n\n\n var angleLog = 1;\n\n function lineDraw() {\n\n if(angleLog === 7) {\n clearInterval(circleLineAnimation);\n ctx.closePath();\n }\n\n ctx.beginPath();\n\n //start an arc, clockwise\n ctx.arc( 50, 50, 35, 0, angleLog, false);\n\n ctx.stroke();\n\n //increment angle\n angleLog++;\n\n }\n //spcify an interval to draw the line for a nice animation\n circleLineAnimation = setInterval(lineDraw, 25);\n }", "function drawInterface(ctx, radius) {\n ctx.beginPath();\n ctx.arc(0, 0, radius, 0, 2 * Math.PI);\n ctx.fillStyle = 'white';\n ctx.fill();\n ctx.lineWidth = radius * 0.001;\n ctx.stroke();\n ctx.beginPath();\n ctx.arc(0, 0, radius * 0.025, 0, 2 * Math.PI);\n ctx.fillStyle = '#333';\n ctx.fill();\n}", "function IoIosAddCircleOutline(props) {\n return (0, _lib.GenIcon)({\n \"tag\": \"svg\",\n \"attr\": {\n \"viewBox\": \"0 0 512 512\"\n },\n \"child\": [{\n \"tag\": \"path\",\n \"attr\": {\n \"d\": \"M346.5 240H272v-74.5c0-8.8-7.2-16-16-16s-16 7.2-16 16V240h-74.5c-8.8 0-16 6-16 16s7.5 16 16 16H240v74.5c0 9.5 7 16 16 16s16-7.2 16-16V272h74.5c8.8 0 16-7.2 16-16s-7.2-16-16-16z\"\n }\n }, {\n \"tag\": \"path\",\n \"attr\": {\n \"d\": \"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z\"\n }\n }]\n })(props);\n}", "function drawDot(center, radius, color) {\n ctx.beginPath();\n ctx.arc(center.x, center.y, radius, 0 , 2 * Math.PI);\n ctx.fillStyle = color;\n ctx.fill();\n}", "display() {\n push();\n fill(255, 255, 0);\n let angle = TWO_PI / this.points;\n let halfAngle = angle / 2.0;\n beginShape();\n for (let a = 0; a < TWO_PI; a += angle) {\n let sx = this.x + cos(a) * this.outerRadius;\n let sy = this.y + sin(a) * this.outerRadius;\n vertex(sx, sy);\n sx = this.x + cos(a + halfAngle) * this.innerRadius;\n sy = this.y + sin(a + halfAngle) * this.innerRadius;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n pop();\n }", "show(){\n fill(0)\n stroke(255)\n circle(this.x,this.y,this.d)\n }", "function drawCircle( c ) {\n \n context.beginPath(); \n context.arc( c.x, c.y, c.size/2, 0, Math.PI * 2 );\n context.fillStyle = c.color;\n context.fill(); \t\t\t\n context.closePath(); \n \n } //drawCircle() ", "function animateCircle(line) {\n\tvar count = 0;\n\twindow.setInterval(function() {\n\t\tcount = (count + 1) % 200;\n\t\tvar icons = line.get('icons');\n\t\ticons[0].offset = (count / 2) + '%';\n\t\tline.set('icons', icons);\n\t}, 20);\n}", "function changeImageShape(x,y){\n ctx.beginPath();\n ctx.arc(x+circleFixed,y+circleFixed, size/2, 0, 2*Math.PI);\n ctx.closePath(); \n ctx.lineWidth = \"5\";\n ctx.strokeStyle = \"white\";\n ctx.stroke(); \n}", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false); //creates a circle\n ctx.fillStyle = '#ffffff';\n ctx.fill();\n }", "show() {\n push();\n noStroke();\n fill(120, 180, 255, 150);\n\n translate(this.position.x, this.position.y);\n\n if (this.crashed) {\n fill(255, 0, 0);\n\n circle(0, 0, 12);\n\n pop();\n return;\n }\n\n circle(0, 0, 14);\n pop();\n }", "function drawCircle(x,y,r,f,s){\r\n ctx.beginPath()\r\n ctx.arc(x,y, r, 0, 2*Math.PI);\r\n if(f){\r\n ctx.fill();\r\n }\r\n if(s){\r\n ctx.stroke();\r\n }\r\n }", "function animateCircle(line) {\n var count = 0;\n window.setInterval(function() {\n count = (count + 1) % 200; //tiene que ver con el recorrigo del poligono entre \n //mayor es el numero mas tarda en aparecer entre menor es\n //se corta en la linea\n\n var icons = line.get('icons');\n icons[0].offset = (count / 2) + '%';\n line.set('icons', icons);\n }, 150); //velocidad entre mayor es el numero mas despacio va\n}", "show(){\n fill(255);\n circle(this.x, this.y, this.r);\n }", "_drawCircleFilledOctants( centerX, centerY, x, y, paletteId ) {\n this.drawLine( centerX - x, centerY + y, centerX + x, centerY + y, paletteId );\n this.drawLine( centerX - x, centerY - y, centerX + x, centerY - y, paletteId );\n this.drawLine( centerX - y, centerY + x, centerX + y, centerY + x, paletteId );\n this.drawLine( centerX - y, centerY - x, centerX + y, centerY - x, paletteId );\n }", "function SwatterCircle() {\n ctx.beginPath();\n ctx.arc(mouse.x + 28, mouse.y + 27, 15, 0, Math.PI * 2, false);\n ctx.strokeStyle = '#D04D00';\n ctx.stroke();\n}", "function draw_circle_point(ctx, oldcenterX, oldCenterY, oldRadius, centerX, centerY, radius, vertice) \n{\n\td = (5 - radius * 4)/4;\n\tx = 0;\n\ty = radius;\n\n\tdo {\n\t\tdraw_pixel_selection(ctx,centerX + x, centerY + y, oldcenterX, oldCenterY, oldRadius, vertice);\n\t\tdraw_pixel_selection(ctx,centerX + x, centerY - y, oldcenterX, oldCenterY, oldRadius, vertice);\n\t\tdraw_pixel_selection(ctx,centerX - x, centerY + y, oldcenterX, oldCenterY, oldRadius, vertice);\n\t\tdraw_pixel_selection(ctx,centerX - x, centerY - y, oldcenterX, oldCenterY, oldRadius, vertice);\n\t\tdraw_pixel_selection(ctx,centerX + y, centerY + x, oldcenterX, oldCenterY, oldRadius, vertice);\n\t\tdraw_pixel_selection(ctx,centerX + y, centerY - x, oldcenterX, oldCenterY, oldRadius, vertice);\n\t\tdraw_pixel_selection(ctx,centerX - y, centerY + x, oldcenterX, oldCenterY, oldRadius, vertice);\n\t\tdraw_pixel_selection(ctx,centerX - y, centerY - x, oldcenterX, oldCenterY, oldRadius, vertice);\n\t\tif (d < 0) {\n\t\t\td += 2 * x + 1;\n\t\t} else {\n\t\t\td += 2 * (x - y) + 1;\n\t\t\ty--;\n\t\t}\n\t\tx = x + 1;\n\t} while (x <= y);\n}", "function redrawCircle(circle) {\n\tcontext.beginPath();\n\tcontext.arc(circle[1], circle[2], circleRadius, 0, 2*Math.PI);\n\tcontext.stroke();\n\tcontext.beginPath();\n}", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false );\n ctx.fillStyle = '#ffffff';\n ctx.fill();\n }", "function drawCircles(){\n for(let i = 0; i < circle.length; i++){\n //console.log(circle.item(i));\n circle.item(i).style.strokeDasharray = `${circumference} ${circumference}`;\n circle.item(i).style.strokeDashoffset = circumference;\n }\n}", "function drawCircle(context,circle) {\n context.beginPath();\n context.arc(circle.x,circle.y,circle.r,0,Math.PI*2,true);\n context.closePath();\n context.stroke();\n }", "function sc_displayCircle(o, p) {\n if (p === undefined) // we assume not given\n\tp = SC_DEFAULT_OUT;\n p.appendJSString(sc_toCircleString(o, sc_toDisplayString));\n}", "draw(ctx,data,radius, color){\n\t\t//Sets it up\n\t\tctx.save();\n let barWidth = 3;\n let barHeight = 6;\n\t\tlet previousPoint = {};\n\t\tlet point = {};\n\t\tlet angle = this.startingAngle;\n\t\tctx.translate(ctx.canvas.width/2, ctx.canvas.height/2);\n\t\t//Creates the color string\n\t\tctx.strokeStyle = \"rgb(\" + color[0] + \",\" + color[1] + \",\" + color[2] + \",\" + color[3] + \")\";\n\t\tctx.lineWidth = 3;\n\t\tctx.beginPath();\n\t\t//Draws the circle\n for (let i = 0; i < data.length; i++) {\n\t\t\tpoint.x = Math.cos(angle)*(radius + this.spacing+data[i]*0.2);\n\t\t\tpoint.y = Math.sin(angle)*(radius + this.spacing+data[i]*0.2);\n\t\t\tangle += (Math.PI * 2/data.length/2);\n if(i == 0)\n\t\t\t{\n\t\t\t\tctx.moveTo(point.x,point.y);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tctx.lineTo(point.x,point.y);\n\t\t\t} \n }\n\t\t//Draws the second half\n\t\tfor (let i = data.length-1; i >= 0; i--) {\n\t\t\tpoint.x = Math.cos(angle)*(radius + this.spacing+data[i]*0.2);\n\t\t\tpoint.y = Math.sin(angle)*(radius + this.spacing+data[i]*0.2);\n\t\t\tangle += (Math.PI * 2/data.length/2);\n\t\t\tctx.lineTo(point.x,point.y); \n }\n\t\tctx.closePath();\n\t\tctx.stroke();\n\t\tctx.restore();\n\t}", "drawCircle () {\n const context = this.canvas.getContext('2d')\n const [x, y] = this.center\n const radius = this.size / 2\n\n for (let angle = 0; angle <= 360; angle++) {\n const startAngle = (angle - 2) * Math.PI / 180\n const endAngle = angle * Math.PI / 180\n context.beginPath()\n context.moveTo(x, y)\n context.arc(x, y, radius, startAngle, endAngle)\n context.closePath()\n context.fillStyle = 'hsl(' + angle + ', 100%, 50%)'\n context.fill()\n }\n }", "draw(){\r\n // acctually, i didnt understood how it works, but it works\r\n ctx.beginPath();\r\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2); //circle\r\n ctx.fillStyle = D_color;\r\n ctx.fill();\r\n ctx.closePath();\r\n }", "function drawSegment(_ref2, _ref3, color, scale, ctx) {\n var _ref4 = _slicedToArray(_ref2, 2),\n ay = _ref4[0],\n ax = _ref4[1];\n\n var _ref5 = _slicedToArray(_ref3, 2),\n by = _ref5[0],\n bx = _ref5[1];\n\n ctx.beginPath();\n ctx.moveTo(ax * scale, ay * scale);\n ctx.lineTo(bx * scale, by * scale);\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.stroke();\n}", "function drawSegment([ax, ay], [bx, by], color, scale, ctx) {\r\n ctx.beginPath();\r\n ctx.moveTo(ax * scale, ay * scale);\r\n ctx.lineTo(bx * scale, by * scale);\r\n ctx.lineWidth = 2;\r\n ctx.strokeStyle = color;\r\n ctx.stroke();\r\n}", "function drawCircle(ctx, x, y, radius, type) {\n if (type == \"full\") {\n ctx.fillStyle = 'rgba(3, 179, 0, 1.0)';\n } else if (type == \"partial\") {\n ctx.fillStyle = 'rgba(181, 91, 0, 1.0)';\n } else if (type == \"empty\") {\n ctx.fillStyle = 'rgba(173, 0, 179, 1.0)';\n } else if (type == \"hint\") {\n ctx.lineWidth = 2;\n ctx.strokeStyle = \"rgba(0, 255, 255, 1.0)\";\n }\n\n ctx.beginPath();\n ctx.arc(x*iMult, y*iMult, radius/iMult, 0, Math.PI*2, true);\n ctx.stroke();\n if (type != \"hint\") {\n ctx.fill();\n } else {\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"black\";\n }\n}", "function dotDrawer(position) {\n\n // Draw a circle path and fill\n ctx.beginPath()\n ctx.arc((position[0] + (pageWidth / 2)), (position[1] + (pageHeight / 2)), globalRadius, 0, 2 * Math.PI, false) \n ctx.fill()\n ctx.restore()\n\n}", "drawSegment(graphics, color) {\n if (color) graphics.setForeground(color)\n graphics.drawLine(this.x1, this.y1, this.x2, this.y2)\n }", "function drawCircle(x,y){\n var c = document.getElementById('board');\n var ctx = c.getContext('2d');\n ctx.beginPath();\n ctx.arc(x,y,CELL_SIZE/5,0,2*Math.PI);\n ctx.strokeStyle = 'red';\n ctx.lineWidth = 4; \n ctx.stroke();\n }", "function drawCircle(x, y, radius, start=0, end=2 * Math.PI){\n ctx.beginPath();\n ctx.arc(x, y, radius, start, end);\n ctx.fillStyle = \"red\";\n ctx.strokeStyle = \"blue\";\n ctx.fill();\n}", "display() {\n fill(127);\n stroke(200);\n strokeWeight(2);\n ellipse(this.x, this.y, this.radius * 2, this.radius * 2);\n }", "draw() {\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\n ctx.fill();\n }", "draw() {\n\t\tinfo.context.beginPath();\n\t\tinfo.context.arc(this.position.x, this.position.y, 30, 0, 2 * Math.PI);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function arc(start, end, exonJSON) {\n let rx = (end - start) / 2,\n ry = rx / 2,\n startBlock = junction_block(start, \"#00AA90\"),\n endBlock = junction_block(end, \"#D0104C\"),\n realStart = getMinMax(exonJSON)[0],\n realEnd = getMinMax(exonJSON)[1],\n display = false,\n circ\n\n let path = \"M\" + (start + 1) + \" 443A\" + rx + \" \" + ry + \" 0 0 1 \" + (end + 1) + \" 443\"\n let c = svg.paper.path(path).attr({\n stroke: \"#000\",\n strokeWidth: 1,\n fill: 'none',\n cursor: 'pointer'\n });\n\n c.click(function () {\n if (display == false) {\n let x = svg.select(\"g\")\n if (x != null) {\n x.remove()\n }\n circ = drawCircRNA(exonJSON)\n display = true\n } else if (display == true) {\n circ.remove()\n display = false\n }\n }).mouseover(function () {\n Snap.animate(1, 6, function (val) {\n c.attr({\n stroke: \"#33A6B8\",\n strokeWidth: val,\n });\n }, 200);\n startBlock.attr({\n stroke: \"#33A6B8\",\n strokeWidth: 1\n });\n endBlock.attr({\n stroke: \"#33A6B8\",\n strokeWidth: 1\n });\n startText = textCenter(start, 470, realStart, 10, '#000')\n\n endText = textCenter(end, 470, realEnd, 10, '#000')\n }).mouseout(function () {\n Snap.animate(6, 1, function (val) {\n c.attr({\n stroke: \"#33A6B8\",\n strokeWidth: val,\n });\n }, 200, function () {\n c.attr({\n stroke: \"#000\",\n strokeWidth: 1,\n fill: 'none',\n });\n })\n startBlock.attr({\n fill: \"#00AA90\",\n stroke: \"none\"\n });\n endBlock.attr({\n fill: \"#D0104C\",\n stroke: \"none\"\n })\n startText.remove();\n endText.remove()\n })\n return c\n}", "function drawCircle(ctx, size) {\n ctx.beginPath();\n ctx.arc(size / 2, size / 2, size / 2, 0, Math.PI * 2, true);\n ctx.closePath();\n}", "function drawCircle(circle, color, line_w = 2) {\n\n context.beginPath();\n context.arc(circle.x, circle.y, circle.r, 0, Math.PI * 2);\n context.closePath();\n if (line_w == 0) {\n context.fillStyle = color;\n context.fill();\n } else {\n context.strokeStyle = color;\n context.lineWidth = line_w;\n context.stroke();\n }\n\n}", "drawOutline() {\n\t\tinfo.context.beginPath();\n\t\tinfo.context.arc(this.position.x, this.position.y, 30, 0, 2 * Math.PI);\n\t\tinfo.context.strokeStyle = \"black\";\n\t\tinfo.context.stroke();\n\t}", "function drawDot(x, y, r) {\n ctx.beginPath();\n ctx.arc(x, y, r, 0, 2 * Math.PI);\n ctx.fillStyle = \"white\";\n ctx.fill();\n}", "function drawCircle(data, colorLastSlice) {\n // draw a circle covering the entire SVG\n // the data retrieved fromt the dataset is drawn incrementally as a slice of the circle\n // the last slice is not drawn (the path element for this particular portion goes round 360 degrees, removing the visual) \n // because of this, the circle is both used as a frame and as the color for the last, final slice\n pieChart\n .append(\"circle\")\n .attr(\"cy\", 50)\n .attr(\"cx\", 50)\n .attr(\"r\",50)\n .attr(\"fill\", colorLastSlice)\n .attr(\"class\", \"slice\")\n // include as a title element the number which the circle represents\n .append(\"title\")\n .text(data[0]);\n}", "drawInnerCircle () {\n const context = this.canvas.getContext('2d')\n const [x, y] = this.center\n const radius = this.size / 2\n\n const innerRadius = 10\n const outerRadius = this.size / 2\n\n const gradient = context.createRadialGradient(x, y, innerRadius, x, y, outerRadius)\n gradient.addColorStop(0, 'white')\n gradient.addColorStop(1, 'rgba(255, 255, 255, 0.2)')\n\n context.arc(x, y, radius, 0, 2 * Math.PI)\n\n context.fillStyle = gradient\n context.fill()\n }", "drawDot(x,y) {\n const size = 12\n // yellow\n const a = 255\n // Select a fill style\n this.ctx.fillStyle = \"rgba(255,255,0,\"+(a/255)+\")\"\n // Draw a filled circle\n this.ctx.beginPath()\n this.ctx.arc(x, y, size, 0, Math.PI*2, true)\n this.ctx.closePath()\n this.ctx.fill()\n }", "segment(type, factor) {\n this.currentShape.addSegment(type, factor);\n }", "async function createDot() {\n var size = 200;\n\n let newDot = 'pulsingDot' + Math.random();\n newDot = {\n width: size,\n height: size,\n data: new Uint8Array(size * size * 4),\n\n // get rendering context for the map canvas when layer is added to the map\n onAdd: function () {\n var canvas = document.createElement('canvas');\n canvas.width = this.width;\n canvas.height = this.height;\n this.context = canvas.getContext('2d');\n },\n\n // called once before every frame where the icon will be used\n render: function () {\n var duration = 1000;\n var t = (performance.now() % duration) / duration;\n\n var radius = (size / 2) * 0.3;\n var outerRadius = (size / 2) * 0.7 * t + radius;\n var context = this.context;\n\n // draw outer circle\n context.clearRect(0, 0, this.width, this.height);\n context.beginPath();\n context.arc(\n this.width / 2,\n this.height / 2,\n outerRadius,\n 0,\n Math.PI * 2\n );\n context.fillStyle = 'rgba(255, 200, 200,' + (1 - t) + ')';\n context.fill();\n\n // draw inner circle\n context.beginPath();\n context.arc(\n this.width / 2,\n this.height / 2,\n radius,\n 0,\n Math.PI * 2\n );\n context.fillStyle = 'rgba(255, 100, 100, 1)';\n context.strokeStyle = 'white';\n context.lineWidth = 2 + 4 * (1 - t);\n context.fill();\n context.stroke();\n\n // update this image's data with data from the canvas\n this.data = context.getImageData(\n 0,\n 0,\n this.width,\n this.height\n ).data;\n\n // continuously repaint the map, resulting in the smooth animation of the dot\n map.triggerRepaint();\n\n // return `true` to let the map know that the image was updated\n return true;\n }\n };\n return newDot;\n}", "showSelf() {\n stroke(this.r, this.g, this.b);\n fill(this.r, this.g, this.b);\n circle(this.x, this.y, circleRadius);\n }", "renderMinimapCircles(ctx) {\n ctx.save();\n drawCircleAndFill(ctx, this.size, '#000');\n\n _.each(PLANET_CIRCLES, (factor) => {\n let size = factor * this.size;\n let offset = (this.size - size) / 2;\n ctx.translate(offset, offset);\n strokeCircle(ctx, size, '#1A6D29');\n ctx.translate(-offset, -offset);\n });\n ctx.restore();\n }", "function draw_circle(x, y, radius, color){\r\n //color = ('0' + (x / cnvs.width) * 0xff).toString(16).substr(-2).repeat(3);\r\n ctx.beginPath();\r\n ctx.arc(x, y, radius, 0, Math.PI * 2);\r\n ctx.fillStyle = color;\r\n ctx.fill();\r\n}", "function deleteCircle()\n{\n\t//get each of the 9 ring segment SVGs and delete them\n\t\tfor (var i=0;i<9;i++){\n\t\t\t document.getElementById(\"d\".concat(i.toString())).remove();\n\t\t}\n\t\n\t//remove any paths that have been drawn \n\tvar pathLength = pathList.length;\n\tfor(var i2 =0;i2<pathLength;i2++)\n\t\tpathList[0].remove();\n}", "function disc(x,y,r,c){\n a.beginPath();\n a.strokeStyle=c;\n a.arc(x,y,r/2,0,2*Math.PI,false);\n a.lineWidth=r;\n a.stroke()\n}", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false);\n ctx.fillStyle = this.color;\n ctx.fill();\n }", "function drawDot(context, x, y, pHeight, radius) {\n context.beginPath();\n context.arc(x, y, radius, 0, 2 * Math.PI, true);\n context.fillStyle = getColor(pHeight);\n context.fill();\n context.closePath();\n}", "function drawCircle(pos, radius, ctx) {\n ctx.beginPath();\n ctx.arc(pos.x, pos.y, radius, 0, Math.PI*2, true); \n ctx.closePath();\n}", "function drawMissile() {\n ctx.beginPath();\n ctx.arc(missile.x, missile.y, missile.size, 0, Math.PI * 2);\n ctx.fillStyle = \"#0095dd\";\n ctx.fill();\n ctx.closePath();\n}", "function drawCircle(context, element) {\n context.strokeStyle = element.strokeStyle;\n context.fillStyle = element.fillStyle;\n context.globalAlpha = 0.5;\n context.beginPath();\n context.arc(element.x, element.y, element.r, 0, 2 * Math.PI);\n context.stroke();\n context.fill();\n }", "function drawCircle(){\nctx.fillStyle = 'green'\nctx.beginPath()\nctx.arc(canvas.width/2, canvas.height/2, canvas.height/4, 0, Math.Pi * 2, false)\nctx.fill()\n}", "drawCircle(x,y,r){\n ctx.beginPath();\n ctx.arc(x,y,r,0,2*Math.PI);\n ctx.lineWidth = 1;\n ctx.strokeStyle = colourButton.selectedColour;\n ctx.stroke();\n }", "function drawCircle(center, radius, color) {\n context.beginPath();\n context.arc(center.x * 4800, center.y * 4800, 2 * .0025 * canvas.width, 2 * Math.PI, false);\n context.closePath();\n context.fillStyle = color;\n context.fill();\n }", "draw(){\r\n ctx.beginPath();\r\n ctx.fillStyle = 'white';\r\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\r\n ctx.fill();\r\n }", "function draw() {\n numOfSegments = map(mouseX, 0, width, 10, 40);\n stepAngle = 360 / numOfSegments;\n\n push();\n translate(250, 250);\n fill(200, 500, 100);\n\n beginShape(TRIANGLE_FAN);\n\n vertex(0, 0);\n\n for (let i = 0; i <= 360; i = i + stepAngle) {\n let vx = radius * cos(i);\n let vy = radius * sin(i);\n\n fill(i, 100, 100);\n vertex(vx, vy);\n }\n\n endShape();\n pop();\n}", "circlePath (x, y, r) {\n return \"M\" + x + \",\" + y + \" \" +\n \"m\" + -r + \", 0 \" +\n \"a\" + r + \",\" + r + \" 0 1,0 \" + r * 2 + \",0 \" +\n \"a\" + r + \",\" + r + \" 0 1,0 \" + -r * 2 + \",0Z\";\n }", "function drawCircle(point, radius) {\n removeCircle();\n selectedCoords = point;\n // set Circle\n cityCircle = new google.maps.Circle({\n strokeOpacity: 0.8,\n strokeWeight: 2,\n strokeColor: '#3498db',\n fillOpacity: 0.35,\n fillColor: '#3498db',\n map: map,\n center: point,\n radius: radius,\n cursor: \"hand\",\n editable: true\n });\n\n //event listener for when circle's radius changes\n google.maps.event.addListener(cityCircle, 'radius_changed', function() {\n $radius.val(this.getRadius().toFixed(0));\n getRestaurants();\n });\n\n //event listener for when circle's center changes\n google.maps.event.addListener(cityCircle, 'center_changed', function() {\n selectedCoords = this.getCenter();\n inspectMarker.setPosition(selectedCoords);\n getRestaurants();\n });\n\n //create inspect marker\n inspectMarker = new google.maps.Marker({\n position: selectedCoords,\n map: map,\n title: \"here\",\n icon: getIcon(\"assets/images/placeholder_inspect.svg\")\n });\n}", "function drawCircle(x, y, radius, fill_color, stroke_color, stroke_size){\r\n\t\tcontext.beginPath();\r\n\t\tcontext.arc(x, y, radius, 0, 2 * Math.PI, false);\r\n\t\tcontext.closePath();\r\n\t\tif(fill_color != null){\r\n\t\t\tcontext.fillStyle = fill_color;\r\n\t\t\tcontext.fill();\r\n\t\t}\r\n\t\tif(stroke_color != null){\r\n\t\t\tcontext.lineWidth = stroke_size;\r\n\t\t\tcontext.strokeStyle = stroke_color;\r\n\t\t\tcontext.stroke();\r\n\t\t}\r\n\t}", "static render(context, structure){\n Geonym.drawCircle(context,[0,0],0.8,'#F7F7F7','black');\n }", "draw() {\n this.context.beginPath();\n this.context.arc(this.x, this.y, this.size, 0, 2 * Math.PI, false)\n this.context.fillStyle = this.color\n this.context.fill()\n this.context.stroke()\n }", "draw(){ \n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false)\n ctx.fillStyle = this.color\n ctx.fill();\n }", "function IoIosAddCircleOutline (props) {\n return Object(_lib__WEBPACK_IMPORTED_MODULE_0__[\"GenIcon\"])({\"tag\":\"svg\",\"attr\":{\"viewBox\":\"0 0 512 512\"},\"child\":[{\"tag\":\"path\",\"attr\":{\"d\":\"M346.5 240H272v-74.5c0-8.8-7.2-16-16-16s-16 7.2-16 16V240h-74.5c-8.8 0-16 6-16 16s7.5 16 16 16H240v74.5c0 9.5 7 16 16 16s16-7.2 16-16V272h74.5c8.8 0 16-7.2 16-16s-7.2-16-16-16z\"}},{\"tag\":\"path\",\"attr\":{\"d\":\"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z\"}}]})(props);\n}", "draw(canvasContext) {\r\n //owner color\r\n let color = null ? COLOR_BG : this.owner ? COLOR_RI : COLOR_AI;\r\n\r\n //drawing the circle\r\n canvasContext.fillStyle = color;\r\n canvasContext.beginPath();\r\n canvasContext.arc(this.centerX, this.centerY, this.r, 0, Math.PI * 2);\r\n canvasContext.fill();\r\n\r\n //drawing the highlighting\r\n if (this.highlight != null) {\r\n //color\r\n color = this.highlight ? COLOR_RI : COLOR_AI;\r\n\r\n //draw a circle around the perimeter\r\n canvasContext.lineWidth = this.r / 4;\r\n canvasContext.strokeStyle = color;\r\n canvasContext.beginPath();\r\n canvasContext.arc(this.centerX, this.centerY, this.r, 0, Math.PI * 2);\r\n canvasContext.stroke();\r\n }\r\n }", "function drawCircle( x, y ) {\n ctx2.beginPath();\n ctx2.arc(x, y, radius, 0, Math.PI * 2);\n ctx2.fillStyle = color;\n ctx2.fill();\n }", "function drawCircle(context, elem, xp, yp, radiusp) {\n let radius = pc(radiusp, elem.width)\n let y = pc(yp, elem.height);\n let x = pc(xp, elem.width); \n context.arc(x, y, radius, 0 * Math.PI, 2 * Math.PI);\n context.closePath();\n}", "function DrawCharacter()\n{\n\tvar color=0xFFFFFF;\n\tvar size=2;\n\te.lineStyle(size, color);\n\te.beginFill(color);\n\te.drawCircle(mapOrigin.x, mapOrigin.y, 2);\n\te.endFill();\n}", "function drawCircles() {\r\n placing = Placing.CIRCLE;\r\n}" ]
[ "0.6846003", "0.67414945", "0.6738644", "0.6661633", "0.6590151", "0.6566648", "0.65329975", "0.65204126", "0.6518095", "0.6454955", "0.64397025", "0.6384671", "0.6378076", "0.6377569", "0.6371192", "0.6362803", "0.6352011", "0.6351579", "0.6350299", "0.63487315", "0.6344933", "0.63350946", "0.6330293", "0.6312958", "0.62396836", "0.6238535", "0.62216705", "0.6218226", "0.62177193", "0.6206781", "0.62062776", "0.6203354", "0.61890906", "0.6186643", "0.6186465", "0.6184726", "0.617296", "0.61485755", "0.6111891", "0.61010957", "0.6098048", "0.60962695", "0.6093555", "0.6076589", "0.6062889", "0.60616773", "0.6049143", "0.6046414", "0.60337496", "0.602803", "0.6020668", "0.6015483", "0.601534", "0.60122406", "0.6008937", "0.60002977", "0.59998596", "0.5997422", "0.5996951", "0.59957755", "0.59899026", "0.5984376", "0.5978667", "0.5975069", "0.5972513", "0.59717613", "0.596372", "0.5960522", "0.5954637", "0.59487176", "0.59449095", "0.5943936", "0.5943568", "0.59359384", "0.5930527", "0.5929343", "0.5922644", "0.59201616", "0.5916023", "0.5914413", "0.5910604", "0.5903652", "0.58831924", "0.5868655", "0.5866693", "0.5861472", "0.5852504", "0.5850574", "0.5848022", "0.58459836", "0.5837328", "0.58372205", "0.58280766", "0.5823589", "0.58234227", "0.58232236", "0.5818088", "0.58128774", "0.5804577", "0.5804261" ]
0.7755988
0
Updates size paramterers to match the current size of the canvas
function updateSize() { innerRadius = innerRadiusArg * canvas.width / 2; outerRadius = outerRadiusArg * canvas.width / 2; centerX = centerXArg * canvas.width; centerY = centerYArg * canvas.height; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateSize(newCanvasWidth, newCanvasHeight) {\n canvasWidth = newCanvasWidth;\n canvasHeight = newCanvasHeight;\n isCanvasDirty = true;\n }", "function updateCanvasSize() {\n canvasContainer.style.width = \"100vw\";\n var size = getCanvasSize();\n if (fullscreenCheckbox.checked) {\n canvasContainer.style.height = \"100%\";\n canvasContainer.style.maxWidth = \"\";\n canvasContainer.style.maxHeight = \"\";\n }\n else {\n size[1] = size[0] * maxHeight / maxWidth;\n canvasContainer.style.height = inPx(size[1]);\n canvasContainer.style.maxWidth = inPx(maxWidth);\n canvasContainer.style.maxHeight = inPx(maxHeight);\n }\n if (size[0] !== lastCanvasSize[0] || size[1] !== lastCanvasSize[1]) {\n lastCanvasSize = getCanvasSize();\n for (var _i = 0, canvasResizeObservers_1 = canvasResizeObservers; _i < canvasResizeObservers_1.length; _i++) {\n var observer = canvasResizeObservers_1[_i];\n observer(lastCanvasSize[0], lastCanvasSize[1]);\n }\n }\n }", "function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tvar bgDirty = false;\n\t\tif(bgCanvas === null) {\n\t\t\tbgDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(bgCanvas.width != rw) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.width = rw;\n\t\t}\n\t\tif(bgCanvas.height != rh) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.height = rh;\n\t\t}\n\n\t\tvar plotDirty = false;\n\t\tif(plotCanvas === null) {\n\t\t\tplotDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#thePlotCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tplotCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(plotCanvas.width != rw) {\n\t\t\tplotDirty = true;\n\t\t\tplotCanvas.width = rw;\n\t\t}\n\t\tif(plotCanvas.height != rh) {\n\t\t\tplotDirty = true;\n\t\t\tplotCanvas.height = rh;\n\t\t}\n\n\t\tvar axesDirty = false;\n\t\tif(axesCanvas === null) {\n\t\t\taxesDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theAxesCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\taxesCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(axesCanvas.width != rw) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.width = rw;\n\t\t}\n\t\tif(axesCanvas.height != rh) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.height = rh;\n\t\t}\n\n\t\tif(dropCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDropCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdropCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t}\n\t\t}\n\t\tif(dropCanvas) {\n\t\t\tdropCanvas.width = rw;\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\t// $log.log(preDebugMsg + \"updateSize found selections: \" + JSON.stringify(selections));\n\t\t// $log.log(preDebugMsg + \"updateSize updated selections to: \" + JSON.stringify(selections));\n\t}", "function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmyCanvas.width = rw;\n\t\tmyCanvas.height = rh;\n\t\tvar W = myCanvas.width;\n\t\tvar H = myCanvas.height;\n\n\t\tif((dataBase.length + 1) * (spacing + fontSize) + 3*marg > H) {\n\t\t\t$scope.set(\"DrawingArea:height\", Math.ceil((dataBase.length + 1) * (spacing + fontSize) + 3*marg));\n\t\t\tH = Math.ceil((dataBase.length + 1) * (spacing + fontSize) + 3*marg);\n\t\t}\n\n\t\tdrawW = W;\n\t\tdrawH = H;\n\n\t\tdrawBackground(W,H);\n\n\t\tvar iv = $scope.gimme(\"InputVector\");\n\t\tvar t = \"\";\n\t\tif(iv.length <= 0 && dataBase.length <= 0) {\n\t\t\tt = \"No data\";\n\t\t}\n\t\telse {\n\t\t\tt = dataBase.length.toString() + \" vectors. \" + iv.length.toString() + \" data items in selected vector.\";\n\t\t}\n\n\t\tvar maxTW = 0;\n\t\tctx.font = fontSize + \"px Arial\";\n\t\tctx.fillStyle = \"black\";\n\t\tvar tw = legacyDDSupLib.getTextWidthCurrentFont(ctx, t);\n\t\tif(tw > maxTW) {\n\t\t\tmaxTW = tw;\n\t\t}\n\n\t\tvar x = 0;\n\t\tif(tw < drawW) {\n\t\t\tMath.floor(x = (drawW - tw) / 2);\n\t\t}\n\t\tvar y = marg;\n\t\tctx.fillText(t, x, y + fontSize);\n\n\t\tfor(var i = 0; i < dataBase.length; i++) {\n\t\t\tt = dataBase[i][0];\n\n\t\t\tif(i == selectedIdx) {\n\t\t\t\tctx.font = \"bold \" + fontSize + \"px Arial\";\n\t\t\t\tctx.fillStyle = \"red\";\n\t\t\t}\n\n\t\t\tvar tw = legacyDDSupLib.getTextWidthCurrentFont(ctx, t);\n\t\t\tif(tw > maxTW) {\n\t\t\t\tmaxTW = tw;\n\t\t\t}\n\n\t\t\tvar x = marg;\n\t\t\tvar y = marg*2 + (i + 1) * (spacing + fontSize);\n\n\t\t\tctx.fillText(t, x, y + fontSize);\n\n\t\t\tif(i == selectedIdx) {\n\t\t\t\tctx.font = fontSize + \"px Arial\";\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t}\n\t\t}\n\n\t\tif(maxTW + 2*marg > W) {\n\t\t\t$scope.set(\"DrawingArea:width\", Math.ceil(maxTW + 2*marg));\n\t\t}\n\t}", "updateSize() {\n this.w = this.ent.width + this.wo;\n this.h = this.ent.height + this.ho;\n }", "function adjustCanvasSize() {\n CANVAS.width = CANVAS_WIDTH;\n CANVAS.height = window.innerHeight;\n}", "updateSize() {\n const totalWidth = Math.round(this.width / this.params.pixelRatio);\n const requiredCanvases = Math.ceil(\n totalWidth / this.maxCanvasElementWidth\n );\n\n while (this.canvases.length < requiredCanvases) {\n this.addCanvas();\n }\n\n while (this.canvases.length > requiredCanvases) {\n this.removeCanvas();\n }\n\n this.canvases.forEach((entry, i) => {\n // Add some overlap to prevent vertical white stripes, keep the width even for simplicity.\n let canvasWidth =\n this.maxCanvasWidth + 2 * Math.ceil(this.params.pixelRatio / 2);\n\n if (i == this.canvases.length - 1) {\n canvasWidth =\n this.width -\n this.maxCanvasWidth * (this.canvases.length - 1);\n }\n\n this.updateDimensions(entry, canvasWidth, this.height);\n this.clearWaveForEntry(entry);\n });\n }", "canvasResize()\n {\n View.canvas.setAttribute(\"width\", this.floatToInt(window.innerWidth*0.95));\n View.canvas.setAttribute(\"height\",this.floatToInt(window.innerHeight*0.95));\n\n //update objects with the new size\n this.updateCharacterDim();\n this.updateVirusDim();\n this.updateSyringesDim();\n this.background.resize();\n\n }", "function setCanvasSize() {\n var width = $('#coloring').width();\n var height = $('#coloring').height();\n\n $('#coloring_canvas').attr('width', width);\n $('#coloring_canvas').attr('height', height);\n context.lineWidth = radius * 2;\n }", "function adjustSize() {\n var\n prevW = canvasW,\n prevH = canvasH;\n canvasW = $(svgContainer).innerWidth();\n canvasH = $(svgContainer).innerHeight();\n canvasR = canvasW / canvasH;\n boxW *= canvasW / prevW ;\n boxH *= canvasH / prevH ;\n svgRoot.setAttribute( 'width', canvasW );\n svgRoot.setAttribute( 'height', canvasH );\n //console.log('called adjustSize: '+canvasW+' '+canvasH);\n }", "updateSize(width, xPos, yPos){\n this.cardWidth = width;\n this.cardHeight = width*1.5;\n this.originX = xPos;\n this.originY = yPos;\n }", "updateCanvasSize() {\n this.drawLines();\n }", "_setSize() {\n this.colorPickerCanvas.style.width = '100%';\n this.colorPickerCanvas.style.height = '100%';\n\n this.colorPickerCanvas.width = 289 * this.pixelRatio;\n this.colorPickerCanvas.height = 289 * this.pixelRatio;\n }", "_updateSize() {\n this._size = this._bottomRight.$subtract(this._topLeft).abs();\n this._updateCenter();\n }", "function setSize(){\n\t\tif(window.innerWidth > window.innerHeight * (2/1)){\n\t\t\tcanvas.style.height = window.innerHeight + \" px\";\n\t\t\tcanvas.style.width = window.innerHeight * (2/1);\n\t\t}else{\n\t\t\tcanvas.style.height = window.innerHeight * (1/2) + \" px\";\n\t\t\tcanvas.style.width = window.innerHeight + \" px\";\n\t\t}\n\t}", "function setCanvasSize() {\n\t\t// Get the screen height and width\n\t\tscreenHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;\n\t\tscreenWidth = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;\n\t\t// Figure out which one is smaller\n\t\tminScreenSide = ( screenWidth < screenHeight ) ? screenWidth : screenHeight;\n\t\t// Figure out if the timer is at its max size\n\t\tif ( (minScreenSide + 2*timerPadding ) > maxTimerSide ) {\n\t\t\tcanvasSide = maxTimerSide - 2*timerPadding;\n\t\t} else {\n\t\t\tcanvasSide = minScreenSide;\n\t\t}\n\t\tcanvas.height = canvasSide;\n\t\tcanvas.width = canvasSide;\n\t\t//logDimensions();\n\t}", "function setCanvasSize() {\n\t\t// Get the screen height and width\n\t\tscreenHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;\n\t\tscreenWidth = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;\n\t\t// Figure out which one is smaller\n\t\tminScreenSide = ( screenWidth < screenHeight ) ? screenWidth : screenHeight;\n\t\t// Figure out if the timer is at its max size\n\t\tif ( (minScreenSide + 2*timerPadding ) > maxTimerSide ) {\n\t\t\tcanvasSide = maxTimerSide - 2*timerPadding;\n\t\t} else {\n\t\t\tcanvasSide = minScreenSide;\n\t\t}\n\t\tcanvas.height = canvasSide;\n\t\tcanvas.width = canvasSide;\n\t\t//logDimensions();\n\t}", "_resize() {\n this.width = this._context.canvas.width;\n this.height = this._context.canvas.height;\n this.dirty = true;\n }", "function setupCanvasSize() {\n margin = {top: 20, left: 80, bottom: 20, right: 100};\n width = 350 - margin.left - margin.right;\n height = 300 - margin.top - margin.bottom;\n}", "function resize(){\n let style_height = +getComputedStyle(canvas).getPropertyValue(\"height\").slice(0, -2); \n let style_width = +getComputedStyle(canvas).getPropertyValue(\"width\").slice(0, -2); \n\n canvas.setAttribute('height', style_height * dpi); \n canvas.setAttribute('width', style_width * dpi); \n}", "function resize_canvas() {\n\t\t\tcanvas_elem.width = window.innerWidth / 2;\n\t\t\tcanvas_elem.height = window.innerWidth / 2;\n\n\t\t\tupdate_needed = true;\n\t\t}", "function _adjustCanvasBounds() {\n\t\t\tvar parentSize = canvas.parentNode.getBoundingClientRect();\n\t\t\tcanvas.width = parentSize.width;\n\t\t\tcanvas.height = parentSize.height;\n\t\t}", "function sizeCanvas($obj) {\n CW = $obj.width();\n CH = $obj.height();\n CScale = CW / scaleFactor;\n canvas.width = CW;\n canvas.height = CH;\n}", "function resizeCanvas() {\n\tvar newHeight = window.innerHeight;\n\tvar newWidth = initWidth/initHeight * newHeight;\n\tcanvas.setWidth(newWidth);\n\tcanvas.setHeight(newHeight);\n\tcanvas.calcOffset();\n}", "_resize() {\n this.aspect = this._context.canvas.width / this._context.canvas.height;\n this.dirty = true;\n }", "adjustSize () {\n this._resize();\n }", "function sizeCanvas() {\n var ratio = mMapHeight / mMapWidth;\n var width = window.innerWidth;\n var height = width * ratio;\n var canvas = $('#MapCanvas');\n canvas.css('width', width + 'px');\n canvas.css('height', height + 'px');\n\n document.getElementById(\"Instructions\").style.top = height + titleHeight - 8 + \"px\";\n\n // Save scale value for use with touch events.\n mCanvasScale = mMapWidth / width\n }", "updateConfig(canvas) {\n this.size = canvas.size;\n\n this.updateCache();\n }", "function resizeCanvas () {\n canvasWidth = canvas.offsetWidth;\n canvasHeight = canvas.offsetHeight;\n canvas.width = canvasWidth;\n canvas.height = canvasHeight;\n pixelsPerUnit = canvasWidth / 10;\n}", "function updateScreenSize(){\n//updates width to be propotional to screen size\n canvasWidth = window.innerWidth*4/5;//2/3\n //updates height be propotional to the width\n canvasHeight = canvasWidth * 1/resolution;\n\t\n//this line updates the size of the canvas to the screen\t\n\tcanvas.style.width = canvasWidth+'px';\n\tcanvas.style.height = canvasHeight+'px';\n}", "updateSize() {\n windowWidth = Math.min(\n this.handler.getMaxGameWidth(),\n window.innerWidth\n )\n windowHeight = Math.min(\n this.handler.getMaxGameHeight(),\n window.innerHeight\n )\n this.handler.getGame().setWidth(windowWidth)\n this.handler.getGame().setHeight(windowHeight)\n }", "updateCanvasSize() {\n var w = window,\n d = document,\n documentElement = d.documentElement,\n body = d.getElementsByTagName('body')[0],\n width = w.innerWidth || documentElement.clientWidth || body.clientWidth,\n height = w.innerHeight|| documentElement.clientHeight|| body.clientHeight;\n\n this.setState({width: width, height: height});\n // if you are using ES2015 I'm pretty sure you can do this: this.setState({width, height});\n }", "function resize() {\n\t\t\tcanvas.width = container.offsetWidth;\n\t\t\tcanvas.height = container.offsetHeight;\n\t\t}", "function resize() {\n\t var box = c.getBoundingClientRect();\n\t c.width = box.width;\n\t\tc.height = (typeof canvasHeight !== 'undefined') ? canvasHeight : document.body.scrollHeight;\n\t}", "function resize() {\n xMax = canvas.width;\n yMax = canvas.height;\n\n positionInstrumentCircles();\n\n getRun();\n tickChase();\n drawCircles();\n }", "setSize(w,h){\n\n\t\t//set the size of the canvas, on chrome we need to set it 3 ways to make it work perfectly.\n\t\tthis.ctx.canvas.style.width = w + \"px\";\n\t\tthis.ctx.canvas.style.height = h + \"px\";\n\t\tthis.ctx.canvas.width = w;\n\t\tthis.ctx.canvas.height = h;\n\n\t\t//when updating the canvas size, must reset the viewport of the canvas \n\t\t//else the resolution webgl renders at will not change\n\t\tthis.ctx.viewport(0,0,w,h);\n\t\tthis.width = w;\t//Need to save Width and Height to resize viewport for WebVR\n\t\tthis.height = h;\n\n\t\treturn this;\n\t}", "function resize() {\n let parStyle = window.getComputedStyle(canvas.elt.parentNode),\n cWidth = parseInt(parStyle.width),\n cHeight = parseInt(parStyle.height);\n\n cHeight -= parseInt(parStyle.paddingTop) + parseInt(parStyle.paddingBottom);\n cWidth -= parseInt(parStyle.paddingLeft) + parseInt(parStyle.paddingRight);\n resizeCanvas(cWidth, cHeight, true);\n}", "function resizeCanvas() {\n //low level\n c.width = window.innerWidth;\n c.height = window.innerHeight;\n //update wrapper\n st.canvas.width = c.width;\n st.canvas.height = c.height;\n //update objects and redraw\n updateObjects();\n}", "function updateSizeValues(){\n\tswitch (runDialog.sizeConfig.outputPresetInput.selection.index){\n\t\tcase 0:\n\t\t\tsetSizeValues(8.5, 11, 6, 9, 150);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tsetSizeValues(11, 8.5, 9, 6, 150);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tsetSizeValues(11, 14, 8, 12, 150);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tsetSizeValues(14, 11, 12, 8, 150);\n\t\t\tbreak;\n\t}\n}", "function set_canvas_size() {\n canvas_width = the_canvas.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,\n canvas_height = the_canvas.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n }", "updateDimensions() {\n this.props.w = this.getWidth();\n this.props.h = this.getHeight();\n }", "function setMapSize() {\n detail = +document.getElementById(\"detail\").value;\n ctx.canvas.width = document.getElementById(\"width_slider\").value;\n ctx.canvas.height = document.getElementById(\"height_slider\").value;\n}", "function resizeCanvas() { // always keep canvas full size (for now)\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n var message = canvasSize + canvas.width + ',' + canvas.height;\n socket.emit('canvasEvent', message); \n if (debug(1)) { console.log(\"[INFO] Canvas size: \" + canvas.width + \" x \" + canvas.height); }\n message = null;\n}", "function attitude_resize(canvas, width, height)\n{\n P = attitude_data[canvas];\n paper = P.paper;\n paper.view.setViewSize(width, height);\n if (paper.view.center.x > paper.view.center.y) { P.view_size = paper.view.center.y; }\n else { P.view_size = paper.view.center.x; }\n}", "resize(width, height) {\n this.canvas.width = width;\n this.canvas.height = height;\n }", "setCanvasSize(width, height) {\n this.width = width;\n this.height = height;\n this.landscape = this.width>=this.height;\n this.circleX = this.width / 2.0;\n this.circleY = this.height * 0.380;\n //this.circleY = this.height * 0.420;\n this.circleRadius = this.height * 0.310;\n if (this.circleRadius > this.width/2.0 - 15)\n this.circleRadius = this.width/2.0 - 15;\n //this.circleRadius = this.width * (375.0/480.0)/2.0;\n }", "_size() {\n const scaleRatio = (window.innerHeight) / (this.gameBoard.height + 2 * config.board.padding);\n this.renderer.resize(window.innerWidth, window.innerHeight);\n this.gameBoard.height *= scaleRatio;\n this.gameBoard.width *= scaleRatio;\n this.gameBoard.position.set((this.screen.width / 2) - (this.gameBoard.width / 2), config.board.padding);\n }", "function resize() {\n width = canvas.width = window.innerWidth;\n height = canvas.height = window.innerHeight - 60;\n }", "function setSize() {\n canvas.width = iOS ? screen.width : window.innerWidth;\n canvas.height = iOS ? screen.height : window.innerHeight;\n}", "function resize() {\n canvas.height = window.innerHeight\n canvas.width = window.innerWidth\n }", "function resizeCanvas(w, h){\n canvas.width = w;\n canvas.height = h;\n }", "function setupCanvasSize() {\n margin = {top: 0, left: 80, bottom: 20, right: 30};\n width = 960 - margin.left - margin.right;\n height = 120 - margin.top - margin.bottom;\n}", "function sizer(){\n //update object\n å.screen.x = window.innerWidth;\n å.screen.y = window.innerHeight;\n //update canvas size\n canvas.width = å.screen.x;\n canvas.height = å.screen.y;\n}", "function resize() {\n getNewSize();\n rmPaint();\n}", "function setupCanvasSize() {\r\n margin = {top: 100, left: 180, bottom: 120, right: 130};\r\n width = 960 - margin.left - margin.right;\r\n height = 800 - margin.top - margin.bottom;\r\n}", "function setCanvasSizeToParentSize(canvas) {\n canvas.width = getParentProp(\"width\", { float: true });\n canvas.height = getParentProp(\"height\", { float: true });\n}", "resize(w, h) {\n\n let c = this.canvas;\n let x, y;\n let width, height;\n\n // Find the best multiplier for\n // square pixels\n let mul = Math.min(\n (w / c.width) | 0, \n (h / c.height) | 0);\n \n // Compute properties\n width = c.width * mul;\n height = c.height * mul;\n x = w/2 - width/2;\n y = h/2 - height/2;\n \n // Set style properties\n let top = String(y | 0) + \"px\";\n let left = String(x | 0) + \"px\";\n\n c.style.height = String(height | 0) + \"px\";\n c.style.width = String(width | 0) + \"px\";\n c.style.top = top;\n c.style.left = left;\n }", "function increaseSize() {\n\tif (selectedShape) {\n\t\tselectedShape.resize(5);\n\t\tdrawShapes();\n\t}\n}", "setSize() {\n this.size = this.fixHeight;\n }", "resizeCanvas () {\n if (this._type === Sandpit.CANVAS && window.devicePixelRatio !== 1 && this._retina) {\n this._handleRetina()\n } else {\n this._canvas.width = this._canvas.clientWidth\n this._canvas.height = this._canvas.clientHeight\n }\n if (this._type === Sandpit.WEBGL || this._type === Sandpit.EXPERIMENTAL_WEBGL) {\n this._context.viewport(0, 0, this._context.drawingBufferWidth, this._context.drawingBufferHeight)\n }\n if (this.change) this.change()\n }", "function setupCanvasSize() {\n margin = {top: 20, left: 80, bottom: 20, right: 30};\n width = 960 - margin.left - margin.right;\n height = 520 - margin.top - margin.bottom;\n}", "function resize(){\n\n\tscreenW=$(window).width()-20;\n\tscreenH=$(window).height()-60;\n\t$(\"#buttonHolder\").css({width:screenW})\n\t$(\"#canvasHolder\").css({width:screenW, height:screenH})\n\tscreenRatio=screenW/screenH;\n\tif(canvasRatio>screenRatio){\n\t\tdefaultZoomLevel=(canvas.height/screenH)\n\t}else{\n\t\tdefaultZoomLevel =(canvas.width/screenW)\n\t}\n\tdefaultZoomLevel= defaultZoomLevel/2\n\tmodBrushSize=brushSize*defaultZoomLevel;\n\tif(canvasRatio>screenRatio){\n\t\tshowAllZoomLevel=(canvas.width/screenW)\n\t}else{\n\t\tshowAllZoomLevel=(canvas.height/screenH)\n\t}\n\t$(\"#buttonHolder\").css({marginTop:(screenH+50)+\"px\"});\n\t$(\"#markerHolder\").css({marginTop:(-($(\"#markerHolder\").height()))});\n\tzoomCanvasTo((canvas.width/2),(canvas.height/2), currentZoomLevel , currentZoomLevel)\n}", "function resizeCanvas() {\n\t\tcanvas.width = (window.innerWidth) * .67;\n\t\tcanvas.height = (window.innerHeight) * .69;\n\t\tredraw();\n\t}", "function resizeCanvas() {\n\t\tcanvas.width = (window.innerWidth) - 150;\n\t\tcanvas.height = (window.innerHeight) - 100;\n\t\tredraw();\n\t}", "function updateCanvasSize(canvas, redrawCallback) {\n\tif (window.innerWidth <= 768) {\n\t\tcanvas.width = window.innerWidth;\n\t\tcanvas.height = parseInt(window.innerHeight*.8);\n\t} else {\n\t\tcanvas.width = parseInt(window.innerWidth*.75);\n\t\tcanvas.height = parseInt(window.innerHeight*.9);\n\t}\n\tredrawCallback();\n}", "setCanvasDimensions(canvasWidth, canvasHeight) {\n\t\tthis.canvasWidth = canvasWidth;\n\t\tthis.canvasHeight = canvasHeight;\n\t}", "function canvasResizer(){\n variables.semlet().height=240;\n variables.semlet().width=400;\n variables.ctx().strokeStyle=\"white\";\n}", "function resize() {\r\n // redefine width and height\r\n width = window.innerWidth; //canvas.offsetWidth;\r\n height = window.innerHeight; //canvas.offsetHeight;\r\n \r\n if (height > width * (3/4)) height = width * (3/4); // scale to meet the ratio of the fov\r\n\r\n // reset the canvas element's size\r\n canvas.width = width;\r\n canvas.height = height;\r\n \r\n MID_VERT = height/2;\r\n MID_HORIZ = width/2;\r\n\r\n changed = true;\r\n}", "function resize() {\n ctx.canvas.width = window.outerWidth;\n ctx.canvas.height = window.outerHeight;\n}", "size(_size) {\n this.penSize = parseFloat(_size);\n this.ctx.lineWidth = this.penSize;\n }", "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n width = canvas.width;\n height = canvas.height;\n }", "function resize() {\n\tvar height = window.innerHeight;\n\n\tvar ratio = canvas.width/canvas.height;\n\tvar width = height * ratio;\n\n\tcanvas.style.width = width+'px';\n\tcanvas.style.height = height+'px';\n}", "function canvas_resize()\n{\n canvas.style.width = window.innerWidth + 'px';\n canvas.style.height = window.innerHeight + 'px';\n}", "resizeCanvas(newWidth, newHeight) {\n\t\tthis.gameWidth = newWidth;\n\t\tthis.gameHeight = newHeight;\n\n\t\tthis.skier.x = this.gameWidth / 2;\n\t\tthis.skier.y = this.gameHeight / 3;\n\n\t\tthis.setUpGameObjects();\n\t\tthis.npcHandler.setUpNPCs();\n\t}", "function reLayout() {\n var newHeight, newWidth;\n // Figure out what is limiting the size of our container and resize accordingly\n if ($(\"body\").height() * CANVAS_RATIO > $(\"body\").width()) {\n // Limited by width\n newWidth = $(\"body\").width();\n newHeight = $(\"body\").width() / CANVAS_RATIO;\n } else {\n // Limited by height\n if ($(\"body\").height() < parseInt($(\"#draw-container\").css(\"min-height\"))) {\n newWidth = $(\"#draw-container\").css(\"min-height\") * CANVAS_RATIO;\n newHeight = $(\"#draw-container\").css(\"min-height\");\n } else {\n newWidth = $(\"body\").height() * CANVAS_RATIO;\n newHeight = $(\"body\").height();\n }\n }\n\n $(\"#draw-container\").css({\"width\" : newWidth, \"height\": newHeight});\n $(canvas).css({\"width\": newWidth, \"height\": newHeight});\n\n // Save some info about the canvas for later calculations\n canvas.offsetX = $(canvas).offset()[\"left\"];\n canvas.offsetY = $(canvas).offset()[\"top\"];\n }", "function resizeCanvas() {\n context.canvas.width = window.innerWidth;\n context.canvas.height = window.innerHeight;\n game.size = {width: context.canvas.width, height: context.canvas.height};\n}", "function Klein() {\n Zauberbild.canvas.height = 400;\n Zauberbild.canvas.width = 400;\n }", "_resize() {\n const ratio = window.devicePixelRatio || 1;\n const width = window.innerWidth;\n const height = window.innerHeight;\n\n if (this.options.dpi) {\n this.width = width * ratio;\n this.height = height * ratio;\n } else {\n this.width = width;\n this.height = height;\n }\n\n this._canvas.width = this.width;\n this._canvas.height = this.height;\n\n this._canvas.style.width = width + 'px';\n this._canvas.style.height = height + 'px';\n }", "resizeImmediate() {\n this.size = vec2.fromValues(this.canvas.parentElement.clientWidth, this.canvas.parentElement.clientHeight);\n this.dpi = window.devicePixelRatio;\n\n this.canvas.style.width = '100%';\n this.canvas.style.height = '100%';\n\n vec2.scale(this.size, this.size, this.options.scale);\n\n this.canvas.width = this.size[0] * this.dpi;\n this.canvas.height = this.size[1] * this.dpi;\n\n this.flagDirty();\n this.draw_required = true;\n\n Logger.debug(`Resizing renderer to ${this.size} @ ${this.dpi}x`);\n }", "onLayout() {\n super.onLayout()\n\n // Update canvas size\n var density = window.devicePixelRatio || 1\n var box = this.canvas.getBoundingClientRect()\n this.canvas.width = box.width * density\n this.canvas.height = box.height * density\n\n }", "_size_elements () {\n\n\t\tvar w = this.context.canvas.width\n\t\tvar h = this.context.canvas.height\n\t\tvar cw = this._deck_blue ['musician']._face_img.width\n\t\tvar ch = this._deck_blue ['musician']._face_img.height\n\n\t\tvar scale_x = (w * 0.9 / 8.0) / cw\n\t\tvar scale_y = (h / 4.0) / ch\n\t\tvar scale = Math.min (scale_x, scale_y)\n\n\t\tfor (var name in this._deck_blue) {\n\t\t\tthis._deck_blue [name].set_size (cw * scale)\n\t\t}\n\t\tfor (var name in this._deck_red) {\n\t\t\tthis._deck_red [name].set_size (cw * scale)\n\t\t}\n\t}", "function resize() {\n context.width = canvas.width = window.innerWidth;\n context.height = canvas.height = window.innerHeight;\n}", "adjustCanvasDimension() {\n const canvasImage = this.canvasImage.scale(1);\n const {width, height} = canvasImage.getBoundingRect();\n const maxDimension = this._calcMaxDimension(width, height);\n\n this.setCanvasCssDimension({\n width: '100%',\n height: '100%', // Set height '' for IE9\n 'max-width': `${maxDimension.width}px`,\n 'max-height': `${maxDimension.height}px`\n });\n\n this.setCanvasBackstoreDimension({\n width,\n height\n });\n this._canvas.centerObject(canvasImage);\n }", "onResize() {\n this._canvas.width = window.innerWidth;\n this._canvas.height = window.innerHeight;\n this._ps.screenSize(this._canvas.width, this._canvas.height)\n }", "function resizeCanvas() {\r\n winWidth = window.innerWidth;\r\n winHeight = window.innerHeight;\r\n cnvs.width = winWidth;\r\n cnvs.height = winHeight;\r\n\r\n // Create star field\r\n buildStars();\r\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}//end windowResized", "function changesize(h,sq,intv,tm) {\n chartx.chart.height = h ;\n standWD(sq) ;\n initChart(sq,intv,tm) ;\n\n // setTimeout( chart.setSize(null,h) ,500);\n}", "function setSize(){\n\n\tvar winW = 600, winH = 400;\n\tif (document.body && document.body.offsetWidth) {\n\t winW = document.body.offsetWidth;\n\t winH = document.body.offsetHeight;\n\t}\n\tif (document.compatMode=='CSS1Compat' &&\n\t\tdocument.documentElement &&\n\t\tdocument.documentElement.offsetWidth ) {\n\t winW = document.documentElement.offsetWidth;\n\t winH = document.documentElement.offsetHeight;\n\t}\n\tif (window.innerWidth && window.innerHeight) {\n\t winW = window.innerWidth;\n\t winH = window.innerHeight;\n\t}\n\t\n\tvar canvas = document.getElementById(\"canvas\");\n\t\tcanvas.height = (winH - 25);\n\t\tcanvas.width = (winW - 5);\n\t\tconstants.MAX_X = winW - 5;\n\t\tconstants.MAX_Y = winH - 25;\n\t\n}", "resize() {\n var factor = 1; //multiply by one - so no resizing \n this.selected = !this.selected;\n if(this.selected) { //make the graph big\n //increase the size\n this.width = this.width*factor;\n this.height = this.height *factor;\n this.colour = this.selectedColour;\n //reposition\n // this.x = this.x - this.width/4;\n // this.y = this.y - this.height /4;\n } else { //make it small\n //reposition\n // this.x = this.x + this.width/4;\n // this.y = this.y + this.height /4;\n //double the size\n this.width = this.width/factor;\n this.height = this.height /factor;\n this.colour = this.idleColour;\n }\n }", "function resize() {\r\n ctx.canvas.width = window.innerWidth;\r\n ctx.canvas.height = window.innerHeight;\r\n}", "function SizeInit(){\n\t\n\t//event_canvas.style=\" height: 100%;width: 100%;margin: 0;padding: 0;display: block;\"\n\tcanvas = document.getElementById(\"event_canvas\"); \n\tif (!canvas.getContext) { \n\t\tconsole.log(\"Canvas not supported. Please install a HTML5 compatible browser.\"); \n\t\treturn; \n\t} \n\ttempContext = canvas.getContext(\"2d\"); \n\ttempContext.canvas.height= window.innerHeight;\n\ttempContext.canvas.width= window.innerWidth;\n\t\n\tSizeX= tempContext.canvas.width;\n\tSizeY= tempContext.canvas.height;\n\t\n\tif(SizeX<SizeY){\n\t\ttemps= SizeY;\n\t\tSizeY=SizeX;\n\t\tSizeX=temps;\n\t\tisrotate= 1;\n\t\ttempContext.rotate(90*Math.PI/180);\n\t\ttempContext.translate(0,-SizeY);\n\t}\n\telse{\n\t\tisrotate=0;\n\t}\n\n\tif(SizeY>SizeX*0.5625){\n\t\tframepx=0;\n\t\tframesx=SizeX;\n\t\tframepy=(SizeY-SizeX*0.5625)/2;\n\t\tframesy=SizeX*0.5625;\n\t}\n\telse{\n\t\tframepx=(SizeX-SizeY/0.5625)/2;\n\t\tframesx=SizeY/0.5625;\n\t\tframepy=0;\n\t\tframesy=SizeY;\n\t}\n\t\n\t//console.log(framesx,framesy);\n\t\n}", "function resize(){\n rect = Canvas.getBoundingClientRect()\n ratio = S/rect.height\n Canvas.width = S\n Canvas.height = S\n\n for (let i=0; i<Class('image').length; i++){\n let c = Class('image')[i]\n c.width = S\n c.height = S\n }\n}", "resize() {\n if (this._isShutDown) return;\n this._canvas.width = window.innerWidth;\n this._canvas.height = window.innerHeight;\n this.redraw();\n }", "function resizeCanvas() {\n canvas.height = window.innerHeight * 0.95;\n canvas.width = window.innerWidth * 0.95;\n stage.update();\n }", "function changeAreaSize() {\n changeBackgroundSize();\n for (i = 0; i <= width; i++) {\n changeLineSize(0, i);\n }\n for (i = 0; i <= height; i++) {\n changeLineSize(1, i);\n }\n for (i = 0; i < $MAX_WIDTH_DIMENSION; i++) {\n for (j = 0; j < $MAX_HEIGTH_DIMENSION; j++) {\n changeSquareSize(i, j);\n changeSquareAuxSize(i, j);\n }\n }\n changeCalculatedSize(0);\n changeCalculatedSize(1);\n changeDecreaseArrowSize(0);\n changeIncreaseArrowSize(0);\n changeDecreaseArrowSize(1);\n changeIncreaseArrowSize(1);\n changeDecreaseArrowSize(2);\n changeIncreaseArrowSize(2);\n}", "function windowResized() {\n resizeCanvas(innerWidth, innerHeight);\n}", "function resizeCanvases() {\n imageCanvas.width = lineCanvas.width = window.innerWidth;\n imageCanvas.height = lineCanvas.height = window.innerHeight;\n}", "adjustSize() {\n VisualizerBase.prototype.adjustSize.call(this);\n\n if ('artist' in this) {\n this.artist.adjustSize();\n }\n }", "function windowResized() {\n resizeCanvas(windowWidth,windowHeight*9);\n \n var multiplier = map(width,200,1800,0.25,1);\n var typesize = (map(width,300,1650,50,195));\n textSize (typesize*multiplier);\n spacesize = 50*multiplier; //width of space between letters\n linesize = 280*multiplier;\n}", "setSize() {\n this.size.D1 = this.shape.D1*this.unit.X;\n this.size.D2 = this.shape.D2*this.unit.Y;\n }" ]
[ "0.84102035", "0.8063861", "0.80084884", "0.7964988", "0.77420676", "0.7595204", "0.7562139", "0.75555253", "0.7453296", "0.7445349", "0.74272376", "0.73913634", "0.7354414", "0.73262084", "0.72478503", "0.72351235", "0.72351235", "0.7226023", "0.72064805", "0.7167985", "0.71477973", "0.71461713", "0.7137135", "0.71282136", "0.7089244", "0.70869064", "0.708112", "0.7062139", "0.7046653", "0.70397854", "0.70117766", "0.6961679", "0.69470775", "0.6942528", "0.6941886", "0.69182783", "0.6904955", "0.69045985", "0.6904233", "0.68933874", "0.68688416", "0.68598336", "0.6847633", "0.68472195", "0.68222696", "0.6792331", "0.6787677", "0.67856824", "0.67852277", "0.67776453", "0.67757386", "0.67716986", "0.6755464", "0.6743057", "0.6734065", "0.67278546", "0.6725249", "0.67229366", "0.67182237", "0.6718115", "0.67047226", "0.6689948", "0.6687993", "0.6681281", "0.66790855", "0.66789645", "0.6665108", "0.6662192", "0.66458577", "0.6631577", "0.6618962", "0.66123897", "0.6596527", "0.65896314", "0.6588737", "0.6588062", "0.6580241", "0.6576663", "0.65722597", "0.6571906", "0.65674883", "0.6566991", "0.6565818", "0.6559502", "0.65574193", "0.655697", "0.6554956", "0.6551091", "0.6544417", "0.6543007", "0.6542461", "0.65420043", "0.65320486", "0.65319604", "0.65227586", "0.65163916", "0.6511146", "0.6510725", "0.6503754", "0.6500451" ]
0.8304707
1
clear any errors already their
function clearErrors(){ let msg = document.getElementById("error"); if(msg) msg.remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetErrors() {\n this.errorCount = 0;\n this.seenErrors.clear();\n }", "clearError() {\n this.error = false;\n this._errortext = this.__initalErrorText;\n }", "clearError() {\n this.error = false;\n this._errortext = this.__initalErrorText;\n }", "clearErrors() {\n this.barcodeNotFound = false;\n this.barcodeCheckedOut = null;\n }", "function resetErrors() {\n self.dangers = [];\n self.warnings = [];\n self.error = [];\n }", "function clearErrorMsg() {\n AlmCommon.clearMsgs();\n }", "function clearErrors() {\n var errorKeys = Object.keys($scope.errors);\n for (var i = 0, l = errorKeys.length; i < l; i++) {\n if (errorKeys[i]) {\n delete $scope.errors[errorKeys[i]];\n }\n }\n }", "clearErrors() {\n this.store.errors = {};\n }", "function removeDataAllErrors() {\r\n allErrors.pop();\r\n }", "function clearErrors(){\n props.dispatch({type: ACTIONS.ERROR, payload: {errors:[]}});\n }", "function esconderError() {\n setError(null);\n }", "function clearErrors() {\n\t$('#errors').html(\"\");\n}", "function clearAllEmailErrors(){\n cleanErrorMessage(emailUser, 'email_mailEmpty_EM');\n cleanErrorMessage(emailUser, 'email_no_At_EM');\n cleanErrorMessage(emailUser, 'email_no_domain_EM');\n cleanErrorMessage(emailUser, 'email_no_dot_EM');\n cleanErrorMessage(emailUser, 'email_blank_Space_EM');\n cleanErrorMessage(emailUser, 'email_bad_Format_EM');\n }", "function _resetErrors() {\r\n el.email_input.removeClass('error');\r\n el.email_error.text('');\r\n }", "function clearErrors() {\n document.querySelector(\".alert\").remove();\n}", "function clearErrors() {\r\n document.getElementById(\"errors\").innerHTML = '';\r\n }", "function clearErrors() {\n // Get the error HTML\n var error = document.getElementById('error');\n\n // And clear the text by setting to an empty string\n error.innerHTML = '';\n}", "function clearErrors() {\n $(\".errors\").remove();\n}", "function clearErrorState() {\n\t\t\t// Has connected successfully\n\t\t\tsettings.hasConnected = true;\n\n\t\t\tif ( hasConnectionError() ) {\n\t\t\t\tsettings.errorcount = 0;\n\t\t\t\tsettings.connectionError = false;\n\t\t\t\t$document.trigger( 'heartbeat-connection-restored' );\n\t\t\t}\n\t\t}", "reset()\n {\n Object.assign(this,this.__.originalData);\n this.errors.clear();\n }", "function _clearErrorMessages() {\n $.each($('span[data-valmsg-for]'), function _clearSpan() {\n $(this).html(\"\");\n });\n }", "function clear_all_errors() {\n for(var wp = 0; wp < inputsWithErrors.length; wp++) {\n if (typeof(inputsWithErrors[wp]) != 'undefined' && typeof inputsWithErrors[wp].parentNode != 'undefined' &&\n inputsWithErrors[wp].parentNode != null) {\n if (inputsWithErrors[wp].parentNode.className.indexOf('x-form-field-wrap') != -1) {\n inputsWithErrors[wp].parentNode.parentNode.removeChild(\n inputsWithErrors[wp].parentNode.parentNode.lastChild\n );\n } else if ($(inputsWithErrors[wp].parentNode.lastChild).hasClass('validation-message')) {\n // removeChild(parentNode.lastChild) can remove actual input fields unless we check to\n // make sure we're only removing those nodes with the 'validation-message' class\n inputsWithErrors[wp].parentNode.removeChild(inputsWithErrors[wp].parentNode.lastChild);\n }\n }\n\t}\n\tif (inputsWithErrors.length == 0) return;\n\n\tif ( YAHOO.util.Dom.getAncestorByTagName(inputsWithErrors[0], \"form\") ) {\n var formname = YAHOO.util.Dom.getAncestorByTagName(inputsWithErrors[0], \"form\").getAttribute(\"name\");\n if(typeof (window[formname + \"_tabs\"]) != \"undefined\") {\n var tabView = window[formname + \"_tabs\"];\n if ( tabView.get ) {\n var tabs = tabView.get(\"tabs\");\n for (var i in tabs) {\n if (typeof tabs[i] == \"object\")\n tabs[i].get(\"labelEl\").style.color = \"\";\n }\n }\n }\n inputsWithErrors = new Array();\n }\n}", "@api\n clearCustomError() {\n this.valid = true;\n }", "function clearErrorMessage() {\n\t$(\"div.error\").each(function(index) {\n\t\t$(this).html(\"\");\n\t});\n}", "function reset() {\n\n factory.error = null;\n factory.success = null;\n\n }", "clear()\n {\n this._exceptionsBySelector.clear();\n this._exceptions.clear();\n }", "function ClearAllValidationErrors(){\n $('.has-error').removeClass('has-error');\n }", "reset() {\n this.error = undefined;\n this.dispatchStack = [];\n }", "function clearErrors()\n{\n var allErrors = document.getElementsByClassName('error');\n for (var i = 0; i < allErrors.length; i++) {\n allErrors[i].innerHTML = \"\";\n }\n var allInputs = document.getElementsByTagName('input');\n for (i = 0; i < allInputs.length; i++) {\n allInputs[i].style.removeProperty(\"background-color\");\n }\n}", "function resetErrors() {\t\n\t//Get all \"error\" Class elements\n\tvar paragraphs = document.getElementsByClassName('error');\n\tfor (i = 0; i < paragraphs.length; i++) {\n\t\tparagraphs[i].innerHTML = \"\";\n\t\t//return false; \n\t}\n\t//return true;\n}", "function clearErrors() {\r\n\tvar address = getId('address');\r\n\taddress.style.removeProperty('background-color');\r\n}", "function clearLoginError() {\n setLoginError(false)\n }", "function clearErrorFields() {\n document.querySelector(\"#errMsg1\").innerHTML = \"\";\n document.querySelector(\"#errMsg2\").innerHTML = \"\";\n document.querySelector(\"#errMsg3\").innerHTML = \"\";\n document.querySelector(\"#errMsg4\").innerHTML = \"\";\n document.querySelector(\"#errMsg5\").innerHTML = \"\";\n document.querySelector(\"#errMsg6\").innerHTML = \"\";\n document.querySelector(\"#errMsg7\").innerHTML = \"\";\n document.querySelector(\"#errMsg8\").innerHTML = \"\";\n document.querySelector(\"#errMsg9\").innerHTML = \"\";\n document.querySelector(\"#errMsg10\").innerHTML = \"\";\n}", "reset() {\n for (let field in this.originalData) {\n this[field] = ''\n }\n\n this.errorClear()\n }", "clear(field, index) {\n let error = this.findErrorBy(index);\n\n if (field && error) {\n delete error[field];\n return;\n }\n\n this.errors = {};\n }", "function clearError() {\n document.querySelector('.alert').remove();\n}", "function clearErrorMsg() {\n\t// Make error message container invisible\n\tdocument.querySelector('#error-msg-container').style.display = 'none';\n\tdocument.querySelector('#error-header').value = ''; // Clear error message\n\n\t// Remove list items of error message\n\tconst errorlist = document.querySelector('#error-message');\n\twhile (errorlist.firstChild != null) {\n\t\terrorlist.removeChild(errorlist.firstChild);\n\t}\n}", "function clearValidationErrorMessages() {\n var messages = document.querySelectorAll('.validate-error'),\n i;\n\n for (i = 0; i < messages.length; i++) {\n messages[i].parentNode.removeChild(messages[i]);\n }\n }", "function clearError() {\r\n\t$('#error').html('');\r\n}", "function reseterr() {\n\tvar errBox = document.getElementById(\"reg-body\");\n\terrBox.innerHTML = \"\";\n\tfor (var i = 0; i < errObj.length; i++) {\n\t\terrObj[i] = false;\n\t}\n}", "function resetValAndErr() {\n setValues({\n newQuestion: \"\",\n nickname: \"\",\n email: \"\"\n });\n setErrors({});\n }", "reset() {\n this.pos = this.start\n this.error = null\n }", "function clearRuleErrors () {\n\t\n\tdocument.getElementById(\"ruleCreatorErrorsDiv\").innerHTML = \"\";\n}", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "function clearFormErrors() {\n let htmlErrors = document.getElementsByClassName(\"formerror\");\n for (let error of htmlErrors) {\n error.style.display = 'none';\n }\n }", "function clearError(element) {\n\tYAHOO.util.Event.stopEvent(element);\n\t// Modifico il contenuto della classe dell'elemento\n\tvar oldValue = this.className;\n\tvar newValue = oldValue.replace(\"error\", \"\");\n\tYAHOO.util.Dom.replaceClass(this, oldValue, newValue);\n\t// Elimino la classe del blocco di errore\n\tvar next = YAHOO.util.Dom.getNextSibling(this);\n\tif (next) {\n\t\tnext.parentNode.removeChild(next);\n\t}\n}", "function clearAll() {\n typeaheads.origin.setValue('');\n typeaheads.destination.setValue('');\n $(options.selectors.origin).removeClass(options.selectors.errorClass);\n $(options.selectors.destination).removeClass(options.selectors.errorClass);\n $(options.selectors.alert).remove();\n }", "function clearError() {\n return o.term.removeClass('error').attr('placeholder', '');\n }", "function clearError(){\n document.querySelector('.alert').remove();\n}", "function resetError(cl, form) {\n var container = form.getElementsByClassName(cl)[0];\n\n if (container.children.length > 1) {\n for (var i = 1; i < container.children.length; i++) {\n var msgElem = (container.children[i]);\n container.removeChild(msgElem);\n }\n }\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "static clearErrors() {\n document.getElementById('js-error-player1-firstName').innerHTML = '';\n document.getElementById('js-error-player1-lastName').innerHTML = '';\n document.getElementById('js-error-player2-firstName').innerHTML = '';\n document.getElementById('js-error-player2-lastName').innerHTML = '';\n }", "resetError() {\n this.validReply = false;\n document.getElementById('messages').innerHTML = \"\";\n }", "function clearErrorLog(){\r\n const errorLog = document.querySelector(\"#errorLog\");\r\n while(errorLog.firstChild){\r\n errorLog.removeChild(errorLog.firstChild)\r\n }\r\n}", "function clearErrors()\n{\n $(\"#errorArea\").html(\"\");\n errorcount = 0;\n $(\"#errorListTabTitle\").html(\"Error List (\"+errorcount+\")\");\n}", "cleanErrorInfo() {\n if (this.responseError) {\n this.responseError = false\n this.redirectLoop = false\n this.illegalURI = false\n this.originalURL = \"\"\n this.urlInput.color = \"#0A0A0F\"\n }\n }", "function resetErrors(elements)\n{\n for ( var i = 0; i < elements.length; i++)\n {\n resetError($(elements[i]));\n }\n}", "clearErrors() {\n this.setState({ errors: {} });\n }", "reset() {\n this.dateMaps = this.getInitialDateClusterMaps();\n this.errorClusters.reset();\n this.errors = {};\n this.events = {};\n this.userMap.clear();\n }", "reset() {\n this.cedulaWarning = null;\n }", "resetWarnings() {\n this.warningCount = 0;\n this.seenWarnings.clear();\n }", "function clear(){\r\n var errors= document.querySelector(\".errmessage\");\r\n errors.innerHTML=\"\"; \r\n}", "clearErr() {\n this.props.dispatch(clearWorkspaceErr());\n }", "function clearContactErrors(){\n jQuery(\".pappaya-c-name\").fadeOut().html(\"\");\n jQuery(\".pappaya-c-email\").fadeOut().html(\"\");\n jQuery(\".pappaya-c-message\").fadeOut().html(\"\");\n }", "function clearErrorMessages() {\n\tvar divs = getElementsByClass(\"errormsg\");\n\tfor (var i=0;i<divs.length;i++) {\n\t\tdivs[i].style.display=\"none\";\n\t\tdivs[i].innerHTML = \"\";\n\t}\n}", "function removeErrorMsg(){ \n if(messages.length >0){\n messages =[];\n removeElement('error');\n }\n}", "function clearSCORMError(success) {\n if (success !== constants.SCORM_FALSE) {\n this.lastErrorCode = 0;\n }\n }", "function clearError(ctrl){\n\t\t$(\"#\" + ctrl + \"\").next().html('');\n\t}", "function inputClearError()\n {\n input.removeClass('mt-error');\n }", "function removeAllErrors() {\n $(\".alert-danger\").remove();\n $(\".bootbox-body .error\").remove();\n}", "function _resetHandler () {\n errorHandled = false;\n}", "static cleanErrors() {\n let fields = document.querySelectorAll(\".field\");\n for (let field of fields) {\n field.classList.remove(\"error\");\n }\n }", "function clearError() {\n\tconst errorMessageContainerElement = getErrorMessageContainerElement();\n\n\tif ((errorMessageContainerElement == null)\n\t\t|| errorMessageContainerElement.classList.contains(\"hidden\")) {\n\n\t\treturn;\n\t}\n\n\terrorMessageContainerElement.classList.add(\"hidden\");\n\n\tconst errorMessageDisplayElement = getErrorMessageDisplayElement();\n\n\tif (errorMessageDisplayElement != null) {\n\t\terrorMessageDisplayElement.innerHTML = \"\";\n\t}\n}", "__init12() {this.error = null}", "function resetError(){\n\t\t$('label.error').hide();\n\t\t$('div.form-group').removeClass('has-error');\n\t}", "removeAll() {\n this.loaderCounter = 0;\n this.errorCounter = 0;\n this._remove(true);\n }", "function clearForm() {\n for (let i = 0; i < inputRefs.current.length; i++) {\n if (inputRefs.current[i].current === null) { break; }\n inputRefs.current[i].current.clearValue();\n }\n setData({});\n setAuthError(\"\");\n }", "function clearForm() {\n for (let i = 0; i < inputRefs.current.length; i++) {\n if (inputRefs.current[i].current === null) { break; }\n inputRefs.current[i].current.clearValue();\n }\n setData({});\n setAuthError(\"\");\n }", "function resetErrorMsgs(){\n const errors = form.querySelectorAll('.errMsg');\n\n for(i=0; i < errors.length; i++){\n errors[i].previousSibling.classList.remove(\"red-border\");\n errors[i].remove();\n }\n\n }", "clear(field) {\n\n if (field) {\n delete this.errors[field]\n\n return\n }\n\n this.errors = {}\n }", "removeErrors() {\n if (!isNullOrUndefined(this.errorText) && this.parent.spellChecker.errorWordCollection.containsKey(this.errorText)) {\n let textElement = this.parent.spellChecker.errorWordCollection.get(this.errorText);\n textElement.splice(0, 1);\n if (textElement.length === 0) {\n this.parent.spellChecker.errorWordCollection.remove(this.errorText);\n }\n }\n if (this.parent.spellChecker.errorWordCollection.length === 0) {\n this.owner.dialog.hide();\n }\n }", "function cleanUp() {\n delete $scope.searchResultBundle;\n delete $scope.message;\n delete $scope.vs;\n delete $scope.queryUrl;\n delete $scope.queryError;\n }", "function clearErrors(){\n input.value = \"\";\n msg.classList.remove('error');\n input.classList.remove('invalid');\n}", "function clearAllErrors() {\n var allElementId = [\"username-missing\", \"username-short\", \"email-missing\", \"email-invalid\", \"phone-invalid\", \"dob-invalid\", \"password-missing\", \"password-short\", \"password-mismatch\", \"confirm-password-missing\"];\n\n for (i = 0; i < allElementId.length; i++) {\n document.getElementById(allElementId[i]).style.display = \"none\";;\n }\n}", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "reset(instruction) {\n const predicate = this.getInstructionPredicate(instruction);\n const oldErrors = this.errors.filter(predicate);\n this.processErrorDelta('reset', oldErrors, []);\n }", "function clearErrorLog(){\n sendRequest(\n 'tools',\n {\n 'action': 'clearErrorLog'\n }, function(data){\n $('#logerrorcount').html('0');\n });\n}", "clearAlert() {\n const currentAlert = document.querySelector('.error');\n // check to see if there is a message alert\n if (currentAlert) {\n currentAlert.remove();\n }\n }", "function clear_error(){\r\n\t\t$('#steps li').removeClass('error');\r\n\t}", "function formClear() {\n // Clear errors from fields\n $('input[name=fname], input[name=lname], select[name=gender], select[name=country], input[name=pwd], input[name=cnfmpwd]').parent().removeClass(\"has-error\");\n}", "function clearMessage() {\n error.removeChild(error.firstChild);\n success.removeChild(success.firstChild);\n }", "reset() {}", "reset() {}", "reset() {}", "function clearErrors(nombre, clase1, clase2){\n nombre.classList.remove(clase1, clase2);\n nombre.innerHTML= \"\";\n }", "clearFormErrors() {\n this.setState({ errors: [] });\n }", "function clearCategoryErrors() {\n $('#validate-category').empty();\n}", "_clear() {\n if (Ember.get(this, 'isEmpty')) {\n return;\n }\n\n var errorsByAttributeName = Ember.get(this, 'errorsByAttributeName');\n var attributes = Ember.A();\n\n errorsByAttributeName.forEach(function (_, attribute) {\n attributes.push(attribute);\n });\n\n errorsByAttributeName.clear();\n attributes.forEach(function (attribute) {\n this.notifyPropertyChange(attribute);\n }, this);\n\n Ember.ArrayProxy.prototype.clear.call(this);\n }" ]
[ "0.8039984", "0.80155706", "0.80155706", "0.7847727", "0.7802759", "0.7645962", "0.76060516", "0.7572854", "0.74863553", "0.73013073", "0.72021604", "0.7003249", "0.6952078", "0.691546", "0.6897805", "0.68899345", "0.68687606", "0.68572915", "0.6806489", "0.67930603", "0.67360276", "0.6732612", "0.6724701", "0.6673832", "0.66348296", "0.66332084", "0.66095406", "0.65888476", "0.65884626", "0.65843356", "0.65674", "0.6552308", "0.6536455", "0.65167713", "0.65088916", "0.64825016", "0.64804554", "0.6479408", "0.64665145", "0.64597636", "0.64577544", "0.6442896", "0.6412146", "0.6406074", "0.6396046", "0.6389868", "0.6380455", "0.6354356", "0.633951", "0.633611", "0.63304704", "0.63304704", "0.63304704", "0.6326189", "0.62783235", "0.62780017", "0.62663835", "0.62651247", "0.6255413", "0.62538767", "0.6243783", "0.6231434", "0.6227865", "0.62167734", "0.619814", "0.6192682", "0.6171161", "0.61568165", "0.6154631", "0.6143934", "0.61380184", "0.6122061", "0.6116525", "0.61156183", "0.61029744", "0.61006844", "0.60860884", "0.60849667", "0.60847396", "0.60847396", "0.60729885", "0.60688645", "0.60681903", "0.6064538", "0.6064079", "0.6058001", "0.6045216", "0.60393006", "0.60283685", "0.60175043", "0.60002625", "0.60000074", "0.59998876", "0.59976095", "0.59976095", "0.59976095", "0.59915316", "0.598815", "0.5979291", "0.59790665" ]
0.6399344
44
sets error message if user hasnt entered form correct
function errorMsg(text){ document.getElementById("form") .insertAdjacentHTML("beforeend", `<div id = "error"> Error: ${text}!</div>`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showFormValidationAlert() {\n\tformIsValid()\n\t\t? null\n\t\t: alert('Please complete the order form and try again.')\n}", "function checkFormSubmit() {\n var errCode = getURLVar(\"error\");\n if (errCode !== false) {\n if (errCode == \"0\") {\n $('#errorMSG').css(\"color\", \"green\");\n $('#errorMSG').html('Success! Thanks for contacting us.');\n } else if (errCode == \"1\") {\n $('#errorMSG').css(\"color\", \"red\");\n $('#errorMSG').html('Please complete all fields.');\n } else if (errCode == \"2\") {\n $('#errorMSG').css(\"color\", \"red\");\n $('#errorMSG').html('Please enter a valid email address.');\n }\n }\n }", "function valid() {\n if (fname.value != \"\") {\n fname.style.border = \"1px solid green\";\n errfname.innerHTML = \"\";\n }\n if (lname.value != \"\") {\n lname.style.border = \"1px solid green\";\n errlname.innerHTML = \"\";\n }\n if (email.value != \"\") {\n email.style.border = \"1px solid green\";\n erremail.innerHTML = \"\";\n }\n if (password.value != \"\") {\n password.style.border = \"1px solid green\";\n errpassword.innerHTML = \"\";\n }\n if (repassword.value != \"\") {\n repassword.style.border = \"1px solid green\";\n errrepassword.innerHTML = \"\";\n }\n}", "function showError(){\r\n var titlu = document.forms[\"regForm\"][\"titlu\"];\r\n var descriere = document.forms[\"regForm\"][\"descriere\"];\r\n var poza = document.forms[\"regForm\"][\"poza\"];\r\n\r\n var titluErr = document.querySelector(\"#titlu + span.error\");\r\n var descriereErr = document.querySelector(\"#descriere + span.error\");\r\n var pozaErr = document.querySelector(\"#poza + span.error\");\r\n\r\n\r\n\r\n if(titlu.value === \"\"){\r\n titluErr.textContent = \"Enter your recipe title!\";\r\n titlu.focus();\r\n return false;\r\n }else if (titlu.value.length < 3){\r\n titluErr.textContent = \"Name not valid!\";\r\n titlu.focus();\r\n return false;\r\n } else {\r\n titluErr.textContent = \"\";\r\n }\r\n\r\n if(descriere.value === \"\"){\r\n descriereErr.textContent = \"Enter the description of the recipe!\";\r\n descriere.focus();\r\n return false;\r\n }else{\r\n descriereErr.textContent = \"\";\r\n }\r\n\r\n if(poza.value === \"\"){\r\n pozaErr.textContent = \"Insert a picture!\";\r\n poza.focus();\r\n return false;\r\n }else{\r\n pozaErr.textContent = \"\";\r\n }\r\n\r\n return true;\r\n\r\n}", "function validateForm() {\n\t// get the values from the inputs\n\tconst firstNameValue = firstName.value.trim();\n\tconst lastNameValue = lastName.value.trim();\n\tconst emailValue = email.value.trim();\n\tconst phoneValue = phone.value.trim();\n\tconst countryValue = country.value.trim();\n\tconst cityValue = city.value.trim();\n\tconst businessValue = business.value.trim();\n\tconst roleValue = role.value.trim();\n\tconst addressValue = address.value.trim();\n\tconst passwordValue = password.value.trim();\n\tconst password2Value = password2.value.trim();\n\n\t// Check Firstname\n\tif (firstNameValue === \"\") {\n\t\tsetErrorFor(firstName, \"First name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(firstName);\n\t}\n\n\t// Check Firstname\n\tif (lastNameValue === \"\") {\n\t\tsetErrorFor(lastName, \"Last name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(lastName);\n\t}\n\n\t// Check Email\n\tif (emailValue === \"\") {\n\t\tsetErrorFor(email, \"Email cannot be blank\");\n\t} else if (!isEmail(emailValue)) {\n\t\tsetErrorFor(email, \"Please enter a valid email\");\n\t} else {\n\t\tsetSuccessFor(email);\n\t}\n\n\t// Check Number\n\tif (phoneValue === \"\") {\n\t\tsetErrorFor(phone, \"Phone number cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(phone);\n\t}\n\n\t// Check country\n\tif (countryValue === \"\") {\n\t\tsetErrorFor(country, \"Please select a country\");\n\t} else {\n\t\tsetSuccessFor(country);\n\t}\n\n\t// Check City\n\tif (cityValue === \"\") {\n\t\tsetErrorFor(city, \"Please enter a city\");\n\t} else {\n\t\tsetSuccessFor(city);\n\t}\n\n\t// Check business\n\tif (businessValue === \"\") {\n\t\tsetErrorFor(business, \"School cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(business);\n\t}\n\n\t// Check role\n\tif (roleValue === \"\") {\n\t\tsetErrorFor(role, \"Please select a role\");\n\t} else {\n\t\tsetSuccessFor(role);\n\t}\n\n\t// Check addresss\n\tif (addressValue === \"\") {\n\t\tsetErrorFor(address, \"Please enter a address\");\n\t} else {\n\t\tsetSuccessFor(address);\n\t}\n\n\t// Check passwords\n\tif (passwordValue === \"\") {\n\t\tsetErrorFor(password, \"Password cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(password);\n\t}\n\n\t// Check password2\n\tif (password2Value === \"\") {\n\t\tsetErrorFor(password2, \"Password confirmation is required\");\n\t} else if (password2Value !== passwordValue) {\n\t\tsetErrorFor(password2, \"Passwords do not match\");\n\t} else {\n\t\tsetSuccessFor(password);\n\t}\n\n\tif (genders[0].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\t\treturn true;\n\t} else if (genders[1].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\n\t\treturn true;\n\t} else {\n\t\t// no checked\n\t\tsetErrorFor(genderInput, \"Please select a gender\");\n\t\treturn false;\n\t}\n}", "function formValidation(user_name, last_Name, user_email, user_password, user_confirm_password){ \n var user_name = getInputVal(\"firstName\");\n var last_Name = getInputVal(\"userLastName\");\n var user_email = getInputVal(\"userEmail\"); \n var user_password = getInputVal(\"user_Password\");\n var user_confirm_password = getInputVal(\"user_Confirm_Password\"); \n\n if(user_name) {\n document.getElementById(\"firstNameError\").innerHTML = \"\"; \n }\n if(last_Name) {\n document.getElementById(\"firstLastError\").innerHTML = \"\"; \n }\n if(user_email) {\n document.getElementById(\"firstEmailError\").innerHTML = \"\"; \n }\n if(user_password) {\n document.getElementById(\"password_Error\").innerHTML = \"\"; \n }\n if(user_confirm_password) {\n document.getElementById(\"confirm_password_Error\").innerHTML = \"\"; \n }\n else if(user_password != user_confirm_password) {\n document.getElementById(\"confirm_password_Error\").innerHTML = \"\";\n }\n }", "function validateForm() {\n\t// get the values from the inputs\n\tconst firstNameValue = firstName.value.trim();\n\tconst lastNameValue = lastName.value.trim();\n\tconst emailValue = email.value.trim();\n\tconst phoneValue = phone.value.trim();\n\tconst countryValue = country.value.trim();\n\tconst cityValue = city.value.trim();\n\tconst schoolValue = school.value.trim();\n\tconst levelValue = level.value.trim();\n\tconst skillValue = skill.value.trim();\n\tconst passwordValue = password.value.trim();\n\tconst password2Value = password2.value.trim();\n\n\t// Check Firstname\n\tif (firstNameValue === \"\") {\n\t\tsetErrorFor(firstName, \"First name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(firstName);\n\t}\n\n\t// Check Firstname\n\tif (lastNameValue === \"\") {\n\t\tsetErrorFor(lastName, \"Last name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(lastName);\n\t}\n\n\t// Check Email\n\tif (emailValue === \"\") {\n\t\tsetErrorFor(email, \"Email cannot be blank\");\n\t} else if (!isEmail(emailValue)) {\n\t\tsetErrorFor(email, \"Please enter a valid email\");\n\t} else {\n\t\tsetSuccessFor(email);\n\t}\n\n\t// Check Number\n\tif (phoneValue === \"\") {\n\t\tsetErrorFor(phone, \"Phone number cannot be blank\");\n\t} else if (isNaN(phoneValue)) {\n\t\tsetErrorFor(phone, \"Please enter a valid phone number\");\n\t} else {\n\t\tsetSuccessFor(phone);\n\t}\n\n\t// Check country\n\tif (countryValue === \"\") {\n\t\tsetErrorFor(country, \"Please select a country\");\n\t} else {\n\t\tsetSuccessFor(country);\n\t}\n\n\t// Check City\n\tif (cityValue === \"\") {\n\t\tsetErrorFor(city, \"Please enter a city\");\n\t} else {\n\t\tsetSuccessFor(city);\n\t}\n\n\t// Check School\n\tif (schoolValue === \"\") {\n\t\tsetErrorFor(school, \"School cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(school);\n\t}\n\n\t// Check Level\n\tif (levelValue === \"\") {\n\t\tsetErrorFor(level, \"Please select a level\");\n\t} else {\n\t\tsetSuccessFor(level);\n\t}\n\n\t// Check LevSkills\n\tif (skillValue === \"\") {\n\t\tsetErrorFor(skill, \"Please enter a skill\");\n\t} else {\n\t\tsetSuccessFor(skill);\n\t}\n\n\t// Check passwords\n\tif (passwordValue === \"\") {\n\t\tsetErrorFor(password, \"Password cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(password);\n\t}\n\n\t// Check password2\n\tif (password2Value === \"\") {\n\t\tsetErrorFor(password2, \"Password confirmation is required\");\n\t} else if (password2Value !== passwordValue) {\n\t\tsetErrorFor(password2, \"Passwords do not match\");\n\t} else {\n\t\tsetSuccessFor(password2);\n\t}\n\n\tif (genders[0].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\t\treturn true;\n\t} else if (genders[1].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\n\t\treturn true;\n\t} else {\n\t\t// no checked\n\t\tsetErrorFor(genderInput, \"Please select a gender\");\n\t\treturn false;\n\t}\n}", "function validateForm()\n{\n // errorMessage holds all errors which may occur during validation and is shown in an alert at the end if there are\n // errors\n var errorMessage = \"\";\n // firstOffender is used to find the first error field so that the cursor can be placed there... see bottom of method\n var firstOffender = [];\n // valid is used to return a boolean to the form, if a true return, the form is saved, if false it is not saved\n var valid = true;\n // these 2 variables are used to get a value after comparison with the regexs and used later\n var email = check_email.test(document.userForm.email.value);\n var city = check_city.test(document.userForm.city.value);\n\n // the following if statements simply check if a field is empty, if it is the error \"no field\" is appended to the\n // error message\n if (document.userForm.fname.value == \"\")\n {\n errorMessage += \"no first name\" + \"\\n\";\n valid = false;\n firstOffender.push(\"firstname\");\n }\n if (document.userForm.lname.value == \"\")\n {\n errorMessage += \"no last name\" + \"\\n\";\n valid = false;\n firstOffender.push(\"lastname\");\n }\n if (document.userForm.email.value == \"\")\n {\n errorMessage += \"no email\" + \"\\n\";\n valid = false;\n firstOffender.push(\"emailField\");\n }\n // test regex against entered value, if result does not match the pattern, the if statement will evaluate to true and enter\n else if (!email)\n {\n errorMessage += \"not a valid email\" + \"\\n\";\n valid = false;\n firstOffender.push(\"emailField\");\n }\n if (document.userForm.phone.value == \"\")\n {\n errorMessage += \"no phone number\" + \"\\n\";\n valid = false;\n firstOffender.push(\"phoneNumber\");\n }\n if (document.userForm.city.value == \"\")\n {\n errorMessage += \"no city\" + \"\\n\";\n valid = false;\n firstOffender.push(\"cityField\");\n }\n // test regex against entered value, if result does not match the pattern, the if statement will evaluate to true and enter\n else if (!city)\n {\n errorMessage += \"not a valid city\" + \"\\n\";\n valid = false;\n firstOffender.push(\"cityField\");\n }\n alert(errorMessage);\n var focusError = document.getElementById(firstOffender[0]);\n focusError.focus();\n return valid;\n}", "function menuvalidate() {\n var errormessage = \"\";\n if (document.forms.fmValidation.firstname.value == \"\") { \n\terrormessage += \"Please provide us with your First Name! \\n\";\n document.getElementById('firstname').style.borderColor = \"red\";\n }\n if (document.forms.fmValidation.lastname.value == \"\") {\n errormessage += \"Please provide us with your Last Name! \\n\";\n document.getElementById('lastname').style.borderColor = \"red\";\n }\n if (document.forms.fmValidation.emailaddress.value == \"\") {\n errormessage += \"Please provide us with your Email Address! \\n\";\n document.getElementById('emailaddress').style.borderColor = \"red\";\n }\n if (document.forms.fmValidation.fmtxtarea.value == \"\") {\n errormessage += \"We want to hear from you! Please provide us comments/suggestions for menu options and how to improve! \\n\"; document.getElementById('fmtxtarea').style.borderColor = \"red\"; }\n if (errormessage != \"\") {\n alert(errormessage);\n return false;\n } else {\n\t\talert(\"Thank you so much for your submission! We will review your suggestions/comments and contact you shortly!\");\n }\n}", "function validateForm() {\n // Retrieving the values of form elements\n var firstname = document.insertion.fname.value;\n var email = document.insertion.email.value;\n var adress = document.insertion.adress.value;\n var phonenumber = document.insertion.ph_number.value;\n var lastname = document.insertion.lname.value;\n \n \n // Defining error variables with a default value\n var firstnameErr = (emailErr = adressErr = true);\n \n // Validate firstname\n if (firstname == \"\") {\n printError(\"firstnameErr\", \"Please enter your first name\");\n document.getElementById(\"fname\").style.borderColor = \"red\";\n } else {\n var regex = /^[a-zA-Z\\s]+$/;\n if (regex.test(firstname) === false) {\n printError(\n \"firstnameErr\",\n \"Please enter a valid first name with min. 3 characters.\"\n );\n document.getElementById(\"fname\").style.borderColor = \"red\";\n } else {\n printError(\"firstnameErr\", \"\");\n document.getElementById(\"fname\").style.borderColor = \"green\";\n firstnameErr = false;\n }\n }\n \n // Validate last name\n if (lastname == \"\") {\n printError(\"lastnameErr\", \"Please enter your last name\");\n document.getElementById(\"lname\").style.borderColor = \"red\";\n } else {\n var regex = /^[a-zA-Z\\s]+$/;\n if (regex.test(lastname) === false) {\n printError(\n \"lastnameErr\",\n \"Please enter a valid last name min. 3 characters.\"\n );\n document.getElementById(\"lname\").style.borderColor = \"red\";\n } else {\n printError(\"lastnameErr\", \"\");\n document.getElementById(\"lname\").style.borderColor = \"green\";\n lastnameErr = false;\n }\n }\n \n // Validate adress\n if (adress == \"\") {\n printError(\n \"adressErr\",\n \"Please enter your adress\"\n );\n document.getElementById(\"adress\").style.borderColor = \"red\";\n } else {\n var regex = /^[a-zA-Z\\s]+$/;\n if (regex.test(adress) === false) {\n printError(\"adressErr\", \"Please enter a valid adress.\");\n document.getElementById(\"adress\").style.borderColor = \"red\";\n\n } else {\n printError(\"adressErr\", \"\");\n document.getElementById(\"adress\").style.borderColor = \"green\";\n adressErr = false;\n }\n }\n\n // Validate phone number\n if (phonenumber == \"\") {\n printError(\n \"ph_numberErr\",\n \"Please enter your phone number\"\n );\n document.getElementById(\"ph_number\").style.borderColor = \"red\";\n } else {\n var regex = /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$/;\n if (regex.test(phonenumber) === false) {\n printError(\"ph_numberErr\", \"Please enter a valid phone number.\");\n document.getElementById(\"ph_number\").style.borderColor = \"red\";\n } else {\n printError(\"ph_numberErr\", \"\");\n document.getElementById(\"ph_number\").style.borderColor = \"green\";\n ph_numberErr = false;\n }\n }\n\n // Validate email address\n if (email == \"\") {\n printError(\"emailErr\", \"Please enter your email address\");\n document.getElementById(\"email\").style.borderColor = \"red\";\n } else {\n // Regular expression for basic email validation\n var regex = /^\\S+@\\S+\\.\\S+$/;\n if (regex.test(email) === false) {\n printError(\"emailErr\", \"Please enter a valid email address ex: [email protected]\");\n document.getElementById(\"email\").style.borderColor = \"red\";\n } else {\n printError(\"emailErr\", \"\");\n document.getElementById(\"email\").style.borderColor = \"green\";\n emailErr = false;\n }\n }\n var g = document.getElementById(\"gender\");\n var gender = g.value;\n \n // Prevent the form from being submitted if there are any errors\n if ((firstnameErr || emailErr || adressErr || lastnameErr || ph_numberErr) == true) {\n return false;\n } \n //else {\n // // Creating a string from input data for preview\n // var dataPreview =\n // \"Data entered! \\n\" +\n // \"first name: \" +\n // firstname + \"\\n\" +\n // \"last name: \" +\n // lastname +\n // \"\\n\" +\n // \"adress : \" +\n // adress +\n // \"\\n\";\n // \"Email Address: \" + email + \"\\n\"+\n // \"phone number: \" +\n // phonenumber +\n // \"\\n\" +\n // \"email adress : \" +\n // email +\"\\n\" +\n // \"Gender : \" +\n // gender ;\n \n \n \n // // Display input data in a dialog box before submitting the form\n // alert(dataPreview);\n // }\n }", "function subm()\n{\n // user firstname error\n if(userName.value == \"\"){\n userName.style.borderColor = \"#d22222\";\n userName.focus();\n nameErr.innerHTML = \"please enter your first name\";\n return false;\n }\n\n // user surname error\n if(surName.value == \"\"){\n surName.style.borderColor = \"#d22222\";\n surName.focus();\n surNameErr.innerHTML = \"please enter your surname\";\n return false;\n }\n\n // user password error\n if(userEmail.value == \"\"){\n userEmail.style.borderColor = \"#d22222\";\n userEmail.focus();\n userEmailErr.innerHTML = \"please enter your email\";\n return false;\n }\n\n if(pass.value.length <= 5){\n pass.style.borderColor = \"#d22222\";\n pass.focus();\n passErr.innerHTML = \"passward must be 6 charecters\";\n return false;\n }\n\n // user confirm password error\n // if(confirmPass.value == \"\"){\n // confirmPass.style.borderColor = \"#d22222\";\n // confirmPass.focus();\n // confirmPassErr.innerHTML = \"please enter password\";\n // return false;\n // }\n\n // if(confirmPass.value != pass.value){\n // confirmPass.style.borderColor = \"#d22222\";\n // confirmPass.focus();\n // confirmPassErr.innerHTML = \"passwords not matched \";\n // return false;\n // }\n}", "checkForm() {\n // set empty string to make it easy to return + boolean to check whether it's successful\n var isSuccess = true;\n var message = \"\";\n\n var patt = new RegExp(\"@\")\n if (!patt.test(this.email)) {\n isSuccess = false;\n message += \"Email\\n\"\n }\n\n // return it with appropriate message\n if (isSuccess) {\n return \"Successfully Submitted!\";\n }\n else {\n return \"You must correct:\\n\" + message;\n }\n }", "function validateEdit(){\n\t\n\t//check to see if the user left the name field blank\n\tif (document.getElementById(\"e_name\").value == null || document.getElementById(\"e_name\").value == \"\"){\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"e_nameerror\").innerHTML= \"*name not filled in\";\n\t\t\n\t\t//changes to the fields properties to highlight the incorrect field\n\t\tformAtt(\"e_name\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t\n\t//check to see if the user left the surname field blank\n\tif (document.getElementById(\"e_surname\").value == null || document.getElementById(\"e_surname\").value == \"\"){\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"e_snameerror\").innerHTML= \"*surname not filled in\";\n\t\t\n\t\t//changes to the fields properties to highlight the incorrect field\n\t\tformAtt(\"e_surname\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t//if the users submission returns no false checks, then tell the even handler to execute the onSubmit command\n\treturn true;\n}", "submitError(){\n\t\tif(!this.isValid()){\n\t\t\tthis.showErrorMessage();\n\t\t}\n\t}", "function messageFormTest () {\n if (document.forms['message-user'].search.value === \"\" ||\n document.forms['message-user'].messageUser.value === \"\")\n// display error messages if user isn’t selected or message field is EMPTY\n\n {\n alert(\"All fields must be filled in to submit form\");\n }\n\n// display message when message sent correctly\n else {\n alert(\"Your message has been sent!\");\n }\n}", "function validate(){\n if(result === null){\n alert(\"Error! You must select at least one character set. Please reload page and try again\")\n } return\n }", "function validateForm() {\n let userName = document.forms[\"contact-form\"][\"user_name\"].value;\n let userEmail = document.forms[\"contact-form\"][\"user_email\"].value;\n let userMessage = document.forms[\"contact-form\"][\"user_message\"].value;\n\n if (userName === \"\" || userEmail === \"\" || userMessage === \"\") {\n alert(\"Please complete all section of the form.\");\n return false;\n } else {\n alert(\"Thank you. Your message has been sent and we will be in touch as soon as possible\");\n return true;\n }\n }", "function formHasErrors()\n{\n\tvar errorFlag = false;\n //validating all of the text fields to confirm the have options\n\tfor(let i = 0; i < requireTextFields.length; i++){\n\t\tvar textField = document.getElementById(requireTextFields[i])\n\t\t\n\t\tif(!hasInput(textField)){\n\t\t\t//display correct error message\n\t\t\tdocument.getElementById(requireTextFields[i] + \"_error\").style.display = \"inline\";\n document.getElementById(requireTextFields[i]).style.border = \"0.75px red solid\";\n \n\t\t\terrorFlag = true;\n\t\t} else {\n\t\t\t\n\t\t\t//after user enters the correct info this hides the border and error message\n\t\t\tdocument.getElementById(requireTextFields[i] + \"_error\").style.display = \"none\";\n\t\t\tdocument.getElementById(requireTextFields[i]).style.border = \"1px solid #e5e5e5;\";\n\t\t}\n\t}\n\treturn errorFlag;\n}", "function checkInput()\r\n{\r\n\t//var isCorrect=false;\r\n\tvar errors = new Array();\r\n\tvar href=location.pathname; //get website address to determine we are in designer or company\r\n\t\r\n\tif(href.search(\"designer\")!=-1)\r\n\t{\r\n\t\t//designer page\r\n\t\terrors = CheckforNullandSpace(\"#form_username\",errors,\"#label_username\",\"Please enter Username\");\r\n errors = CheckforNullandSpace(\"#form_password\",errors,\"#label_password\",\"Please enter Password\");\r\n errors = CheckforNullandSpace(\"#form_confirm\" ,errors,\"#label_confirm\" ,\"Please enter Confirm Password\");\r\n\t\r\n\t\tif($(\"#form_password\").val()!=$(\"#form_confirm\").val())\r\n\t\t{\r\n\t\t\t//loadPopup(\"error.html\",\"Password and Confirm Password must be the same\");\r\n\t\t\terrors.push(\"Password and Confirm Password must be the same\");\r\n\t\t\t$(\"#label_password\").attr(\"style\",errorStyle);\r\n\t\t\t$(\"#label_confirm\").attr(\"style\",errorStyle);\r\n\t\t}\r\n\t\terrors = CheckforNull(\"#form_ans_q1\",errors,\"#label_ans_q1\",\"Please enter answer for Security Question 1\");\r\n\t\terrors = CheckforNull(\"#form_ans_q2\",errors,\"#label_ans_q2\",\"Please enter answer for Security Question 2\");\r\n\t\terrors = CheckforNull(\"#form_first_name\",errors,\"#label_firstname\",\"Please enter First Name\");\r\n\t\terrors = CheckforNull(\"#form_last_name\" ,errors,\"#label_lastname\" ,\"Please enter Last Name\");\r\n\t\terrors = CheckforNull(\"#form_address_1\",errors,\"#label_address_1\",\"Please enter Street Address 1\");\r\n\t\terrors = CheckforNull(\"#form_city\",errors,\"#label_city\",\"Please enter City\");\r\n\t\terrors = CheckforNull(\"#form_state\",errors,\"#label_state\",\"Please enter State\");\r\n\t\terrors = CheckforNullandNumber(\"#form_zipcode\",errors,\"#label_zipcode\",\"Please enter Zip Code\")\r\n\t\terrors = CheckforNull(\"#form_country\",errors,\"#label_country\",\"Please enter Country\");\r\n\t\terrors = CheckforNullandPhoneNumber(\"#form_cell_phone\",errors,\"#label_cell_phone\",\"Cell Phone Number\");\r\n\t\terrors = CheckforNullinSelect(\"#form_languages\",errors,\"#label_languages\",\"Please select at least 1 language\");\r\n\t\terrors = CheckforNull(\"#form_company_name\",errors,\"#label_company_name\",\"Please enter Company Name\");\r\n\t\terrors = CheckforNullandPhoneNumber(\"#form_brand_work_phone\",errors,\"#label_brand_work_phone\",\"Brand Work Phone Number\");\r\n\t\t//errors = CheckforNullandPhoneNumber(\"#form_fax\",errors,\"#label_fax\",\"Fax Number\");\r\n\t\terrors = CheckforNullinSelect(\"#form_skills\",errors,\"#label_skills\",\"Please select at least 1 skill\");\r\n\t\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\terrors = CheckforNullandSpace(\"#form_username\",errors,\"#label_username\",\"Please enter Username\");\r\n errors = CheckforNullandSpace(\"#form_password\",errors,\"#label_password\",\"Please enter Password\");\r\n errors = CheckforNullandSpace(\"#form_confirm\" ,errors,\"#label_confirm\" ,\"Please enter Confirm Password\");\r\n \r\n if($(\"#form_password\").val()!=$(\"#form_confirm\").val())\r\n\t\t{\r\n\t\t\t//loadPopup(\"error.html\",\"Password and Confirm Password must be the same\");\r\n\t\t\terrors.push(\"Password and Confirm Password must be the same\");\r\n\t\t\t$(\"#label_password\").attr(\"style\",errorStyle);\r\n\t\t\t$(\"#label_confirm\").attr(\"style\",errorStyle);\r\n\t\t}\r\n \r\n\t\terrors = CheckforNull(\"#form_ans_q1\",errors,\"#label_ans_q1\",\"Please enter answer for Security Question 1\");\r\n\t\terrors = CheckforNull(\"#form_ans_q2\",errors,\"#label_ans_q2\",\"Please enter answer for Security Question 2\");\r\n\t\terrors = CheckforNull(\"#form_first_name\",errors,\"#label_firstname\",\"Please enter First Name\");\r\n\t\terrors = CheckforNull(\"#form_last_name\" ,errors,\"#label_lastname\" ,\"Please enter Last Name\");\r\n\t\terrors = CheckforNullinSelect(\"#form_languages\",errors,\"#label_languages\",\"Please select at least 1 language\");\r\n\t\terrors = CheckforNullandPhoneNumber(\"#form_cell_phone\",errors,\"#label_cell_phone\",\"Cell Phone Number\");\r\n\t\terrors = CheckforNull(\"#form_company_name\",errors,\"#label_company_name\",\"Please enter Company Name\");\r\n\t\terrors = CheckforNull(\"#form_address_1\",errors,\"#label_address_1\",\"Please enter Street Address 1\");\r\n\t\terrors = CheckforNull(\"#form_city\",errors,\"#label_city\",\"Please enter City\");\r\n\t\terrors = CheckforNull(\"#form_state\",errors,\"#label_state\",\"Please enter State\");\r\n\t\terrors = CheckforNullandNumber(\"#form_zip\",errors,\"#label_zipcode\",\"Please enter Zip Code\")\r\n\t\terrors = CheckforNull(\"#form_country\",errors,\"#label_country\",\"Please enter Country\");\r\n\t\terrors = CheckforNullandPhoneNumber(\"#form_phone\",errors,\"#label_phone\",\"Compnay Phone Number\");\r\n\t\t//errors = CheckforNullandPhoneNumber(\"#form_fax\",errors,\"#label_fax\",\"Company Fax Number\");\r\n\t\terrors = CheckforNullandSpace(\"#form_website\",errors,\"#label_website\",\"Please enter comapny Website\");\r\n\t\r\n\t}\r\n\treturn errors;\r\n}", "function validate() {\n\t\t\n\t\tvar fname = $(\"#fname\").val();\n\t\tvar lname = $(\"#lname\").val();\n\t\t\n\t\tvar question = $(\"#resizable\").val();\n\t\tvar date = $(\"#datepicker\").val();\n\t\t\n\t\tif(fname == \"\") {\n\t\t\talert(\"Please enter first name\");\n\t\t}\n\t\t\n\t\telse if(lname == \"\") {\n\t\t\talert(\"Please enter last name\");\n\t\t}\n\t\t\n\t\telse if(question == \"\") {\n\t\t\talert(\"Please enter a question\");\n\t\t}\n\t\t\n\t\telse if(date == \"\") {\n\t\t\t\talert(\"Please select a date\");\n\t\t}\n\t\t\n\t\telse {\n\t\t\talert(\"Submitted\");\n\t\t}\n\t}", "function onXareltoSubmit() {\n //first clear error element\n var t = document.getElementById(\"errorElement\");\n t.innerHTML=\"\";\n if (!validateName()) {\n displayFormErrors(\"name\");\n return false;\n } else if (!validateZipCode()){\n displayFormErrors(\"zip\");\n return false;\n } else if (!validateTelephone()){\n displayFormErrors(\"telephone\");\n return false;\n } else if (!validateEmail()) {\n displayFormErrors(\"email\");\n return false;\n } else if(!validateConsent()){\n displayFormErrors(\"consent\");\n return false;\n }\n return true;\n}", "function validateForm() {\n // Retrieving the values of form elements \n var name = document.contactForm.name.value;\n var email = document.contactForm.email.value;\n var mobile = document.contactForm.mobile.value;\n var country = document.contactForm.country.value;\n var gender = document.contactForm.gender.value;\n\n // Defining error variables with a default value\n var nameErr = emailErr = mobileErr = countryErr = genderErr = true;\n\n // Validate name\n if (name == \"\") {\n printError(\"nameErr\", \"Por Favor Ingrese su nombre \");\n } else {\n var regex = /^[a-zA-Z\\s]+$/;\n if (regex.test(name) === false) {\n printError(\"nameErr\", \"Por Favor Ingresa un nombre valido\");\n } else {\n printError(\"nameErr\", \"\");\n nameErr = false;\n }\n }\n\n // Validate email address\n if (email == \"\") {\n printError(\"emailErr\", \"Por Favor Ingrese Su Correo\");\n } else {\n // Regular expression for basic email validation\n var regex = /^\\S+@\\S+\\.\\S+$/;\n if (regex.test(email) === false) {\n printError(\"emailErr\", \"Por Favor Ingrese un Correo Valido\");\n } else {\n printError(\"emailErr\", \"\");\n emailErr = false;\n }\n }\n\n // Validate mobile number\n if (mobile == \"\") {\n printError(\"mobileErr\", \"Por Favor Ingrese Su Numero Telefonico\");\n } else {\n var regex = /^[1-9]\\d{9}$/;\n if (regex.test(mobile) === false) {\n printError(\"mobileErr\", \"Por favor Ingrese un Numero Valido(+569)12345678\");\n } else {\n printError(\"mobileErr\", \"\");\n mobileErr = false;\n }\n }\n\n // Validate country\n if (country == \"seleccionar\") {\n printError(\"countryErr\", \"Por Favor Ingrese Su Region\");\n } else {\n printError(\"countryErr\", \"\");\n countryErr = false;\n }\n\n // Validate gender\n if (gender == \"\") {\n printError(\"genderErr\", \"Por Favor Ingrese Su Genero\");\n } else {\n printError(\"genderErr\", \"\");\n genderErr = false;\n }\n\n // Prevent the form from being submitted if there are any errors\n if ((nameErr || emailErr || mobileErr || countryErr || genderErr) == true) {\n return false;\n } else {\n // Creating a string from input data for preview\n var dataPreview = \"Tu Has Ingresado los siguientes Datos: \\n\" +\n \"Nombre Completo: \" + name + \"\\n\" +\n \"Correo: \" + email + \"\\n\" +\n \"Telefono: \" + mobile + \"\\n\" +\n \"Region: \" + country + \"\\n\" +\n \"Genero: \" + gender + \"\\n\";\n }\n // Display input data in a dialog box before submitting the form\n alert(dataPreview);\n}", "function validateForm() {\n clearPage(); // Removes previous popups\n\n // Alerts the user if they have submitted an input with no text\n if (document.forms[\"inputFood\"][\"food\"].value == \"\") {\n warningAlert.innerHTML = \"Please Provide a Dish\";\n warningAlert.classList.add(\"reveal\");\n return false;\n }\n getFood(document.forms[\"inputFood\"][\"food\"].value);\n}", "function invalidFormInput() {\n return (modalConfirm.form.linearId === undefined);\n }", "function errorCheckEditProfileForm(){\n\t\tvar errorString =\"\";\n\t\tvar isError = false;\n\t\tvar obj = {\n\t\t\tFirstName: $(\"#firstName\").val(),\n\t\t\tLastName: $(\"#lastName\").val(),\n\t\t\tEmail: $(\"#email\").val(),\n\t\t\tCountry: $(\"#country\").val(),\n\t\t\tCity: $(\"#city\").val(),\n\t\t\tBirthday: $(\"#birthday\").val()\n\t\t}\n\n\t\tif(!ErrorChecking.isOkName(obj.FirstName)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The first name you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkName(obj.LastName)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The last name you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkEmail(obj.Email)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The email you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkCountry(obj.City)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The city you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkCountry(obj.Country)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The country you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkDate(obj.Birthday)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The birthday you entered in not valid\\n\";\n\t\t}\n\t\tif(isError)\n\t\t\talert(errorString);\n\t\treturn isError;\n\t}", "function validateForm(){\n let errors = {};\n\n if (!formValue.firstName.trim()) {\n errors.firstName = 'First Name is required';\n }\n \n if (!formValue.lastName.trim()) {\n errors.lastName = 'Last Name is required';\n }\n \n if (!formValue.email) {\n errors.email = 'Email is required';\n } else if (!/^[\\w-.]+@([\\w-]+.)+[\\w-]{2,4}$/.test(formValue.email)) {\n errors.email = 'Email address is invalid';\n }\n setErrors(errors); \n }", "function nameErrorHandler() {\n if (fullName.value.length != 0) {\n if (fullnameRegex.test(fullName.value) == false) {\n var name_message =\n \"Fullname should contain min 2 words with min 4 alphabet Ex: John Snow\";\n document.getElementById(\"name_err\").innerHTML = name_message;\n } else {\n document.getElementById(\"name_err\").innerHTML = \"\";\n }\n }\n}", "function formCheck( input, error, errorMsg ) {\n\n if ( input.length === 0 ) {\n error.html(errorMsg);\n test = false;\n }else { \n error.html('&nbsp;'); \n test = true; \n }\n}", "function validateForm(){\n if (!nameRegex.test($(\"#name\").val())){\n toggleError(true, $(\"#nameError\"), $(\"label[for=name]\"), errorMessages.name);\n $(\"#name\").addClass(\"errorInput\");\n } else {\n toggleError(false, $(\"#nameError\"));\n $(\"#name\").removeClass(\"errorInput\");\n }\n// Trigger warning\n $(\"#mail\").trigger(\"keyup\");\n\n if ($(\"#design option\").first().prop(\"selected\")){\n toggleError(true, $(\"#designError\"), $(\".shirt-box\"), errorMessages.design);\n $(\"#design\").addClass(\"errorInput\");\n } else {\n toggleError(false, $(\"#designError\"));\n $(\"#design\").removeClass(\"errorInput\");\n }\n\n if ($(\".activities input:checked\").length == 0){\n toggleError(true, $(\"#activityError\"), $(\".activities label\").first(), errorMessages.activities);\n } else {\n toggleError(false, $(\"#activityError\"));\n }\n\n if ($(\"option[value='credit card']\").prop(\"selected\")){\n ccErrorEvaluation ();\n\n if (!zipRegex.test($(\"#zip\").val())){\n toggleError(true, $(\"#zipCodeError\"), $(\".credit-card\"), errorMessages.zipCode);\n $(\"#zip\").addClass(\"errorInput\");\n } else {\n toggleError(false, $(\"#zipCodeError\"));\n $(\"#zip\").removeClass(\"errorInput\");\n }\n\n if (!cvvRegex.test($(\"#cvv\").val())){\n toggleError(true, $(\"#cvvError\"), $(\".credit-card\"), errorMessages.cvv);\n $(\"#cvv\").addClass(\"errorInput\");\n } else {\n toggleError(false, $(\"#cvvError\"));\n $(\"#cvv\").removeClass(\"errorInput\");\n }\n }\n}", "function validateSubmission(form) {\n var alertMsg = \"\"; // Stores the message to display to user indicating which fields are entered incorrectly\n var checkEntry = true; // Is true if all fields are entered correctly, set to false if a field is entered incorrectly\n if (form.name.value == \"\") {\n //checks to see if Name field contains user input\n window.alert(\"No Name entered.\");\n return false;\n }\n if (form.price.value == \"\") {\n //checks to see if Price field contains user input, if not the validate function returns false\n window.alert(\"No Price entered.\");\n return false;\n }\n if (form.long1.value == \"\") {\n //checks to see if Longittude field contains user input, if not the validate function returns false\n window.alert(\"No Longittude entered.\");\n return false;\n }\n if (form.latt1.value == \"\") {\n //checks to see if Lattitude field contains user input, if not the validate function returns false\n window.alert(\"No Lattitude entered.\");\n return false;\n }\n\n if (!validateSpotName(form.name.value)) {\n //checks to see if Name entry is in the appropriate format\n var el = document.getElementsByName(\"name\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Name must be 5 characters long and cannot begin with a space or have consecutive spaces.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"name\")[0].style.backgroundColor = \"white\";\n }\n if (\n !validateDescription(form.description.value) &&\n form.description.value != \"\"\n ) {\n //checks to see if Description entry is in the appropriate format\n var el = document.getElementsByName(\"description\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += \"Description must be less than 300 characters.\\n\"; //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n checkEntry = false;\n } else {\n document.getElementsByName(\"description\")[0].style.backgroundColor =\n \"white\";\n }\n if (!validatePrice(form.price.value)) {\n //checks to see if Price entry is in the appropriate format\n var el = document.getElementsByName(\"price\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Price must contain only digits, a single decimal point and up to 2 digits following the decimal point.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"price\")[0].style.backgroundColor = \"white\";\n }\n if (!validateCoordinate(form.long1.value)) {\n //checks to see if Longittude entry is in the appropriate format\n var el = document.getElementsByName(\"long1\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Longittude must contain at least 1 and up to 3 digits optionally followed by a decimal point and any number of digits.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"long1\")[0].style.backgroundColor = \"white\";\n }\n if (!validateCoordinate(form.latt1.value)) {\n //checks to see if Lattitude entry is in the appropriate format\n var el = document.getElementsByName(\"latt1\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Lattitude must contain at least 1 and up to 3 digits optionally followed by a decimal point and any number of digits.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"latt1\")[0].style.backgroundColor = \"white\";\n }\n if (!checkEntry) {\n //if any of the input fields have an entry in an incorrect format\n window.alert(alertMsg); //displays an error message for each incorrect field to user\n return false; //the validate function returns fa;se\n }\n\n return true; //All input fields contain values in the correct format so the validate function returns true\n}", "function checkForm() {\n\t\tif (parseInt($('#w').val())) return true;\n\t\t$('.error').html('Please select a crop region and then press Upload').show();\n\t\treturn false;\n}", "validate() {\n this.errorMessage = \"Dit is geen text\";\n super.validate();\n }", "requiredFieldMsg() {\n try {\n alert('Please fill out all required fields');\n // window.location.reload();\n } catch (error) {\n alert('There seems to be a problem!');\n }\n }", "function checkForm() {\n var a = true\n\n if (isValidName($pr_name.val())) {\n $('#error-name').html('')\n } else {\n $('#error-name').html('Tên là ký tự chữ số dài từ 2 - 200 ký tự')\n a = false\n }\n if (a) emptyError()\n return a;\n }", "function showError(error) {\n errorElement.innerText = error;\n\n //check for the username field\n if (!username.value) {\n username.classList = 'username invalid';\n } else {\n username.classList = 'username';\n }\n\n //check for the password field\n if (!password.value) {\n password.classList = 'password invalid';\n } else {\n password.classList = 'password';\n }\n\n //check for the mail field\n if (!mail.value) {\n mail.classList = 'mail invalid';\n } else {\n mail.classList = 'mail';\n }\n}", "function displayFormErrors(e) {\n var t = document.getElementById(\"errorElement\");\n switch (e) {\n case \"name\":\n t.innerHTML = \"Name must be between 2 - 30 characters.\";\n break;\n case \"email\":\n t.innerHTML = \"Please provide a valid e-mail address.\";\n break;\n case \"telephone\":\n t.innerHTML = \"Please provide a valid telephone number.\";\n break;\n case \"zip\":\n t.innerHTML = \"Please provide a valid Zip Code.\";\n break;\n case \"consent\":\n t.innerHTML = \"Please read statement and click checkbox to continue.\"\n break;\n default:\n t.innerHTML = \"\";\n break;\n }\n}", "displayInputErrors(team) {\n if (team.sport.trim() == \"\") {\n this.refs.sport.setError(\"Please give a non-empty value\");\n }\n if (team.city.trim() == \"\") {\n this.refs.city.setError(\"Please give a non-empty value\");\n }\n if (team.name.trim() == \"\") {\n this.refs.name.setError(\"Please give a non-empty value\");\n }\n if ( isNaN(team.maxPlayers) || game.gameLength < 1 ) {\n this.refs.gameLength.setError(\"Please input a positive number\");\n }\n }", "function checkInputs(){\r\n const fNameValue = fName.value.trim();\r\n const lNameValue = lName.value.trim();\r\n const addressValue =address.value.trim();\r\n const cityValue =city.value.trim();\r\n //const vValue =state.value.trim();\r\n const zipValue = zip.value.trim();\r\n const dobValue = dob.value.trim();\r\n const phoneValue = phone.value.trim();\r\n const emailRValue = emailR.value.trim();\r\n const passwordValue = password.value.trim();\r\n \r\n if(fNameValue === '')\r\n {\r\n setErrorFor(fName)\r\n }else{\r\n setSuccessFor(fName);\r\n }\r\n\r\n if(lNameValue === '')\r\n {\r\n setErrorFor(lName)\r\n }else{\r\n setSuccessFor(lName);\r\n }\r\n\r\n if(addressValue === '')\r\n {\r\n setErrorFor(address)\r\n }else{\r\n \r\n setSuccessFor(address);\r\n }\r\n\r\n if(cityValue === '')\r\n {\r\n setErrorFor(city)\r\n }else{\r\n \r\n setSuccessFor(city);\r\n }\r\n\r\n if(zipValue === '')\r\n {\r\n setErrorFor(zip)\r\n }else{\r\n \r\n setSuccessFor(zip);\r\n }\r\n\r\n if(dobValue === '')\r\n {\r\n setErrorFor(dob)\r\n }else{\r\n \r\n setSuccessFor(dob);\r\n console.log(dobValue)\r\n }\r\n\r\n if(phoneValue === '')\r\n {\r\n setErrorFor(phone)\r\n }else{\r\n \r\n setSuccessFor(phone);\r\n }\r\n\r\n if(emailRValue === '')\r\n {\r\n setErrorFor(emailR)\r\n }else if(!isEmail(emailRValue)){\r\n setErrorFor(emailR)\r\n \r\n }else{\r\n setSuccessFor(emailR);\r\n }\r\n\r\n if(passwordValue === '')\r\n {\r\n setErrorFor(password)\r\n }else{\r\n setSuccessFor(password);\r\n }\r\n}", "validateForm() {\n if (!this.event.title) {\n this.formWarning = 'Please enter a title';\n }\n if (!this.event.startTime) {\n this.formWarning = 'Please enter a start time';\n return false;\n }\n if (!this.event.endTime) {\n this.formWarning = 'Please enter an end time';\n return false;\n }\n return true;\n }", "validate() {\n // Als NIET (!) valide, dan error weergeven\n if (!this.isValid()) {\n this.showError();\n console.log(\"niet valide\");\n }\n else\n this.hideError();\n }", "function validateForm() {\n // Retrieving the values of form elements \n var dept_num = document.contactForm.dept_num.value;\n var dept_name = document.contactForm.dept_name.value;\n var dept_leader = document.contactForm.dept_leader.value;\n\t// Defining error variables with a default value\n var deptnumErr = deptnameErr = deptleaderErr = true;\n // Validate name\n if(dept_num == \"\") {\n printError(\"deptnumErr\", \"Please enter Depertment Number\");\n } else {\n printError(\"deptnumErr\", \"\");\n deptnumErr = false;\n }\n // Validate email address\n if(dept_name == \"\") {\n printError(\"deptnameErr\", \"Please enter Depertment Name\");\n } else {\n printError(\"deptnameErr\", \"\");\n deptnameErr = false;\n }\n // Validate mobile number\n if(dept_leader == \"\") {\n printError(\"deptleaderErr\", \"Please enter Depertment Leader\");\n } else {\n printError(\"deptleaderErr\", \"\");\n deptleaderErr = false;\n }\n\n \n // Prevent the form from being submitted if there are any errors\n if((deptnumErr || deptleaderErr || deptnameErr ) == true) {\n return false;\n } else {\n // Creating a string from input data for preview\n var dataPreview = \"You've entered the following details: \\n\" +\n \"Depertment Number: \" + dept_num + \"\\n\" +\n \"Depertment Name: \" + dept_name + \"\\n\" +\n \"Depertment Leader: \" + dept_leader + \"\\n\";\n // Display input data in a dialog box before submitting the form\n alert(dataPreview);\n }\n}", "function checkForm(){\n //if all outcomes are true, this means all inputs have correct data\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){ //if all inputs filled correctly, allow user to send form\n btn.disabled = false; //enable submit btn\n }else{\n btn.disabled = true;\n }\n }", "function checkForm(frm) {\r\n var eror = 0; // to store errors, determine to return TRUE or FALSE\r\n\r\n // for fields Users\r\n if(frm.username) var username = frm.username.value;\r\n if(frm.pass) var pass = frm.pass.value;\r\n if(frm.pass2) var pass2 = frm.pass2.value;\r\n if(frm.passnew) var passnew = frm.passnew.value;\r\n if(frm.email) var email = frm.email.value;\r\n if(frm.codev) var codev = frm.codev.value;\r\n if(document.getElementById('codev0')) var codev0 = document.getElementById('codev0').innerHTML;\r\n\r\n // gets form fields values Message\r\n if(frm.emailc) {\r\n var email = frm.emailc.value;\r\n if(email == 'optional') { frm.emailc.value = ''; email = ''; }\r\n }\r\n if(frm.coment) var coment = frm.coment.value;\r\n\r\n // check fields value, if incorrect, sets error in \"eror\"\r\n // validate the email\r\n if(frm.email && email.search(regx_mail)==-1) {\r\n alert(texts['email']);\r\n eror = frm.email;\r\n }\r\n else if(frm.emailc && email.length>0 && email.search(regx_mail)==-1) {\r\n alert(texts['email']);\r\n eror = frm.emailc;\r\n }\r\n // validate user name\r\n else if(frm.username && (username.length<3 || username.length>32 || username.search(regx_chr) == -1)) {\r\n alert(texts['name']);\r\n eror = frm.username;\r\n }\r\n // Check password length and to contains only the characters from \"regx_chr\"\r\n else if (frm.pass && (pass.length<7 || pass.search(regx_chr) == -1)) {\r\n alert(texts['pass']);\r\n eror = frm.pass;\r\n }\r\n // Check if it's the same password in \"Retype password\"\r\n else if (frm.pass2 && pass2!=pass) {\r\n alert(texts['pass2']);\r\n eror = frm.pass2;\r\n }\r\n // Check the length of the new password (the form in \"usrbody.php\")\r\n else if (frm.passnew && (passnew.length<7 || passnew.search(regx_chr) == -1)) {\r\n alert(texts['passnew']);\r\n eror = frm.passnew;\r\n }\r\n // check the verification code\r\n else if (frm.codev && codev0 && codev!=codev0) {\r\n alert(texts['codev']);\r\n eror = frm.codev;\r\n }\r\n // check the message /comment\r\n else if(frm.coment && (coment.length<5 || coment.length>600)) {\r\n alert(texts['coment']);\r\n eror = frm.coment;\r\n }\r\n\r\n // if no error in 'eror', returns true, else, select incorrect field,and returns false\r\n if (eror==0) return true;\r\n else {\r\n eror.focus();\r\n eror.select();\r\n return false;\r\n }\r\n}", "function ForumInputCheck() {\n if (document.forms.addform.user_name.value == '') {\n alert('名前が入力されていません。');\n document.forms.addform.user_name.focus();\n return false;\n } else if (document.forms.addform.title.value == '') {\n alert('タイトルが入力されていません。');\n document.forms.addform.title.focus();\n return false;\n } else if (document.forms.addform.comment.value == '') {\n alert('コメントが入力されていません。');\n document.forms.addform.comment.focus();\n return false;\n } else if (document.forms.addform.user_pass.value == '') {\n alert('パスワードが入力されていません。');\n document.forms.addform.user_pass.focus();\n return false;\n }\n return true;\n}", "function check() {\n var fname = document.register.firstN.value\n var lname = document.register.lastN.value\n var street = document.register.street.value\n var city = document.register.city.value\n var province = document.register.province.value\n var postal = document.register.postal.value\n var email = document.register.email.value\n var phone = document.register.phone.value\n\n \n if (!fname) {\n event.preventDefault();\n document.getElementById('errorFirstN').style.display = 'block'\n }\n if (!lname) {\n event.preventDefault();\n document.getElementById('errorLastN').style.display = 'block'\n }\n if (!street) {\n event.preventDefault();\n document.getElementById('errorAddress').style.display = 'block'\n }\n if (!city) {\n event.preventDefault();\n document.getElementById('errorCity').style.display = 'block'\n }\n if (!province) {\n event.preventDefault();\n document.getElementById('errorProvince').style.display = 'block'\n }\n if (!postal) {\n event.preventDefault();\n document.getElementById('errorPostal').style.display = 'block'\n }\n if (!email) {\n event.preventDefault();\n document.getElementById('errorEmail').style.display = 'block'\n }\n if (!phone) {\n event.preventDefault();\n document.getElementById('errorPhone').style.display = 'block'\n }\n else {\n event.preventDefault();\n document.getElementById('completed').style.display = 'block'\n }\n \n\n}", "function showError() {\n //error for email\n if (email.validity.valueMissing) {\n // If the field is empty,\n // display the following error message.\n errorEmail.textContent = \"You need to enter an e-mail address.\";\n } else if (email.validity.typeMismatch) {\n // If the field doesn't contain an email address,\n // display the following error message.\n errorEmail.textContent = \"Entered value needs to be an e-mail address.\";\n } else if (email.validity.tooShort) {\n // If the data is too short,\n // display the following error message.\n errorEmail.textContent = `Email should be at least ${email.minLength} characters; you entered ${email.value.length}.`;\n }\n // Set the styling appropriately\n errorEmail.className = \"error active\";\n\n //error for password\n if (password.validity.valueMissing) {\n errorPass.textContent = \"You need to enter a password.\";\n } else if (email.validity.typeMismatch) {\n errorPass.textContent = \"Entered at-least 8 characters.\";\n } else if (email.validity.tooShort) {\n errorPass.textContent = `Password should be at least ${password.minLength} characters; you entered ${password.value.length}.`;\n }\n errorPass.className = \"error active\";\n\n //error for passwordconf\n if (passwordConf.value != password.value) {\n passwordConf.validity.valueMissing;\n errorPassConf.textContent = \"Needs to match password above.\";\n return;\n }\n errorPassConf.className = \"error active\";\n\n //error for zipcode\n if (zipcode.validity.valueMissing) {\n errorZipcode.textContent = \"Needs to be zipcode\";\n } else if (zipcode.validity.typeMismatch) {\n errorZipcode.textContent = \"Entered at-least 8 characters.\";\n } else if (zipcode.validity.tooShort) {\n errorZipcode.textContent = `Password should be at least ${zipcode.minLength} characters; you entered ${zipcode.value.length}.`;\n }\n errorZipcode.className = \"error active\";\n}", "function validateSignUp() {\n \n\t//check to see if the username field is empty\n if (document.getElementById(\"name\").value == null || document.getElementById(\"name\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"fnameerror\").innerHTML= \"*first name not filled in\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"name\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t\n\t//check to see if the password field is empty\n\tif (document.getElementById(\"surname\").value == null || document.getElementById(\"surname\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"snameerror\").innerHTML= \"*surname not filled in\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"surname\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t\n\t//check to see if the age field is empty\n\tif (document.getElementById(\"age\").value == null || document.getElementById(\"age\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"ageerror\").innerHTML= \"*age not selected\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"age\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t//if the users submission returns no false checks, then tell the even handler to execute the onSubmit command\t\t\n\treturn true;\n\t\n}", "function validateForm() {\n if($('.recipient input').val() === \"\") {\n return \"recipient\";\n }else if($('.first-name input').val() === \"\") {\n return \"first name\";\n }else if(emailAvailable === \"taken\") {\n return \"email\";\n }else if($('.password input').val().length < 4){\n return \"password\";\n }else{\n return \"success\";\n }\n }", "function isValidUpdateForm() {\n\tvar name = $(\"#name-update\").val();\n\tvar date = $(\"#date-update\").val();\n\tvar score = $(\"#scores-update\").val();\n\t\n\tvar checkName = isValidName(name);\n\tvar checkDate = isValidDate(date);\n\tvar checkScore = isValidScore(score);\n\t\n\t$(\"#invalid-name-update\").html(\"\");\n\t$(\"#invalid-date-update\").html(\"\");\n\t$(\"#invalid-score-update\").html(\"\");\n\t\n\tif (!checkName || !checkDate || !checkScore) {\n\t\tif (!checkName) {\n\t\t\t$(\"#invalid-name-update\").html(\"Invalid student's name\");\n\t\t}\n\t\tif (!checkDate) {\n\t\t\t$(\"#invalid-date-update\").html(\"Invalid student's date\");\n\t\t}\n\t\tif (!checkScore) {\n\t\t\t$(\"#invalid-score-update\").html(\"Invalid student's score\");\n\t\t}\n\t\treturn false;\n\t}\n\treturn true;\n}", "function processForm() {\n // validate elevation\n if ($('#mtnElevation').val() < 4003 || $('#mtnElevation').val() > 6288) {\n $('#alertMsg').html('Elevation must be between 4,003 and 6,288 feet.');\n $('#mtnElevation').focus();\n $('#alertMsg').show();\n return false;\n }\n\n // validate effort\n if ($('#mtnEffort').val() === '') {\n $('#alertMsg').html('Please select an effort.');\n $('#mtnEffort').focus();\n $('#alertMsg').show();\n return false;\n }\n\n // validate image\n if ($('#mtnImage').val() === '') {\n $('#alertMsg').html('Please enter an image name.');\n $('#mtnImage').focus();\n $('#alertMsg').show();\n return false;\n }\n\n // validate lat / lng\n // Note: Can break into Lat and Lgn checks, and place cursor as needed\n var regex = /^([-+]?)([\\d]{1,2})(((\\.)(\\d+)(,)))(\\s*)(([-+]?)([\\d]{1,3})((\\.)(\\d+))?)$/;\n var latLng = `${$('#mtnLat').val()},${$('#mtnLng').val()}`;\n if (! regex.test(latLng)) {\n $('#alertMsg').html('Latitude and Longitude must be numeric.');\n $('#alertMsg').show();\n return false;\n }\n\n // Form is valid\n $('#alertMsg').html('');\n $('#alertMsg').hide();\n\n return true;\n }", "function validate_form(e) {\n var username = document.getElementById(\"username\").value;\n var password = document.getElementById(\"password\").value;\n if(username.trim() == ''){\n e.preventDefault();\n markAsError(\"username\", true);\n }\n else{\n markAsError(\"username\", false);\n }\n if(password.trim() == ''){\n e.preventDefault();\n markAsError(\"password\", true); \n }\n else{\n markAsError(\"password\", false);\n }\n}", "function formValidator() {\n //create object that will save user's input (empty value)\n let feedback = [];\n //create an array that will save error messages (empty)\n let errors = [];\n //check if full name has a value\n if (fn.value !== ``){\n //if it does, save it\n feedback.fname = fn.value; \n }else {\n //if it doesn't, crete the error message and save it\n errors.push(`<p>Invalid Full Name</p>`);\n }\n \n //for email\n if (em.value !== ``){\n feedback.email = em.value;\n //expression.test(String('[email protected]').toLowerCase()); \n }else {\n errors.push(`<p>Invalid Email</p>`);\n }\n\n //for message\n if (mes.value !== ``){\n feedback.message = mes.value;\n }else {\n errors.push(`<p>Write a comment</p>`)\n }\n \n //create either feedback or display all errors\n if (errors.length === 0) {\n console.log(feedback);\n }else {\n console.log(errors);\n }\n //close event handler\n}", "function checkForm() {\n if (!charactersOK(\"flavor\", \"pizza flavor name\", \n \t\t\t\"`!@#$%^&*()+=[]\\\\\\';,./{}|\\\":<>?\"))\n\treturn false;\n if (!charactersOK(\"desc\", \"flavor description\", \n \t\t\t\"`!@#$%^&*()+=[]\\\\\\';,./{}|\\\":<>?\"))\n\treturn false;\n if (!charactersOK(\"mail\", \"email address\", \"$`\\\\\"))\n\treturn false;\n\tvar x=document.forms[\"pizza\"][\"mail\"].value;\n\tvar atpos=x.indexOf(\"@\");\n\tvar dotpos=x.lastIndexOf(\".\");\n\tif (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)\n\t{\n\t\talert(\"Missing or not a valid email address\");\n\t\treturn false;\n\t}\n}", "function checkforblank(){\n \n var errormessage = \"\";\n\n if(document.getElementById(\"txtname\").value == \"\")\n {\n \n errormessage += \"Enter your full Name \\n\";\n \n }\n\n if(document.getElementById(\"txtuname\").value == \"\")\n {\n \n errormessage += \"Enter your UserName \\n\";\n }\n\n if(document.getElementById(\"txtemail1\").value == \"\")\n {\n errormessage += \"Please Enter your Email \\n\";\n }\n \n if(document.getElementById(\"password1\").value == \"\")\n {\n errormessage += \"Please Enter a Suitable Password \\n\";\n }\n\n if(document.getElementById(\"txtno\").value == \"\")\n {\n errormessage += \"Please Enter a Phone Number with 10 Digits \\n\";\n }\n \n if(document.getElementById(\"txtaddress\").value == \"\")\n {\n errormessage += \"Please Enter an Address for us to Deliver \\n\";\n }\n\n if(errormessage != \"\")\n {\n alert(errormessage);\n return false;\n }\n\n }", "function checkFeedback(myForm)\n{\n //errMsg depends on the language context this form has been called in.\n var errMsg=\"$textLang->{errMsg}\";\n if(myForm.subject.value != \"\" && myForm.message2.value != \"\")\n {\n //The user has filled out the required fields, continue submission.\n\n //if a state has been selected, deselect the country\n if ( myForm.state[0].selected == false )\n {\n myForm.country[0].selected = true;\n }\n //now we return true to allow the form submission\n return true;\n }\n else\n {\n //user forgot to fill in one of the required fields\n alert(errMsg);\n //cancel submit\n return false;\n }\n}", "function validateForm() {\n return name.length > 0 && phone.length > 0;\n }", "function validateForm ()\n {\n\n //Variabele om errors bij te houden\n\n let numberOfErrors = 0;\n\n //Check voornaam\n\n let voornaam = document.getElementById(\"voornaam\");\n let voornaamSpan = document.querySelector(\"#voornaam + span\");\n\n if(voornaam.value.length > 30)\n {\n voornaam.style.borderColor = \"red\";\n voornaamSpan.innerText = \"max 30 karakters !\";\n voornaamSpan.color = \"red\";\n numberOfErrors += 1;\n }\n else //terugzetten van de kleur als er geen fout meer is.\n {\n resetStyle(voornaam, voornaamSpan, numberOfErrors);\n\n }\n\n //Check familienaam\n\n let familienaam = document.getElementById(\"familienaam\");\n let familienaamSpan = document.querySelector(\"#familienaam + span\");\n\n if(familienaam.value === '' || familienaam.value === ' ')\n {\n familienaam.style.borderColor = \"red\";\n familienaamSpan.innerText = \"Het veld is verplicht !\";\n familienaamSpan.style.color = \"red\";\n numberOfErrors += 1;\n }\n else\n {\n if(familienaam.value.length > 50)\n {\n familienaam.style.borderColor = \"red\";\n familienaamSpan.innerText = \"Max 50 karakters\";\n familienaamSpan.style.color = \"red\";\n numberOfErrors += 1;\n }\n else //terugzetten van de kleur als er geen fout meer is.\n {\n resetStyle(familienaam, familienaamSpan, numberOfErrors);\n }\n }\n\n\n\n //Check geboortedatum\n\n let geboortedatum = document.getElementById(\"geboortedatum\");\n let geboortedatumSpan = document.querySelector(\"#geboortedatum + span\");\n\n\n //Gebruik regex expressie. Bemerk dat de expressie tussen twee slashes moet staan.\n\n let regex = /^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/;\n\n //We gebruiken de test() method die we aanroepen over een regex expressie\n //Zie https://www.w3schools.com/js/js_regexp.asp\n //Check dat geboortedatum niet leeg is en dan niet aan het patroon voldoet\n\n if(geboortedatum.value !== '' && regex.test(geboortedatum.value) === false)\n {\n numberOfErrors += 1;\n geboortedatum.style.borderColor = \"red\";\n geboortedatumSpan.innerText = \"Formaat is niet YYYY-MM-DD !\";\n geboortedatumSpan.style.color = \"red\";\n }\n else\n {\n //Check of geboortedatum leeg is\n\n if(geboortedatum.value === '')\n {\n numberOfErrors += 1;\n geboortedatum.style.borderColor = \"red\";\n geboortedatumSpan.innerText = \"Geboortedatum is een verplicht veld !\";\n geboortedatumSpan.style.color = \"red\";\n }\n else\n {\n resetStyle(geboortedatum, geboortedatumSpan, numberOfErrors);\n }\n }\n\n //Check e-mail\n\n let email = document.getElementById(\"email\");\n let emailSpan = document.querySelector(\"#email + span\");\n\n //Regex voor mail geplukt van https://emailregex.com/\n\n regexMail =\n /^(([^<>()\\[\\]\\\\.,;:\\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 //Check email tegen regexMail\n\n if(regexMail.test(email.value) === false)\n {\n numberOfErrors += 1;\n email.style.borderColor = \"red\";\n emailSpan.innerText = \"Geen geldig email adres !\";\n emailSpan.style.color = \"red\";\n }\n\n else\n {\n //Check of email ingevuld is\n\n if(email.value === '' || email.value === ' ')\n {\n numberOfErrors += 1;\n emailSpan.innerText = \"Verplicht veld !\";\n emailSpan.style.color = \"red\";\n email.style.borderColor = \"red\";\n }\n else\n {\n resetStyle(email, emailSpan, numberOfErrors);\n }\n }\n\n //Check aantal kinderen\n\n let aantalKinderen = document.querySelector(\"#aantalKinderen\");\n let aantalKinderenSpan = document.querySelector(\"#aantalKinderen + span\");\n\n if(aantalKinderen.value < 0)\n {\n numberOfErrors += 1;\n aantalKinderen.style.borderColor = \"red\";\n aantalKinderenSpan.innerText = \"is geen positief getal\";\n aantalKinderenSpan.style.color = \"red\";\n }\n else\n {\n if(aantalKinderen.value > 99)\n {\n numberOfErrors += 1;\n aantalKinderen.style.borderColor = \"red\";\n aantalKinderenSpan.innerText = \"te hoog aantal\";\n aantalKinderenSpan.style.color = \"red\";\n }\n else\n {\n resetStyle(aantalKinderen, aantalKinderenSpan, numberOfErrors);\n }\n }\n\n //Geef alert als het formulier volledig correct is\n\n if(numberOfErrors === 0)\n {\n alert(\"formulier correct ingevuld !\")\n }\n }", "function validateForm(event) {\n // Prevent the browser from reloading the page when the form is submitted\n event.preventDefault();\n\n // Validate that the name has a value\n const name = document.querySelector(\"#name\");\n const nameValue = name.value.trim();\n const nameError = document.querySelector(\"#nameError\");\n let nameIsValid = false;\n\n if (nameValue) {\n nameError.style.display = \"none\";\n nameIsValid = true;\n } else {\n nameError.style.display = \"block\";\n nameIsValid = false;\n }\n\n // Validate that the answer has a value of at least 10 characters\n const answer = document.querySelector(\"#answer\");\n const answerValue = answer.value.trim();\n const answerError = document.querySelector(\"#answerError\");\n let answerIsValid = false;\n\n if (checkInputLength(answerValue, 10) === true) {\n answerError.style.display = \"none\";\n answerIsValid = true;\n } else {\n answerError.style.display = \"block\";\n answerIsValid = false;\n }\n\n // Validate that the email has a value and a valid format\n const email = document.querySelector(\"#email\");\n const emailValue = email.value.trim();\n const emailError = document.querySelector(\"#emailError\");\n const invalidEmailError = document.querySelector(\"#invalidEmailError\");\n let emailIsValid = false;\n\n if (emailValue) {\n emailError.style.display = \"none\";\n emailIsValid = true;\n } else {\n emailError.style.display = \"block\";\n emailIsValid = false;\n }\n\n if (checkEmailFormat(emailValue) === true) {\n invalidEmailError.style.display = \"none\";\n emailIsValid = true;\n } else {\n invalidEmailError.style.display = \"block\";\n emailIsValid = false;\n }\n\n // Validate that the answer has a value of at least 15 characters\n const address = document.querySelector(\"#address\");\n const addressValue = address.value.trim();\n const addressError = document.querySelector(\"#addressError\");\n addressIsValid = false;\n\n if (checkInputLength(addressValue, 15) === true) {\n addressError.style.display = \"none\";\n addressIsValid = true;\n } else {\n addressError.style.display = \"block\";\n addressIsValid = false;\n }\n\n // Display form submitted message if all fields are valid\n if (\n nameIsValid === true &&\n answerIsValid === true &&\n emailIsValid === true &&\n addressIsValid === true\n ) {\n submitMessage.style.display = \"block\";\n } else {\n submitMessage.style.display = \"none\";\n }\n}", "function validateForm() {\n // Retrieving the values of form elements \n let name = document.contactForm.name.value;\n let age = document.contactForm.age.value;\n let email = document.contactForm.email.value;\n let mobile = document.contactForm.mobile.value;\n\n // Defining error letiables with a default value\n let nameErr = emailErr = mobileErr = ageErr = true;\n\n // Validate name\n if (name == \"\") {\n printError(\"nameErr\", \"Please enter your name\");\n } else {\n let regex = /^[a-zA-Z\\s]+$/;\n if (regex.test(name) === false) {\n printError(\"nameErr\", \"Please enter a valid name\");\n } else {\n printError(\"nameErr\", \"\");\n nameErr = false;\n }\n }\n // Validate age number\n if (age == \"\") {\n printError(\"ageErr\", \"Please enter your age\");\n } else {\n let regex = /^[1-9]/;\n if (regex.test(age) === false) {\n printError(\"mobileErr\", \"Please enter a valid 10 digit mobile number\");\n } else {\n printError(\"mobileErr\", \"\");\n ageErr = false;\n }\n }\n\n // Validate email address\n if (email == \"\") {\n printError(\"emailErr\", \"Please enter your email address\");\n } else {\n // Regular expression for basic email validation\n let regex = /^\\S+@\\S+\\.\\S+$/;\n if (regex.test(email) === false) {\n printError(\"emailErr\", \"Please enter a valid email address\");\n } else {\n printError(\"emailErr\", \"\");\n emailErr = false;\n }\n }\n\n // Validate mobile number\n if (mobile == \"\") {\n printError(\"mobileErr\", \"Please enter your mobile number\");\n } else {\n let regex = /^[1-9]\\d{9}$/;\n if (regex.test(mobile) === false) {\n printError(\"mobileErr\", \"Please enter a valid 10 digit mobile number\");\n } else {\n printError(\"mobileErr\", \"\");\n mobileErr = false;\n }\n }\n // Prevent the form from being submitted if there are any errors\n if ((nameErr || emailErr || mobileErr || ageErr) == true) {\n return false;\n }\n let arr = [name, age, email, mobile]\n store(arr);\n\n}", "function validateUserInputs(form) {\n\t\tvar errmsg = \"\";\n\t\tvar userid = form.userId.value;\n\t\tvar subscriberId = form.subscriberId.value.toUpperCase();\n\t\tvar memberCode = form.memberCode.value;\n\t\tif( userid == \"\") {\n\t\t\terrmsg += \"<li><span class='leftMargin20'>Please enter a User ID.</span><br /></li>\";\n\t\t}\n else if(!validUser(userid)){\n \terrmsg += \"<li><span class='leftMargin20'>User ID must be at least 7 characters.</span><br /></li>\";\n\t\t}\n\t\tif( subscriberId == \"\") {\n\t\t\terrmsg += \"<li><span class='leftMargin20'>Please enter the Subscriber ID from your Member ID card.</span><br /></li>\";\n\t\t}\n\t\telse if(!validSIDFormat(subscriberId)){\n\t\t\terrmsg += \"<li><span class='leftMargin20'>Subscriber ID format incorrect. Please enter the letters and number in your Subscriber ID as it appears on your BCBSNC ID card.</span><br /></li>\";\n\t\t}\n\t\tif( memberCode == \"\") {\n\t\t\terrmsg += \"<li><span class='leftMargin20'>Please enter the Member Code from your Member ID card.</span><br /></li>\";\n\t\t}\n\t\telse if(!validMemberCode(memberCode)){\n\t\t\terrmsg += \"<li><span class='leftMargin20'>Member Code format incorrect. Please enter the number next to your name as it appears on your BCBSNC ID card.</span><br /></li>\";\n\t\t}\n\t\tif(errmsg) {\n\t\t\t// display error\n\t\t\t$('#passwordForgottenForm .errorBox ul').html(errmsg);\n\t\t\t$('#passwordForgottenForm .errorBox').show();\n\t\t} else {\n\t\t\tvar user = {\n\t\t\t\t\"userId\" : userid,\n\t\t\t\t\"subscriberId\" : subscriberId + memberCode\n\t\t\t};\n\t\t\tprocessSubmission(user);\n\t\t}\n\t\treturn false;\n\t}", "function validate_form(thisform){\n //if (validate_required(instanceName)==false){\n if(false){\n SetErrorMessage(1,\"Hola Yandy, esto es un error\");\n return false;\n }\n return true;\n}", "function validateFieldsUF(){\n \n\n var floraName = document.getElementById('txtFlora');\n var abundance = document.getElementById('txtAbundance');\n var floweringPeriod = document.getElementById('txtFloweringPeriod');\n var park = document.getElementById('txtPark');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyAbundance = false, emptyFloweringPeriod = false, \n emptyPark = false, emptyDescription = false;\n \n if(floraName.value.length < 2){// está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(abundance.value.length < 2){//está vacia\n document.getElementById('msgErrorAbundance').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorAbundance').style.visibility = \"hidden\";\n }//end else\n \n if(floweringPeriod.value.length < 2){//está vacia\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"visible\";\n emptyFloweringPeriod = true;\n }else{\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyAbundance === true || emptyDescription === true || emptyFloweringPeriod === true || \n emptyName === true || emptyPark === true){\n return false;\n }else{\n return true;\n }\n}//end validateFieldsUF", "function validate(form){\r\n\t\t//check if values are empty\r\n\t\tif(valid)\r\n\t\t{\r\n\t\t\talert(\"This note will be archived!\");\r\n\t\t}\r\n\t}", "function invalidFormInput() {\n return (modalTransfer.form.cusipTr === undefined);\n }", "function validateForm(){\n\n // Here, four variables are created and values obtained from form are stored in each of them accordingly.\n var name = document.forms[\"messageBox\"][\"name\"].value;\n var email = document.forms[\"messageBox\"][\"email\"].value;\n var subject = document.forms[\"messageBox\"][\"subject\"].value;\n var message = document.forms[\"messageBox\"][\"message\"].value;\n\n // This line of code is executed when all the fields are left empty.\n if(name == \"\" && email == \"\" && subject == \"\" && message == \"\"){\n alert(\"Form is empty, please complete the form.\");\n }\n\n // This line of code is executed when the name field is left empty.\n else if(name == \"\"){\n alert(\"Field for name is empty, please enter your name.\");\n }\n\n // This line of code is executed when email field is left empty.\n else if(email == \"\"){\n alert(\"E-mail address hasn't beed filled, please enter your e-mail address.\");\n }\n \n // This line of code is executed when subject field is left empty.\n else if(subject == \"\"){\n alert(\"The subject of message is empty, please enter appropriate subject.\");\n }\n\n // This line of code is executed when the message field is left empty.\n else if(message == \"\"){\n alert(\"No message is written, please write what you want to say.\");\n }\n\n // This line of code is executed when all the fields are filled.\n else{\n alert(\"Thankyou for the message \" + name + \" , your message would be considered.\");\n }\n \n}", "function mdm_error(message) { document.getElementById(\"error\").innerHTML = 'try again'; }", "function Validation1()\n{\n if ($(\"txtAdjective1\").value === \"\")\n {\n $(\"error1\").innerHTML = \"Please enter your answer above. **Example: Dirty\";\n return false;\n }\n return true;\n}", "function setFormErrorMessage(msg) {\n setFormErrorState(msg)\n }", "function checkqual() {\n if($('#qual1').val() == ''){\n $('#qualerr').html(\"Enter your Qualification\");\n $('#qualerr').show();\n err_qual = true;\n }else {\n $('#qualerr').hide();\n }\n }", "function checkNewForm(){\n let formElement = document.querySelector(\"#checkNewForm\");\n let fornavn = formElement.fornavn;\n let efternavn = formElement.efternavn;\n let email = formElement.email;\n let postnr = formElement.postnr;\n let by_navn = formElement.by;\n\n //Tjek fornavn\n if(fornavn.value === \"\"){\n console.log(\"Tjekker navn\");\n failtext(\"#namefail\", \"Du skal indtaste dit navn\");\n return false;\n }else if (!/^[a-zA-Z]*$/){\n failtext(\"#namefail\", \"Du kan kun bruge bogstaver i dit navn\");\n return false;\n }else{\n clear(\"#namefail\");\n }\n\n //Tjek efternavn\n if(efternavn.value === \"\"){\n console.log(\"Tjekker efternavn\");\n failtext(\"#enamefail\", \"Du skal indtaste dit efternavn\");\n return false;\n } else if (!/^[a-zA-Z]*$/) {\n failtext(\"#enamefail\", \"Du kan kun bruge bogstaver i dit efternavn\");\n return false;\n } else{\n clear(\"#enamefail\");\n }\n\n //Tjek email\n if(email.value === \"\"){\n console.log(\"tjekker email\");\n failtext(\"#emailfail\", \"Du skal indtaste en email\");\n return false;\n }else if (!/([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 failtext(\"#emailfail\", \"Du skal skrive en valid email\");\n return false;\n }else {\n clear(\"#emailfail\");\n }\n\n //Tjek postnr\n if(postnr.value === \"\"){\n console.log(\"tjekker postnr\");\n failtext(\"#postfail\", \"Du skal indtaste dit postnummer\");\n return false;\n }else if (postnr.value.length != 4){\n failtext(\"#postfail\", \"Dit postnummer skal bestå af 4 cifre\");\n return false;\n }else {\n clear(\"#postfail\");\n }\n\n //Tjek by\n if(by_navn.value === \"\"){\n console.log(\"tjekker bynavn\");\n failtext(\"#byfail\", \"Du skal indtaste den by du bor i\");\n return false;\n }else if (!/^[a-zA-ZæøåÆØÅ]*$/){\n failtext(\"#byfail\", \"Du kan kun bruge bogstaver i by navnet\");\n return false;\n }else if(by_navn.value.length < 2){\n failtext(\"#byfail\", \"Du skal indtaste et valideret bynavn\");\n return false;\n }else{\n clear(\"#byfail\");\n }\n}", "function invalid()\n\t{\n \t if(document.getElementById(\"project_title\").value == \"\")\n \t\t{\n\t \t\t\talert(\"Please Enter Project Title! \");\n\t\t\t\tdocument.getElementById(\"project_title\").focus()\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\tif(document.getElementById(\"short_desc\").value == \"\")\n \t\t{\n\t \t\talert(\"Please Enter Short Description! \");\n\t\t\tdocument.getElementById(\"short_desc\").focus()\n\t\t\treturn false;\n\t\t} \n\tif(document.getElementById(\"file\").value == \"\")\n \t\t{\n\t \t\talert(\"Please Enter Upload Image! \");\n\t\t\tdocument.getElementById(\"file\").focus()\n\t\t\treturn false;\n\t\t} \n\tif(document.getElementById(\"description\").value == \"\")\n \t\t{\n\t \t\talert(\"Please Enter Description! \");\n\t\t\tdocument.getElementById(\"description\").focus()\n\t\t\treturn false;\n\t\t} \t\n \t}", "function formErrorDisplay() {\n\n const errorDisplay = (tag, message, valid) => {\n const container = document.querySelector(`.${tag}-container`);\n const span = document.querySelector(`.${tag}-container > span`);\n\n\n if (!valid) {\n container.classList.add('error');\n span.textContent = message;\n } else {\n container.classList.remove('error');\n span.textContent = message;\n }\n };\n\n //Récupérer les données saisis dans le champ adresse\n const adresseChecker = (value) => {\n\n if (value.length > 0 && (value.length < 3 ||\n value.length > 40)) {\n errorDisplay('adresse', \"Votre adresse doit etre entre 3 et 10 caractères\");\n address = null;\n } else if (!value.match(/^[a-zA-Z0-9_.-]*$/)) {\n\n errorDisplay('adresse', \"Votre adresse ne doit pas contenir de caractères spéciaux\");\n address = null;\n } else {\n errorDisplay('adresse', '', true);\n address = value;\n }\n\n };\n //Récupérer les données saisis dans le champ email\n const emailChecker = (value) => {\n\n if (!value.match(/^[\\w_-]+@+[\\w-]+\\.[a-z]{2,4}$/i)) {\n errorDisplay('email', \"Le mail n'est pas valide\");\n email = null;\n\n } else {\n errorDisplay('email', '', true);\n email = value;\n\n }\n };\n //Récupérer les données saisis dans le champ city\n const cityChecker = (value) => {\n if (value.length > 0 && (value.length < 3 ||\n value.length > 10)) {\n\n errorDisplay('city', \"Votre ville doit etre entre 3 et 10 caractères\");\n city = null;\n } else if (!value.match(/^[a-zA-Z0-9_.-]*$/)) {\n\n errorDisplay('city', \"Votre ville ne doit pas contenir de caractères spéciaux\");\n city = null;\n } else {\n errorDisplay('city', '', true);\n city = value;\n }\n };\n //Récupérer les données saisis dans le champ firstName\n const userChecker = (value) => {\n\n //Si le numéro de l'utilsateur ne respecte pas les conditions requises \n if (value.length > 0 && (value.length < 3 ||\n value.length > 20)) {\n errorDisplay('pseudo', 'Le nom doit etre entre 3 et 20 caractères');\n firstName = null;\n\n }\n\n //SI le nom de l'utilisateur contient des caractères spéciaux\n else if (!value.match(/^[a-zA-Z0-9_.-]*$/)) {\n errorDisplay('pseudo', 'Votre nom ne doit pas contenir de caractères spéciaux ');\n firstName = null;\n\n } else {\n errorDisplay('pseudo', '', true);\n firstName = value;\n\n\n }\n };\n //Récupérer les données saisis dans le champ LastName\n const LastNameChecker = (value) => {\n if (value.length > 0 && (value.length < 3 ||\n value.length > 20)) {\n\n errorDisplay('lastname', \"Votre prenom doit etre entre 3 et 20 caractères\");\n lastName = null;\n\n } else if (!value.match(/^[a-zA-Z0-9_.-]*$/)) {\n\n errorDisplay('lastname', \"Votre prenom ne doit pas contenir de caractères spéciaux\");\n lastName = null;\n } else {\n errorDisplay('lastname', '', true);\n lastName = value;\n }\n };\n\n //Récupérer les valeurs des inputs et les stocker dans une boucle\n inputs.forEach((input) => {\n input.addEventListener('input', (e) => {\n\n switch (e.target.id) {\n case \"firstname\":\n userChecker(e.target.value);\n break;\n case \"lastname\":\n LastNameChecker(e.target.value);\n break;\n\n case \"address\":\n adresseChecker(e.target.value);\n break;\n case \"city\":\n cityChecker(e.target.value);\n break;\n case \"email\":\n emailChecker(e.target.value);\n default:\n null;\n }\n });\n });\n\n }", "function adderr(txt) { return !fields.attr(\"required\", false).mbError(txt); }", "function checkForm() {\n let isValid = true;\n let errors_messages = [];\n\n // Check all input\n document.querySelectorAll(\"#signup_form input\").forEach(input => {\n if (!input.value) {\n errors_messages.push(input.name + \"is missing.\");\n isValid = false;\n }\n })\n\n // Check all select\n document.querySelectorAll(\"#signup_form select\").forEach(select => {\n if (!select.value) {\n errors_messages.push(select.name + \"is missing.\");\n isValid = false;\n }\n })\n\n // Check if the password and the re password are the same\n if (passwordInput.current.value !== repasswordInput.current.value) {\n errors_messages.push(\"Password and Re-password are not the same.\");\n isValid = false;\n }\n\n // Check if the user is 18 years or older\n if (!checkAge(document.querySelector(\"input[id=birthdate]\"))) {\n errors_messages.push(\"You must be at least 18 years old.\");\n isValid = false;\n }\n\n // Show all information about the form\n if (!isValid) {\n let html_return = \"<ul>\";\n errors_messages.forEach(error => {\n html_return += \"<li>\" + error + \"</li>\"\n })\n html_return += \"</ul>\";\n\n UIkit.notification({\n message: html_return,\n status: 'danger',\n pos: 'top-right',\n timeout: 5000\n });\n }\n\n return isValid;\n }", "function validateNewBusiness(form){\n error = false\n field = form.querySelector(\"[name=new_business_name\")\n if(!field.value){\n message=\"Provide the business name\"\n error = true\n }\n if(error) {\n alert(message)\n return false\n }\n return true\n}", "function validate_form_goal()\n{\n\t// season (only need to check if season2 is not empty)\n\tbseason = document.createitem.season2.value != \"\";\n\tif (!bseason)\n\t{\n\t\tdocument.createitem.season.value = 0;\n\t}\n\telse\n\t{\n\t\tdocument.createitem.season.value = document.createitem.season1.value + \"/\" + document.createitem.season2.value\n\t}\n\t\t\n\t\t\n\t// At this point, if bok equals true, then the details have been filled correctly\n\t////////////////////////////////////////////////////////////////////////\n\t\n\t// submit form if it has been correctly populated\n\tshow_topscorers(\"div_topscorer\",\"get_topscorer.php\")\n}", "function posterror() { alert( \"There was an error. TODO: Prompt to resubmit here.\" ); }", "function validInputs(){\n \n // if first.value is empty and is different regex(textInput),\n //or first.length is less than 2 characters => error message\n if(textInput.exec(first.value) === null || first.length < 2) {\n firstError.textContent = \"Veuillez renseigner 2 caractères minimum pour le prénom\";\n firstError.style.color = \"red\";\n firstError.style.fontSize = \"15px\";\n first.style.borderColor = \"red\";\n first.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n firstError.style.display = \"none\";\n first.style = \"default\";\n }\n\n // if last.value is empty and is different regex(textInput),\n //or last.length is less than 2 characters => error message\n\n if(textInput.exec(last.value) === null || last.length < 2) {\n lastError.textContent = \"Veuillez renseigner 2 caractères minimum pour le nom\";\n lastError.style.color = \"red\";\n lastError.style.fontSize = \"15px\";\n last.style.borderColor = \"red\";\n last.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n lastError.style.display = \"none\";\n last.style = \"default\";\n }\n\n // if email doesn't correspond to regex => message error\n \n if(mailInput.exec(email.value) === null) {\n emailError.textContent = \"Veuillez renseigner une adresse mail valide\";\n emailError.style.color = \"red\";\n emailError.style.fontSize = \"15px\";\n email.style.borderColor = \"red\";\n email.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n emailError.style.display = \"none\";\n email.style = \"default\";\n }\n\n if(!birthDate.value) {\n birthDateError.textContent = \"Veuillez indiquer votre date de naissance\";\n birthDateError.style.color = \"red\";\n birthDateError.style.fontSize = \"15px\";\n birthDate.style.borderColor = \"red\";\n birthDate.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n birthDateError.style.display = \"none\";\n birthDate.style = \"default\";\n }\n\n // if quantity.value is empty or its value is not a number => message error\n if(quantity.value === \"\" || isNaN(quantity.value)) {\n quantityError.textContent = \"Veuillez renseigner le nombre de participation au tournoi\";\n quantityError.style.color = \"red\";\n quantityError.style.fontSize = \"15px\";\n quantity.style.borderColor = \"red\";\n quantity.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n quantityError.style.display = \"none\";\n quantity.style = \"default\";\n }\n\n //if no cities are chosen => message error\n if (!(location1[0].checked || location1[1].checked || location1[2].checked || location1[3].checked || \n location1[4].checked || location1[5].checked)) {\n\n locationError.textContent = \"Veuillez indiquer une ville\";\n locationError.style.color = \"red\";\n locationError.style.fontSize = \"15px\";\n return formValid === false;\n } else {\n locationError.style.display = \"none\";\n location2.style = \"default\";\n }\n\n //if terms of use are not accepted => message error\n\n if(!checkBox1.checked) { \n cguError.textContent = \"Veuillez accepter les conditions d'utilisation\";\n cguError.style.color = \"red\";\n cguError.style.fontSize = \"15px\";\n checkBox1.style.borderColor = \"red\";\n checkBox1.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n cguError.style.display = \"none\";\n checkBox1.style = \"default\";\n }\n return formValid = true;\n}", "function validateForm() {\n return username.length > 0 && password.length > 0;\n }", "function userResponse() {\n \n var x = document.forms[\"SafetyTest\"][\"fname\"].value;\n if (x == \"\") {\n alert(\"Name must be filled out\");\n return false;\n }\n\n \n}", "function wpabstracts_validateUser(){\n var errors = false;\n if(document.getElementById('first_name').value=='') {\n errors = true;\n document.getElementById('firstname_error').style.display='inline';\n document.getElementById('firstname_error').style.color='red';\n }\n else {\n document.getElementById('firstname_error').style.display='none';\n }\n if(document.getElementById('last_name').value == '') {\n errors = true;\n document.getElementById('lastname_error').style.display='inline';\n document.getElementById('lastname_error').style.color='red';\n }\n else {\n document.getElementById('lastname_error').style.display='none';\n }\n if(document.getElementById('username').value == '') {\n errors = true;\n document.getElementById('username_error').style.display='inline';\n document.getElementById('username_error').style.color='red';\n }\n else {\n document.getElementById('username_error').style.display='none';\n }\n if(document.getElementById('password').value == '') {\n errors = true;\n document.getElementById('password_error').style.display='inline';\n document.getElementById('password_error').style.color='red';\n }\n else {\n document.getElementById('password_error').style.display='none';\n }\n if(document.getElementById('email').value == '') {\n errors = true;\n document.getElementById('email_error').style.display='inline';\n document.getElementById('email_error').style.color='red';\n }\n else {\n document.getElementById('email_error').style.display='none';\n }\n if(document.getElementById('user_level').value == '') {\n errors = true;\n document.getElementById('userlevel_error').style.display='inline';\n document.getElementById('userlevel_error').style.color='red';\n }\n else {\n document.getElementById('userlevel_error').style.display='none';\n }\n if(errors) {\n alert(front_ajax.fillin);\n } else {\n document.getElementById('new_user').submit();\n }\n\n}", "function validate(){\n let isErrors = false;\n let firstName = formReserve['firstName'];\n let lastName = formReserve['lastName'];\n let phone = formReserve['phone'];\n let email = formReserve['email'];\n let age = formReserve['birthdate'];\n let quantity = formReserve['quantity'];\n let location = formReserve['location'];\n let cgv = formReserve['cgv'];\n document.querySelectorAll('.error').forEach(error => error.remove());\n document.querySelectorAll('.error--bg').forEach(error => error.classList.remove('error--bg'));\n if(!nameCheked(firstName.value)){\n isErrors = true;\n firstName.classList.add('error--bg');\n firstName.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer 2 caractères ou plus pour le prénom.'));\n }\n if(!nameCheked(lastName.value)){\n isErrors = true;\n lastName.classList.add('error--bg');\n lastName.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer 2 caractères ou plus pour le nom.'));\n }\n if(!isPhone(phone.value)){\n isErrors = true;\n phone.classList.add('error--bg');\n phone.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer un numéro de téléphone valide.'));\n }\n if(!isEmail(email.value)){\n isErrors = true;\n email.classList.add('error--bg');\n email.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer une adresse mail valide.'));\n }\n if(!checkAge(age.value)){\n isErrors = true;\n age.classList.add('error--bg');\n age.insertAdjacentElement('afterend', createErrorSpan('Vous devez avoir au moins 18 ans.'));\n }\n if(!isNumeric(quantity.value)){\n isErrors = true;\n quantity.classList.add('error--bg');\n quantity.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer une valeur comprise entre 0 et 99.'));\n }\n if(!atLeastOneCheck(location)){\n isErrors = true;\n location[0].parentNode.classList.add('error--bg');\n document.getElementsByClassName(\"formData\")[6].insertAdjacentElement('afterend', createErrorSpan('Vous devez choisir au moins une ville.'));\n }\n if(!checkboxChecked(cgv)){\n isErrors = true;\n document.getElementsByClassName(\"checkbox2-label\")[0].children[0].classList.add('error--bg');\n document.getElementsByClassName(\"checkbox2-label\")[0].insertAdjacentElement('afterend', createErrorSpan('Vous devez accepter les termes et conditions.'));\n }\n if(isErrors == true){\n return false;\n } else {\n let participant = {\n firstname: firstName.value,\n lastname: lastName.value,\n phonenumber: phone.value,\n email: email.value,\n birthdate: age.value,\n previousparticipations : quantity.value,\n location: location.value\n };\n const bio = () => {\n this.firstName + this.lastname + 'né(e) le' + this.birthdate + 'tél : ' + this.phonenumber + this.email + 'A déjà participé : ' + this.previousparticipation + 'à' + this.location + '.';\n } \n formReserve.style.display = 'none';\n modalBody.classList.add('message-sended');\n valmessage.innerHTML='Merci, votre formulaire a bien été envoyé !';\n modalBody.append(valmessage);\n buttonClose.classList.add('button','button:hover','button-close');\n buttonClose.innerHTML = \"Fermer\";\n modalBody.appendChild(buttonClose);\n buttonClose.addEventListener (\"click\", closeModal);\n return false; \n }\n}", "function validateRegister(form) {\n var alertMsg = \"\"; // Stores the message to display to user indicating which fields are entered incorrectly\n var checkEntry = true; // Is true if all fields are entered correctly, set to false if a field is entered incorrectly\n if (form.fname.value == \"\") {\n //checks to see if First Name field contains user input\n window.alert(\"No First Name entered.\");\n return false;\n }\n if (form.lname.value == \"\") {\n //checks to see if Last Name field contains user input, if not the validate function returns false\n window.alert(\"No Last Name entered.\");\n return false;\n }\n if (form.uname.value == \"\") {\n //checks to see if Username field contains user input, if not the validate function returns false\n window.alert(\"No Username entered.\");\n return false;\n }\n if (form.emailadd.value == \"\") {\n //checks to see if Email address field contains user input, if not the validate function returns false\n window.alert(\"No Email entered.\");\n return false;\n }\n if (form.pass.value == \"\") {\n //checks to see if Password field contains user input, if not the validate function returns false\n window.alert(\"No Password entered.\");\n return false;\n }\n\n if (!validateName(form.fname.value)) {\n //checks to see if First Name entry is in the appropriate format\n var el = document.getElementsByName(\"fname\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"First Name cannot begin with a space, contain 2 consecutive spaces or digits and must be at least 2 characters long.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"fname\")[0].style.backgroundColor = \"white\";\n }\n if (!validateName(form.lname.value)) {\n //checks to see if Last Name entry is in the appropriate format\n var el = document.getElementsByName(\"lname\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Last Name cannot begin with a space, contain 2 consecutive spaces or digits and must be at least 2 characters long.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"lname\")[0].style.backgroundColor = \"white\";\n }\n if (!validateUsername(form.uname.value)) {\n //checks to see if Username entry is in the appropriate format\n var el = document.getElementsByName(\"uname\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Username cannot contain spaces and must be at least 5 characters long.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"uname\")[0].style.backgroundColor = \"white\";\n }\n if (!validateEmail(form.emailadd.value)) {\n //checks to see if Email address entry is in the appropriate format\n var el = document.getElementsByName(\"emailadd\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Email address must contain at least one valid character followed by '@' and a valid domain name and extension.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"emailadd\")[0].style.backgroundColor = \"white\";\n }\n if (!validatePassword(form.pass.value)) {\n //checks to see if Password entry is in the appropriate format\n var el = document.getElementsByName(\"pass\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Password must be 8 characters long and contain at least 1 lowercase and 1 uppercase letter and 1 digit.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"pass\")[0].style.backgroundColor = \"white\";\n }\n if (!checkEntry) {\n //if any of the input fields have an entry in an incorrect format\n window.alert(alertMsg); //displays an error message for each incorrect field to user\n return false; //the validate function returns fa;se\n }\n\n return true; //All input fields contain values in the correct format so the validate function returns true\n}", "function check_form_verify () {\n const form = document.getElementById('form_verify');\n const error = document.getElementById('form_verify_error');\n error.style.display = 'none';\n if (form.diplom.value == '') {\n error.innerHTML = 'Please select a diplom.';\n error.style.display = 'block';\n return false;\n } else if (!(2010 <= parseInt(form.awarding_year.value, 10) && parseInt(form.awarding_year.value, 10) <= 2019)) {\n error.innerHTML = 'Please fill in a valid awarding date. (2010 -> 2019)';\n error.style.display = 'block';\n return false;\n } else if (!form.student_name.value.match(/^[A-Za-z ]+$/)) {\n error.innerHTML = 'Please fill in a valid name. What I call a \"valid name\" is a name given with only letters and spaces.<br>\\\n Ex: \"Jean-Pierre Dupont\" should be entered as \"Jean Pierre Dupont\"';\n error.style.display = 'block';\n return false;\n }\n const birthdate = form.student_birthdate.value.split('/');\n if (birthdate.length != 3) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1 <= parseInt(birthdate[0], 10) && parseInt(birthdate[0], 10) <= 31)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1 <= parseInt(birthdate[1], 10) && parseInt(birthdate[1], 10) <= 12)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1919 <= parseInt(birthdate[2], 10) && parseInt(birthdate[2], 10) <= 2019)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995 with the 1919 <= year <= 2019';\n error.style.display = 'block';\n return false;\n }\n const txid = form.txid.value;\n if (txid.length != 64) {\n error.innerHTML = 'Please fill in a valid transaction identifier (txid). This is a 64 characters hexadecimal value.';\n error.style.display = 'block';\n return false;\n }\n return true;\n}", "function getFormIsValid() {\n return interactedWith && !getFieldErrorsString()\n }", "function validateInput() {\n // Get the users vales from the DOM\n const nameInput = document.getElementById(\"name-input\").value;\n const emailInput = document.getElementById(\"email-input\").value;\n const messageInput = document.getElementById(\"message-box\").value;\n\n // If any of them are blank show an error message\n if (!nameInput) userMessage(\"Please fill out the name field\", true);\n else if (!emailInput) userMessage(\"Please fill out the email field\", true);\n else if (!emailInput.includes('@')) userMessage(\"Please enter a valid email address\", true);\n else if (!emailInput.includes('.')) userMessage(\"Please enter a valid email address\", true);\n else if (!messageInput) userMessage(\"Please fill out the message field\", true);\n else userMessage(\"<p>Thank you for your message!</p> <p>You have instantly become a member of our cooking community!</p>\", false);\n}", "function validateForm(){\n // Set error catcher\n var error = 0;\n // Check name\n if(!validateName('reg_name')){\n document.getElementById('nameError').style.display = \"block\";\n error++;\n }\n // Validate email\n var x =document.getElementById('reg_email').value;\n if(!validateEmail(x)){\n document.getElementById('emailError').style.display = \"block\";\n error++;\n }\n // Validate animal dropdown box\n if(!validateSelect('Occupation')){\n document.getElementById('animalError').style.display = \"block\";\n error++;\n }\n if(!validatePassword('reg_pass')){\n document.getElementById('pass_Error').style.display = \"block\";\n error++;\n }\n // Don't submit form if there are errors\n if(error > 0){\n return false;\n }\n else if(error == 0){\n regfun();\n }\n }", "function validate() {\n\t\t//Invaild entry responces.\n\t\tvar nameConf = \"Please provide your Name.\";\n\t\tvar emailConf = \"Please provide your Email.\";\n\t\tvar phoneConf = \"Please provide a valid Phone Number.\";\n\t\t\n\t\t//Regular Expression validation.\n\t\tvar phoneNumber = /^\\d{10}$/; //validate that the user enters a 10 digit phone number\n\t\n\t if(document.myForm.name.value === \"\" ) {\n\t document.getElementById(\"valConf\").innerHTML = nameConf;\n\t document.myForm.name.focus();\n\t return false;\n\t }\n\t \n\t if(document.myForm.email.value === \"\" ) {\n\t document.getElementById(\"valConf\").innerHTML = emailConf;\n\t document.myForm.email.focus();\n\t return false;\n\t }\n\t \n\t \tif(document.myForm.phone.value.match(phoneNumber) ) {\n\t document.getElementById(\"valConf\").innerHTML = phoneConf;\n\t document.myForm.phone.focus();\n\t return false;\n\t }\n\t} //form validation to confirm the form isn't empty ", "function validateForm()\n {\n var firstname=document.forms[\"UserForm\"][\"field_first_name\"].value;\n var birthdate=document.forms[\"UserForm\"][\"field_birthdate\"].value;\n var email=document.forms[\"UserForm\"][\"mail\"].value;\n var phone=document.forms[\"UserForm\"][\"field_mobile\"].value;\n\t\t\t var pass=document.forms[\"UserForm\"][\"pass\"].value;\n\t\t\t var pass2=document.forms[\"UserForm\"][\"passconfirm\"].value;\n\n if (firstname==null || firstname==\"\")\n\t\t\t \n {\n\t\t\t document.getElementById('fn_validation').innerHTML=\"this is invalid name\";\n return false;\n\t\t\t \n }\n\t\t\telse\n\t\t\t{\n\t\t\t document.getElementById('fn_validation').innerHTML=\"\";\n\t\t\t}\n\t\t\t//\n\t\t if (birthdate==null || birthdate==\"\" || !(validatebirthdate(birthdate)))\n\t\t\t{\n\t\t\t document.getElementById('birth_validation').innerHTML=\"this is invalid date\";\n return false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t document.getElementById('birth_validation').innerHTML=\"\";\n\t\t\t}\n\t\t\t//\n\t\t\tif (email==null || email==\"\" || validateEmail(email)==false)\n\t\t\t{\n\t\t\t document.getElementById('email_validation').innerHTML=\"this is invalid email\";\n return false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t document.getElementById('email_validation').innerHTML=\"\";\n\t\t\t}\n\t\t\t//\n\t\t\tif (!(validateMobileNum(phone)))\n\t\t\t{\n\t\t\t document.getElementById('phone_validation').innerHTML=\"this is invalid mobile number\";\n return false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t document.getElementById('phone_validation').innerHTML=\"\";\n\t\t\t}\n\t\t\t//\n\t\t\tif (pass==null || pass==\"\" || pass.length < 6)\n\t\t\t{\n\t\t\t document.getElementById('pass_validation').innerHTML=\"this is invalid password\";\n return false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t document.getElementById('pass_validation').innerHTML=\"\";\n\t\t\t}\n\t\t\t//\n\t\t\tif (pass2!= pass )\n\t\t\t{\n\t\t\t document.getElementById('pass2_validation').innerHTML=\"this is invalid password\";\n return false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t document.getElementById('pass2_validation').innerHTML=\"\";\n\t\t\t}\n\t\t\t\n\t\t\t\n }", "function validateFieldsUP(){\n \n var namePark = document.getElementById('txtName');\n var location = document.getElementById('txtLocation');\n var contact = document.getElementById('txtContact');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyLocation = false, emptyContact = false, \n emptyDescription = false;\n \n if(namePark.value.length < 2){//el parque est� vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(location.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorLocation').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorLocation').style.visibility = \"hidden\";\n }//end else\n \n if(contact.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorContact').style.visibility = \"visible\";\n emptyContact = true;\n }else{\n document.getElementById('msgErrorContact').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyContact === true || emptyDescription === true || \n emptyLocation === true || emptyName === true){\n return false;\n }else{\n return true;\n }\n}", "function verifForm(f)\r\n{\r\n var nameOk = verifName(f.name);\r\n var mailOk = verifMail(f.mail);\r\n var subjectOk = verifSubject(f.subject);\r\n var messageOk = verifMessage(f.message);\r\n\r\n if(nameOk && mailOk && subjectOk && messageOk)\r\n return true;\r\n else\r\n {\r\n alert(\"Please fill the fields correctly.\");\r\n return false;\r\n }\r\n}", "function validateForm(){\n\n var fname = document.forms[\"userDetails\"][\"first_name\"].value;\n var lname = document.forms[\"userDetails\"][\"last_name\"].value;\n var city = document.forms[\"userDetails\"][\"city_name\"].value;\n var uname = document.forms[\"userDetails\"][\"Username\"].value;\n var password = document.forms[\"userDetails\"][\"Password\"].value;\n\n if (fname == null || lname == \"\" || city == \"\" || uname == \"\" || password == \"\"){\n swal({\n title: \"Error! Fields Empty!\",\n text: \"Please check the missing field\",\n icon: \"warning\",\n button: \"Ok\"\n });\n //alert(\"All details required were not supplied\");\n return false;\n }\n\n\n return true;\n\n}", "function checkUserForm(form)\n {\n console.log(\"checkuserForm\");\n //check empty fields\n if (validateUserEmptyInput(form) == false) {\n return false;\n }\n \n\n // validation fails if the input doesn't match our regular expression\n if(!reg.test(form.fName.value)) {\n alert(\"Error: Please input characters only!\");\n form.fName.focus();\n return false;\n }\n\n if(!reg.test(form.mInitial.value)) {\n alert(\"Error: Please input characters only!\");\n form.mInitial.focus();\n return false;\n }\n if(!reg.test(form.lName.value)) {\n alert(\"Error: Please input characters only!\");\n form.lName.focus();\n return false;\n }\n\n if(!reg.test(form.userName.value)) {\n alert(\"Error: Please input characters only!\");\n form.userName.focus();\n return false;\n }\n\n if(form.passPhrase.value.length < 6) {\n alert(\"Error: Please input more than 6 characters!\");\n form.passPhrase.focus();\n return false; \n }\n // regular expression to match only alphanumeric characters for password\n var passreg = /^[\\w]+$/;\n if(!passreg.test(form.passPhrase.value)) {\n alert(\"Error: Please input alphanumeric characters without spaces!\");\n form.passPhrase.focus();\n return false;\n }\n\n // validation was successful\n return true;\n }", "function validateForm() {\n\n\tvar emaildMandatory = \"\";\n\tvar passwordMandatory = \"\";\n\tvar countryMandatory = \"\";\n\tvar lScoreMandatory = \"\";\n\tvar sScoreMandatory = \"\";\n\tvar wScoreMandatory = \"\";\n\tvar rScoreMandatory = \"\";\n\tvar genderMandatory = \"\";\n\tvar lDateMandatory = \"\";\n\tvar dobMandatory = \"\";\n\tvar proMandatory = \"\"\n\tvar credentialMandatory = \"\"\n\tvar isFormValid = true;\n\tvar crsScoreMandatory = \"\";\n\n\tif (String(document.getElementById(\"email\").value).length == 0) {\n\t\t$(\"#email\").css('width', '935px');\n\t\t$(\"#email\").css('border-right-style', 'solid');\n\t\t$(\"#email\").css('border-right-color', 'red');\n\t\t$(\"#email\").css('border-right-width', '15px');\n\t\t$(\"#email\").css('border-radius', '3px');\n\t\temaildMandatory = \"*Email is Mandatory\";\n\t\tisFormValid = false;\n\t} else if (!validateEmail(document.getElementById(\"email\").value)) {\n\t\t$(\"#email\").css('width', '935px');\n\t\t$(\"#email\").css('border-right-style', 'solid');\n\t\t$(\"#email\").css('border-right-color', 'red');\n\t\t$(\"#email\").css('border-right-width', '15px');\n\t\t$(\"#email\").css('border-radius', '3px');\n\t\temaildMandatory += \"*Entered Email is invalid\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#email\").css('width', '935px');\n\t\t$(\"#email\").css('border-right-style', 'solid');\n\t\t$(\"#email\").css('border-right-color', 'green');\n\t\t$(\"#email\").css('border-right-width', '15px');\n\t\t$(\"#email\").css('border-radius', '3px');\n\t}\n\n\tif (!validateGender()) {\n\t\tgenderMandatory += \"*Gender is Mandatory\";\n\t\t$(\"#malediv\").css('width', '935px');\n\t\t$(\"#malediv\").css('border-radius', '3px');\n\t\t$(\"#malediv\").css('border-right-style', 'solid');\n\t\t$(\"#malediv\").css('border-right-color', 'red');\n\t\t$(\"#malediv\").css('border-right-width', '15px');\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#malediv\").css('width', '935px');\n\t\t$(\"#malediv\").css('border-radius', '3px');\n\t\t$(\"#malediv\").css('border-right-style', 'solid');\n\t\t$(\"#malediv\").css('border-right-color', 'green');\n\t\t$(\"#malediv\").css('border-right-width', '15px');\n\t}\n\n\tif (!validateCountry()) {\n\t\t$(\"#coc\").css('border-right-style', 'solid');\n\t\t$(\"#coc\").css('border-right-color', 'red');\n\t\t$(\"#coc\").css('border-right-width', '15px');\n\t\t$(\"#coc\").css('border-radius', '3px');\n\t\tcountryMandatory += \"*Country is Mandatory\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#coc\").css('border-right-style', 'solid');\n\t\t$(\"#coc\").css('border-right-color', 'green');\n\t\t$(\"#coc\").css('border-right-width', '15px');\n\t\t$(\"#coc\").css('border-radius', '3px');\n\t}\n\n\tif (!validateCRS()) {\n\t\tif ($('#calButton').is(':visible')) {\n\t\t\t$(\"#crs\").css('width', '935px');\n\t\t\t$(\"#crs\").css('border-radius', '3px');\n\t\t\t$(\"#crs\").css('border-right-style', 'solid');\n\t\t\t$(\"#crs\").css('border-right-color', 'red');\n\t\t\t$(\"#crs\").css('border-right-width', '15px');\n\t\t\tcrsScoreMandatory += \"*You should calculate the CRS Score. Please click 'Calculate' button\";\n\t\t\t$(\"#calButton\").click(function() {\n\t\t\t\t$(\"#crs\").css('width', '935px');\n\t\t\t\t$(\"#crs\").css('border-radius', '3px');\n\t\t\t\t$(\"#crs\").css('border-right-style', 'solid');\n\t\t\t\t$(\"#crs\").css('border-right-color', 'green');\n\t\t\t\t$(\"#crs\").css('border-right-width', '15px');\n\t\t\t\tcrsScoreMandatory = \"\";\n\t\t\t})\n\t\t} else {\n\t\t\t$(\"#crs\").css('width', '935px');\n\t\t\t$(\"#crs\").css('border-radius', '3px');\n\t\t\t$(\"#crs\").css('border-right-style', 'solid');\n\t\t\t$(\"#crs\").css('border-right-color', 'red');\n\t\t\t$(\"#crs\").css('border-right-width', '15px');\n\t\t\tcrsScoreMandatory += \"*Make sure proper IELTS score is provided.\";\n\t\t}\n\t\tisFormValid = false;\n\t}\n\n\tif (!validateCredential()) {\n\t\t$(\"#edu\").css('border-right-style', 'solid');\n\t\t$(\"#edu\").css('border-right-color', 'red');\n\t\t$(\"#edu\").css('border-right-width', '15px');\n\t\t$(\"#edu\").css('border-radius', '3px');\n\t\tcredentialMandatory += \"*Educational Credential is Mandatory\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#edu\").css('border-right-style', 'solid');\n\t\t$(\"#edu\").css('border-right-color', 'green');\n\t\t$(\"#edu\").css('border-right-width', '15px');\n\t\t$(\"#edu\").css('border-radius', '3px');\n\t}\n\n\tif (!validateLScore()) {\n\t\t$(\"#lscore\").css('border-right-style', 'solid');\n\t\t$(\"#lscore\").css('border-right-color', 'red');\n\t\t$(\"#lscore\").css('border-right-width', '15px');\n\t\t$(\"#lscore\").css('border-radius', '3px');\n\t\tlScoreMandatory += \"*Listening Score is Mandatory\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#lscore\").css('border-right-style', 'solid');\n\t\t$(\"#lscore\").css('border-right-color', 'green');\n\t\t$(\"#lscore\").css('border-right-width', '15px');\n\t\t$(\"#lscore\").css('border-radius', '3px');\n\t}\n\n\tif (!validateRScore()) {\n\t\t$(\"#rscore\").css('border-right-style', 'solid');\n\t\t$(\"#rscore\").css('border-right-color', 'red');\n\t\t$(\"#rscore\").css('border-right-width', '15px');\n\t\t$(\"#rscore\").css('border-radius', '3px');\n\t\trScoreMandatory += \"*Reading Score is Mandatory\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#rscore\").css('border-right-style', 'solid');\n\t\t$(\"#rscore\").css('border-right-color', 'green');\n\t\t$(\"#rscore\").css('border-right-width', '15px');\n\t\t$(\"#rscore\").css('border-radius', '3px');\n\t}\n\n\tif (!validateWScore()) {\n\t\t$(\"#wscore\").css('border-right-style', 'solid');\n\t\t$(\"#wscore\").css('border-right-color', 'red');\n\t\t$(\"#wscore\").css('border-right-width', '15px');\n\t\t$(\"#wscore\").css('border-radius', '3px');\n\t\twScoreMandatory += \"*Writing Score is Mandatory\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#wscore\").css('border-right-style', 'solid');\n\t\t$(\"#wscore\").css('border-right-color', 'green');\n\t\t$(\"#wscore\").css('border-right-width', '15px');\n\t\t$(\"#wscore\").css('border-radius', '3px');\n\t}\n\n\tif (!validateSScore()) {\n\t\t$(\"#sscore\").css('border-right-style', 'solid');\n\t\t$(\"#sscore\").css('border-right-color', 'red');\n\t\t$(\"#sscore\").css('border-right-width', '15px');\n\t\t$(\"#sscore\").css('border-radius', '3px');\n\t\tsScoreMandatory += \"*Speaking Score is Mandatory\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#sscore\").css('border-right-style', 'solid');\n\t\t$(\"#sscore\").css('border-right-color', 'green');\n\t\t$(\"#sscore\").css('border-right-width', '15px');\n\t\t$(\"#sscore\").css('border-radius', '3px');\n\t}\n\n\tif (!validateDob()) {\n\t\t$(\"#dob\").css('width', '935px');\n\t\t$(\"#dob\").css('border-right-style', 'solid');\n\t\t$(\"#dob\").css('border-right-color', 'red');\n\t\t$(\"#dob\").css('border-right-width', '15px');\n\t\t$(\"#dob\").css('border-radius', '3px');\n\t\tdobMandatory += \"*Please enter a valid date\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#dob\").css('width', '935px');\n\t\t$(\"#dob\").css('border-right-style', 'solid');\n\t\t$(\"#dob\").css('border-right-color', 'green');\n\t\t$(\"#dob\").css('border-right-width', '15px');\n\t\t$(\"#dob\").css('border-radius', '3px');\n\t}\n\n\tif (!validateLDate()) {\n\t\t$(\"#ldate\").css('width', '935px');\n\t\t$(\"#ldate\").css('border-right-style', 'solid');\n\t\t$(\"#ldate\").css('border-right-color', 'red');\n\t\t$(\"#ldate\").css('border-right-width', '15px');\n\t\t$(\"#ldate\").css('border-radius', '3px');\n\t\tlDateMandatory += \"*Please enter a valid date\";\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#ldate\").css('width', '935px');\n\t\t$(\"#ldate\").css('border-right-style', 'solid');\n\t\t$(\"#ldate\").css('border-right-color', 'green');\n\t\t$(\"#ldate\").css('border-right-width', '15px');\n\t\t$(\"#ldate\").css('border-radius', '3px');\n\t}\n\n\tif (!validateProvince()) {\n\t\tproMandatory += \"*Please select atleast one province\";\n\t\t$(\"#proinpdiv\").css('width', '935px');\n\t\t$(\"#proinpdiv\").css('border-radius', '3px');\n\t\t$(\"#proinpdiv\").css('border-right-style', 'solid');\n\t\t$(\"#proinpdiv\").css('border-right-color', 'red');\n\t\t$(\"#proinpdiv\").css('border-right-width', '15px');\n\t\tisFormValid = false;\n\t} else {\n\t\t$(\"#proinpdiv\").css('width', '935px');\n\t\t$(\"#proinpdiv\").css('border-radius', '3px');\n\t\t$(\"#proinpdiv\").css('border-right-style', 'solid');\n\t\t$(\"#proinpdiv\").css('border-right-color', 'green');\n\t\t$(\"#proinpdiv\").css('border-right-width', '15px');\n\t}\n\n\tif (isFormValid) {\n\t\tshowSuccess();\n\t}\n\n\tdocument.getElementById('emailinvalid').innerHTML = emaildMandatory;\n\tdocument.getElementById('dobinvalid').innerHTML = dobMandatory;\n\tdocument.getElementById('cocinvalid').innerHTML = countryMandatory;\n\tdocument.getElementById('lscoreinvalid').innerHTML = lScoreMandatory;\n\tdocument.getElementById('sscoreinvalid').innerHTML = sScoreMandatory;\n\tdocument.getElementById('wscoreinvalid').innerHTML = wScoreMandatory;\n\tdocument.getElementById('rscoreinvalid').innerHTML = rScoreMandatory;\n\tdocument.getElementById('ldateinvalid').innerHTML = lDateMandatory;\n\tdocument.getElementById('provinceinvalid').innerHTML = proMandatory;\n\tdocument.getElementById('genderinvalid').innerHTML = genderMandatory;\n\tdocument.getElementById('eduinvalid').innerHTML = credentialMandatory;\n\tdocument.getElementById('crsinvalid').innerHTML = crsScoreMandatory;\n}", "function invalidFormInput() {\n return isNaN(modalInstance.form.purchaseCost) || (modalInstance.form.cusip === undefined);\n }", "function validate() {\n\t //pattern for name\n\t var reName = /^[a-zA-Z][a-zA-Z0-9]*$/\n\t // pattern for phone number\n\t var rePhone = /^\\d{3}-\\d{3}-\\d{4}$/;\n\t // pattern for email\n\t var reEmail = /^\\S+@\\S+\\.\\S+$/;\n\t // pattern for zipcode\n\t var reZip = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/;\n\t // save all missed items\n\t var missedStr = \"\";\n\t if (newName.value!=\"\" && newName.value!=null && !reName.test(newName.value)) {\n\t \tmissedStr = \"Account name is not valid. Account name can only be upper or lower case letters and numbers, but may not start with a number.\\n\" + missedStr;\n\t }\n\t if (newEmail.value!=\"\" && newEmail.value!=null && !reEmail.test(newEmail.value)) {\n\t \tmissedStr = missedStr + \"The email is not valid.\\n\"\n\t }\n\t if (newZipcode.value!=\"\" && newZipcode.value!=null &&!reZip.test(newZipcode.value)) {\n\t \tmissedStr = \"Zipcode is not valid and the format should be xxxxx or xxxxx-xxxx.\\n\" + missedStr;\n\t }\n\t \n\t\tif (newPhone.value!=\"\" && newPhone.value!=null &&!rePhone.test(newPhone.value)) {\n\t \tmissedStr = \"The phone number format should be xxx-xxx-xxxx.\\n\" + missedStr;\n\t }\n\n\t if (newPassword.value != newPwconfirm.value) {\n\t \tmissedStr = missedStr + \"The password is not the same as password confirmation.\\n\";\t\n\t }\n\t if (missedStr != \"\") {\n\t \talert(missedStr);\n\t \treturn false;\n\t }\n\t return true;\n\t}", "function logForm()\n{\n if(userEmail1.value == \"\"){\n userEmail1.style.borderColor = \"#dddddd\";\n userEmail1.focus();\n emailError.innerHTML = \"please enter your email\";\n return false;\n }\n\n if(userPass.value == \"\"){\n userPass.style.borderColor = \"#dddddd\";\n userPass.focus();\n userPassErr.innerHTML = \"please enter your password\";\n return false;\n }\n \n}", "function checkForm(){\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){\n btn.disabled = false; //enable submit btn if form filled correctly\n }else{\n btn.disabled = true;\n }\n }", "function formNotZero() {\n if (($(\"#bookBicycles\").val() == 0 && $(\"#bookMotobikes\").val() == 0)) {\n $(\"#errorForm\").text(\"*Choose at least one bicycle or motobike\");\n return;\n\n } else {\n $(\"#bookButton\").removeAttr(\"disabled\");\n $(\"#errorForm\").text(\"\")\n return;\n }\n }", "function msg() {\n document.getElementById('l5').style.display = 'block';\n document.getElementById('l5').value = 'User is invalid';\n }", "checkForm() {\n this.elements.resetHint();\n\n const title = this.elements.form.querySelector('.field-title').value;\n const price = this.elements.form.querySelector('.field-price').value;\n\n if (!title || /^\\W/.test(title)) {\n this.elements.showHint('title', 'Нужно заполнить поле');\n return true;\n }\n\n if (!price) {\n this.elements.showHint('price', 'Нужно заполнить поле');\n return true;\n }\n\n if (/\\D/.test(price)) {\n this.elements.showHint('price', 'некорректное значение');\n return true;\n }\n }" ]
[ "0.6951915", "0.677835", "0.6755606", "0.6749636", "0.6743643", "0.6723397", "0.6706985", "0.6673913", "0.6644014", "0.6643277", "0.6616356", "0.6599352", "0.6585044", "0.65827453", "0.6580768", "0.65548605", "0.6544394", "0.6534897", "0.6534437", "0.6530584", "0.6530242", "0.6524828", "0.6523896", "0.65137255", "0.6510109", "0.64945924", "0.6493175", "0.6485974", "0.6485143", "0.64788306", "0.64601713", "0.64593655", "0.6458514", "0.6455766", "0.6454719", "0.64473456", "0.6443767", "0.6442649", "0.6442076", "0.64404047", "0.643754", "0.643325", "0.64278716", "0.6419826", "0.6404921", "0.6404712", "0.6404536", "0.640001", "0.6387327", "0.6377506", "0.6374456", "0.6366879", "0.6358896", "0.6354421", "0.6353473", "0.63515115", "0.63499826", "0.63489324", "0.6348316", "0.63369477", "0.63367116", "0.63333774", "0.6323156", "0.63230675", "0.6322909", "0.6316961", "0.63156134", "0.63147455", "0.6312791", "0.63055885", "0.6302142", "0.62996256", "0.6283415", "0.628145", "0.62772256", "0.6274027", "0.6273921", "0.627341", "0.6272836", "0.62708735", "0.6270386", "0.62700343", "0.6266692", "0.6261498", "0.62583697", "0.6254004", "0.6251649", "0.6248694", "0.62469375", "0.6241048", "0.6238242", "0.6234716", "0.62341845", "0.62331516", "0.6232603", "0.6231355", "0.6230107", "0.6229288", "0.6227972", "0.6227947", "0.62246245" ]
0.0
-1
checks if the email is in the database
function checkDB(email, msg) { axios.get('https://ift-bot-default-rtdb.firebaseio.com/attendees.json') .then((res) => res.data) .then((data) => { var found = false; for (let i = 0; i < data.length; i++) { if (email == data[i]) { // success msg.channel.send("yay"); found = true; } } if (!found) { msg.channel.send("boo"); throw new Error("Email not found"); } }) .catch((err) => console.log("authentication failed")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmail(usersDB, email, callback){\n usersDB.find({Email:email}, function(err, doc){\n if(!err && doc.length > 0){\n console.log(\"emial: \",doc);\n callback(false);\n } else {\n callback(true);\n }\n });\n}", "function checkExistingEmail(email) {\n var flag = false;\n for (let item in databases.users) {\n if(databases.users[item].email === email){\n flag = true;\n userId = databases.users[item].id;\n }\n }\n return flag;\n}", "function emailChecker (email) {\n for (id in users){\n if (email === users[id].email){\n return true;\n }\n }\n return false;\n}", "async emailVerify(email) {\n const _email = await User.findOne({ email: email });\n if (!_email) {\n return false;\n } else {\n return true;\n }\n }", "async function checkEmail(email) {\n const accountUser = await db('users')\n .where({\n email\n })\n .first()\n .catch(console.log)\n\n const accountOrg = await db('organizations')\n .where({\n email\n })\n .first()\n .catch(console.log)\n\n if (!accountUser && !accountOrg) {\n return false\n }\n return (accountUser.email === email || accountOrg.email === email) ? true : false\n}", "function isEmailExist() {\n for (var index = 0; index < signUpContainer.length; index++) {\n if ( signUpContainer[index].userEmail.toLowerCase() == signUpEmail.value.toLowerCase() ) {\n return false\n }\n }\n}", "async isEmailExists(){\n const brand = await Brands.find({\"email\" : this._userData.email});\n\n if(brand.length == 0){\n return false;\n }\n\n return true;\n }", "function checkEmail(email) {\n for (let id in users) {\n if (email === users[id].email)\n return true;\n }\n return false;\n}", "function emailChecker (email){\n for (id in users) {\n if (email === users[id].email){\n return users[id]\n } \n }\n return false;\n}", "function emailExist(email) {\n for (let userKey in users) {\n if (users[userKey].email === email) {\n return true;\n }\n }\n return false;\n}", "async isEmailExist(email, role) {\n let query = '';\n const data = [];\n this.email = email;\n this.role = role;\n data.push(this.email);\n\n switch (this.role) {\n case constants.USER:\n query = 'SELECT id_user FROM users WHERE email = $1';\n break;\n case constants.ADMIN:\n query = 'SELECT id_admin FROM admin WHERE email = $1';\n break;\n default:\n query = 'SELECT id_user FROM users WHERE email = $1';\n break;\n }\n\n const result = await execute(query, data);\n return result.rowCount > 0;\n }", "static async isRegisteredMail(mail) {\n let res = await db.query('SELECT * FROM users WHERE mail = $1', [mail])\n return res.rowCount > 0;\n }", "isEmailInUse(email) {\n return __awaiter(this, void 0, void 0, function* () {\n if (email == null) {\n throw new nullargumenterror_1.NullArgumentError('email');\n }\n return this.users.find(u => u.email == email) != null;\n });\n }", "async checkEmail({request, response}) {\n let exist = await User.findBy('email', request.input('email'));\n return response.send(!!exist);\n }", "function checkIfEmailExists(email){\n return new Promise((resolve, reject) => {\n r.table(table)\n .filter({ email: email })\n .run()\n .then(response => _.isEmpty(response) ? reject([{param: 'email', msg: 'User not found'}]) : resolve(response))\n .error(err => reject(err));\n })\n}", "function emailExists(email: string, callback: GenericCallback<boolean>) {\n email = email.toLowerCase();\n getUIDFromMail(email, function (error, username) {\n callback(error, username !== null);\n });\n}", "function isEmailUsed(email){\n return Users.count({where: {email: email}})\n .then(count => {\n if (count !== 0){\n return true;\n }\n return false;\n });\n }", "function checkEmail(email) {\n const savedEmail = \"[email protected]\";\n const loginEmail = email.toLowerCase().trim();\n return savedEmail === loginEmail ? true : false;\n}", "function emailSearch(emailIn) {\n for (id in users) {\n if (users[id].email == emailIn){\n return true;\n }\n }\n return false;\n}", "function checkEmail() {}", "function user_exists(email){\n\tvar user_array = get_user_array();\n\tif(user_array.length > 0){\n\t\tfor(var i=0; i<user_array.length; ++i){\n\t\t\tif(user_array[i].email == email) return true;\n\t\t}\n\t}\n\treturn false;\n}", "function isEmailTaken(){\n return new Promise(function(resolve, reject){\n mysql.pool.getConnection(function(err, connection){\n if(err){return reject(err)};\n\n connection.query({\n sql: 'SELECT email FROM deepmes_auth_login WHERE email=?',\n values: [fields.email+'@sunpowercorp.com']\n }, function(err, results){\n if(err){return reject(err)};\n\n if(typeof results[0] !== 'undefined' && results[0] !== null && results.length > 0){\n let emailTaken = 'Email is already taken.';\n reject(emailTaken);\n } else {\n resolve();\n }\n\n });\n\n connection.release();\n\n });\n });\n }", "function checkEmail(req,res,next){\n var email = req.body.email;\n var databaseValue = userModel.findOne({email:email});\n databaseValue.exec((err,data)=>{\n if(err)throw err;\n if(data) return res.render('signup', { title: 'Sign Up' ,msg : 'Email Already Exists'});\n next();\n });\n \n}", "function checkEmail(email){\n return new Promise((resolve,reject)=>{\n Pool.getConnection((errorA,connection)=>{\n \n if(!errorA){\n \n connection.query(`SELECT id FROM users WHERE email=\"${email}\"`,(errorB,result,fields)=>{\n \n let amount = Object.keys(result).length;\n \n if(amount) reject('Given email is already used');\n else resolve(true);\n \n connection.release();\n });\n \n \n }else{\n \n }\n }); \n });\n}", "function validarEmail(email) {\n if (usuariosList.find(function(item){\n return item[2] == email;\n }) !== undefined) return false;\n if (/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.([a-zA-Z]{2,4})+$/.test(email)){\n return true;\n } else {\n return false;\n }\n\n }", "function isAlreadyRegistered(email, callback) {\n \n UserModel.findOne({\n email: email\n }, (err, value) => {\n if(err) console.log(err);\n if(value != null) {\n callback(true);\n } else {\n callback(false);\n }\n });\n\n}", "function existsEmail(user_input){\n for(let i in users){\n let user = users[i];\n if(user_input === user.email){\n return true;\n }\n }\n return false;\n}", "isUserDetailsExists(email) {\n return new Promise(function (resolve, reject) {\n let sql = \"SELECT email FROM personal_details WHERE email=?\";\n db.all(sql, [email], (err, rows) => {\n if (err) {\n reject(Error(\"Error:\" + err.message));\n }\n if (rows.length > 0) {\n resolve(true);\n } else {\n resolve(false);\n }\n });\n });\n }", "function checkIfEmailExist(req, res, next) {\n models.user.findOne({\n where: {\n 'email':req.body.email\n }\n }).then(( user) => {\n if (user) {\n res.status(400).send({error: \"The email is in use.\"});\n }\n });\n next();\n }", "emailExists(email, callback) {\n let query = \"select count(*) as numberOfUsers from user where email = '\" + email + \"';\";\n this.selectQuery(query, (result) => {\n //wenn die Anzahl der user mit der angegebenen E-Mail 1 beträgt existiert dieser User -> true\n //ansonsten (bei 0) existiert dieser User nicht -> false\n callback(result[0].numberOfUsers == 1);\n });\n }", "function emailChecker(storedEmail, reqEmail, callback){\n if (storedEmail === reqEmail){\n callback();\n };\n}", "checkEmail(req, res, next){\n\n if (req.body.email){\n\n db.query(queries.selectUserWithEmail, [req.body.email], (err, results, fields) => {\n\n if (err) throw err;\n \n if (results.length == 0){\n next();\n } else {\n res.status(400).send(\"Email already exists.\");\n }\n });\n } else {\n \n res.status(400).send(\"Email field is empty.\");\n }\n \n }", "function emailAvailable(req, res, next) {\n // Check if email has already been taken\n Account.findOne({email: req.body.email}, function (err, acc) {\n if (err) {\n console.error(\"Database find email error: \" + err);\n return next(err);\n }\n return res.send(!acc);\n });\n}", "function checkForUserEmail(data) {\n let sql = \"SELECT id FROM users WHERE email = '\" + data.email + \"'\";\n return db.query(sql);\n}", "emailExists(email: string, callback) {\n super.query(\n 'SELECT organiser_email as email, \"organiser\" as type FROM organiser WHERE organiser_email = ? UNION SELECT email, \"user\" as type FROM user WHERE email = ?',\n [email, email],\n callback,\n );\n }", "function userExists(email){\n for(user in users){\n if(users[user].email === email){\n return true;\n }\n }\n return false;\n}", "function lookupEmail (email) {\n for (let key in users) {\n if (email === users[key].email){\n return users[key];\n }\n }\n return false;\n}", "function emailLookup(userEmail, users) {\n for (user in users) {\n if (userEmail === users[user][\"email\"]) {\n return true;\n }\n }\n return false;\n}", "async exists(email) {\n\n // parameter email doesn't exist\n if (!this._parameterExists(email)) {\n return false;\n }\n\n try {\n // user exists\n if (await this._count('users', 'email', { email }) === 1) {\n return true;\n }\n\n // user doesn't exist\n return false;\n } catch (err) {\n this.logger.error(err);\n return false;\n }\n }", "function checkemail(data,callback)\n{\n console.log(\"entered email :\"+ data);\n var query='select email from info where email =\"'+data+'\"';\n con.query(query,function(err,result,feilds){\n console.log(\"result is\"+result[0]);\n if(result[0]==undefined)\n return callback(false);\n else\n return callback(true);\n })\n}", "function userEmailCheck(input) {\n for (user in users) {\n if (users[user].email === input) {\n return users[user].id;\n }\n }\n return false;\n}", "static async exists(email){\n let user = await User.findOne({where: {email: email}});\n return user !== null\n }", "function isRegistered(email) {\n let flag = true;\n for (let user in users) {\n if (users[user].email === email) {\n return false;\n }\n }\n return true;\n}", "function checkemail(req, res, next){\n var email = req.body.email;\n var checkEmailExist = userModel.findOne({email: email});\n checkEmailExist.exec((err, data)=>{\n if(err) throw err;\n if(data){\n return res.render('signup', { title: 'Password Management System', msg: 'Email Already Exist' });\n }\n next();\n })\n}", "function emailValid() {\n\tvar domain = new RegExp(/^[A-z0-9.]{1,}@(?=(my.bcit.ca$|bcit.ca$|gmail.com$))/i); //checks email for single occurrence of @ and valid domain containing only valid characters.\n\tvar email = document.getElementById(\"email\").value;\n\tif (domain.test(email))\n\t{\n\t\t/*if (email exists in database) {\n\t\t\tdocument.getElementById(\"email\").value = \"Email already exists\"\n\t\t} else {whatever value to let form submit}*/\n\t\tdocument.getElementById(\"emailErrorField\").innerHTML = \"Email valid\"\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(\"emailErrorField\").innerHTML = \"Email invalid.\"\n\t\treturn false;\n\t}\n}", "async validateEmailInput() {\n this.baseEl.find('.email-exists').removeClass('on');\n this.baseEl.find('.email-invalid').removeClass('on');\n\n let email = this.baseEl.find('.email-input').val();\n\n let result = await User.find(`.findOne({email: '${email}'})`);\n if (result) {\n this.baseEl.find('.email-exists').addClass('on');\n return false;\n }\n let regEx = /\\w\\w+@\\w\\w+\\.\\w\\w+/;\n if (!regEx.test(email)) {\n this.baseEl.find('.email-invalid').addClass('on');\n return false;\n }\n return true;\n }", "function checkUser(usersDB, email) {\n for (let user in usersDB) {\n if (usersDB[user].email === email) {\n return usersDB[user];\n }\n }\n return null;\n}", "hasEmail(first_name, middle_name, last_name) {\n\t for (id in Contacts.findOne(\"Contacts\")[\"contacts\"]) {\n\t\tif((Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"first\"] == first_name) &&\n\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"middle\"] == middle_name) &&\n\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"last\"] == last_name)) {\n\t\t if(Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"email\"]\n\t\t != undefined)\n\t\t\tif((Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"email\"][\"personal\"] != \"\") ||\n\t\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"email\"][\"secondary\"] != \"\") ||\n\t\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"email\"][\"email\"] != \"\"))\n\t\t\t return true;\n\t\t}\t \n\t }\n\t return false;\n\t}", "async findEmail(email) {\n try {\n const emailExists = await knex\n .select()\n .from('users')\n .where({ email: email });\n\n if (emailExists.length) return true;\n else return false;\n } catch (error) {\n console.log(error);\n return false;\n }\n }", "function is_email(email){ \r\n var emailReg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\r\n return emailReg.test(email); }", "function checkEmail() {\n return validator.isEmail(this.email);\n}", "hasUser(email)\n {\n return this.users.includes(email);\n }", "async function emailIsExist(email) {\r\n try {\r\n const user = await User.findOne({\r\n where: {\r\n email,\r\n },\r\n });\r\n if (user) {\r\n return user.toJSON();\r\n }\r\n return false;\r\n } catch (error) {\r\n console.error(error.message);\r\n return false;\r\n }\r\n}", "function check_email_req(email){\n var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\\.)+[A-Z]{2,4}$/i;\n if (testEmail.test(email)){\n return true;\n }\n\n return false;\n }", "function checkEmail(req,res,next){\n var email=req.body.email;\n var checkexitemail=userModule.findOne({email:email});\n checkexitemail.exec((err,data)=>{\n if (err) throw err;\n if(data){\n return res.render('signup', { title: 'Password Management System', msg:'Email Already Exit !'}); \n }\n next(); \n });\n\n }", "function checkEmail(req,res,next){\n var email=req.body.email;\n var checkexitemail=userModule.findOne({email:email});\n checkexitemail.exec((err,data)=>{\n if (err) throw err;\n if(data){\n return res.render('signup', { title: 'Password Management System', msg:'Email Already Exit !'}); \n }\n next(); \n });\n\n }", "function checkE(email) {\r\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(String(email).toLowerCase());\r\n}", "function checkEmail(email)\n { \n let passed = false;\n for (let i = 0; i < email.length; ++i) {\n if (email[i] == \"@\" && i != 0 && i != email.length-1) {\n passed = true;\n }\n }\n return passed;\n }", "async function checkFirst(email) {\n try {\n email = decodeURIComponent(email);\n const results = await User.find({ email: email });\n if (results.length == 0) {\n return true;\n } else {\n return false;\n }\n } catch (err) {\n console.log(err.response);\n }\n}", "get isEmail(): boolean {\n return this._id.includes('@');\n }", "function checkRegistrationEmail(email) {\n var blank = isBlank(email);\n if(blank) {\n\tvar element = document.getElementById('email');\n\tvar existence = false;\n\tinputFeedback(element, existence, blank);\n } else {\n\tvar element = document.getElementById('email');\n\tvar existence = checkMailExistence(email);\n\tinputFeedback(element, existence, blank);\n }\n}", "function check(email, username){\n var usrobj = userobj;\n var usrs = usrobj.users;\n //Checks login info with all objects of signup json object\n for (let index = 0; index < usrs.length; index++) {\n const obj = usrs[index];\n if(obj.email_address == email || obj.username == username) {\n return true;\n }\n }\n return false;\n}", "function isExist() {\r\n for (let i = 0; i < allUsers.length; i++) {\r\n if (allUsers[i].email.toLowerCase() == suEmailInput.value.toLowerCase()) {\r\n suEmailInput.classList.replace(\"is-valid\", \"is-invalid\");\r\n emailExistInp.classList.replace(\"d-none\", \"d-block\");\r\n return true;\r\n }\r\n }\r\n }", "function emailValidator(req, res, next) {\n usermodel.User.findOne({\n where: { email: req.body.email }\n })\n .then(function(result) {\n\n if (result.dataValues != '') {\n next({ \"status\": 301, \"message\": \"Email already Exits\" })\n return;\n }\n })\n .catch(function(err) {\n next({ \"status\": 201, \"message\": \"Email available\" });\n })\n\n}", "function checkEmail(mail) {\n var k = mail;\n for (var i = 0; i < k.length; i++)\n if ((k[i] == '@') || (k[i] == '.') || (k[i] == '_'))\n return true;\n return false;\n}", "testEmail (email) {\n var regexemail =/^(\\w|-|\\.)+@(\\w|-)+\\.(\\w|-)+$/;\n return regexemail.test(email)\n }", "function emailExists(email) {\n return $.ajax(`${userInfoControllerRoot}/EmailExists`, {\n method: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify(email)\n });\n}", "function emailExistUpdate(email) {\n var emailObj = {\n 'value':email\n };\n return baseAuth().post('email', emailObj);\n }", "function emailChecker(email) {\n\tvar x = email.toLowerCase;\n\tvar y = x.split(\"\");\n\tvar alphabet = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z];\n\tif ( y[0] ) {}\n}", "function checkIfUserAlreadyExists(req, res, next) {\n\tlet userEmail = req.body.email\n\n\tlet findUser = `SELECT COUNT(*) AS count FROM users WHERE email=\"${userEmail}\"`;\n\n\tconn.query(findUser, (err, result) => {\n\t\tif (err) {\n\t\t\tres.status(500).send({\n\t\t\t\t\"error\": \"Something Went Wrong\"\n\t\t\t})\n\t\t}\n\n\t\tif (result[0].count == 0) {\n\t\t\tnext()\n\t\t}\n\t\telse {\n\t\t\tres.status(200).send({\n\t\t\t\tsuccess: false,\n\t\t\t\t\"message\": \"User Already Exists With This Email.\"\n\t\t\t})\n\t\t}\n\t})\n}", "function isEmailExist() {\r\n for (var i = 0; i < myForm.length; i++) {\r\n if (myForm[i].myemail.toLowerCase() == emailInput.value.toLowerCase()) {\r\n return false;\r\n }\r\n }\r\n}", "function isEmail(email){\r\n\t let regex = /^([a-zA-Z0-9_.+-])+\\@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\r\n\t return regex.test(email);\t\r\n\t}", "function validateEmail(email) {\n\tvar valid \n\treturn valid = /\\S+@\\S+\\.\\S+/.test(email);\n}", "function validateEmail(email) \r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function isEmail($email) {\r\n\t\t\t\t\tconsole.log($email + \" checking email here\");\r\n \t\t\t\t var filter = /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/;\r\n \t\t\t\r\n \t\t\t if (filter.test($email)) {\r\n \t\t\t \t\r\n \t\t\t\treturn true;\r\n \t\t\t\t}\r\n \t\t\t\t else {\r\n \t\t\t\t \r\n \t\t\t\treturn false;\r\n \t\t\t}\r\n \t\t\t\t\r\n\t\t\t}", "async function isUserExist(email){\n const result = await User.find({email : email});\n if(result.length == 0)\n return false;\n\n return result[0];\n}", "function isIdUnique (email) {\n return db.User.findAll({ where: { email: email } })\n .then(count => {\n if (count != 0) {\n return false;\n } else {\n return true;\n }\n });\n }", "function validateEmail(email)\r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function isEmail(email){ \n return (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email))\n }", "async function checkEmail(email) {\n if(validEmail(email)) {\n let methods = await auth.fetchSignInMethodsForEmail(email) \n if (methods.length == 0) {\n setErrorMessage('There is no user registered with that email address.');\n return true;\n }\n }\n }", "async function userExists(email){\n real_email = email.emails[0].value\n const user = await db.any('select * from users WHERE email=$1', [real_email])\n console.log(user.length)\n if (user.length){\n return user[0]\n }\n return false\n}", "function emailExists($email){\n\n\treturn $.ajax({\n\t\turl: \"php/checkemail.php\",\n\t\tdataType: \"text\",\n\t\ttype: \"POST\",\n\t\tdata: {\n\t\t\temail : email\n\t\t}\n\t});\n}", "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function validateEmail (email) {\n return /\\S+@\\S+\\.\\S+/.test(email)\n}", "function checkMail()\n {\n email = $('#ftven_formabo_form_email').val();\n var emailPattern = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n return (emailPattern.test(email));\n }", "function emailCheck () {\n var emailResultTest = reEmail.test(userEmail.value);\n if (emailResultTest === true) {\n emailResult = true; \n } else {\n emailResult = false; \n }\n}", "function afficherEmail() {\n return isValidEmail(email.value);\n}", "function checkEmail() {\n\t\tvar email=document.sform.eml.value;\n\t\tif (email==\"\") {\n\t\t\talert (\"Please enter a valid email.\");\n\t\t\tdocument.sform.eml.focus();\n\t\t\treturn false;\n\t\t} \n\t\telse if (!(email.includes(\"@\"))) {\n\t\t\talert (\"Please enter a valid email.\");\n\t\t\tdocument.sform.eml.value=\"\";\n\t\t\tdocument.sform.eml.focus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function checkEmail(n)\r\n{\r\n\treturn n.search(/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$/)!=-1?!0:!1\r\n\t\r\n}", "function validateEmail(email) {\n\t\tvar re = /\\S+@\\S+\\.\\S+/;\n\t\treturn re.test(email);\n\t}", "function validateEmail(req, res, next) {\n knex('users').where('email', req.body.email).first().then(email => {\n //if email exists already, exits with 400 and a message\n if (email) {\n res.set('Content-Type', 'text/plain');\n res.status(400).send('Email already exists');\n return;\n }\n req.email = email;\n next();\n });\n }", "function emailIsValid(email) {\n return /\\S+@\\S+\\.\\S+/.test(email);\n }", "function doesEmailRepeat(emailBeingChecked) {\n for (const user in users) {\n let currentUser = users[user];\n return currentUser.email === emailBeingChecked;\n }\n}", "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function IsEmail(email) {\r\r\n var regex = /^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\r\r\n if(!regex.test(email)) {\r\r\n return false;\r\r\n }else{\r\r\n return true;\r\r\n }\r\r\n}", "function isEmail(email) {\n\t\t var regex = /^$|^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.(?:[a-zA-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)$/;\n\t\t return regex.test(email);\n\t\t}", "function isEmail(email){\n return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(email)\n}", "function isEmail(email) {\r\n \t\tvar regex = /^([a-zA-Z0-9_.+-])+\\@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\r\n \t\treturn regex.test(email);\r\n\t}", "function checkEmail(email) {\n //if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email)) {\n if (/^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/.test(email)) {\n return true;\n } else {\n return false;\n }\n}", "function emailCheck(email) {\n\tatSplit = email.split('@');\n\tif (atSplit.length == 2 && alphaNumCheck(atSplit[0])) {\n\t\tperiodSplit = atSplit[1].split('.')\n\t\tif (periodSplit.length == 2 && alphaNumCheck(periodSplit[0] + periodSplit[1])) {\n\t\t\treturn true;\n\t\t}\n\t}\n\tvalCheck = false;\n\treturn false;\n}" ]
[ "0.7767635", "0.7669948", "0.75848085", "0.74351454", "0.7400646", "0.73669106", "0.73538303", "0.73212266", "0.73073894", "0.7269829", "0.71567494", "0.7148885", "0.7141706", "0.71338475", "0.7083601", "0.70819086", "0.7062965", "0.7059417", "0.70411104", "0.7016574", "0.7008912", "0.7005683", "0.6978636", "0.6943334", "0.69414467", "0.69211113", "0.6918194", "0.6913359", "0.6908617", "0.6895285", "0.6888531", "0.68841946", "0.68654567", "0.6854256", "0.6850798", "0.6848761", "0.68377554", "0.68363696", "0.6834619", "0.6832296", "0.68170726", "0.68167007", "0.67608047", "0.6759533", "0.675532", "0.6749057", "0.6722438", "0.66976637", "0.6693641", "0.66922665", "0.6686327", "0.6676841", "0.66427004", "0.6626438", "0.66188765", "0.66188765", "0.6614024", "0.6594019", "0.6590268", "0.6563213", "0.6557988", "0.6532169", "0.653117", "0.6529403", "0.6523806", "0.65235037", "0.6514726", "0.65080863", "0.6500835", "0.6499136", "0.6498141", "0.64945227", "0.64917374", "0.64910364", "0.6489966", "0.6473432", "0.6460514", "0.6448131", "0.64327854", "0.6424652", "0.6424154", "0.6415415", "0.6412348", "0.64101464", "0.63963443", "0.63932425", "0.6389718", "0.63827", "0.63681364", "0.63672215", "0.63592523", "0.63539964", "0.63461745", "0.63393366", "0.6338926", "0.63322186", "0.6330911", "0.63241", "0.63208055", "0.6317804" ]
0.6362355
90
var textArr = upset(randColorArr); console.log(textArr);
function allReset() { randFontArr = upset(randFontArr); randColorArr = upset(randColorArr); mainFont.innerHTML = randFontArr[Math.floor(Math.random() * 5)]; mainFont.style.color = randColorArr[Math.floor(Math.random() * 5)]; for (var i = 0; i < fontArr.length; i++) { fontArr[i].innerHTML = randFontArr[i]; fontArr[i].style.color = randColorArr[i]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createColorPicker() {\n\n // Shuffle color array\n\n\n\n // Push to text color array\n\n\n\n // Shuffle text color array\n\n\n // Loop through all colors in the array\n // Create element to hold word\n // Output a word\n // Make word a random color\n\n }", "function getColorSet(){\n\tvar colorSet = [\n\t\"#05668D\",\n\t\"#028090\",\n\t\"#00A896\",\n\t\"#02C39A\",\n\t\"#FF5733\"\n\t];\n\n\tvar selectColor = colorSet[Math.floor(Math.random() * 5)];\n\t//console.log(selectColor);\n\treturn selectColor;\n}", "function add() {\n arr.push(color[Math.floor(Math.random() * 4)]);\n arr.push(\" \");\n }", "function nextSequence() {\n userClickedPattern = [];\n level++;\n $(\"#level-title\").text(\"Level \" + level);\n let randomNumber = Math.floor(Math.random() * 4);\n let randomChosenColor = buttonColors[randomNumber];\n gamePattern.push(randomChosenColor);\n $(\"#\" + randomChosenColor).fadeIn(100).fadeOut(100).fadeIn(100);\n playSound(randomChosenColor);\n console.log(randomChosenColor);\n console.log(\"Game pattern is: \" + gamePattern)\n}", "function setup() {\n\n/* \n================================\n RANDOM WORD \n================================ \n*/\n Word = AllStars[Math.floor(Math.random() * AllStars.length)];\n\n PlayerArray= [];\n\n\n for (var i = 0; i < Word.length; i++) {\n PlayerArray[i] = \"_\";\n }\n\n/* \n================================\n RESET VARIABLE \n================================ \n*/ \n\n GuessesLeft = maxGuess;\n LettersGuessed = [];\n\n \n document.getElementById(\"Pictures\").src = \"\";\n \n document.getElementById(\"GuessesLeft\").style.color = \"\";\n\n \n updateScreen();\n}", "function buildColorSelection(){\n let colorSelection = [];\n for(let colors = 0; colors < 8; colors++){\n colorSelection.push(generateRandomColor());\n }\n return colorSelection\n}", "function setup() {\n playAudio();\n ansWordArr = [];\n\n // adds \"_\" to ansWordArr\n for (var i = 0; i < ansWord.length; i++) {\n if (ansWord[i] === \" \") {\n ansWordArr[i] = \" \";\n } else {\n ansWordArr[i] = \"_\";\n }\n }\n\n // reset the variables\n numGuessesRemaining = maxNumGuesses;\n guessedLetters = [];\n\n //removes color from numGuesses\n document.getElementById(\"numGuesses\").style.color = \"\";\n\n //show the selected elements on the screen\n updateScreen();\n}", "function nextSequence() {\r\n userClickedPattern = [];\r\n $(\"#level-title\").text(\"Level \" + level);\r\n var randomNumber = Math.floor(Math.random()*4);\r\n var randomChosenColor = buttonColors[randomNumber];\r\n\r\n gamePattern.push(randomChosenColor);\r\n\r\n $(\"#\"+randomChosenColor).fadeOut(100).fadeIn(100);\r\n playSound(randomChosenColor);\r\n level ++;\r\n}", "function displayShuffledArray(array){\n var i = 0\n var display = document.getElementById(\"display\");\n display.innerText = peasantQuest[storyTracker][\"array\"][i];\n word = peasantQuest[storyTracker][\"array\"][i];\n i++\n\n}", "set_colors()\r\n {\r\n /* colors */\r\n let colors = [\r\n Color.of( 0.9,0.9,0.9,1 ), /*white*/\r\n Color.of( 1,0,0,1 ), /*red*/\r\n Color.of( 1,0.647,0,1 ), /*orange*/\r\n Color.of( 1,1,0,1 ), /*yellow*/\r\n Color.of( 0,1,0,1 ), /*green*/\r\n Color.of( 0,0,1,1 ), /*blue*/\r\n Color.of( 1,0,1,1 ), /*purple*/\r\n Color.of( 0.588,0.294,0,1 ) /*brown*/\r\n ]\r\n\r\n this.boxColors = Array();\r\n for (let i = 0; i < 8; i++ ) {\r\n let randomIndex = Math.floor(Math.random() * colors.length);\r\n this.boxColors.push(colors[randomIndex]);\r\n colors[randomIndex] = colors[colors.length-1];\r\n colors.pop();\r\n }\r\n\r\n }", "function strt(){\n start = true;\n imgArray = [];\n\n // storing the orginal array in imgArray.\n for(var i =0; i<orgImgArray.length; i++){\n imgArray.push(orgImgArray[i]);\n }\n //calling function to chnage the position of array randomly.\n suffelArray(imgArray);\n \n}", "function setup() {\n var cnv = createCanvas(800, 800);\n cnv.position((windowWidth-width)/2, 30);\n background(200, 200, 200);\n fill(200, 30, 150);\n console.log(txt);\nbubbleSort();\nconsole.log(txt);\n}", "function nextSequence() {\n userClickedPattern = [];\n level++; // chanhing level\n\n $('#level-title').text('Level ' + level); //updating h1 by every level\n\n let randomNumber = Math.floor(Math.random() * 4); // reating random numbers\n let randomChosenColour = buttonColours[randomNumber]; // combine numbers with colors\n\n gamePattern.push(randomChosenColour); // push color names to array\n\n $('#' + randomChosenColour)\n .fadeIn(100)\n .fadeOut(100)\n .fadeIn(100); // flash animation in buttons\n\n // playing audio\n playSound(randomChosenColour);\n}", "function nextSequence() {\r\n userClickedPattern = [];\r\n level++;\r\n $(\"#level-title\").text(\"Level \" + level);\r\n var randomNumber = Math.floor(Math.random() * 4);\r\n var randomChosencolor = buttoncolors[randomNumber];\r\n gamePattern.push(randomChosencolor);\r\n $(\"#\" + randomChosencolor).fadeIn(100).fadeOut(100).fadeIn(100);\r\n playSound(randomChosencolor);\r\n}", "function nextSequence() {\r\n userClickedPattern = [];\r\n level++;\r\n $(\"h1\").text(\"Level \" + level);\r\n var randomNumber = Math.floor((Math.random() * 4));\r\n var randomChosenColor = buttonColors[randomNumber];\r\n gamePattern.push(randomChosenColor);\r\n $(\"#\" + randomChosenColor).fadeOut(100).fadeIn(100);\r\n playSound(randomChosenColor);\r\n}", "function nextSequence(){\n\n userClickedPattern = [];\n\n $(\"#level-title\").text(\"Level \" + level);\n level++;\n\n var randomNumber = Math.floor(Math.random() * 4);\n var randomChosenColour = buttonColours[randomNumber];\n gamePattern.push(randomChosenColour);\n\n $(\"#\" + randomChosenColour).fadeOut(250).fadeIn(250);\n playSound(randomChosenColour);\n\n console.log(randomNumber);\n console.log(randomChosenColour);\n\n}", "function arrayToScreen(){\n var outputString = \"\";\n for (var i = 0; i < randomArray.length; i++){\n outputString += \"The value in array position \" + i + \" is \" + randomArray[i] + \"<br>\";\n }\n document.getElementById(\"output\").innerHTML = outputString;\n}", "function arrayToScreen(){\n var outputString = \"\";\n for (var i = 0; i < randomArray.length; i++){\n outputString += \"The value in array position \" + i + \" is \" + randomArray[i] + \"<br>\";\n }\n document.getElementById(\"output\").innerHTML = outputString;\n}", "function setup()\n{\n textSize(8*scaleFactor);\n createCanvas(0.9*windowWidth, 0.9*windowHeight); //Sets the createCanvas of the app. You should modify this to your device's native createCanvas. Many phones today are 1080 wide by 1920 tall.\n noStroke(); //my code doesn't use any strokes.\n predictionary.addWords(topHundo);\n phrases=shuffle(phrases)\n}", "function makeFinalMarkov(textStamps, markovText){\n var output = [];\n for(var i = 0; i < markovText.length; i++){\n var curWord = markovText[i];\n var chooseArr = textStamps[curWord];\n output.push(chooseArr[Math.floor(Math.random() * chooseArr.length)]);\n }\n return output;\n}", "function nextSequence() {\r\n level++;\r\n userClickedPattern = [];\r\n $(\"#level-title\").text(\"Level \" + level);\r\n var randomNumber = Math.floor(Math.random() * 4);\r\n var chosenColor = buttonColors[randomNumber];\r\n gamePattern.push(chosenColor);\r\n $(\"#\" + chosenColor).fadeOut(200).fadeIn(200);\r\n playSound(chosenColor);\r\n}", "function setup() {\n var canvas = createCanvas(canvasWidth, canvasHeight);\n canvas.parent('canvasHome');\n background(34, 139, 34);\n $('#rainArray').append(rainFallString);\n $('#bucket').append(bucket);\n\n}", "function nextSequence() { \n gamePattern.push(buttonColors[Math.floor(Math.random() * 4)]) \n}", "function fillColorArray() {\n return randomColor({\n count: 100\n });\n }", "function printUp(){\n var arr = [];\n for(var i = 255; i < 513; i++){\n arr.push(i);\n // console.log(arr);\n }\n return arr;\n}", "function resetPhrase() { \n const ul = document.getElementById('phrase').firstElementChild;\n while (ul.firstElementChild) {\n ul.removeChild(ul.firstElementChild);\n } \n\n let phraseArray = getRandomPhraseAsArray(phrases);\n addPhraseToDisplay(phraseArray); \n console.log(phraseArray);\n}", "function randFace() {\n return [\"bau\", \"cua\", \"tom\", \"ca\"]\n [rand(0, 3)];\n}", "function nextSequence(){\n userClickedPattern = [];\n level++;\n $(\"h1\").text(\"Level \" + level);\n\n var randomNumber = Math.round(Math.random()*3);\n var randomChosenColor = buttonColors[randomNumber];\n gamePattern.push(randomChosenColor);\n\n $(\"#\" + randomChosenColor).fadeIn(200).fadeOut(200).fadeIn(200);\n playSound(randomChosenColor);\n}", "function computerGenerateChoice() {\n \n // Math.floor(Math.random() * 4) ;\n game.computerArrayOfChoicesToMatch.push(game.colors[(Math.floor(Math.random() * 4))])\n\n\n}", "function setTestValues() {\n var testValues = new Array();\n\n if (labMode) {\n testValues[ 0] = new Array(37.984, 13.555, 14.063, \"dark skin\");\n testValues[ 1] = new Array(65.711, 18.133, 17.813, \"light skin\");\n testValues[ 2] = new Array(49.930, -4.883, -21.922, \"blue sky\");\n testValues[ 3] = new Array(43.141, -13.094, 21.906, \"foliage\");\n testValues[ 4] = new Array(55.109, 8.844, -25.398, \"blue flower\");\n testValues[ 5] = new Array(70.719, -33.398, -0.195, \"bluish green\");\n testValues[ 6] = new Array(62.664, 36.039, 57.094, \"orange\");\n testValues[ 7] = new Array(40.023, 10.406, -45.961, \"purplish blue\");\n testValues[ 8] = new Array(51.125, 48.242, 16.250, \"moderate red\");\n testValues[ 9] = new Array(30.328, 22.977, -21.586, \"purple\");\n testValues[10] = new Array(72.531, -23.711, 57.258, \"yellow green\");\n testValues[11] = new Array(71.938, 19.359, 67.859, \"orange yellow\");\n testValues[12] = new Array(28.781, 14.180, -50.297, \"blue\");\n testValues[13] = new Array(55.258, -38.344, 31.367, \"green\");\n testValues[14] = new Array(42.102, 53.375, 28.188, \"red\");\n testValues[15] = new Array(81.734, 4.039, 79.820, \"yellow\");\n testValues[16] = new Array(51.938, 49.984, -14.570, \"magenta\");\n testValues[17] = new Array(51.039, -28.633, -28.641, \"cyan\");\n testValues[18] = new Array(96.539, 0.000, 0.000, \"white\");\n testValues[19] = new Array(81.258, 0.000, 0.000, \"neutral 8\");\n testValues[20] = new Array(66.766, 0.000, 0.000, \"neutral 6.5\");\n testValues[21] = new Array(50.867, 0.000, 0.000, \"neutral 5\");\n testValues[22] = new Array(35.656, 0.000, 0.000, \"neutral 3.5\");\n testValues[23] = new Array(20.461, 0.000, 0.000, \"black\");\n } else {\n testValues[ 0] = new Array( 80.859, 66.984, 54.117, \"dark skin\"); \n testValues[ 1] = new Array(158.984, 134.805, 113.453, \"light skin\");\n testValues[ 2] = new Array( 93.945, 101.414, 133.258, \"blue sky\");\n testValues[ 3] = new Array( 74.891, 85.898, 55.375, \"foliage\");\n testValues[ 4] = new Array(117.938, 110.547, 154.383, \"blue flower\");\n testValues[ 5] = new Array(126.953, 167.813, 157.258, \"bluish green\");\n testValues[ 6] = new Array(166.602, 117.953, 53.539, \"orange\");\n testValues[ 7] = new Array( 79.133, 74.336, 144.883, \"purplish blue\");\n testValues[ 8] = new Array(140.938, 82.898, 79.453, \"moderate red\");\n testValues[ 9] = new Array( 68.016, 49.133, 82.281, \"purple\");\n testValues[10] = new Array(144.016, 169.398, 74.227, \"yellow green\");\n testValues[11] = new Array(181.305, 151.672, 59.617, \"orange yellow\");\n testValues[12] = new Array( 56.617, 50.094, 120.367, \"blue\");\n testValues[13] = new Array( 84.836, 123.047, 69.234, \"green\");\n testValues[14] = new Array(119.844, 59.328, 46.445, \"red\");\n testValues[15] = new Array(199.367, 188.328, 65.641, \"yellow\");\n testValues[16] = new Array(143.297, 84.891, 127.109, \"magenta\");\n testValues[17] = new Array( 77.656, 110.742, 147.680, \"cyan\");\n testValues[18] = new Array(242.313, 242.313, 242.313, \"white\");\n testValues[19] = new Array(190.008, 190.008, 190.008, \"neutral 8\");\n testValues[20] = new Array(145.172, 145.172, 145.172, \"neutral 6.5\");\n testValues[21] = new Array(101.672, 101.672, 101.672, \"neutral 5\");\n testValues[22] = new Array( 66.211, 66.211, 66.211, \"neutral 3.5\");\n testValues[23] = new Array( 36.953, 36.953, 36.953, \"black\");\n }\n return(testValues);\n}", "function createArrays() {\n phraseArray = [];\n blankArray = [];\n phraseArray = secretPhrase.split(\"\");\n phraseArray.forEach( () => blankArray.push(\"_\"));\n spanSecretRandom.innerHTML = blankArray.join(\" \");\n}", "function answer(){\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n }", "function createEmojiList(list, lvl) {\r\n let selected = []\r\n for (let i = 0; i < lvl + 2; i++) {\r\n let index = Math.floor(Math.random() * list.length)\r\n selected.push(list[index]);\r\n \r\n }\r\n \r\n return selected\r\n}", "function wordBank() {\n var underScore = [];\n answer = moviebank[Math.floor(Math.random() * moviebank.length)];\n for (var i = 0; i < answer.length; i++) {\n underScore.push(\"_\");\n console.log(underScore);\n };\n document.getElementById(\"movieword\").textContent = underScore.join(\" \");\n underScoreGlobal = underScore;\n underScore = [];\n }", "function resetIn(){\r\n\tarr=generateRandomColor(noOfSquares);\r\n\tpicked=arr[randomPickedColorIndex()];\r\n\tcolorDisplay.textContent = picked;\r\n\tmessage.textContent=\"\";\r\n\thead.style.backgroundColor= \"steelblue\";\r\n\r\n\tfor(var i=0;i<squares.length;i++)\r\n\t\tsquares[i].style.backgroundColor=arr[i];\r\n\r\n}", "function setColors(colorArr){ //removed \"[]\"\n let i = 0;\n let len = colorArr.length;\n for(i = 0; i < len; i++){\n colorArr[i] = {red: randomInt(255), green: randomInt(255), blue: randomInt(255)};\n //TODO we will need to add a function that makes sure that no two colors are the same.\n //Maybe use a while loop? (RON)\n }\n}", "function getRandomEmoji(){\n\tvar emojiSet = [\n\t\"1\",\n\t\"2\",\n\t\"3\",\n\t\"4\",\n\t\"5\",\n\t\"6\",\n\t\"7\",\n\t\"8\",\n\t\"9\",\n\t\"10\",\n\t\"11\",\n\t\"12\",\n\t\"13\",\n\t\"14\",\n\t\"15\",\n\t\"16\"\n\t];\n\n\tvar selectEmoji = emojiSet[Math.floor(Math.random() * 16)];\n\t//console.log(selectColor);\n\treturn selectEmoji;\n}", "function NewBackgroundColors() {\n return backgroundColors[Math.floor(Math.random() * backgroundColors.length)];\n}", "function nextSequence() {\n\n userClickedPattern = [];\n\n // Selecting a random color from array\n let randomNumber = Math.floor(Math.random() * 4);\n let randomChosenColor = buttonColors[randomNumber];\n gamePattern.push(randomChosenColor);\n\n // Assigning flash animation to random button from array\n $(\"#\" + randomChosenColor).fadeIn(100).fadeOut(100).fadeIn(100);\n\n // Play correct sound for the next button in the sequence\n playSound(randomChosenColor);\n\n // Go up a Level\n level++;\n\n // Update title of game\n $(\"#level-title\").text(\"Level \" + level);\n\n}", "function assignColors() {\r\n\t// assign the right color\r\n\trightColor = colors[Math.floor(Math.random()*mode)];\r\n\t// display it\r\n\tcolorDisplay.textContent = rightColor;\r\n\r\n\t// loop through colors array and assign rgb to squares\r\n\tfor(var i = 0; i < colors.length; i++){\r\n\t\tsquares[i].style.backgroundColor = colors[i];\r\n\t} \r\n}", "function catColors(array, color){\n //your code here!\n}", "function nextSequence() {\n userClickedPattern = [];\n //increases the level by 1\n level++;\n //displays the level the user is currently at\n $(\"#level-title\").text(\"Level \" + level);\n var randomNumber = Math.floor(Math.random() * 4);\n var randomChosenColor = buttonColors[randomNumber];\n\n //push random color intern gamePattern array\n gamePattern.push(randomChosenColor);\n\n // animates the randomly chosen color\n $(\"#\" + randomChosenColor).fadeIn(100).fadeOut(100).fadeIn(100);\n\n\n playSound(randomChosenColor);\n}", "function setup() {\n createCanvas(600, 400);\n for (var i = 0; i < 15; i++) {\n circles.push(new drawaCircle());\n }\n noCursor();\n strcolor = random([\"red\", \"green\", \"blue\", \"white\", \"yellow\", \"purple\"]);\n}", "function randColor() {\n\n // Set random word\n\n\n // Set random word color\n\n\n }", "function startUp() {\n for (var i = 0; i < randomElement.length; i++) {\n answerArray[i] = \"_\";\n //console.log(answerArray);\n }\n s = answerArray.join(\" \");\n //console.log(s);\n document.getElementById(\"answer\").innerHTML = s;\n}", "function colorGeneration () {\n\tvar rgb = []; \n\tfor (var i=0; i<3;i++){\n\t\trgb[i] = Math.floor(Math.random() * 256); // gera numeros aleatorios entre 0 e 255\n\t}\n\treturn rgb; \n}", "function nextSequence()\r\n{ userClickedPattern = [];\r\n level = level+1;\r\n $(\"h1\").text(\"level \"+level);\r\n var rn = Math.floor( Math.random()*4 ) ;\r\n var randomChosenColor = buttonColors[rn];\r\n sound(randomChosenColor);\r\n gamePattern.push(randomChosenColor);\r\n $(\"#\"+randomChosenColor).fadeIn(200).fadeOut(200).fadeIn(200);\r\n}", "function nextSequence() {\nuserClickedPattern=[];\nlevel++;\n$(\"#level-title\").text(\"Level \" + level);\n\nvar randomNumber=Math.floor(Math.random() *4);\n var randomChosenColour =buttonColours[randomNumber];\n gamePattern.push(randomChosenColour);\n\n $(\"#\" + randomChosenColour).fadeIn(100).fadeOut(100).fadeIn(100);\n playSound(randomChosenColour);\n}", "function tcolor(){\n var tarray=subset(garray,9);\n\n //subset of main grid\n function subset(arr,n){\n var res=new Array(n);\n var len=arr.length;\n var taken = new Array(len);\n while(n--){\n var x=Math.floor(Math.random()*len);\n res[n]=arr[x in taken? taken[x]:x];\n taken[x]= --len in taken? taken[len]:len;}\n return res;\n }\n var titem= document.querySelectorAll('.box');\n for(let i=0;i<titem.length;++i){\n titem[i].style.backgroundColor = tarray[i];\n }\n }", "function getRandomPhraseAsArray(arr){\n ul.textContent = \"\";\n const randomPhrase = arr[Math.floor(Math.random()*phrases.length)];\n message = randomPhrase;\n const phraseAsArray = randomPhrase.split(\"\");\n return phraseAsArray;\n }", "function createAnsArray(){\n for (let i=0; i<numberOfButtons; i++) {\n ansArray.push($lisArray[Math.floor(Math.random()*$lisArray.length)]);\n }\n console.log(ansArray);\n }", "function nextSequence(){\n userClickedPattern = [];\n level++;\n\n $(\"#level-title\").html(\"level \" + level);\n\n var randomNumber = Math.floor((Math.random() * 4));\n\n var randomChosenColor = buttonColors[randomNumber];\n\n gamePattern.push(randomChosenColor);\n\n //select the chosen collor tile and make it fade in and out\n $(\"#\" + randomChosenColor).fadeIn(100).fadeOut(100).fadeIn(100);\n\n playSound(randomChosenColor);\n}", "function nextSequence()\n{\n userClickedPattern=[];\n level++;\n $(\"#level-title\").text(\"Level \"+level);\n var randomNumber=Math.floor((Math.random() * 4));\n var randomChosenColour=buttonColours[randomNumber];\n gamePattern.push(randomChosenColour);\n $(\"#\"+randomChosenColour).fadeIn(100).fadeOut(100).fadeIn(100);\n playSound(randomChosenColour);\n}", "function nextSequence(){\n \n userClickedPattern = []\n \n level++;\n $(\"#level-title\").text(\"Level \"+level);\n //it generates a random numver between 0 and 4, \n //it get its color and it .push into the gamePattern array, \n //then it plays the sound of that color and animates it\n let randomNumber = Math.floor(Math.random()*4);\n let randomChosenColor = buttonColors[randomNumber];\n gamePattern.push(randomChosenColor);\n \n $(\"#\"+randomChosenColor).fadeIn(100).fadeOut(100).fadeIn(100);\n playSound(randomChosenColor);\n}", "function gameInitialize() {\n //Chooses a random word from the words array\n wordPicker = words[Math.floor(Math.random() * words.length)];\n console.log(wordPicker);\n\n\n for (var i = 0; i < wordPicker.length; i++){\n answerArray[i] = '_';\n }\n console.log(answerArray[i]);\n\n answer = answerArray.join(\" \");\n wrong\n\n\n}", "function getRandomRGB(randomArr){\n for(var i = 0; i< randomArr.length;i++){\n randomArr[i] = getRandomIntInclusive(0,255);\n }\n return randomArr;\n}", "function nextSequence() {\n userClickedPattern = []; // clears user pattern\n level++;\n $(\"h1\").text(\"Level \" + level); //update level\n\n var randomNumber = Math.floor( Math.random() * 4);\n var randomChosenColor = buttonColors[randomNumber];\n gamePattern.push(randomChosenColor); // add random to color\n playPattern(); // play updated gamePattern to user\n\n}", "function randomColor() { return Array.from({ length: 3 }, () => Math.floor(Math.random() * 256)); }", "function getRandomColors() {\n // Search thru colors array for random color\n let myRandomColor = colors[Math.floor(Math.random() * colors.length)];\n // Returns #+value.\n return myRandomColor;\n }", "function arraySelect() {\n let selectedArray = charArray[Math.floor(Math.random() * charArray.length)];\n return selectedArray;\n}", "function randomize(){\n let rgb = [];\n for(let i = 0; i < 3; i++){\n rgb.push(Math.floor(Math.random() * 255));\n }\n return rgb;\n}", "function nextSequence() {\n\n userClickedPattern = [];\n gameLevel++;\n $(\"#level-title\").text(\"Level \" + gameLevel);\n\n // Use Math random() and floor() functions to get random number 0 ... 9999...\n // multiply this by number of buttons, then floor to get number range 0 .. 3\n var randomNumber = Math.random() * 4;\n\n randomNumber = Math.floor(randomNumber);\n\n // Capture randomly chosen colour\n randomChosenColour = buttonColours[randomNumber];\n\n// Add the random chosen colour to the end of array gamePattern\n gamePattern.push(randomChosenColour);\n\n// Play the sound for the randomly chosen colour\n playSound(randomChosenColour);\n\n// Animate the button for the randonly chosen colour\n animateButton(randomChosenColour);\n\n}", "generateSequence() {\n this.sequence = new Array(finalLevel)\n .fill(0)\n .map(element => Math.floor(Math.random() * numberOfColors));\n }", "function nextSequence(){\r\n //Once nextSequence() is triggered, reset the userClickedPattern to an empty array ready for the next level.\r\n userClickPattern=[];\r\n level++;\r\n //change the value of level\r\n $(\"#level-title\").text(\"Level \" + level);\r\n //generate a random number\r\n var randomNumber=Math.floor(Math.random()*4);\r\n //Randomly Generated color\r\n randomChosenColor=buttonColors[randomNumber];\r\n //push colors to gamepettern\r\n gamePattern.push(randomChosenColor);\r\n //jQuery to Select the color id and Animate\r\n $(\"#\" + randomChosenColor).fadeIn(100).fadeOut(100).fadeIn(100);\r\n //Query to set audio\r\n playSound(randomChosenColor);\r\n}", "drawLetters() {\n let lettersInhHand = _.sampleSize(letterBag, 10);\n console.log(lettersInhHand);\n return lettersInhHand\n }", "get wrongColors() {\n // first, empty the array of old colors\n wrongColorsArray = [];\n\n let numWrongColors;\n round <= 6 ? (numWrongColors = round) : (numWrongColors = 6);\n\n for (let i = numWrongColors; i > 0; i--) {\n wrongColorsArray.push(chroma.random().hex());\n }\n return wrongColorsArray;\n }", "function getRandomColors() {\n let rand = Math.floor(Math.random() * colors.length);\n return colors[rand];\n}", "function shuffle () {\n for (var i = 0; colorSet.length > 0; i += 1) {\n colorShuffled = colorShuffled.concat(colorSet.splice(Math.floor(Math.random() * colorSet.length), 1));\n }\n}", "function nextSequence() {\n userClickedPattern = [];\n level++;\n var randomNumber = Math.floor(Math.random() * 4);\n var randomChosenColour = buttonColours[randomNumber];\n gamePattern.push(randomChosenColour);\n $(\"#\" + randomChosenColour)\n .fadeOut(100)\n .fadeIn(100);\n playSound(randomChosenColour);\n $(\"h1\").text(\"Level \" + level);\n}", "function randomSelection() {\n secretPhrase = secretArray[Math.floor(Math.random() * secretArray.length)];\n console.log(secretPhrase)\n}", "function setColor (arr); {\n\n}// CODE HERE", "function color(){\n var random_colors = [\"#c2ff3d\",\"#ff3de8\",\"#3dc2ff\",\"#04e022\",\"#bc83e6\",\"#ebb328\",\"#ekb123\"];\n\n if(i > random_colors.length - 1){\n i = 0;\n }\n return random_colors[i++];\n}", "function getWinningColor(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function getRandomPhraseAsArray () {\n var result= phrase[Math.floor(Math.random() * phrase.length)]; \n result = result.split(\"\");\n return result;\n}", "function nextSequence() {\r\n gameStarted = true;\r\n level++;\r\n userChosenColors = [];\r\n curIndex = 0;\r\n $(\"h1\").text(\"Level \" + level);\r\n var randomNumber = Math.floor(Math.random() * 4);\r\n \r\n var randomChosenColor = buttonColors[randomNumber];\r\n gamePattern.push(randomChosenColor);\r\n\r\n $(\".\" + randomChosenColor).fadeOut(300).fadeIn(300);\r\n playSound(randomChosenColor);\r\n}", "function genRandomColors(num){\n var arr=[]\n for (var i=0; i<num; i++){\n arr.push(randomRGB());\n }\n return arr;\n}", "function nextSequence() {\n userClickedPattern = [];\n var randomNumber = (Math.random() * 3) + 1;\n var randomChosenColour = buttonColour[Math.floor(randomNumber)];\n gamePattern.push(randomChosenColour);\n var randomID = \"#\" + randomChosenColour;\n $(randomID).fadeOut(100).fadeIn(100);\n playSound(randomID);\n level++;\n $(\"h1\").text(\"Level \" + level);\n\n}", "function generateUC(){\n return uc[Math.floor(Math.random()*26)];\n}", "getText(numWords = 100) {\n const objKeys = Object.keys(this.markovChain);\n // console.log(\"objKeys = \", objKeys);\n let chosenWord;\n let currNumWords = text.length;\n let randomKeyIdx = this._getRandomNum(objKeys);\n let key = objKeys[randomKeyIdx];\n let text = [];\n\n while (chosenWord !== null && currNumWords <= numWords) {\n console.log(\"key = \", key);\n let wordList = this.markovChain[key];\n console.log(\"wordlist = \", wordList);\n let randomWordIdx = this._getRandomNum(wordList);\n\n if (wordList.length === 1) chosenWord = wordList[0];\n \n chosenWord = wordList[randomWordIdx];\n // console.log(\"chosenWord = \", chosenWord);\n \n key = chosenWord;\n text.push(chosenWord);\n currNumWords = text.length;\n }\n console.log(\"text = \", text.join(' '));\n return text.join(' ');\n }", "function finalColors(){\n\treset.textContent=\"Play Again?\";\n\th1.style.backgroundColor=pickedColor;\n\tfor(var i=0;i<squares.length;i++)\n\t\tsquares[i].style.backgroundColor=pickedColor;\n}", "function produceColors(lst) {\r\n\tvar red, green, blue;\r\n\tvar i = 0;\r\n\twhile ( i < 60){\r\n\t\tblue = Math.random();\r\n\t\tred = Math.random();\r\n\t\tgreen = Math.random();\r\n\t\tlst.push(vec4(red,green,blue,1.0));\r\n\t\ti++;\r\n\t}\r\n\treturn lst;\r\n}", "function setup() {\n createCanvas(1200, 800);\n textSize(20);\n textAlign(CENTER);\n \n randomizeCoords();\n }", "function getRandomColor() {\n return arrayOfColors[Math.floor(Math.random()*arrayOfColors.length)];\n}", "function reset () {\n shuffledArray = visualizer.getRandomArray();\n visualizer.drawArray(shuffledArray);\n}", "function getColors(len){\r\n\tfor(var i=0 ; i<len ; i++ )\r\n\t{\r\n\t\tcolorArr[i]=generateColor();\r\n\t}\r\n}", "getText(numWords = 100) {\n // MORE CODE HERE\n let textArr = [];\n let wordChoice = Array.from(this.words);\n let word = this.getRandomElement(wordChoice)\n \n \n while (textArr.length < numWords && word !== null){\n textArr.push(word)\n\n let nextWord = this.getRandomElement(this.chain.get(word))\n //append to textarr the newly defined word\n word = nextWord\n\n }\n return textArr.join(\" \");\n }", "function generateRandomColors(size){\r\n\tvar arry = [];\r\n\r\n\t//Store random colors to the array\r\n\tfor(var i = 0; i<size; i++){\r\n\t\tarry[i] = randomColor();\t\t\t\t\t\t\t\r\n\t}\t\r\n\treturn arry;\r\n}", "function getRandomColor(array) {\n const index = getRandomNumber(array);\n document.querySelector('body').style.background = array[index];\n}", "function getRandomPhraseAsArray(arr) {\n return arr[Math.floor(Math.random() *arr.length)].split('');\n}", "function setup() {\n createCanvas( windowWidth, windowHeight );\n //creating a canvas//\n frameRate(60);\n //setting framerate//\n background('white');\n let dotBlue = color( 0, 100, 0, 100);\n let dotGreen = color( 0, 0, 100, 100);\n let dotRed = color( 100, 0, 0, 100);\n let rainArray = [dotBlue, dotGreen, dotRed];\n//defining rain array variables for canvas\n\n\n}", "function getRandomPhraseAsArray(arr){\n const randomPhrase = arr[Math.floor(Math.random() * arr.length)];\n return randomPhrase;\n }", "function resetWord() {\n index = Math.floor(Math.random() * colors.length);\n chosenWord = colors[index];\n underScore = [];\n guessesLeft = 5;\n guessedLetters = [];\n wrongLetters = [];\n console.log(chosenWord);\n updateDomElements();\n generateUnderScore();\n audio.play();\n}", "function setup() {\n\tcreateCanvas(500, 500); //create a 500px X 500px canvas\n //Pick colors randomly \n r=random(255);\n g=random(255);\n b=random(255);\n}", "function randomPickedColorIndex()\r\n{\r\n\treturn Math.floor(Math.random()*arr.length);\r\n}", "function colors() {\r\n\t// получаем элементы с атрибутом Data-colors\r\n\tlet element = document.querySelectorAll('[data-colors]');\r\n\telement.forEach(function(item){\r\n\t\tcreateColorText(item);\r\n\t});\r\n}", "function generateRGB() {\n let rgb = [];\n for (let i = 0; i < 3; i++) {\n rgb.push(Math.floor(Math.random() * 255));\n }\n console.log(`rgb(${rgb.toString(\",\")})`);\n}", "function pickColor(colorArry){\r\n\tvar correctColorIdx = Math.floor(Math.random()*colorArry.length);\t//choose a random index, use the array length as it may be 3/6sqaures\r\n\trgbDisplay.textContent = colorArry[correctColorIdx];\t\t\t\t//display the \"RGB Value\" of the picked color\r\n\treturn colorArry[correctColorIdx];\t\t\t\t\t\t\t\t\t//return the \"RGB Value\"\r\n}", "function arrRandomColor(){\r\n var red = Math.floor(Math.random() * 256); // random number for red\r\n var green = Math.floor(Math.random() * 256); // random number for green\r\n var blue = Math.floor(Math.random() * 256); // random number for blue;\r\n return \"rgb(\" +red + \", \" + green+ \", \" + blue+ \")\";\r\n}", "function randstr()\n{\n\tvar output = \"\";\n\tfor (var i=0; i < config.msglen; i++\t)\n\t{\n\t\toutput += alpha[rand(0,squares.length)];\n\t}\n\tconsole.log(output);\n\treturn output;\n}", "function colorpicker(num){\n let arr=[];\n for(let i=0;i<num;i++)\n {\n let r=Math.floor(Math.random() * 256);\n let g=Math.floor(Math.random() * 256);\n let b=Math.floor(Math.random() * 256);\n arr.push(\"rgb(\"+r+\", \"+g+\", \"+b+\")\");\n }\n return arr;\n}" ]
[ "0.6421091", "0.59906214", "0.5901348", "0.5840064", "0.5830631", "0.5826966", "0.58205366", "0.5719183", "0.57159007", "0.570526", "0.56829214", "0.5641998", "0.5638426", "0.5607687", "0.5601075", "0.5600142", "0.55981666", "0.55981666", "0.55859697", "0.55839777", "0.55838525", "0.5556398", "0.555583", "0.5533631", "0.55216336", "0.55170196", "0.55133206", "0.5501105", "0.550017", "0.54974437", "0.5492054", "0.548151", "0.54651946", "0.5462362", "0.5458572", "0.5456521", "0.54472864", "0.54455495", "0.5445431", "0.54452854", "0.54379284", "0.5436866", "0.5427004", "0.5416503", "0.5413315", "0.5411624", "0.54087985", "0.5405348", "0.54051024", "0.5402651", "0.5386947", "0.5386584", "0.5383165", "0.537505", "0.536412", "0.5363957", "0.5363068", "0.5357694", "0.5352767", "0.5351612", "0.535019", "0.53481036", "0.5346288", "0.53439695", "0.5341756", "0.53413254", "0.53326607", "0.5325945", "0.530967", "0.5309459", "0.52958256", "0.5294551", "0.5290282", "0.5285623", "0.52845633", "0.5275004", "0.5274286", "0.52740574", "0.52681196", "0.52649885", "0.5264449", "0.52625984", "0.52617836", "0.5261102", "0.5258101", "0.52546483", "0.5254592", "0.52544916", "0.5252065", "0.5250882", "0.52464896", "0.52428967", "0.5239664", "0.52395135", "0.5238976", "0.52387017", "0.5236806", "0.52357554", "0.5232803", "0.52306765" ]
0.57818675
7
The data manager. let dataManager = require(__dirname + "/data/testDataManager.js")(db, engine, fs, promise) The data object manager. let dataObjectManager Run the test suite.
async function run() { let test // await db.init() // TODO : Run the data manager's test data setup // dataObjectManager = await require(__dirname + '/../../server/dataObjects/dataObjectManager.js')(engine, db, fs, promise) for (test in config) { if (config[test] === 1) { if (test === "extensionManager") { testExtensionManager.run() } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DataManager() {}", "function DataManager() {\n\t\t(0, _classCallCheck3.default)(this, DataManager);\n\n\t\tthis.dataset = [];\n\t}", "function DataManager(dataModel) {\n this.model = dataModel;\n }", "function DataManager() {\n\n /**\n * Stores all documents by UID.\n * @property documentsByUid\n * @type gs.Document[]\n */\n this.documentsByUid = {};\n\n /**\n * Stores all documents.\n * @property documents\n * @type gs.Document[]\n */\n this.documents = [];\n\n /**\n * Indiciates if all requested documents are loaded.\n * @property documentsLoaded\n * @type boolean\n */\n this.documentsLoaded = true;\n\n /**\n * @property events\n * @type gs.EventEmitter\n */\n this.events = new gs.EventEmitter();\n }", "function Data(dataSource,query){this.initDataManager(dataSource,query);}", "function Manager() {}", "function Manager() {}", "function DataStore() {}", "function DataStore() {}", "function DataManager(networkSource, selectedNode, allNodes, OPT, budget){\n\tthis.networkSource = []; \t\t// in case there are multiple networks, store the roots in array\n\tthis.selectedNode = selectedNode; // the root fo the currently selected subnetwork\n\tthis.allNodes = allNodes; \t\t// dictionary of all nodes indexed by node id\n\n\tthis.OPT = OPT;\t\t\t\t\t\t// the solution data\n\tthis.budget = budget; \t\t\t\t// the current budget available \n}", "function init() {\n \n inquirer.prompt(managerQuestions).then((managerData) => {\n \n\n const {name, id, email, officeNumber } = managerData;\n const manager = new Manager (name, id, email, officeNumber);\n\n teamData.push(manager);\n addEmployee()\n console.log(manager);\n });\n}", "function DataService(){\n /*\n * dataObj is used to simulate getting the data from a backend server\n * The object will hold data which will then be returned to the other\n * factory declared in js/factory/quiz.js which has this factory\n * as a dependency\n */\n\n var dataObj = {\n companiesData: companiesData,\n quizQuestions: quizQuestions,\n correctAnswers: correctAnswers\n };\n\n // returning the dataObj to anything that uses this factory as a\n // dependency\n return dataObj;\n }", "function managerData() {\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Please provide your teams name: \",\n name: \"teamTitle\"\n },\n {\n type: \"input\",\n message: \"Who is the manager of this project/team?\",\n name: \"managerName\"\n },\n {\n type: \"input\",\n message: \"Please provide the managers ID: \",\n name: \"managerID\"\n },\n {\n type: \"input\",\n message: \"Please provide the managers email address: \",\n name: \"managerEmail\"\n },\n {\n type: \"input\",\n message: \"Please provide the managers office number: \",\n name: \"officeNumber\"\n }]).then(managerResponse => {\n manager = new Manager(managerResponse.managerName, managerResponse.managerID, managerResponse.managerEmail, managerResponse.officeNumber);\n teamTitle = managerResponse.teamTitle;\n secondaryEmployeeData();\n });\n}", "function initManager() {\n employeeList.length = 0;\n inquirer.prompt(managerQues).then(function (data) {\n const manager = new Manager(\n data.name,\n employeeID,\n data.email,\n data.officeNumber\n );\n employeeID++;\n employeeList.push(manager);\n checkEmployeeType(data.type);\n });\n}", "function setUpMockData() {\n fetch('/source/Backend/MockData.json')\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n mockData = data;\n console.log('here is the mock Data', mockData);\n console.log('setting up mock data');\n createDay(mockData.sampleDay1);\n createDay(mockData.sampleDay2);\n createMonthlyGoals(mockData.sampleMonthlyGoals);\n createYearlyGoals(mockData.sampleYearlyGoals);\n createSettings(mockData.sampleSetting);\n });\n\n /* sample way to update the monthly goals\n let month = mockData.sampleMonthlyGoals;\n month.goals[0].text = 'run some laps';\n updateMonthGoals(month);\n */\n\n /* sample way to delete day\n \n deleteDay('05/20/2021');\n */\n\n /* sample way to get the monthly goals\n let req = getMonthlyGoals('12/2021');\n req.onsuccess = function (e) {\n console.log('got monthly goals');\n console.log(e.target.result);\n };\n */\n}", "function newManager() {\n return new breeze.EntityManager({\n dataService: dataService,\n metadataStore: metadataStore\n });\n }", "async function getManager(){\n \n let manager = new Manager();\n // calls class specific question stores the results into the new class object\n let roleResultObj = await inquirer.prompt(manager.getRole());\n manager.role = roleResultObj.role\n\n let nameResultObj = await inquirer.prompt(manager.getName());\n manager.name = nameResultObj.name;\n\n let idResultObj = await inquirer.prompt(manager.getId());\n manager.id = idResultObj.id;\n\n let emailResultObj = await inquirer.prompt(manager.getEmail());\n manager.email = emailResultObj.email;\n\n let officeNumberResultObj = await inquirer.prompt(manager.getOfficeNumber());\n manager.specialAttr = officeNumberResultObj.officeNumber;\n // pushes the manager object into the team array\n teamArray.push(manager);\n\n getTeamMembers();\n}", "function ResourceManager(){\n\tthis.data = {};\n\tthis.load = (function(idString, data){\n\t\tif(this.data[idString]!==undefined){\n\t\t\tthrow new Error(\"RESOURCE MANAGER: idString already used: \" + idString);\n\t\t}else{\n\t\t\tthis.data[idString] = data;\n\t\t}\n\t}).bind(this);\n\tthis.get = (function(idString){\n\t\tif(this.data[idString]===undefined){\n\t\t\tthrow new Error(\"RESOURCE MANAGER: idString not found: \" + idString);\n\t\t}else{\n\t\t\treturn this.data[idString];\n\t\t}\n\t}).bind(this);\n}", "function main() {\n // First, we need to initialize the data model\n sequelize.initSequelize();\n\n // Then, continue populating the test data\n populateAllTestData(false).then(() => {\n process.exit(0);\n }).catch((err) => {\n console.error(err);\n process.exit(1);\n });\n}", "function manager() {\n console.log(\"let's get started with building your team!\");\n inquirer.prompt(managerSetup).then(function(data) {\n const manager = new Manager(data.managerName, data.managerId, data.managerEmail,data.managerOfficeNumber);\n fullTeam.push(manager);\n emptyId.push(data.managerId);\n\n \n team();\n });\n}", "async function newManager() {\n\tconst input = await inquirer.prompt([\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"name\",\n\t\t\tmessage: \"What is the name of the manager for this Project?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"id\",\n\t\t\tmessage: \"What is the manager's employee ID number?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"email\",\n\t\t\tmessage: \"What is the manager's email address?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"office\",\n\t\t\tmessage: \"What is the manager's office number?\"\n\t\t}\n\t]);\n\n\t// Creates a new manager using the constructor function from Manager.js. The user inputs are stored as an object.\n\tconst manager = new Manager(\n\t\tinput.name,\n\t\tinput.id,\n\t\tinput.email,\n\t\tinput.office\n\t);\n\n\t// Pushes the new manager class to the empty team array with global scope.\n\tteamArray.push(manager);\n\n\t// Runs the new team function, which asks the user if they want to add other employees.\n\tnewTeam();\n}", "function createManager() {\n // define constant questions for the inquirer prompt\n console.log(\"Create your team now\")\n\n\n // use inquirer to gather information about the development team members by prompting the questions variable\n inquirer\n .prompt(managerQuestions)\n // use .then promise and feed in the parameters of name, id, email, role, officeNumber, gitHub, and school\n .then(function (answers) {\n const manager = new Manager(answers.name, parseInt(answers.id), answers.email, answers.officeNumber);\n teamMembers.push(manager);\n\n\n createTeam()\n // addAnother();\n })\n}", "constructor(manager) {\n super('PathwaysDataProvider');\n this.manager = manager;\n this.version = 2;\n\n this.util = Object.fromEntries(\n Object.keys(PathwaysDataUtil).map(name => [name, PathwaysDataUtil[name].bind(null, this)])\n );\n\n const logFolderPath = manager.externals.resources.getLogsDirectory();\n if (!fs.existsSync(logFolderPath)) {\n fs.mkdirSync(logFolderPath);\n }\n\n this.reset();\n }", "constructor(data) {\n this.filename = `dbfile_${(0xffffffff*Math.random())>>>0}`;\n if (data) { createDataFile('/', this.filename, data, true, true); }\n this.handleError(sqlite3_open(this.filename, apiTemp));\n this.db = getValue(apiTemp, 'i32');\n RegisterExtensionFunctions(this.db);\n this.statements = {}; // A list of all prepared statements of the database\n }", "constructor() {\n this.#database = new Datastore({\n filename: \"./server/database/rooms.db\",\n autoload: true,\n });\n }", "function Manager() {\n Employee.call(this);\n this.reports = [];\n}", "async setup() {\n if (this._clearExisting) {\n await fs.emptyDir(FOLDER_NAME);\n }\n\n // If there isn't a database file, we'll make sure this\n // directory exists.\n await fs.mkdirp(FOLDER_NAME);\n\n // A connection pool prevents database queries from intefering\n // with each other while a transaction is occurring. Instead,\n // connections will wait on each others' transactions to finish\n // before proceeding execution or starting another transaction.\n this._dbPool = genericPool.createPool({\n create: async () => {\n const db = await sqlite.open(DB_FILE);\n db.configure('busyTimeout', 3000);\n return db;\n },\n destroy: (db) => db.close()\n }, { max: 1, min: 0 });\n\n await this._withDb(async (db) => {\n await db.run('CREATE TABLE IF NOT EXISTS ' +\n 'images(id INTEGER PRIMARY KEY AUTOINCREMENT, ' +\n 'deleted BOOLEAN DEFAULT FALSE)');\n });\n }", "function createManager() {\n inquirer.prompt(managerQuestions).then(response => {\n let manager = new Manager(\n response.nameOfManager,\n response.idOfManager,\n response.emailOfManager,\n response.officeNumberOfManager\n );\n // Push manager to team array\n team.push(manager);\n // Calls function employeeOption()\n employeeOption();\n });\n }", "function main() {\n return __awaiter(this, void 0, void 0, function* () {\n //My local development folders. Change if different.\n let d = 'C:/Users/Nlanson/Desktop/Coding/Yomi/test/data/manga'; //Location of manga\n let c = 'C:/Users/Nlanson/Desktop/Coding/Yomi/test/data/collections.json'; //Location of collections.json\n yield YomiInitialiser.run(d, c, 'prod');\n });\n}", "function getManager() {\n selectManager();\n return managerArray;\n}", "function ObjectManager() {\n\tthis.objects = [];\n}", "async loadDatabase() {\n this.__db =\n (await qx.tool.utils.Json.loadJsonAsync(this.__dbFilename)) || {};\n }", "function DependencyManagerService(cacheStoreManagerService, dataService) {\n this.cacheStoreManagerService = cacheStoreManagerService;\n this.dataService = dataService;\n }", "function DependencyManagerService(cacheStoreManagerService, dataService) {\n this.cacheStoreManagerService = cacheStoreManagerService;\n this.dataService = dataService;\n }", "async initializeDataLoad() {\n }", "function run_database(){\n return require('./database/db.service')\n .set(app);\n}", "function createDataCollections() {\n _dataCreator.initialize();\n\n _peopleSourceData = JSON.parse(getLocalStorageObject('mockTTData.people'));\n _projectsSourceData = JSON.parse(getLocalStorageObject('mockTTData.projects'));\n _assignmentsSourceData = JSON.parse(getLocalStorageObject('mockTTData.assignments'));\n\n _peopleCollection = _this.createMapCollection({id: 'peopleCollection'});\n _projectsCollection = _this.createMapCollection({id: 'projectsCollection'});\n _assignmentsCollection = _this.createMapCollection({id: 'assignmentsCollection'});\n\n _peopleCollection.addFromObjArray(_peopleSourceData, 'id', false);\n _projectsCollection.addFromObjArray(_projectsSourceData, 'id', false);\n _assignmentsCollection.addFromObjArray(_assignmentsSourceData, 'id', false);\n\n _currentUserMap = getCurrentUserMap();\n }", "constructor() {\n this.data = {}\n sinon.stub(mongoose, 'connect').returns(Promise.resolve(true))\n }", "function DataStore() {\n\t\t\tthis.DELIMITER = ':';\n\t\t\tthis.blank();\n\t\t\tthis.onOpen = new Do();\n\t\t\tthis.onSave = new Do();\n\t\t}", "function DataTextureLoader( manager ) {\n\n\t\tLoader.call( this, manager );\n\n\t}", "function EntityManager() {\n this.container = new Northwind.Service.Container();\n this.ajax = null;\n this.hydrator = null;\n this.uow = new Northwind.Persistence.UnitOfWork;\n }", "function setUp() {\n window.loadTimeData.getString = id => id;\n window.loadTimeData.data = {};\n\n new MockChromeStorageAPI();\n new MockCommandLinePrivate();\n\n widget = new importer.TestCommandWidget();\n\n const testFileSystem = new MockFileSystem('testFs');\n nonDcimDirectory = new MockDirectoryEntry(testFileSystem, '/jellybeans/');\n\n volumeManager = new MockVolumeManager();\n MockVolumeManager.installMockSingleton(volumeManager);\n\n const downloads = volumeManager.getCurrentProfileVolumeInfo(\n VolumeManagerCommon.VolumeType.DOWNLOADS);\n assert(downloads);\n destinationVolume = downloads;\n\n mediaScanner = new TestMediaScanner();\n mediaImporter = new TestImportRunner();\n}", "function validateManagerData(data, cb, clientId) {\n\n if (!data.teams || !data.teams.length) {\n result.sendTeamMandatory(cb);\n }\n\n teamModel.find({teamId:{ $in: data.teams }}).then((response) => {\n console.log('response', JSON.stringify(response));\n let teamArray = [];\n response.forEach((ele) => {\n console.log('ele', JSON.stringify(ele));\n ele = (ele) ? ele.toObject() : null;\n teamArray.push(ele._id);\n })\n data.teams = teamArray;\n console.log('data', JSON.stringify(data));\n const testData = Object.assign({}, data, {clientId: clientId, cognitoSub: '23232332'});\n const adminData = new managerModel(testData);\n\n adminData.validate((err) => {\n if (err) {\n managerError(err, cb);\n } else {\n cognitoManager(data, cb, clientId);\n }\n })\n });\n\n\n}", "function testAddData() {\n describe('Add Test Data', function() {\n it('should add data to the database and return data or error', function(done) {\n var session = driver.session();\n session\n .run('CREATE (t:Test {testdata: {testdata}}) RETURN t', {testdata: 'This is an integration test'})\n .then(function (result) {\n session.close();\n result.records.forEach(function (record) {\n describe('Added Data Returned Result', function() {\n it('should return added test data from database', function(done) {\n assert(record);\n done();\n });\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Added Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "static newWithData(dummyGlobal, dummyPacks) {\n const manager = new DataManager();\n manager.globalDataInternal = dummyGlobal || manager.globalDataInternal;\n Object.assign(manager.packDataComplete, dummyPacks);\n return manager;\n }", "function getInformationEmployee() {\n\n const askManager = () => {\n return inquirer.prompt\n (\n managerQuestions // start by asking about the manager.\n )\n .then\n (\n (response) => {\n const filename = outputPath; // filename is another name for outputPath\n let manager = null;\n\n // if the tests didn't fail, we could use error checking\n try {\n manager = new Manager(response.ManagerPrompt, response.IdPrompt, response.EmailPrompt, response.OfficePrompt);\n }\n catch (err) {\n console.log(err.message);\n askManager();\n return; // kill other thread\n }\n\n arrayOfEmployees.push(manager); // save to array\n\n // ask if engineer or intern\n const askType = () => {\n\n return inquirer.prompt(\n [\n {\n type: 'list',\n message: 'Choose an employee type or exit',\n name: 'EmployeePrompt',\n choices: ['Engineer', 'Intern', 'Exit'],\n }\n ]\n )\n .then((responseEmployeeType) => {\n\n const data = responseEmployeeType;\n if (responseEmployeeType.EmployeePrompt !== 'Exit') {\n\n switch (responseEmployeeType.EmployeePrompt) {\n\n case \"Intern\":\n inquirer.prompt(\n [\n employeeQuestions.employeeName,\n employeeQuestions.employeeId,\n employeeQuestions.employeeEmail,\n {\n type: 'input',\n message: 'What is your school?',\n name: 'SchoolPrompt'\n }\n\n ]\n )\n .then((responseIntern) => {\n const data = responseIntern;\n let intern = null;\n try {\n intern = new Intern(data.EmployeePrompt, data.IdPrompt, data.EmailPrompt, data.SchoolPrompt);\n commonFunctionsOfType(intern);\n\n }\n catch (err) {\n console.log(err.message);\n askType();\n return;\n }\n }\n );\n break;\n case \"Engineer\":\n inquirer.prompt(\n [\n employeeQuestions.employeeName,\n employeeQuestions.employeeId,\n employeeQuestions.employeeEmail,\n {\n type: 'input',\n message: 'What is the Github url?',\n name: 'GithubPrompt'\n }\n ]\n )\n .then((responseEngineer) => {\n const data = responseEngineer;\n let engineer = null;\n try {\n engineer = new Engineer(data.EmployeePrompt, data.IdPrompt, data.EmailPrompt, data.GithubPrompt);\n commonFunctionsOfType(engineer);\n }\n catch (err) {\n console.log(err.message);\n askType();\n return;\n }\n }\n );\n break;\n default:\n console.log(`Unrecognized employee type: ${responseEmployeeType.EmployeePrompt}`);\n throw new Error(\"You're done. Unrecognized employee type. Press control-C\");\n break;\n }\n }\n else {\n const renderedHTML = render(arrayOfEmployees);\n writeToFile(filename, renderedHTML);\n }\n }\n );\n }\n\n const commonFunctionsOfType = (data) => {\n arrayOfEmployees.push(data);\n askType();\n }\n\n askType();\n }\n );\n }\n\n askManager();\n}", "handleDataManagerCreated_() {\n\t\tconst manager = this.component_.getDataManager();\n\t\tif (this.component_.constructor.SYNC_UPDATES_MERGED) {\n\t\t\tthis.componentRendererEvents_.add(\n\t\t\t\tmanager.on(\n\t\t\t\t\t'dataPropChanged',\n\t\t\t\t\tthis.handleManagerDataPropChanged_.bind(this)\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\tthis.componentRendererEvents_.add(\n\t\t\t\tmanager.on(\n\t\t\t\t\t'dataChanged',\n\t\t\t\t\tthis.handleManagerDataChanged_.bind(this)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "function DataLoader() {\n this.fs = require('fs')\n this.pt = require('path')\n this.data = []\n this.metaData = {\n book: [],\n drama: []\n }\n\n this.readMetaData = function(filePath) {\n this.metaData = JSON.parse(this.fs.readFileSync(`${filePath}/../metaData.json`));\n }\n\n this.readData = function(dir) {\n const items = this.fs.readdirSync(dir);\n\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n const itemPath = this.pt.join(dir, item);\n const stats = this.fs.statSync(itemPath);\n\n if (stats.isDirectory()) {\n this.readData(itemPath);\n } else {\n // first read json file then put contents of relevant txt file into contents attribute in json\n if (itemPath.split(\".\")[1] === 'json') {\n var obj = JSON.parse(this.fs.readFileSync(itemPath));\n obj.contents = this.fs.readFileSync(itemPath.split(\".\")[0] + '.txt').toString().replace(/(\\r\\n|\\n|\\r|\\s\\s)/gm, \" \");\n this.data.push(obj);\n } else if (itemPath.split(\".\")[1] === 'txt') {\n // console.log(itemPath);\n // this.data[0].contents = this.fs.readFileSync(itemPath).toString();\n } else {\n console.log(`readData err : ${itemPath}`);\n }\n }\n }\n }\n\n // Just to see whether items have been loaded well\n this.showData = function() {\n this.data.forEach((item) => {\n console.log(`Title : ${item.title}`);\n console.log('Contents : ' + item.contents.slice(0, 10));\n });\n }\n\n //\n this.searchData = function(searchTarget, filterCategory, filterContents) {\n var resObjList = [];\n var resultTotalCount = 0;\n\n for (let i = 0; i < this.data.length; ++i) {\n const item = this.data[i];\n let filterTrigger = false;\n\n if (filterCategory.includes(item.category))\n filterTrigger = true;\n\n if (!filterTrigger) {\n let title = item.title;\n\n if (item.category === 'drama')\n item.title.slice(0, item.title.lastIndexOf(' '));\n\n if (filterContents.includes(title))\n filterTrigger = true;\n }\n\n if (!filterTrigger) {\n var resObj = {\n title: item.title,\n category: item.category,\n language: item.language,\n resList: []\n };\n\n var res = 0;\n\n // search target through contents from start to very end\n while (1) {\n res = item.contents.toLowerCase().indexOf(searchTarget.toLowerCase(), res);\n // very end\n if (res === -1) {\n break;\n // something catched, so push result into list\n } else {\n let sentence = item.contents.slice(res - 250, res + 250);\n const firstSpaceIndex = sentence.indexOf(' ');\n const lastSpaceIndex = sentence.lastIndexOf(' ');\n resObj.resList.push(sentence.slice(firstSpaceIndex, lastSpaceIndex));\n res += searchTarget.length;\n ++resultTotalCount;\n }\n }\n // push only when there were results\n if (resObj.resList.length !== 0)\n resObjList.push(resObj);\n }\n }\n return {\n resultTotalCount: resultTotalCount,\n resObjList: resObjList\n };\n }\n\n // initializing\n // this.readMetaData('./data');\n // this.readData('./data');\n // console.log('Loading data completed')\n}", "function managerData() {\n return inquirer\n .prompt([\n {\n name: \"name\",\n message: \"Enter your name:\",\n type: \"input\",\n },\n {\n name: \"id\",\n message: \"Enter your ID:\",\n type: \"input\",\n },\n {\n name: \"email\",\n message: \"Enter your email:\",\n type: \"input\",\n },\n {\n name: \"office\",\n message: \"What is the manager's office number?\",\n type: \"input\",\n },\n ])\n .then(function (answers) {\n const managerObj = new Manager(\n answers.name,\n answers.id,\n answers.email,\n answers.office\n );\n employeeArray.push(managerObj);\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "async __prepareWorkflowManager () {\n\n\t\t// Inject the dependencies the workflow manager requires.\n\t\tthis.workflowManager.inject(`sharedLogger`, sharedLogger);\n\t\tthis.workflowManager.inject(`MessageObject`, MessageObject);\n\t\tthis.workflowManager.inject(`analytics`, this.analytics);\n\t\tthis.workflowManager.inject(`database`, this.database);\n\t\tthis.workflowManager.inject(`nlp`, this.nlp);\n\t\tthis.workflowManager.inject(`scheduler`, this.scheduler);\n\n\t\t// Start the workflow manager.\n\t\tawait this.workflowManager.start(this.options.directories);\n\n\t}", "function Manager(module) {\n this.emitter = new events.EventEmitter();\n this.pending = [];\n this.lastUsed = -1;\n}", "function setupAndRun() {\n try {\n var teradataConnection = new TeradataConnection.TeradataConnection();\n var cursor = teradataConnection.cursor();\n teradataConnection.connect(connParams);\n\n dropTable(cursor)\n createData(cursor);\n doFetchAll(cursor);\n dropTable(cursor);\n\n teradataConnection.close();\n } catch (error) {\n if (!anIgnoreError(error)) {\n throw error;\n }\n }\n}", "async initializeMockData() {\n // Mock data gets executed too early\n // While the genesis block gets created this function (initializeMockData()\n // is running which results in a height of -1\n // (while creating the blockchain with new inside the init function of this class)\n await\n console.log(\"Try to initialize mock data\");\n let height = await this.blockChain.getBlockHeight();\n if (height === -1)\n console.log(\"Warning: Mock init called too early, Blockchain height =\", height, \". Call to new Blockchain did not created genesis Block yet\");\n else\n console.log(\"Mock init, Blockchain height = \", height);\n if (await height === 0) { // TODO: is this await helpful?\n for (let index = 0; index < 10; index++) {\n let blockAux = new BlockClass.Block(`Test Data #${index}`);\n blockAux = await this.blockChain.addBlock(blockAux);\n console.log(\"Added auxiliar block\", blockAux);\n }\n }\n }", "open() {\n this.workflow = null;\n\n console.log('Opened the DBManager');\n }", "function Import(manager) {\n if (!manager) {\n throw new TypeError(\"Must provide a manager\");\n }\n\n this.manager = manager;\n this.context = manager.context || {};\n\n if (!this.context.modules) {\n this.context.modules = {};\n }\n }", "function setupData() {\n\tlet testQuoteData = {}\n\tlet testQuote = {}\n\ttestQuote.name = \"Batman\"\n testQuote.phone = \"0411111111\"\n\ttestQuote.message = \"Need powerpoints installed in the batcave\"\n\ttestQuoteData[\"1\"] = testQuote\n\n\tfs.writeFileSync(testDataFileRelative, JSON.stringify(testQuoteData))\n\ttestBlogQuotes = utilities.loadData(testDataFileRelative)\n}", "function Manager(displayName, language, bodyGenerator) {\n\tthis.displayName = displayName;\n\tthis.language = language;\n\tthis.bodyGenerator = bodyGenerator;\n}", "function DataStore() {\n\tthis.DELIMITER = ':';\n\tthis.blank();\n\tthis.onOpen = new Do();\n\tthis.onSave = new Do();\n\n\tthis.listeners = [];\n}", "viewByManager() {\n // collect manager info\n inquirer.prompt([\n questions.functions.manager,\n ])\n // send results to view by function\n .then((results) => {\n dbFunctions.viewBy(results)\n .then((results) => {\n console.table(results)\n startManagement()\n })\n\n })\n }", "function getManager(){\n return masterManager || (masterManager = service.newManager());\n }", "function getTestData() {\n return new Promise((resolve, reject) => {\n /**\n * @type {string}\n */\n const testDataFilename = args[TEST_DATA_FILENAME] || DEFAULT_TEST_DATA;\n\n fs.readFile(testDataFilename, (err, data) => {\n if (err) {\n reject(err);\n }\n try {\n resolve(JSON.parse(data.toString()));\n } catch (e) {\n reject(new Error(\"Unable to parse input data\"));\n }\n });\n });\n}", "function preload() {\n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n adventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "function Loader(manager) {\n if (!manager) {\n throw new TypeError(\"Must provide a manager\");\n }\n\n this.manager = manager;\n this.context = manager.context || {};\n\n if (!this.context.loaded) {\n this.context.loaded = {};\n }\n }", "tingoInit() {\n // create a storage directory\n var dataDir = fs.realpathSync(path.resolve(this.cm.dataDir || \".\"));\n this.storageDir = path.join(dataDir, \"user-data\");\n mkdirp.sync(this.storageDir);\n // log.debug (\"storage directory:\", this.storageDir);\n\n // create database\n var TingoDb = require(\"tingodb\")().Db;\n this.database = new TingoDb(this.storageDir, {});\n }", "function addManager() {\n inquirer.prompt(managerQs).then((answers) => {\n const manager = new Manager(answers.name, answers.id, answers.email, answers.officeNumber)\n teamMembers.push(manager);\n questionUser();\n })\n }", "function RecordManager() {\n\n /**\n * Stores all data-record documents\n * @property documents\n * @type gs.Document[]\n */\n this.documents = null;\n\n /**\n * Stores all data-record documents by category > id.\n * @property collectionDocuments\n * @type gs.Document[][]\n */\n this.collectionDocuments = [];\n\n /**\n * Localizable strings of all data-record documents.\n * @property localizableStrings\n * @type Object\n */\n this.localizableStrings = {};\n\n /**\n * Indicates if all data-records are already translated.\n * @property translated\n * @type boolean\n */\n this.translated = false;\n\n /**\n * Indicates if all data-records are loaded and initialized.\n * @property initialized\n * @type boolean\n */\n this.initialized = false;\n }", "function Database(data) {\n this.filename = 'dbfile_' + (0xffffffff * Math.random() >>> 0);\n if (data != null) {\n FS.createDataFile('/', this.filename, data, true, true);\n }\n this.handleError(sqlite3_open(this.filename, apiTemp));\n this.db = getValue(apiTemp, 'i32');\n this.statements = {};\n }", "function Manager( socialList, options ) {\n Logger.call( this, {\n objectMode: true,\n } );\n options = options || {};\n this.socialList = socialList || [];\n\n // Status var to keep track of the runs\n this.runId = 0;\n this.runIds = {};\n\n // Configurable splitting function\n this.splitData = options.splitData || this.splitData;\n\n // Create an instance for each social\n this.trace( 'Creating the instances for each social' );\n this.instances = _.map( this.socialList, this.createInstance, this );\n\n setImmediate( function() {\n this.emit( 'ready', this.getInstanceIds() );\n }.bind( this ) );\n}", "function Manager(managerName) {\n return _super.call(this, managerName) || this;\n }", "constructor() {\n this.data = this._loadData();\n }", "function createManager (data){\n const theManager = new Manager (data.name,data.id,data.email,data.officeNumber)\n emplyArr.push(theManager)\n}", "function createManager({ name, emailID, employeeId, officeNumber }) {\n const manager = new Manager(name, \"Manager\", emailID, employeeId, officeNumber)\n teamMembers.push(manager)\n buildTeam();\n}", "initializeMockData() {\n this.myBlockChain = new BlockChain.Blockchain();\n console.log(\"initializeMockData\")\n }", "function getData() {\r\n // retrieve our data object\r\n fetch(\"./data.json\") // go and get the data (fetch boy!)\r\n .then(res => res.json()) // good dog! clean the stick (convert the data to a plain object)\r\n .then(data => {\r\n console.log(data);\r\n\r\n buildTeam(data);\r\n\r\n })\r\n .catch(error => console.error(error));\r\n }", "async function getData() {\n // Commented below is a request I would have made to an API, instead I will just get the mock data\n try {\n // const response = await axios({\n // method: \"GET\",\n // url: ``,\n // });\n // setData(response)\n\n setData(mockData);\n } catch (error) {\n console.log(error);\n }\n }", "constructor() {\n this.datastore = require('../data/Datastore');\n if (this.datastore.users.length === 0) {\n this.createDefaultUsers();\n }\n }", "async function main() {\n try {\n // First, we need to initialize the data model\n await sequelize.initSequelize();\n\n // Then, define the tables and set initial values\n await defineTables();\n await populateTools();\n } catch (err) {\n console.error('Database did not initialize correctly:', err);\n process.exit(1);\n }\n\n console.log('Database was successfully initialized!');\n process.exit(0);\n}", "async function defineTests () {\n const examplesData = await loadExamplesData()\n describe('dt2js CLI integration test', function () {\n this.timeout(20000)\n examplesData.forEach(data => {\n context(`for file ${data.fpath}`, () => {\n data.names.forEach(typeName => {\n it(`should convert ${typeName}`, async () => {\n const schema = await dt2jsCLI(data.fpath, typeName)\n validateJsonSchema(schema)\n })\n })\n })\n })\n })\n}", "createDataDirectory() {\n const dir = `./${this.config.directory}`;\n\n if (!fs.existsSync(dir)){\n fs.mkdirSync(dir);\n }\n }", "function MemDataProvider() {\n\tthis._init();\n}", "start(){\n var self = this;\n this.allViews = [];\n\n return new Promise((resolve, reject)=>{\n this._createDatabase(this.database)\n .then(()=>{\n self.initialize();\n self._fetchModules();\n\n return Promise.all(self.allViews);\n }).then((result)=>{\n self._insertTestToken(); //just for mocha tests\n\n resolve({\n name: self.database.name,\n url: self.database.url,\n status: 'Ready'\n });\n }).catch((error)=>{\n reject(error);\n console.log(error); //TODO Better error handler\n });\n });\n\n }", "function MediaTestManager() {\n\n // Sets up a MediaTestManager to runs through the 'tests' array, which needs\n // to be one of, or have the same fields as, the g*Test arrays of tests. Uses\n // the user supplied 'startTest' function to initialize the test. This\n // function must accept two arguments, the test entry from the 'tests' array,\n // and a token. Call MediaTestManager.started(token) if you start the test,\n // and MediaTestManager.finished(token) when the test finishes. You don't have\n // to start every test, but if you call started() you *must* call finish()\n // else you'll timeout.\n this.runTests = function(tests, startTest) {\n this.startTime = new Date();\n //SimpleTest.info(\"Started \" + this.startTime + \" (\" + this.startTime.getTime()/1000 + \"s)\");\n this.testNum = 0;\n this.tests = tests;\n this.startTest = startTest;\n this.tokens = [];\n this.isShutdown = false;\n this.numTestsRunning = 0;\n this.handlers = {};\n\n this.nextTest();\n // Always wait for explicit finish.\n // SimpleTest.waitForExplicitFinish();\n // SpecialPowers.pushPrefEnv({'set': gTestPrefs}, (function() {\n // this.nextTest();\n // }).bind(this));\n\n // SimpleTest.registerCleanupFunction(function() {\n // if (this.tokens.length > 0) {\n // info(\"Test timed out. Remaining tests=\" + this.tokens);\n // }\n // for (var token of this.tokens) {\n // var handler = this.handlers[token];\n // if (handler && handler.ontimeout) {\n // handler.ontimeout();\n // }\n // }\n // }.bind(this));\n }\n\n // Registers that the test corresponding to 'token' has been started.\n // Don't call more than once per token.\n this.started = function(token, handler) {\n this.tokens.push(token);\n this.numTestsRunning++;\n this.handlers[token] = handler;\n // is(this.numTestsRunning, this.tokens.length, \"[started \" + token + \"] Length of array should match number of running tests\");\n }\n\n // Registers that the test corresponding to 'token' has finished. Call when\n // you've finished your test. If all tests are complete this will finish the\n // run, otherwise it may start up the next run. It's ok to call multiple times\n // per token.\n this.finished = function(token) {\n var i = this.tokens.indexOf(token);\n if (i != -1) {\n // Remove the element from the list of running tests.\n this.tokens.splice(i, 1);\n }\n\n info(\"[finished \" + token + \"] remaining= \" + this.tokens);\n this.numTestsRunning--;\n //is(this.numTestsRunning, this.tokens.length, \"[finished \" + token + \"] Length of array should match number of running tests\");\n if (this.tokens.length < PARALLEL_TESTS) {\n this.nextTest();\n }\n }\n\n // Starts the next batch of tests, or finishes if they're all done.\n // Don't call this directly, call finished(token) when you're done.\n this.nextTest = function() {\n while (this.testNum < this.tests.length && this.tokens.length < PARALLEL_TESTS) {\n var test = this.tests[this.testNum];\n var token = (test.name ? (test.name + \"-\"): \"\") + this.testNum;\n this.testNum++;\n\n if (DEBUG_TEST_LOOP_FOREVER && this.testNum == this.tests.length) {\n this.testNum = 0;\n }\n\n var element = document.createElement('video');\n element.defaultMuted = true;\n // Ensure we can play the resource type.\n if (test.type && !element.canPlayType(test.type))\n continue;\n\n // Do the init. This should start the test.\n this.startTest(test, token);\n }\n\n if (this.testNum == this.tests.length &&\n !DEBUG_TEST_LOOP_FOREVER &&\n this.tokens.length == 0 &&\n !this.isShutdown)\n {\n this.isShutdown = true;\n if (this.onFinished) {\n this.onFinished();\n }\n var onCleanup = function() {\n var end = new Date();\n // SimpleTest.info(\"Finished at \" + end + \" (\" + (end.getTime() / 1000) + \"s)\");\n // SimpleTest.info(\"Running time: \" + (end.getTime() - this.startTime.getTime())/1000 + \"s\");\n // SimpleTest.finish();\n }.bind(this);\n mediaTestCleanup(onCleanup);\n return;\n }\n }\n}", "function Manager(managerName) {\r\n /** const has to acept a name that initializes base class para\r\n so use - super keyword */\r\n return _super.call(this, managerName) || this;\r\n }", "function testReturnData() {\n describe('Return Test Data', function() {\n it('should return data from the database and return data or error', function(done) {\n var session = driver.session();\n session\n .run('MATCH (t:Test) RETURN t')\n .then(function (result) {\n session.close();\n result.records.forEach(function (record) {\n describe('Data Returned Result', function() {\n\n it('should return test data from database', function(done) {\n assert(record);\n done();\n });\n\n it('should have length of one', function(done) {\n assert.equal(record.length, 1);\n done();\n });\n\n var result = record._fields[0];\n\n it('should return correct label type', function(done) {\n assert.equal(typeof result.labels[0], 'string');\n done();\n });\n\n it('should have label \\'Test\\'', function(done) {\n assert.equal(result.labels[0], 'Test');\n done();\n });\n\n it('should return correct testdata type', function(done) {\n assert.equal(typeof result.properties.testdata,'string');\n done();\n });\n\n it('should have property \\'Testdata\\' containing \\'This is an integration test\\'', function(done) {\n assert.equal(result.properties.testdata, 'This is an integration test');\n done();\n });\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function establishDataStore(onReadyCallback) {\n\t // if (typeof gTools == 'object' && gTools.node) {\n\t // if (typeof onReadyCallback === 'function') {\n\t // onReadyCallback();\n\t // }\n\t // return;\n\t // }\n\t\t \n\t if (options.dataStoreCache) {\n\t if (typeof options.dataStoreCache === 'object') {\n\t dataStore = options.dataStoreCache;\n\t if (typeof onReadyCallback === 'function') {\n\t onReadyCallback();\n\t }\n\t }\n\n\t } else {\n\t if (typeof gTools == 'object' && gTools.dataStoreAddress) {\n\t if (!isFistBuild) {\n\t //dataStore = $.extend(true, {}, dataStoreCache);\n\t dataStore = JSON.parse(dataStoreCache);\n\t if (typeof onReadyCallback === 'function') {\n\t onReadyCallback();\n\t }\n\t return;\n\t }\n\t if (isGetingJson) {\n\t return;\n\t }\n\t isGetingJson = true;\n\t var succfun = function (response) {\n\t if (typeof response !== 'object') {\n\t response = JSON.parse(response);\n\t }\n\t delete localStorage[localStorage.dataStoreAddress];\n\t delete localStorage.dataStoreAddress;\n\t localStorage.dataStoreAddress = gTools.dataStoreAddress;\n\t localStorage[localStorage.dataStoreAddress] = JSON.stringify(response);\n\t isFistBuild = false;\n\t isGetingJson = false;\n\t dataStore = response;\n\t dataStoreCache = JSON.stringify(dataStore)//$.extend(true, {}, dataStore);\n\t if (typeof onReadyCallback === 'function') {\n\t onReadyCallback();\n\t }\n\t };\n\t if (localStorage.dataStoreAddress === gTools.dataStoreAddress && localStorage[localStorage.dataStoreAddress]) {\n\t succfun(JSON.parse(localStorage[localStorage.dataStoreAddress]));\n\t return;\n\t }\n\t $.getJSON(gTools.origin + gTools.dataStoreAddress, succfun).fail(function () {\n\t dataStore = build();\n\t isGetingJson = false;\n\t if (typeof onReadyCallback === 'function') {\n\t onReadyCallback();\n\t }\n\t });\n\t return;\n\t }\n\n\t dataStore = build();\n\n\t if (typeof onReadyCallback === 'function') {\n\t onReadyCallback();\n\n\t }\n\t }\n\t }", "static load (environment) {\n TestData.environment = environment || 'stage'\n\n let configData\n let testData\n\n try {\n const cdFile = path.join(configPath, `cd_${TestData.environment}.yml`)\n configData = yaml.safeLoad(fs.readFileSync(cdFile, 'utf8'))\n } catch (e) {\n console.log(`Unable to load config data for ${TestData.environment}!`)\n throw e\n }\n\n try {\n const tdFile = path.join(configPath, `td_${TestData.environment}.yml`)\n testData = yaml.safeLoad(fs.readFileSync(tdFile, 'utf8'))\n } catch (e) {\n console.log(`Unable to load ${TestData.environment} test data!`)\n throw e\n }\n\n try {\n TestData.data = _.merge(configData, testData)\n } catch (e) {\n console.log('Unable to load test data!')\n console.log(e)\n }\n }", "function addManager(data) {\n const managerDetail = new manager(data.id, data.name, data.email, data.officeNumber);\n //adding the data to the file\n const read = details(managerDetail);\n fs.appendFileSync('./src/file.html', read, (err) => {\n if (err) {\n console.log(err);\n }\n else {\n console.log(\"suceesfully appended in to the file\")\n }\n });\n //function to ask if wants to add more people\n addMore();\n}", "function testMe(){\n getData();\n}", "getObjectManager(name) {\n return self.objectManagers[name];\n }", "function teamData() {\n inquirer.prompt(teamQuestions)\n .then(userResponse => {\n const role = userResponse.role;\n const employeeName = userResponse.employeename;\n const employeeId = userResponse.employeeid;\n const employeeEmail = userResponse.employeeemail;\n const github = userResponse.github;\n const school = userResponse.school;\n // Asks if you want to add another member (y/n)\n const additonalMember = userResponse.additonalmember;\n\n // Creates new engineer or intern\n if (role === \"Engineer\") {\n const engineer = new Engineer(employeeName, employeeId, employeeEmail, github);\n teamMembers.push(engineer);\n } else if (role === \"Intern\") {\n const intern = new Intern(employeeName, employeeId, employeeEmail, school);\n teamMembers.push(intern);\n }\n\n // Creates statement that lets the function rerun to include more engineers or interns\n if (additonalMember === true) {\n teamData();\n } else {\n // Makes manager card\n renderManagerCard(manager);\n\n // Renders engineers and-or intern cards\n for (var i = 0; i < teamMembers.length; i++) {\n let employee = teamMembers[i];\n cards += renderEmployeeCard(employee);\n }\n\n // Places all employees cards into main.html page\n let main = fs.readFileSync(\"./templates/main.html\", \"utf8\");\n\n // Slashes with g will plug into multiple spots /{{teamTitle}}/g \n main = main.replace(/{{teamTitle}}/g, teamName);\n main = main.replace(\"{{cards}}\", cards);\n\n // Creates new folder and teampage.html\n writeFileAsync(\"./example/teampage.html\", main);\n }\n })\n}", "function promptMgr() {\n inquirer.prompt(manQuestions)\n .then(data => {\n console.log(data);\n employeeList[0] = new Manager(data.name, data.id, data.email, data.officeNumber);\n if (data.role == \"Yes, add an Engineer\") {\n promptEng();\n }\n else if (data.role == \"Yes, add an Intern\") {\n promptInt();\n }\n else {\n // writeData();\n }\n }\n)}", "function openDataFolder() {\n dataFolder = savePath\n if (!fs.existsSync(dataFolder)) {\n mkdirp.sync(dataFolder)\n }\n shell.showItemInFolder(dataFolder)\n}", "function mockSyncDataservice() {\n return {getAvengers: mockData.getMockAvengers};\n }", "function ObjectManager() {\n\n /**\n * All game objects to manage.\n * @property objects\n * @type gs.Object_Base[]\n */\n this.objects = [];\n\n /**\n * All game objects by ID.\n * @property objectsById\n * @type Object\n */\n this.objectsById = {};\n\n /**\n * All game objects by group.\n * @property objectsByGroup_\n * @type Object\n */\n this.objectsByGroup_ = {};\n\n /**\n * Indicates if the ObjectManager is active. If <b>false</b> the game objects are not updated.\n * @property active\n * @type boolean\n */\n this.active = true;\n\n /**\n * Indicates if the ObjectManager needs to sort the game objects.\n * @property active\n * @type boolean\n */\n this.needsSort = true;\n }", "function loadData(data) {\r\n // returns a promise\r\n }", "function StockDataManager() {\n this.items = {};\n this.count = 0;\n}", "function setupDatabase(){\n\n return new Promise((resolve, reject) => {\n const database = {};\n debug(\"Initializing DB...\");\n resolve(database);\n }); \n}", "createEntityManager(): EntityManager {\n return PRIVATE(this).entityManagerFactory.createEntityManager()\n }", "function testSchema() {\n\n var ST = new SchemaTest();\n\n // creating manager\n var manager = ST.createUser(auntpolly);\n ST.manager = manager;\n console.log(\"Added manager: \" + JSON.stringify(manager));\n\n // creating team\n var tData = JSON.parse(JSON.stringify(myteam));\n tData.manager = ST.manager;\n var team = ST.createTeam(tData);\n ST.team = team;\n console.log(\"Added team: \" + JSON.stringify(team));\n\n // creating another user as assignee\n var assignee = ST.createUser(tomsawyer);\n ST.assignee = assignee;\n console.log(\"Added assignee: \" + JSON.stringify(assignee));\n\n // creating a project\n var pData = JSON.parse(JSON.stringify(some_project));\n pData.manager = ST.manager._id\n var project = ST.createProject(pData);\n ST.project = project;\n console.log(\"Added project: \" + JSON.stringify(project));\n\n // creating issue - to fill bucket of paint\n var issue1 = JSON.parse(JSON.stringify(issue_fill_bucket));\n issue1.project = ST.project;\n issue1.assignee = ST.assignee;\n ST.createIssue(issue1);\n ST.issues.push(issue1);\n\n // adding comment to a task\n var comment1 = JSON.parse(JSON.stringify(some_comment));\n comment1.writer = ST.assignee;\n comment1.issue = issue1._id;\n ST.createComment(comment1);\n ST.comments.push(comment1);\n}", "function LoadTeamPersonalData()\r\n{\r\n var ShedModeUtils = require( '/ShedModeUtils' ) ;\r\n ShedModeUtils.LoadTeamPersonalData() ;\r\n}" ]
[ "0.7521985", "0.66531396", "0.65599114", "0.620891", "0.5735846", "0.5647061", "0.5647061", "0.56161046", "0.56161046", "0.5453702", "0.540025", "0.5370829", "0.5329403", "0.5265055", "0.52623004", "0.5245484", "0.52412397", "0.5164236", "0.5144205", "0.51281166", "0.51258636", "0.5112851", "0.5077922", "0.5058995", "0.5053154", "0.5016465", "0.4997941", "0.49899888", "0.49609601", "0.4945292", "0.4939292", "0.49375513", "0.4929007", "0.4929007", "0.49060723", "0.4900236", "0.48982722", "0.48882958", "0.48871264", "0.48793134", "0.48792028", "0.48727", "0.48633462", "0.4846683", "0.4828687", "0.48088944", "0.48082003", "0.48076242", "0.48064828", "0.48004243", "0.47930896", "0.47928894", "0.4789542", "0.4781626", "0.47741705", "0.47735012", "0.4750403", "0.4748696", "0.47410828", "0.47399807", "0.47212172", "0.47191185", "0.47169715", "0.4714791", "0.47147757", "0.47146767", "0.47085866", "0.47072667", "0.469954", "0.46994588", "0.4698976", "0.4694551", "0.46846008", "0.4684423", "0.46734408", "0.46702358", "0.46693712", "0.4667049", "0.46538624", "0.46503457", "0.46499225", "0.4647302", "0.4636844", "0.46279937", "0.46149686", "0.46107766", "0.45991954", "0.45972162", "0.45964512", "0.4596399", "0.45921513", "0.4589338", "0.4583075", "0.457439", "0.4566509", "0.4558524", "0.45564657", "0.45410132", "0.4537525", "0.45357782" ]
0.6504151
3
Load json data for incidents of gun violence. On success, instantiate knockout and pass it the data. Note: this function won't fire until map is ready.
function loadData(){ var getData = $.getJSON( "dev/data/shooting_incidents.json", function() { }) .done(function(data){ mapData = data; viewModel = new AppViewModel(); ko.applyBindings(viewModel); }) .fail(function(msg){ console.log('error: ' + msg); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function googleSuccess() {\r\n //Apply knockout bindings and load the appViewModel\r\n vm = new appViewModel();\r\n ko.applyBindings(vm);\r\n //Initialize map\r\n mapInit();\r\n}", "function initMap() {\n $.getJSON('/places/json', function (data) {\n // showDescription will toggle show and hide descriptions\n // viewModel.data = data;\n for (var key in data) {\n viewModel.catalogs.push(key);\n data[key].forEach(function (value) {\n value['showDescription'] = ko.observable(false);\n value['showItem'] = ko.observable(true);\n value['catalog'] = key;\n viewModel.locations.push(value)\n });\n }\n viewModel.catalogs.push('Default');\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 37.7749, lng: -122.4194},\n zoom: 13,\n mapTypeControl: false\n });\n defaultIcon = makeMarkerIcon('0091ff');\n highlightedIcon = makeMarkerIcon('FFFF24');\n if (viewModel.locations().length > 0) {\n // update markers at this step because\n // NeighborhoodMapViewModel can not update markers before google map library is ready\n updateMarkers(viewModel.locations());\n showMarkers();// show markers on the map\n }\n\n })\n .fail(function () { // show message if can not fetch data\n console.log('Something went wrong, can not fetch the data from server');\n viewModel.message('can not fetch the data from server');\n });\n}", "function projectJsonLoaded(data) {\n project = data;\n if(typeof project == 'string') project = JSON.parse(project);\n georeferences = project.georeferences;\n for(var i in project.levels) {\n\tif(!routingId) routingId = project.levels[i].source;\n levelLoadFunction(project, i)(); \n }\n }", "function googleMapSuccess() {\n\n // create the google map object\n g_map = new google.maps.Map(document.getElementById('map_container'),mapOptions);\n\n // now that we know we have a map to work with, create the viewModel\n ko.applyBindings(new viewModel() );\n}", "function LoadData(){\n\t$.ajax(\"/cgi-bin/main.py\", {\n\t\tformat: \"json\"\n\t}).done(function(data) {\n\t\tdatajson = JSON.parse(data);\n\t\tLoadCheckboxes();\n\t\tLoadMarkers();\n\t});\n}", "function initMap() {\n var ViewModel = function() {\n var self = this;\n var lat = -1.2886009200028272;\n var lng = 36.822824478149414;\n var infowindow;\n self.artLocations = new ko.observableArray();\n self.markers = new ko.observableArray();\n self.catId = ko.observable('');\n self.categoryTips = new ko.observableArray();\n self.categories = new ko.observableArray();\n\n self.map = new google.maps.Map(document.getElementById('map'), {\n zoom: 16,\n center: new google.maps.LatLng(lat, lng),\n mapTypeId: 'roadmap'\n });\n\n // fetch artisan details and locations from the database and store them in array artLocations\n\n var xhttp;\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n var i;\n if (this.readyState === 4 && this.status === 200) {\n var myText = this.responseText;\n var obj = JSON.parse(myText);\n var myAdd = {};\n var addresses = obj.Addresses;\n var l = addresses.length;\n for (i = 0; i < l; i++) {\n myAdd = {\n position: {\n lat: parseFloat(obj.Addresses[i].lat),\n lng: parseFloat(obj.Addresses[i].lng)\n },\n name: obj.Addresses[i].name,\n skill: obj.Addresses[i].skill,\n cat: obj.Addresses[i].cat,\n bio: obj.Addresses[i].bio,\n id: obj.Addresses[i].id,\n details: obj.Addresses[i].details,\n type: 'artisan'\n };\n\n self.artLocations().push(myAdd);\n\n }\n var c = obj.Categories.length;\n for (i = 0; i < c; i++) {\n self.categories().push(new Category(obj.Categories[i].id, obj.Categories[i].name));\n\n }\n // Iterate over artisan details and locations and create map markers and store them in markers array\n self.artLocations().forEach(function(feature) {\n infowindow = new google.maps.InfoWindow({\n content: ''\n });\n var marker = new google.maps.Marker({\n position: feature.position,\n icon: icons[feature.type].icon,\n title: feature.name,\n cat: feature.cat,\n bio: feature.bio,\n id: feature.id,\n skill: feature.skill\n\n\n });\n // include an info window on click for each marker with artisan details and link to respective list item\n marker.addListener('click', showWindow = function() {\n marker = this;\n var content = this.skill + '<br>' + this.bio + '<a href=\"/show/artisan/' + this.id + '\">' + '<br>' + 'Click for More' + '</a>';\n if (infowindow) {\n infowindow.close();\n }\n infowindow.setContent(content);\n infowindow.open(self.map, marker);\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function() {\n marker.setAnimation(null);\n }, 2100);\n });\n self.markers.push(marker);\n });\n } else if (this.readyState === 4) {\n\n var pos = {\n lat: lat,\n lng: lng\n };\n\n var infoWindow = new google.maps.InfoWindow({\n map: self.map\n });\n infoWindow.setPosition(pos);\n infoWindow.setContent('An error occured, we are unable to retreive Artisan Locations.');\n\n }\n // Function to set the map on all markers in the array if it is not empty.\n function displayMarkers(map) {\n if (self.markers().length > 0) {\n for (i = 0; i < self.markers().length; i++) {\n self.markers()[i].setMap(map);\n }\n }\n }\n // Function to remove the markers from the map, but keeps them in the array.\n function clearMarkers() {\n displayMarkers(null);\n }\n\n //actually display all markers on the map then store them in allMarkers array for when we start manipulating the markers\n\n\n displayMarkers(self.map);\n var allMarkers = self.markers();\n\n\n\n //filter the markers depending on the category of artisans selected\n\n var updatedMarkers = [];\n\n self.catId.subscribe(function(newId) {\n clearMarkers();\n\n if (newId === '') {\n updatedMarkers = allMarkers;\n } else {\n for (i = allMarkers.length - 1; i >= 0; i--) {\n if (allMarkers[i].cat === newId) {\n updatedMarkers.push(allMarkers[i]);\n }\n }\n }\n\n //display filtered markers by calling calling out observable array with array of filtered markers. Reset updatedMarkers\n self.markers(updatedMarkers);\n displayMarkers(self.map);\n updatedMarkers = [];\n });\n\n };\n\n xhttp.open('GET', '/loc', true);\n xhttp.send();\n\n\n\n\n self.catId.subscribe(function(newId) {\n var catText = 'Do it Yourself - DIY';\n var x;\n for (x = 0; x < self.categories().length; x++) {\n if (self.categories()[x].categoryId === newId) {\n catText = self.categories()[x].catText;\n }\n }\n\n var nyttp;\n nyttp = new XMLHttpRequest();\n nyttp.onreadystatechange = function() {\n var updatedLinks = [];\n var link;\n if (this.readyState === 4 && this.status === 200) {\n\n var myResponse = this.responseText;\n var obj = JSON.parse(myResponse);\n var i;\n var articles = obj.response.docs;\n var l = articles.length - 4;\n var headline;\n var url;\n for (i = 0; i < l; i++) {\n headline = articles[i].headline.main;\n url = articles[i].web_url;\n link = '<a href=\"' + url + '\">' + headline + '</a>';\n updatedLinks.push(link);\n\n }\n self.categoryTips(updatedLinks);\n } else if (this.readyState === 4) {\n link = '<a href=\"https://www.nytimes.com/\">An error occured, we are unable to retrieve NYT tips but you can click here to explore their website</a>';\n updatedLinks.push(link);\n self.categoryTips(updatedLinks);\n updatedLinks = [];\n }\n };\n var nytUrl = 'https://api.nytimes.com/svc/search/v2/articlesearch.json?q=' + catText + '&api-key=440fb4e8ca6a45da863a6e7152f51571';\n nyttp.open('GET', nytUrl, true);\n nyttp.send();\n });\n\n };\n ko.applyBindings(new ViewModel());\n\n}", "loadData(div,endpointUrl,flag,paths) {\n\t\t\t//console.log(this.that);\n\t\t\tvar that = this.that;\n $.getJSON(endpointUrl + \"key=\" + apiKey,\n\t\t\t\tfunction (data) {\n\t\t\t\t\t// Do something with the data; probably store it\n\t\t\t\t\t// in the Model to be later read by the View.\n\t\t\t\t\t//console.log(this);\n\t\t that.notify(div,data,flag,paths); // Notify View(s)\n\t\t\t\t}\n\t\t\t);\n }", "function initMap() {\n ko.applyBindings(new ProjViewModel());\n}", "function initMap() {\n\n //map that loads at the start co-ordinates mentioned\n map = new google.maps.Map(document.getElementById('map'), {\n center: placesOfInterest.tokyo[0].coOrdinates,\n zoom: 11\n });\n\n ko.applyBindings(new viewModel());\n}", "function initialize() {\n initMap();\n ko.applyBindings(new viewModel());\n}", "loadJS() {\n\t\tif (typeof(window.TileMaps) == 'undefined') {\n\t\t\twindow.onTileMapLoaded = this.onTileMapLoaded.bind(this);\n\t\t} else {\n\t\t\tfor (const map in window.TileMaps)\n\t\t\t\tthis.data[map] = window.TileMaps[map];\n\t\t}\n\t}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"));\n var viewModel = new ViewModel();\n ko.applyBindings(viewModel);\n}", "function initialize() {\n // Create a new ViewModel, apply the Knockout bindings\n // and then initialize the ViewModel and add the markers\n // to the map.\n initializeMap();\n vm = new ViewModel();\n ko.applyBindings(vm);\n vm.initialize();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: mapCenter,\n zoom: defaultZoom\n });\n\n ko.applyBindings(ViewModel());\n}", "function initMap() {\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: {\r\n lat: 33.6844,\r\n lng: 73.0479\r\n },\r\n zoom: 12\r\n });\r\n largeInfowindow = new google.maps.InfoWindow();\r\n bounds = new google.maps.LatLngBounds();\r\n ko.applyBindings(new ViewModel());\r\n}", "function levelJsonLoaded(data, project, index) {\n if(data.bounds[0] == 0 && data.bounds[1] == 0) {\n virtualCoordinates = true;\n }\n mapBounds = data.bounds;\n levels[data.name] = data;\n levels[data.name].levelIndex = parseInt(index);\t\n levelIndex[levels[data.name].levelIndex] = levels[data.name];\n \n loadedLevels[index] = data.name;\n\n // ok, then, count the levels \n var levelCount = 0;\n for(var j in levels) {\n levelCount++;\n }\n // if we've loaded all levels, let's go!\n if(levelCount == project.levels.length) { \n loadedLevels.reverse();\n map.toggleLevelControl(levelControl);\n\n\tmapDiv.hide().css('opacity', 1).fadeIn();\n\n\tif(targetLevel != undefined && levels[targetLevel]) _setLevel(targetLevel);\n else _setLevel(data.name);\n\n\tif(!initialCenterSet) {\n\t var bounds = new L.LatLngBounds(\n new L.LatLng(data.bounds[1]-(data.bounds[3]-data.bounds[1])/2,\n data.bounds[0]-(data.bounds[2]-data.bounds[0])/2),\n new L.LatLng(data.bounds[3]+(data.bounds[3]-data.bounds[1])/2,\n data.bounds[2]+(data.bounds[2]-data.bounds[0])/2));\n\t map.setMaxBounds(bounds);\n\t mapBounds = new L.LatLngBounds(\n new L.LatLng(data.bounds[1],\n data.bounds[0]),\n new L.LatLng(data.bounds[3], \n data.bounds[2]));\n\t map.fitBounds(mapBounds);\n\n\t map.addEventListener('moveend', function(e) {\n\t var tl = mapBounds.getNorthWest();\n\t var br = mapBounds.getSouthEast();\n\t var mapCenter = map.getCenter();\n\t var targetLatLng = new L.LatLng(mapCenter.lat, mapCenter.lng);\n\t if(mapCenter.lat < br.lat) targetLatLng.lat = br.lat;\n\t if(mapCenter.lat > tl.lat) targetLatLng.lat = tl.lat;\n\t if(mapCenter.lng < tl.lng) targetLatLng.lng = tl.lng;\n\t if(mapCenter.lng > br.lng) targetLatLng.lng = br.lng;\n\t if(mapCenter.lat != targetLatLng.lat || mapCenter.lng != targetLatLng.lng) {\n\t map.panTo(targetLatLng);\n\t }\n\t });\n\t initialCenterSet = true;\n\t}\n\tif(callback) {\n callback(_.project, element);\n\t}\n }\n }", "function initialize() {\n\n $.ajax({\n method: 'GET',\n url: 'map/usersfeed',\n dataType: 'JSON',\n })\n .done(function(data) {\n populateMap(data);\n console.log(\"Successfully got data on initialize!!\");\n })\n .fail(function(data) {\n console.log( \"Failed to get my own data initialize :(\");\n console.log(JSON.stringify(data));\n })\n}", "function loadFromJson(){\n\tvar canvas_url = '/facesix/api/geo/poi/'+spid;\n\t$.ajax({\n\t url:canvas_url+'/canvas',\n\t type:'GET', \n\t success: function(data){\n\t \tconsole.log('Received poi canvas data');\n\t \tconsole.log(data);\t \t\t \t\n \t\tvar jsonObj = JSON.parse(JSON.stringify(data));\n \t\tif(jsonObj.fg_json != ''){\n \t\t\tvar s = JSON.parse(JSON.stringify(jsonObj.fg_json));\t \t\n \t\t\tfg_canvas.loadFromJSON(s,fg_canvas.renderAll.bind(fg_canvas));\n \t\t} \n\t }\n\t });\n}", "function initMap() {\n if ($('#venues-map').length > 0) {\n $.getScript('https://cdn.jsdelivr.net/npm/[email protected]/dist/snazzy-info-window.min.js', function () {\n drawMap($('#venues-map').data('venues'));\n });\n }\n}", "async function InOutMap_init(){\n \n\n //Clearing preselected information\n clearData();\n\n //Getting inbound and outbond countries as arrays\n getGeoJsonData(Object.keys(inbound_countries), Object.keys(outbound_countries));\n}", "function getData(map){\r\n //load the data\r\n $.ajax(\"data/MegaCities.geojson\", {\r\n dataType: \"json\",\r\n success: function(response){\r\n var attributes = processData(response);\r\n minValue = calculateMinValue(response); \r\n //add symbols and UI elements\r\n createPropSymbols(response, attributes);\r\n createSequenceControls(attributes);\r\n updatePropSymbols(attributes);\r\n }\r\n });\r\n}", "function getData(map){\n //load the data from the pertussis json\n $.ajax(\"data/ca_pertussis.geojson\", {\n dataType: \"json\",\n success: function(response){ \n\t\t\t//create an attributes array\n var attributes = processData(response);\n createPropSymbols(response, map, attributes);\n createSequenceControls(map, attributes);\n createLegend(map, attributes);\n\t\t}\n });\n}", "loadJsonData() {\n }", "function initMap() {\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 38.889939, lng: -77.00905},\n zoom: 13\n });\n\n ko.applyBindings(viewModel);\n}", "function initMap() {\n var ghent = {\n lat: 51.0543,\n lng: 3.7174\n };\n var mapOptions = {\n center: ghent,\n zoom: 14,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n // Run viewModel \n ko.applyBindings(new viewModel());\n }", "function initialize() {\n\n var mapOptions = {\n zoom: 13,\n center: new google.maps.LatLng(42.360082, -71.05888),\n mapTypeId: google.maps.MapTypeId.SATELLITE\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'),\n mapOptions);\n\n $.ajax({\n type:\"GET\",\n dataType: \"json\",\n cache: false,\n url: \"https://data.cityofboston.gov/resource/7cdf-6fgx.json?year=2014\",\n success: function(data){\n for(var i = 0; i < data.length; i++){\n locations.push(new google.maps.LatLng(data[i].location.latitude, data[i].location.longitude));\n }\n\n console.log(locations);\n\n pointArray = new google.maps.MVCArray(locations);\n\n heatmap = new google.maps.visualization.HeatmapLayer({\n data: pointArray,\n maxIntensity: 5\n });\n\n heatmap.setMap(map);\n }\n });\n\n setMarkers(map, placePoints);\n\n}//initialize end", "function setUp() {\n var map = new MapViewModel();\n google.maps.event.addDomListener(window, 'load', map.initialize);\n ko.applyBindings(map);\n}", "function initialize() {\r\n //get the json\r\n $.getJSON('/resources/maps/' + name + '.json', {}, function (data) {\r\n //json loaded\r\n\r\n //get size of map\r\n _self.size = new Size(data.size.width, data.size.height);\r\n\r\n //get the tilesets\r\n for (var k = 0; k < data.tilesets.length; k++) {\r\n var tileset = data.tilesets[k];\r\n\r\n var img = new Image();\r\n img.src = tileset.src;\r\n var set = {\r\n image: img,\r\n autotile: tileset.autotile,\r\n frames: tileset.frames,\r\n size: tileset.size\r\n };\r\n //add tileset to array\r\n _tilesets.push(set);\r\n }\r\n\r\n //separate the layers out into logical layers to be drawn\r\n //get all tiles with prioriry 0, and layer them first\r\n createLayers(data, _bottomLayers, PRIORITY_BELOW);\r\n\r\n //then, get all tiles with priority 1, and layer them last\r\n createLayers(data, _topLayers, PRIORITY_ABOVE);\r\n\r\n //map is loaded\r\n _self.mapLoaded = true;\r\n\r\n //loaded callback\r\n if (typeof loaded == 'function') {\r\n loaded();\r\n }\r\n });\r\n\r\n }", "function getData(map){\n //load the data\n $.ajax(\"data/IndiaRoadAccidents.geojson\", {\n //specify that we expect to get a json file back\n dataType: \"json\",\n //in the case of a success, run this function:\n success: function(response){\n //set up variable attributes and point to processData function\n var attributes = processData(response);\n //point to createPropSymbols function\n createPropSymbols (response, map, attributes);\n //points to createSequenceControls function to create slider\n createSequenceControls(map, attributes);\n //while we're at it, let's create the legend too\n createLegend(map, attributes);\n }\n });\n }", "function getInternshipData(){\r\n\t$.ajax({\r\n\t\turl: '/internships.json',\r\n\t\tdata: filters,\r\n\t\tdataType: 'json',\r\n\t\tsuccess: function(data){\r\n\t\t\tinternship_data.countries = data;\r\n\t\t\tdataIsLoaded = true;\r\n\t\t}\r\n\t});\r\n}", "function init() {\n _apikey = $(\"#apikey\").val();\n if (GBrowserIsCompatible()) {\n\t_map = new GMap2($(\"#map_canvas\").get(0));\n\t_map.setCenter(new GLatLng($(\"#lat\").val(), $(\"#lon\").val()), 12);\n\t_map.addControl(new GLargeMapControl());\n }\n $.getJSON(APIHOST + \"/e/san-francisco-ca/userview/empire-entities?apikey=\" +\n\t escape(_apikey) + \"&jsoncallback=?\",\n\t loadUserCreatedEntities);\n}", "function initMap () {\n gMap.map = new google.maps.Map(document.getElementById('map-canvas'), {\n mapTypeControl: false,\n streetViewControl: false,\n center: {lat: 46.202646, lng: 10.480957},\n scrollwheel: true,\n zoom: 7,\n mapTypeId: google.maps.MapTypeId.HYBRID\n });\n gMapsLoaded = true;\n ko.applyBindings(vm);\n}", "function loadIslands() {\n var request = new XMLHttpRequest();\n request.open('GET', 'juice.json', true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n // Success!\n var data = JSON.parse(request.responseText);\n processIslands(data);\n } else {\n // We reached our target server, but it returned an error\n\n }\n };\n\n request.onerror = function() {\n // There was a connection error of some sort\n };\n\n request.send();\n}", "function getData(map){\n //load the data\n $.ajax(\"data/Deposits.geojson\",{\n dataType: \"json\",\n success: function(response){\n\n //create an array for the attributes\n var attributes = processData(response);\n\n //call function to create and style prop symbols\n createPropSymbols(response, map, attributes);\n\n //create slider to sequence through the years\n createSlider(map, attributes);\n }\n });\n}", "function addGeoJsonToMap(v){\n\t\t\t$('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\n\t\t\tif(layer.currentGEERunID === geeRunID){\n if(v === undefined){loadFailure()}\n\t\t\t\tlayer.layer = new google.maps.Data();\n // layer.viz.icon = {\n // path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,\n // scale: 5,\n // strokeWeight:2,\n // strokeColor:\"#B40404\"\n // }\n\t\t layer.layer.setStyle(layer.viz);\n\t\t \n\t\t \tlayer.layer.addGeoJson(v);\n if(layer.viz.clickQuery){\n map.addListener('click',function(){\n infowindow.setMap(null);\n })\n layer.layer.addListener('click', function(event) {\n console.log(event);\n infowindow.setPosition(event.latLng);\n var infoContent = `<table class=\"table table-hover bg-white\">\n <tbody>`\n var info = event.feature.h;\n Object.keys(info).map(function(name){\n var value = info[name];\n infoContent +=`<tr><th>${name}</th><td>${value}</td></tr>`;\n });\n infoContent +=`</tbody></table>`;\n infowindow.setContent(infoContent);\n infowindow.open(map);\n }) \n }\n\t\t \tfeatureObj[layer.name] = layer.layer\n\t\t \t// console.log(this.viz);\n\t\t \n\t\t \tif(layer.visible){\n\t\t \tlayer.layer.setMap(layer.map);\n\t\t \tlayer.rangeOpacity = layer.viz.strokeOpacity;\n\t\t \tlayer.percent = 100;\n\t\t \tupdateProgress();\n\t\t \t$('#'+layer.legendDivID).show();\n\t\t \t}else{\n\t\t \tlayer.rangeOpacity = 0;\n\t\t \tlayer.percent = 0;\n\t\t \t$('#'+layer.legendDivID).hide();\n\t\t \t\t}\n\t\t \tsetRangeSliderThumbOpacity();\n\t\t \t}\n \t\t}", "function renderStatBlock(json) {\n try {\n var data = ko.utils.parseJson(json);\n window.vm.Monster(data);\n if (!vm.Bound) {\n vm.Bound = true;\n ko.applyBindings(window.vm);\n }\n }\n catch (e) {\n alert(e.toString());\n }\n}", "function loadRoadData()\n{\n\tvar zoomLevel = map.getZoom();\n var bound = map.getBounds();\n var min_lat = bound.sw.Latitude;\n var min_lng = bound.sw.Longitude;\n var max_lat = bound.ne.Latitude;\n var max_lng = bound.ne.Longitude;\n min_lat-= alpha*bound.sw.Latitude;\n min_lng-= alpha*bound.sw.Longitude;\n max_lat+= alpha*bound.ne.Latitude;\n max_lng+= alpha*bound.ne.Longitude;\n\t$.post(\"/data_map/getSectionRoadData\", {\n\t\tsb_id: $('input[name=\"sb_id_seek\"]').val(),\n\t\tsurvey_date: $('input[name=\"survey_date_seek\"]').val(),\n\t\troad_name: $('input[name=\"road_name\"]').val(),\n\t\tkilopost_from: $('input[name=\"kilopost_from\"]').val(),\n\t\tkilopost_to: $('input[name=\"kilopost_to\"]').val(),\n\t\tmin_lat: min_lat,\n\t\tmin_lng: min_lng,\n\t\tmax_lat: max_lat,\n\t\tmax_lng: max_lng,\n\t\tzoomLvl: zoomLevel,\n\t}, function(res){\n\t\tresetMap();\n \t\tcreatePoly(JSON.parse(res));\n \t\t$('#dim_wrapper').hide();\n \t});\n}", "function googleMapSuccess() {\n ko.applyBindings(new AppViewModel());\n}", "function loadRoadData()\n\t{\n\t\tvar zoom_level = map.getZoom();\n\t var bound = map.getBounds();\n\t var min_lat = bound.sw.Latitude;\n\t var min_lng = bound.sw.Longitude;\n\t var max_lat = bound.ne.Latitude;\n\t var max_lng = bound.ne.Longitude;\n\t min_lat-= alpha*bound.sw.Latitude;\n\t min_lng-= alpha*bound.sw.Longitude;\n\t max_lat+= alpha*bound.ne.Latitude;\n\t max_lng+= alpha*bound.ne.Longitude;\n\t\t$.get(\"/data_map\", {\n\t\t\tsb_id: 0,\n\t\t\tsurvey_date: \"latest\",\n\t\t\tmin_lat: min_lat,\n\t\t\tmin_lng: min_lng,\n\t\t\tmax_lat: max_lat,\n\t\t\tmax_lng: max_lng,\n\t\t\tzoom_level: zoom_level\n\t\t}, function(res){\n\t\t\tresetMap();\n\t \t\tcreatePoly(res);\n\t \t});\n\t}", "function initMap() {\n map = new google.maps.Map(\n document.getElementById('map'), {\n center: {\n lat: 30.793701,\n lng: 31.003353\n },\n zoom: 15,\n mapTypeControl: false\n }\n );\n infowindow = new google.maps.InfoWindow();\n\n ko.applyBindings(new ViewModel());\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 38.905206,\n lng: -77.035511\n },\n scrollwheel: false,\n zoom: 14\n });\n ko.applyBindings(new AppViewModel());\n}", "function initMap() {\n\n // Instantiate Google Maps Map object\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -22.8967084, lng: -43.1820523},\n zoom: 14\n });\n\n // Instantiate Google Maps InfoWindow object\n infoWindow = new google.maps.InfoWindow();\n\n // Apply Knockout bindings on ViewModel\n ko.applyBindings(new ViewModel());\n}", "function getData(map) {\n $.ajax(\"data/airqual_final.geojson\", {\n dataType: \"json\",\n success: function(response) {\n\n var attributes = processData(response);\n\n createPropSymbols(response, map, attributes);\n createSequenceControls(map, attributes);\n createLegend(map, attributes);\n }\n });\n //add power plants geojson\n $.ajax(\"data/pplants.geojson\", {\n dataType: \"json\",\n success: function(response) {\n addCoalPlants(response, map);\n }\n })\n}", "function loadMapShapes() {\n\n map.data.loadGeoJson('https://raw.githubusercontent.com/lotharJiang/Cluster-Sentiment-Analysis/master/Data%20Visualisation/newVicJson.json',{idPropertyName:'Suburb_Name'});\n\n google.maps.event.addListenerOnce(map.data,\"addfeature\",function(){\n google.maps.event.trigger(document.getElementById('Aurin-Variable'),'change');\n })\n\n map2.data.loadGeoJson('https://raw.githubusercontent.com/lotharJiang/Cluster-Sentiment-Analysis/master/Data%20Visualisation/newVicJson.json',{idPropertyName:'Suburb_Name'});\n\n google.maps.event.addListenerOnce(map2.data,\"addfeature\",function(){\n google.maps.event.trigger(document.getElementById('Aurin-Variable2'),'change');\n })\n}", "function preload(){\n\tdata = loadJSON('population.json'); // data variable is assigned json data\n}", "function initMap() {\n // create styles array to use with the map\n var styles = [\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"lightness\": 100\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#C6E2FF\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#C5E3BF\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#D1D1B8\"\n }\n ]\n }\n];\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 37.801663, lng: -122.447909},\n styles: styles,\n mapTypeControl: false,\n zoom: 12\n });\n\n bounds = new google.maps.LatLngBounds();\n ViewModel = new ViewModel();\n ko.applyBindings(ViewModel);\n infowindow = new google.maps.InfoWindow();\n}", "function loadData(secType) {\n $.getJSON(preURL+\"/json/\" + secType, function (data) {\n\n var element = $('#datatables');\n ko.cleanNode(element);\n\n var vm = new VM();\n ko.applyBindings(vm);\n \n \n // apply DataTables magic\n\n var parsedata = JSON.parse(data.GetJsonResultResult);\n $.each(parsedata, function (index, value) {\n console.log(value);\n vm.items.push(value);\n });\n $(document).ready(function() {\n $('#datatables').DataTable();\n } );\n });\n}", "function getData() {\n $http.get(ctrl.mapVisUrl).\n success(function(data, status, headers, config) {\n processData(data); //Process the result.\n ctrl.isLoading = false; //Tell the loadingGif to turn off, we're done.\n\n }).\n error(function(data, status, headers, config) {\n ctrl.isLoading = false;\n });\n }", "function readyBegin(json){\r\n console.log(\"inside prepData\", json);\r\n // Convert Topo Json object to GeoJson feature collection\r\n var topo = topojson.feature(json, json.objects.chicago_health2);\r\n appendROC(topo);\r\n}", "function loadSmallTrail(evt) {\n var req = $.ajax({\n url: \"http://localhost:3000/w_pathnondistinct\",\n type: \"GET\",\n });\n req.done(function (resp_json) {\n console.log(JSON.stringify(resp_json));\n var listaFeat = jsonAnswerDataToListElements(resp_json);\n var linjedata = {\n \"type\": \"FeatureCollection\",\n \"features\": listaFeat\n };\n smallTrailArray.addFeatures((new ol.format.GeoJSON()).readFeatures(linjedata, { featureProjection: 'EPSG: 3856' }));\n });\n}", "function incidentsContentViewModel() {\r\n var self = this;\r\n self.loadIncident = function (data) {\r\n console.log(data);\r\n history.pushState(null, '', 'index.html?root=incident&id=' + data);\r\n oj.Router.sync();\r\n };\r\n\r\n self.getUrl = function () {\r\n var urlParams = config.url + 'alerts/';\r\n urlParams = urlParams + \"?loc=\" + rootViewModel.currentLocationID();\r\n urlParams = urlParams + \"&type=\" + self.alertType();\r\n urlParams = urlParams + \"&start=\" + self.start;\r\n urlParams = urlParams + \"&end=\" + self.end;\r\n return urlParams;\r\n };\r\n\r\n self.alertType = ko.observable('Temp');\r\n\r\n self.setAlertType = function (alertType) {\r\n console.log(alertType);\r\n self.alertType(alertType);\r\n self.loadData();\r\n };\r\n\r\n self.ready = ko.observable(false);\r\n var rootViewModel = ko.dataFor(document.getElementById('globalBody'));\r\n self.currentLocation = ko.observable();\r\n\r\n self.incidents = ko.observableArray();\r\n self.tempTotal = ko.observable(0);\r\n self.energyTotal = ko.observable(0);\r\n self.otherTotal = ko.observable(0);\r\n\r\n\r\n\r\n\r\n\r\n // self.prod = rootViewModel.prod();\r\n self.prod = true;\r\n\r\n\r\n\r\n /*Load Data*/\r\n self.loadData = function () {\r\n return new Promise(function (resolve, reject) {\r\n\r\n if (self.prod) {\r\n url = self.getUrl();\r\n console.log(url)\r\n } else {\r\n url = 'js/data/mock/incidents.json';\r\n }\r\n\r\n jsonData.fetchData(url).then(function (incidents) {\r\n self.incidents.removeAll();\r\n \r\n if(self.alertType()==='Temp'){\r\n self.tempTotal(incidents.length) \r\n }\r\n \r\n if(self.alertType()==='Energy'){\r\n self.energyTotal(incidents.length) \r\n }\r\n \r\n \r\n self.incidents(incidents);\r\n self.ready(true);\r\n resolve(true);\r\n }).fail(function (error) {\r\n console.log(error);\r\n resolve(false);\r\n });\r\n });\r\n\r\n };\r\n\r\n /*Location Change*/\r\n self.locationChange = ko.computed(function () {\r\n // self.currentLocation(rootViewModel.currentLocationID());\r\n // self.loadData();\r\n });\r\n\r\n self.start = moment().subtract(6, 'days');\r\n self.end = moment();\r\n self.dateText = ko.observable();\r\n\r\n\r\n\r\n self.handleAttached = function () {\r\n $(\"#reportrange\").daterangepicker({startDate: self.start,\r\n endDate: self.end,\r\n ranges: {\r\n 'Today': [moment(), moment()],\r\n 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\r\n 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\r\n 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\r\n 'This Month': [moment().startOf('month'), moment().endOf('month')],\r\n 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\r\n }\r\n }, self.datePicked);\r\n };\r\n\r\n // $('#reportrange span').html(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'));\r\n\r\n self.datePicked = function (start, end) {\r\n // console.log(moment(start).unix(), moment(end).unix());\r\n self.start = start;\r\n self.end = end;\r\n self.dateText(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'))\r\n self.loadData();\r\n };\r\n\r\n// self.datePicked(self.start, self.end);\r\n self.dateText(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'))\r\n self.loadData();\r\n }", "function initialize() {\r\n var mapOptions = {\r\n zoom: 12,\r\n center: kampala\r\n };\r\n\r\n map = new google.maps.Map(document.getElementById('map-canvas'),\r\n mapOptions);\r\n\r\n\t$.getJSON('/map-geojson/stations', function(data){\r\n\t\t// var latLng = new google.maps.LatLng(data)\r\n\t\t$.each(data, function(key, value){\r\n\t\t\tvar coord = value.geometry.coordinates;\r\n\t\t\tvar latLng = new google.maps.LatLng(parseFloat(coord[0]), parseFloat(coord[1]));\r\n\r\n\t\t\tvar content = '<div id=\"content\">'+\r\n\t\t\t\t'<h2>' + value.properties.title + '</h2>'+\r\n\t\t\t\t'<p>' + \"<a href='\"+value.properties.url +\"'>Readings</a>\" + '</p>'+\r\n\t\t\t\t'</div>'\r\n\t\t\t//create an informatin window\t\r\n\t\t\tvar infowindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: content\r\n\t\t\t})\r\n\t\t\t//create a marker\r\n\t\t\tvar marker = new google.maps.Marker({\r\n\t\t\t\tposition: latLng,\r\n\t\t\t\tmap: map,\r\n\t\t\t\ttitle: value.properties.title\r\n\t\t\t});\r\n\t\t\t//add click event listener\r\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function(){\r\n\t\t\t\tinfowindow.open(map, marker);\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n\r\n}", "function getData(){\n\t\t//load the data\n\t\t$.getJSON(\"data/canada-strikes.geojson\", function(response){\n\t\t\t\t//call relevant functions\n\t\t\t\tprocessData(response);\n\t\t\t\tcreatePropSymbols(response, map, attributes);\n\t\t\t\tcreateSequenceControls();\n\t\t});\n}", "function initialize(){\n\t\tgetJSON('https://gist.githubusercontent.com/akashravi7/ce6dbf5a91716613ec09aac2544b99d3/raw/23028c2ab28a430518c0dac267df51747d4b7d72/cirtual_challenge_data.json', function(err, data) {\n\t\tif (err != null) {\n\t\t\talert('Something went wrong: ' + err);\n\t\t} else {\n\t\t\tobject=data;\n\t\t\tloaddata(data.Data);\n\t }\n });\n}", "function onGapiLoaded() {\n gapi.client.hut.listHuts().execute(function(resp) {\n if (!resp.code) {\n gapiLoaded = true;\n resp.huts.forEach(function(hut){\n vm.hutList.push(new Hut(hut));\n });\n if (gapiLoaded && gMapsLoaded) {\n vm.showMarkers();\n }\n $('#loadinghuts').hide();\n $('#hutList').show();\n }\n // if the response fails show error message\n else {\n gapiLoaded = false;\n $('#loadinghuts').hide();\n $('#error-messages').show();\n }\n });\n}", "function initialize() {\n var mapOptions = {\n center: { lat: 41.862313, lng: -87.616688},\n zoom: 13\n };\n\n var mapElement = document.getElementById('map-canvas');\n\n map = new google.maps.Map(mapElement, mapOptions);\n vm = new ViewModel();\n ko.applyBindings(vm);\n }//end initialize", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 14,\n mapTypeControl: false,\n center: {lat:lat,lng:lng}\n });\n infowindow = new google.maps.InfoWindow(); \n viewModel = new ViewModel(); \n ko.applyBindings(viewModel);\n}", "function getData() {\n\t$.getJSON(\"js/polls.json\", function(data) {\n\t\t//When we have the data, pass it to the `drawMarkers()` function\n\t\tdrawMarkers(data);\n\t});\n}", "function initMap() {\n\tupdateYear();\n map = new google.maps.Map($('#map')[0], { \n \tzoom:6,\n center:{lat: 43, lng: -76},\n \tbackgroundColor:\"#d8e8ff\",\n \tstreetViewControl:false,\n mapTypeControl:false,\n maxZoom:15,\n minZoom:5,\n clickableIcons:false\n });\n \tmap.fitBounds({north: 43.5, south: 40.5, west: -76, east: -74});\n \n $.getJSON( \"guide_data.json\", onGuideLoad)\n .fail(function() {console.log( \"guide load error\" );});\n\n\t\n \t$.ajax({\n\t\turl: \"https://data.ny.gov/resource/dzn2-x287.json?$where=starts_with(waterbody,'HUDSON R')\",\n\t\ttype: \"GET\",\n\t\tdata: {\n\t\t \"$limit\" : 75000,\n\t\t \"$$app_token\" : \"6VuR0Szvnvt58kUl87cNa4tdF\"\n\t\t}\n\t}).done(onJSONLoad);\n}", "constructor(data) {\n this.data = data;\n this.rebuild_population();\n this.list_of_infoBoxData = [];\n }", "function getData(map){\n\n //load the data\n $.ajax(\"data/hotspotInfo.geojson\", {\n dataType: \"json\",\n success: function(response){\n\n //create a leaflet GeoJSON layer and add it to the map\n geojson = L.geoJson(response, {\n style: function (feature){\n if(feature.properties.TYPE === 'hotspot_area'){\n return {color: '#3182bd',\n weight: 2,\n stroke:1};\n } else if(feature.properties.TYPE ==='outer_limit'){\n return {color: '#9ecae1',\n weight: 2,\n stroke: 0,\n fillOpacity: .5};\n }\n },\n\n\n onEachFeature: function (feature,layer) {\n var popupContent = \"\";\n if (feature.properties) {\n //loop to add feature property names and values to html string\n popupContent += \"<h5>\" + \"Region\" + \": \" + feature.properties.NAME + \"</h5>\";\n\n if (feature.properties.TYPE ===\"hotspot_area\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot\" + \"</h5>\";\n\n }\n\n\n if (feature.properties.TYPE ===\"outer_limit\"){\n\n popupContent += \"<h5>\" + \"Type: \" + \"Hotspot Outer Limit\" + \"</h5>\";\n\n }\n\n\n layer.bindPopup(popupContent);\n\n };\n\n\n layer.on({\n mouseover: highlightFeature,\n mouseout: resetHighlight,\n click: zoomToFeature\n });\n layer.on({\n click: panelInfo,\n })\n }\n }).addTo(map);\n\n //load in all the biodiversity and threatened species image overlays\n var noneUrl = 'img/.png',\n noneBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var none = L.imageOverlay(noneUrl, noneBounds);\n\n \tvar amphibianUrl = 'img/amphibian_richness_10km_all.png',\n \tamphibianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var amphibians = L.imageOverlay(amphibianUrl, amphibianBounds);\n\n var caecilianUrl = 'img/caecilian_richness_10km.png',\n \tcaecilianBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caecilians = L.imageOverlay(caecilianUrl, caecilianBounds);\n\n var anuraUrl = 'img/frog_richness_10km.png',\n \tanuraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var anura = L.imageOverlay(anuraUrl, anuraBounds);\n\n var caudataUrl = 'img/salamander_richness_10km.png',\n \tcaudataBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var caudata = L.imageOverlay(caudataUrl, caudataBounds);\n\n var threatenedaUrl = 'img/threatened_amp.png',\n threatenedaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threateneda = L.imageOverlay(threatenedaUrl, threatenedaBounds);\n\n var birdsUrl ='img/birds.png',\n birdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var birds = L.imageOverlay(birdsUrl, birdsBounds);\n\n var psittaciformesUrl = 'img/psittaciformes_richness.png',\n psittaciformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var psittaciformes = L.imageOverlay(psittaciformesUrl, psittaciformesBounds);\n\n var passeriformesUrl = 'img/passeriformes_richness.png',\n \t passeriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var passeriformes = L.imageOverlay(passeriformesUrl, passeriformesBounds)\n\n var nonpasseriformesUrl = 'img/nonPasseriformes.png',\n nonpasseriformesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var nonpasseriformes = L.imageOverlay(nonpasseriformesUrl, nonpasseriformesBounds)\n\n var hummingbirdsUrl = 'img/hummingbirds.png',\n hummingbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var hummingbirds = L.imageOverlay(hummingbirdsUrl, hummingbirdsBounds)\n\n var songbirdsUrl = 'img/songbirds_richness.png',\n \tsongbirdsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var songbirds = L.imageOverlay(songbirdsUrl, songbirdsBounds);\n\n var threatenedbUrl = 'img/threatened_birds.png',\n threatenedbBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedb = L.imageOverlay(threatenedbUrl, threatenedbBounds);\n\n var mammalsUrl = 'img/mammals.png',\n mammalsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var mammals = L.imageOverlay(mammalsUrl, mammalsBounds);\n\n var carnivoraUrl = 'img/carnivora.png',\n carnivoraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var carnivora = L.imageOverlay(carnivoraUrl, carnivoraBounds);\n\n var cetartiodactylaUrl = 'img/cetartiodactyla.png',\n cetartiodactylaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var cetartiodactyla = L.imageOverlay(cetartiodactylaUrl, cetartiodactylaBounds);\n\n var chiropteraUrl = 'img/chiroptera_bats.png',\n chiropteraBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var chiroptera = L.imageOverlay(chiropteraUrl, chiropteraBounds);\n\n var eulipotyphlaUrl = 'img/eulipotyphla.png',\n eulipotyphlaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var eulipotyphla = L.imageOverlay(eulipotyphlaUrl, eulipotyphlaBounds);\n\n var marsupialsUrl = 'img/marsupials.png',\n marsupialsBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var marsupials = L.imageOverlay(marsupialsUrl, marsupialsBounds);\n\n var primatesUrl = 'img/primates.png',\n primatesBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var primates = L.imageOverlay(primatesUrl, primatesBounds);\n\n var rodentiaUrl = 'img/rodentia.png',\n rodentiaBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var rodentia = L.imageOverlay(rodentiaUrl, rodentiaBounds);\n\n var threatenedmUrl = 'img/threatened_mammals.png',\n threatenedmBounds = [[84.65, -220.9],[-62.24, 220.85]];\n var threatenedm = L.imageOverlay(threatenedmUrl, threatenedmBounds);\n\n //define structure of layers and overlays\n var animals = [\n {\n groupName: \"Overlays Off\",\n expanded: false,\n layers: {\n \"Overlays Off\": none\n }\n }, {\n groupName: \"Amphibians\",\n expanded: true,\n layers: {\n \"All Amphibians\": amphibians,\n \t\"Caecilian\": caecilians,\n \t\"Anura\": anura,\n \t\"Caudata\": caudata\n }\n }, {\n groupName: \"Birds\",\n expanded: true,\n layers: {\n \"Birds\": birds,\n \t\"Psittaciformes\": psittaciformes,\n \t\"Passeriformes\": passeriformes,\n \"NonPasseriformes\": nonpasseriformes,\n \"Trochilidae\": hummingbirds,\n \t\"Passeri\": songbirds\n }\n }, {\n groupName: \"Mammals\",\n expanded: true,\n layers: {\n \"All Mammals\": mammals,\n \"Carnivora\": carnivora,\n \"Cetartiodactyla\": cetartiodactyla,\n \"Chiroptera\": chiroptera,\n \"Eulipotyphla\": eulipotyphla,\n \"Marsupials\": marsupials,\n \"Primates\": primates,\n \"Rodentia\": rodentia\n }\n }, {\n groupName: \"Threatened Species\",\n expanded: true,\n layers: {\n \"Threatened Amphibians\": threateneda,\n \"Threatened Birds\": threatenedb,\n \"Threatened Mammals\": threatenedm\n }\n }\n ];\n\n var overlay = [\n {\n groupName: \"Hotspots\",\n expanded: true,\n layers: {\n \"Hotspots (Biodiversity Hotspots are regions containing high biodiversity but are also threatened with destruction. Most hotspots have experienced greated than 70% habitat loss.)\": geojson\n }\n }\n ];\n\n //style the controls\n var options = {\n group_maxHeight: \"200px\",\n exclusive: false,\n collapsed: false\n }\n\n //add heat maps and hotspot overlay to map\n var control = L.Control.styledLayerControl(animals, overlay, options);\n control._map = map;\n var controlDiv = control.onAdd(map);\n\n document.getElementById('controls').appendChild(controlDiv);\n\n $(\".leaflet-control-layers-selector\").on(\"change\", function(){\n $(\"#mapinfo\").empty();\n if ( map.hasLayer(amphibians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caecilians)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(anura)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(caudata)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(threateneda)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Amphibians</h2><p>Amphibians are ectothermic, or cold blooded, which means they regulate their body temperature behaviorally via the outside world. Amphibians are typically four-limbed vertebrates. They have smooth, unscaly, permeable skin that helps them absorb oxygen. Some amphibians even produce toxins using their skin glands to deter predators. Modern Amphibians are generally grouped as Caecilian (limbless amphibians), Caudata (salamanders) and, and Anura (frogs). As you can see from the map, amphibians as a whole occupy a large amount of the earth. Most amphibians live in or around aquatic ecosystems, as water is crucial to their reproduction. Most amphibians begin life in the water, and experience metamorphosis to move from an adolescent with gills to an adult that breathes air. Due to their close relationship with water, amphibians are typically good environmental indicators.</p><h3>Caecilian</h3><p>These amphibians are unlike others in that they are limbless. You probably have not encountered these, as they live underground and are not commonly seen. They can be as small as earthworms and can grow as large as 5 feet long. As you can see from the map they are mostly located in South and Central America. Their diet consists of earthworms and other small creatures that live underground. Like frogs, caecilians skin secretes chemicals to deter predators. They are adapted for burrowing, but some species also can swim (similarly to eels) in bodies of water. Caecilians are less affected by climate change than some of the other species of amphibian; however, those who live in regions where deforestation or massive landscape changes are taking place are feeling the effects of losing large portions of their habitat. This is especially concerning because some caecilians are specific to very small regions and therefore are extremely vulnerable to habitat loss.</p>\t<h3>Anura</h3><p>Anura, more commonly referred to as frogs, are members of a group of short bodied amphibians that, in their adult form, lack a tail. As you can see from the map, frogs are widely distributed, but most species are located in tropical rainforests, such as the Amazon Rainforest. Due to their life cycle largely involving water, most species live in moist areas, but a few species have adapted to dry habitats. Frogs are extremely diverse, and make up more than 85% of living amphibians. Frogs normally lay their eggs in water, which then hatch into tadpoles and eventually metamorphize into adults. Adult frogs are typically carnivorous and eat small invertebrates, but some species are omnivorous. We generally call warty frogs toads, but this is based solely on informal naming, and many toads are very closely related to frogs. More than one third of frog species are considered to be threatened and over 120 species have become extinct since the 1980s. Frogs have had increasing malformations, and a fungal disease called chytridiomycosis has spread around the world - even frogs in quarantine are being afflicted by the fungus. </p><h3>Caudata</h3><p>Caudata are known more commonly as salamanders. They have slender bodies and short legs. Unlike other amphibians, salamanders have a tail in both their adolescent and adult forms. As you can see on the map, they are mostly found in the Northern Hemisphere. Like many other amphibians, salamanders. Although most salamanders are small, two species can reach up to 5 feet in length. They are also nocturnal. They live in or around water – only a few species are completely terrestrial in adulthood. Salamanders can regenerate lost limbs within a few weeks, which allows them greater survivability of predator attacks. Due to the chytrid fungus that afflicts amphibians and destruction of wetland habitats, populations have dramatically decreased over the last few years.</p>\t<h3>Threatened Amphibians</h3><p>Although we are constantly discovering new amphibians, in the past 50 years we have been experiencing a rapid decline in amphibians, and scientists are not entirely sure why. Scientists have numerous ideas – acid rain, thinning ozone layer increasing UV radiation, toxic compounds in the air being absorbed via amphibians’ skins, and toxic fungus – but we still cannot be sure exactly what is happening, other than that many of these ideas result from human-caused climate change.</p>\");\n };\n if (map.hasLayer(birds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(psittaciformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(nonpasseriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(passeriformes)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(hummingbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(songbirds)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if (map.hasLayer(threatenedb)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Birds</h2><p>Birds are endothermic (warm-blooded) vertebrates whose defining characteristics are the presence of feathers and wings. Feathers are used as a barrier against the water, provide insulation from cold, provide a flat surface to push against the air during flight, and are used, especially by brightly colored males, to attract mates. Although all birds have fore-limbs adapted into wings, their hind limbs vary in purpose; depending upon the species, they can be used for walking, perching, swimming, or some combination. In lieu of typical jaws, birds’ jaws are modified into different shaped beaks, depending upon their diet. Birds can be a wide range of sizes – from a two inch tall hummingbird, to an ostrich that can reach heights of eight feet. This high level of variablity allows birds to occupy a wide variety of habitats.</p><h3>Psittaciformes</h3><p>Psittaciformes are parrots and related birds such as lorikeets, macaws, and cockatoos. They commonly have strong, curved beaks; strong legs; and clawed feet. They subsist off seeds, nuts, fruits, and other organic plant materials. Parrots are one of the most intelligent birds, and are popular pets, partially due to their ability to imitate human speech. However, because of parrots’ popularity as pets, habitat loss, and invasive species, wild parrot populations have diminished.</p><h3>Passeriformes</h3><p>Passerines are birds of the order Passeriformes, which are distinguished by the arrangement of their toes: three pointing forward, and one back. This arrangement makes it easier for the birds to perch, which resulted in their common name “perching birds.” Most passerines who live in trees do not fall from their perch while asleep because when they bend their ankles to squat on a perch, tension on their tendons automatically closes the toes around the perch. Passerines account for more than half of all species of birds. As you can see from the map, passerines are found throughout the world in many different habitats.</p><h3>Non-Passeriformes</h3><p>Non-Passeriformes, or non-Passerines are birds who do not belong to the order Passeriformes. This means that they could have any toe combinations – two forward, two backward; two forward, one backward; etc. Additionally, this includes birds with webbed feet. Some examples of birds that belong to this order are turkeys, geese, ducks, and cranes.</p><h3>Trochilidae</h3><p>Trochilidae, or hummingbirds, are known for their small size (the smallest hummingbird weighs 2 grams) and quick wing movements. They belong to the order Apodiformes, which means “unfooted birds.” They have tiny feet and are unable to walk on the ground. Their diet consists of nectar and flowers, supplemented with small insects on occasion. Their bills are shaped specifically for the flowers that they feed off and their ability to hover also allows them to extract nectar more easily. Hummingbirds are the only birds that are able to hover, due to specialized skeletal and flight muscles. Hummingbirds play an important role in pollinating many plants – in Brazil they pollinate 58 different plant species. Humans have had a large impact on hummingbird survivability. Previously, we hunted them for their feathers, which we used to make jewelry. Now, they are being threatened by habitat loss, degradation, and fragmentation. However, habitat destruction in the tropics has not threatened hummingbirds as much as some other species, as hummingbirds are typically able to find suitable habitats in human modified landscapes. In North America, some species have even increased their population and range, as hummingbird feeders and flower gardens allow them to move around more.</p><h3>Passeri</h3><p>Passeri, or songbirds, include birds who have a vocal organ developed specifically for “singing.” The reason why songbirds sing can vary – it can be to defend territory, communicate position, or to mate. Nearly all birds have a call of some kind, but songbirds have more intricate songs, and also know more varieties of songs. They disperse seeds and pollinate flowers, which helps the ecosystem and survival of plant species. They feed on insects that cause disease among plants. However, in recent years there has been a significant decline in the number of songbirds, and studies show that song bird habitat fragmentation due to human changes and modifications of the environment could be one of the main reasons for this decline.</p><h3>Threatened Birds</h3><p>Humans have greatly affected birds and their habitats. Birds were once considered an inexhaustible resource; thus, they were killed in large quantities for various purposes, or no purpose at all. Our expansion of infrastructure such as cities, roads, and farms has infringed upon their natural habitats. Pollution from anthropogenic sources, such as pesticides and oil spills have further damaged bird populations.</p>\");\n };\n if(map.hasLayer(mammals)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(carnivora)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(cetartiodactyla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(chiroptera)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(eulipotyphla)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(marsupials)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(primates)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(rodentia)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(threatenedm)){\n $(\"#mapinfo\").html(\"<h2>Biodiversity</h2><p>Biodiversity is considered the variability of species in a given area, or species richness. This map offers insight into the richness of numerous terrestrial classes and orders.</p><h2>Mammals</h2><p>Mammals are endothermic, or warm blooded, vertebrates. To be classified as a mammal, the organism must also have hair on its body, and produce milk to feed its young. Most mammals live on land, but there are many that fly, or live in the ocean. Some species of mammals are intelligent and can use tools, or are self-aware. Mammals can communicate in several ways, but most communicate vocally. Humans are mammals, and have benefited from the domestication of other mammals, such as cows, dogs, and sheep (among others) which have allowed us to thrive on the earth. However, human effects on the climate and environment, such as poaching and deforestation, is the biggest threat to mammals. </p><h3>Carnivora</h3><p>The order Carnivora are descendants of a group of Paleocene mammals who were carnivorous. However, this does not mean that all current members of Carnivora eat strictly meat. As they have evolved, Carnivorans still primarily eat meat, but now include other food sources as well, as many are omnivores. As you can see from the map, members of Carnivora are well distributed throughout the world. Species belonging to Carnivora can be identified by their teeth: they have large premolars, which are sharp and specialized for cutting through meat and tendons, as well as six incisors, which is how many their ancestors had as well. Many Carnivorans are the top predator in their ecosystem, therefore, they play an important role in regulating populations of their prey. Due to many members of Carnivora being nuisances or threats to human livelihood (example: wolves eat humans’ cows and sheep), they have been threatened by humans for a long time. Major threats to members of Carnivora include habitat loss, fragmentation, and degredation; hunting for sport and for profit; and reluctance of humans to coexist with carnivorans.</p><h3>Cetartiodactyla</h3><p>This group includes even-toed hoofed mammals, such as cows and deer. As you can see from the map, cetartiodactyls can be found throughout the world. Most live entirely on land and can live in many habitats, such as forest, mountain, desert, or farmland. One example of an exception is the hippopotamus, which is semi-aquatic. Most cetartiodactyls are social animals that live in herds. Also, most are herbivores, but some are omnivorous. The biggest threats, other than predators, to cetartiodactyls is habitat loss and over hunting.</p><h3>Chiroptera</h3><p>Chiroptera are bats, and they make up about 20% of all living mammal species. They are the only mammals that can fly. Bats are primarily nocturnal, and navigate at night using echolocation. In more northern regions, bats hibernate during the winter. As you can see from the map, most bats reside in tropical areas, although many live throughout the world. Generally, if there are good roosts and enough food, you will find bats. They vary in what they eat, including fruit, nectar, pollen, insects, amphibians, and small rodents. One surprising fact about bats is that many live over 30 years in the wild. Bats are important to their ecosystems because they serve as pollinators and keep their prey populations, such as insects, in check. One fourth of bat species are considered threatened, and destruction of roost sites via deforestation and habitat degradation remain issues. Additionally, a fungus that lives on and kills hibernating bats called white nose syndrome, has led to greater losses.</p><h3>Eulipotyphla</h3><p>Eulipotyphla is an order of mammals that contains the hedgehogs, moles, and shrews. These animals are typically small to medium sized, have sharp teeth, long pointed snouts, and small eyes.</p><h3>Marsupials</h3><p>Marsupials are a group of mammals typically thought of as pouched mammals, such as the kangaroo. They keep their young in their pouch until the young are old enough to fend for themselves. Although marsupials are commonly associated with Australia and that is where they are mostly located, they can live in many other places. In North America, we have marsupials in the form of opossums. Marsupials are heavily affected by environmental degradation and deforestation.</p><h3>Primates</h3><p>Primates typically live in forested areas and have features that most likely were adaptations for forest life. They are highly social and typically live in groups, and most reside in the tropics and subtropics. Primates eat a variety of things, including leaves, fruit, insects, and meat. Human land use strategies, particularly using deforestation to change land use, is a huge threat to primates.</p><h3>Rodentia</h3><p>Rodents are highly diverse, but have one thing in common: their teeth are specialized for gnawing. As you can see from the map, they are found around the world, except for Antarctica and some islands. This is due to the fact that they are extremely diverse. Some live in the water, and some live only in deserts. Most are omnivorous; others only eat a few specific species. Humans generally dislike rodents, as the aisles in many hardware stores with multiple ways to kill mice and moles will demonstrate to you. However, aside from pest control, many rodents die by human-caused environmental degradation.</p><h3>Threatened Mammals</h3><p>Mammals are hunted or raced for sport, and are used as model organisms in science. Loss of mammal populations is primarily driven by anthropogenic (human caused) factors, such as poaching and habitat destruction, though there are efforts to stop this.</p>\");\n };\n if(map.hasLayer(geojson)){\n };\n });\n\n}\n});\n\n\n\n}", "function getData(map){\r\n $.ajax(\"data/Species.geojson\", {\r\n dataType: \"json\"\r\n ,success: function(response){\r\n var layerWells = createPropSymbols(response, map, processData(response));\r\n getDataMinMax(map, processData(response)[0]);\r\n addLayerControl(layerWells);\r\n createSequenceControls(map, response, processData(response));\r\n }\r\n });\r\n}", "function initLunr() {\n var data = $(CATEGORYS).map(function (index, category) {\n return $.getJSON('/' + category + '/index.json')\n });\n $.when.apply(null, data)\n .done(makeLunrIndex)\n .fail(function () {\n alert(\"fail\");\n });\n}", "function getData(map) {\r\n console.log(\"D\");\r\n //load the data\r\n $.getJSON(\"data/MegaCities.geojson\", function (response) {\r\n console.log(\"a\");\r\n //calculate minimum data value\r\n var attributes = processData(response);\r\n console.log(\"b\");\r\n minValue = calculateMinValue(response);\r\n //call function to create proportional symbols\r\n createPropSymbols(response, attributes);\r\n createSequenceControls(attributes);\r\n });\r\n}", "function reloadMapWithData() {\r\n var startDate_period1 = formatDate($('#datePeriod1').data('daterangepicker').startDate);\r\n var endDate_period1 = formatDate($('#datePeriod1').data('daterangepicker').endDate);\r\n var startDate_period2 = formatDate($('#datePeriod2').data('daterangepicker').startDate);\r\n var endDate_period2 = formatDate($('#datePeriod2').data('daterangepicker').endDate);\r\n\r\n var kioskIds = getSelectedWithComma('selKiosks');\r\n var channelIds = getSelectedWithComma('selChennel');\r\n var showTop = getSelectedWithComma('selShowTop');\r\n\r\n clearMap();\r\n //$(\"#slider\").slider(\"option\", \"value\", 2);\r\n //handle.text(2);\r\n\r\n //$.getJSON(\"Data/SampleData.json\", loadSampleData);\r\n //\"Data/MapDataInJson.php?startP1=1-02-2017&endP1=28-02-2017&startP2=1-03-2017&endP2=31-03-2017&showTop=10&kiosks=98,99,100,101,012,103,104,105,112,113&channels=115,116,117,118,119,120,121\"\r\n\r\n var root = $('#myRoot').val();\r\n var url = root + \"Data/MapDataInJson.php?startP1=\" + startDate_period1 + \"&endP1=\" + endDate_period1 +\r\n \"&startP2=\" + startDate_period2 + \"&endP2=\" + endDate_period2 + \"&showTop=\" + showTop +\r\n \"&kiosks=\" + kioskIds + \"&channels=\" + channelIds;\r\n\r\n\r\n $.getJSON(url, loadMapData);\r\n\r\n }", "function populateData()\n\t{\n\t\t//Add our event listner for the data stream!\n\t\tTi.App.addEventListener('data.google', function(d)\n\t\t{\n\t\t\tTi.API.debug(d);\n\t\t\t//Ti.API.info('your data: ' + d.responseText);\n\t\t\t//Ti.API.info('your data: ' + d.json.response);\n\t\t\t\n\t\tjsonArray = JSON.parse(d.responseText);\n\t\t//Ti.API.info(jsonArray.results);\n\t\t\t\t\n\t\t//Ti.API.info('My result: ' + results);\n\t\t\n\t\tfor (var i = 0; i < jsonArray.results.length; i++)\n\t\t{\n\t\t\tmapview.addAnnotation\n\t\t\t(\n\t\t\t\tTi.Map.createAnnotation\n\t\t\t\t({\n\t\t\t\t\tanimate: true,\n\t\t\t\t\tpincolor: Titanium.Map.ANNOTATION_GREEN,\n\t\t\t\t\t//image: createImage,\n\t\t\t\t\ttitle: jsonArray.results[i].name, //+ ', $' + results[i].price,\n\t\t\t\t\tsubtitle: jsonArray.results[i].vicinity,\n\t\t\t\t\tlatitude: jsonArray.results[i].geometry.location.lat,\n\t\t\t\t\tlongitude: jsonArray.results[i].geometry.location.lng,\n\t\t\t\t\t//leftButton: jsonArray.results[i].icon,//Ti.UI.iPhone.SystemButton.INFO_LIGHT,\n\t\t\t\t\tmyid: jsonArray.results[i].reference,\n\t\t\t\t\trightButton: Ti.UI.iPhone.SystemButton.DISCLOSURE\n\t\t\t\t})\n\t\t\t);\n\t\t\t\n\t\t\t//Ti.API.info('map view results ' + results[i].name + results[i].address);\n\t\t\t} //end the for loop\n\t\t\t\n\t\t});\n\t} //end function", "onLoad() {\n this.curLogic = require(\"logic\").getInstance();\n emitter.on(\"getdifficultData\",this.resetdifficultData,this); //保证能在数据层的json读取后赋值\n this.difficult = null;\n this.difficultData = this.curLogic.get(\"difficultData\");\n this.levelsData = [];\n this.initDiffState();\n this.initEditLevel();\n this.isshowLevels();\n }", "function initData() {\n data = $.getJSON('./data/weathers.json').done(() => {\n console.log(\"Loaded: JSON - data\");\n data = data.responseJSON;\n console.log(data);\n initPage();\n }).fail(() => {\n console.log(\"Error when loading JSON - data.\");\n });\n}", "function addGeoJSON() {\r\n $.ajax({\r\n url: \"https://potdrive.herokuapp.com/api/map_mobile_data\",\r\n type: \"GET\",\r\n success: function(data) {\r\n window.locations_data = data\r\n console.log(data)\r\n //create markers from data\r\n addMarkers();\r\n //redraw markers whenever map moves\r\n map.on(plugin.google.maps.event.MAP_DRAG_END, addMarkers);\r\n setTimeout(function(){\r\n map.setAllGesturesEnabled(true);\r\n $.mobile.loading('hide');\r\n }, 300);\r\n },\r\n error: function(e) {\r\n console.log(e)\r\n alert('Request for locations failed.')\r\n }\r\n }) \r\n }", "function loadData() {\n loadJson('am');\n loadJson('pm');\n}", "function fetchGeoData(){\n $.ajax({\n dataType: \"json\",\n url: \"data/map.geojson\",\n success: function(data) {\n $(data.features).each(function(key, data) {\n geoDataLocations.push(data);\n });\n startMap();\n },\n error: function(error){\n console.log(error);\n return error;\n }\n });\n }", "function getData(map){\r\n $.ajax(\"data/MidWesternCities5.geojson\", {\r\n dataType: \"json\",\r\n success: function(response){\r\n \r\n var attributes = processData(response);\r\n \r\n createPropSymbols(response, map, attributes);\r\n createSequenceControls(map, attributes);\r\n createLegend(map, attributes);\r\n \r\n \r\n }\r\n \r\n });\r\n}", "function initMap() {\n map = new google.maps.Map(document.getElementsByClassName('map')[0], {\n zoomControl: true,\n });\n\n\n // Add mapBounds property to the window object\n window.mapBounds = new google.maps.LatLngBounds();\n\n //infowindow\n infoWindow = new google.maps.InfoWindow({maxWidth: 250});\n\n\n //Invoking createMarkers function\n createMarkers(Model.touristPlaces);\n\n vmodel = new viewModel();\n\n // apllyy binding\n ko.applyBindings(vmodel);\n}", "function loadData() {\n meterColorCheck();\n $.getJSON(\"data/related.json\",dataLoaded);\n}", "function loadScript() {\n\n $.ajaxSetup({\n async: false\n });\n\n map = new L.Map('map', {\n center: new L.LatLng(1.355312, 103.827068),\n zoom: 12\n });\n openStreeMapLayer = L.tileLayer.grayscale('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\n });\n googleLayerSatellite = new L.Google('SATELLITE');\n googleLayerStreet = new L.Google('ROADMAP');\n osmMap = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '&copy; ' + '<a href=\"http://openstreetmap.org\">OpenStreetMap</a>' + ' Contributors'\n });\n var baseMaps = {\n 'Open Street Map': osmMap,\n 'Open Street Maps (B/W)': openStreeMapLayer,\n 'Google (Satellite)': googleLayerSatellite,\n 'Google (Street)': googleLayerStreet,\n };\n markersCluster = L.markerClusterGroup();\n transactedPriceHeatMap = new L.TileLayer.HeatCanvas({}, {\n 'step': 0.3,\n 'degree': HeatCanvas.QUAD,\n 'opacity': 0.5\n });\n //initializing the layer groups\n PointSymbolMap = L.layerGroup();\n pointSymbolHeatMap = new L.TileLayer.WebGLHeatMap({}, {\n size: 1000,\n autoresize: true,\n opacity: 0.5\n // zIndex: 100\n });\n proportionalSymbolMap = L.layerGroup();\n schoolsLayer = L.layerGroup();\n\n //loading of property transaction data\n $.getJSON('data/realis.geojson', function(data) {\n jsonArray = data;\n\n //treat the data according to marker cluster\n addMarkerCluster(jsonArray);\n //treat the data according to heatmap\n addHeatMapLayer(jsonArray, 'Transacted');\n //treat the data according to point symbols\n addPointSymbolMap(jsonArray, 'Property T');\n addPointSymbolHeatMap(jsonArray);\n\n $.getJSON('data/Polygon.geojson', function(polygonData) {\n boundaryArray = polygonData;\n setChoroplethLayer(boundaryArray, jsonArray, 'Average Price Area');\n //addProportionateSymbolMap(boundaryArray);\n });\n\n\n $.getJSON('data/PolygonCentroid.geojson', function(polygonCentroidData) {\n addProportionateSymbolMap(polygonCentroidData, boundaryArray, 'Number Of Transactions');\n });\n\n });\n\n\n $.getJSON('data/sgmrtstations.geojson', function(stationData) {\n // $.getJSON('data/sgrailnetwork.geojson', function(railData) {\n // addMRTStationMap(stationData, railData);\n // });\n railData = [];\n $.getJSON('data/NSLine.geojson', function(NSLineData) {\n railData.push(NSLineData);\n });\n $.getJSON('data/EWLine.geojson', function(EWLineData) {\n railData.push(EWLineData);\n });\n $.getJSON('data/NELine.geojson', function(NELineData) {\n railData.push(NELineData);\n });\n $.getJSON('data/DowntownLine.geojson', function(DowntownLineData) {\n railData.push(DowntownLineData);\n });\n $.getJSON('data/CircleLine.geojson', function(CircleLineData) {\n railData.push(CircleLineData);\n });\n addMRTStationMap(stationData, railData);\n });\n\n $.getJSON('data/Stadiums.geojson', function(stadiumData) {\n addStadiumMap(stadiumData);\n });\n $.getJSON('data/Schools.geojson', function(schoolData) {\n addSchoolsMap(schoolData);\n });\n $.getJSON('data/Clinics.geojson', function(clinicData) {\n addClinicMap(clinicData);\n });\n\n\n /*\n $.getJSON('data/sgroadsnetwork.geojson', function(data) {\n var myLayer = L.geoJson().addTo(map);\n myLayer.addData(data);\n });\n */\n\n var overlayMaps = {\n 'Cluster Marker': markersCluster,\n 'Point Symbol': PointSymbolMap,\n 'Transacted Price Heat Map': transactedPriceHeatMap,\n // 'Heat Map': pointSymbolHeatMap,\n 'MRT Map': mrtMapLayerReference,\n 'Singapore Sub Zones': polygonBoundary,\n 'Proportional Symbol': proportionalSymbolMap,\n 'Schools': schoolsLayer,\n 'Stadiums': stadiumsLayer,\n 'Clinics' : clinicsLayer\n };\n\n map.addLayer(osmMap);\n addHoverInfoControl();\n layerControl = L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(map);\n renderChoroplethVariableControl();\n addLayerChangeEventHandler();\n addPanLayerControl();\n addUserMarkerControl();\n applyAHPFormEffect();\n\n $.ajaxSetup({\n async: false\n });\n $(\".genericcontainer\").fadeOut(1500, function() {\n $(\".genericcontainer\").remove();\n });\n\n $(\".splashlayer\").fadeOut(1200);\n}", "function getData() \n{\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function ()\n {\n if (this.readyState == 4 && this.status == 200)\n {\n // creates a new Data() object from picalc.js\n window.data = new Data(JSON.parse (this.responseText));\n\n // this is essentially the view logic; it builds the HTML\n setup();\n }\n };\n\n xmlhttp.open(\"GET\", \"https://tspi.io/factory-planet/planetary_commodities.json\", true);\n xmlhttp.send();\n}", "function build_map_comp() {\r\n\r\n var overlayMaps = {};\r\n d3.json(\"/assets/data/data_upd.geojson\")\r\n .then(function(data) {\r\n createFeatures(data.features)\r\n }) \r\n .catch(function(error){\r\n console.log(error)\r\n });\r\n}", "function getIncidents() {\n $.ajax({\n url: \"/database/all\",\n type: \"POST\",\n success: function (result) {\n clearIncidents();\n addIncidentMarkers(result);\n populateIncidents(result);\n }\n });\n}", "loadData() {\n this.hvacData = HVACDataLoader.getHVACData(this);\n if (this.hvacData.getBuildingList().length > 0) this.selectBuilding(this.hvacData.getBuildingList()[0]);\n }", "function loadGoals(data) {\n _goals = data;\n}", "function getMapData(){\r\n\t$(\"#svg-map\").svg('destroy');\r\n\t$(\"#svg-map\").svg({\r\n\t\tloadURL: '/images/map.svg',\r\n\t\tonLoad: function(){\r\n\t\t\tmapIsLoaded = true;\r\n\t\t}\r\n\t});\r\n}", "function loadOkaloosaCountySignals(){ \n\t$.get(\"xml/OkaloosaCountySignal.xml\", {}, function(data) {\n\t\t$(data).find(\"marker\").each(function() {\n\t\t\tvar marker = $(this);\n\t\t\tvar intname = $(this).attr('intname');\n\t\t\tvar intnum = $(this).attr('intnum');\n\t\t\tvar latlng = new google.maps.LatLng(parseFloat(marker.attr(\"lat\")),parseFloat(marker.attr(\"lng\")));\n\t\t//Icon Sytyle\n\t\t\tvar image = 'images/OkaloosaCountySignal.png' ;\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tposition: latlng, \n\t\t\t\tmap: map,\n\t\t\t\ticon: image\n\t\t\t\t});\n\t\t//Contents of Info Window\n\t\t\t\tvar contentString = '<div id=\"signalinfowindow\"><img src=\"images/OkaloosaCountySmallSeal.gif\">' + \n\t\t\t\t'Intersection number: <b>' +intnum+ '</b><br>' +\n\t\t\t\t'Intersection name:<b>' +intname+ '</b><br>' +\n\t\t\t\t'<font size=\"1\" color=\"purple\">'+\n\t\t\t\t'</div>' ;\n \t\t//Info Window \n\t\t\tvar infowindow = new google.maps.InfoWindow({ \n\t\t\tcontent:contentString,\n\t\t\tmaxWidth:500\n\t\t\t}); \n\t\t//Event Listener, Opens Info Window on click\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function() {\n\t\t\t\tinfowindow.open(map,marker); \n\t\t\t});\n\t\t}); \n });\n}", "function populateModel() {\n var success = true;\n $.ajax({\n url:'https://api.foursquare.com/v2/venues/search',\n dataType: 'json',\n data: 'limit=22' +\n '&ll='+ center.lat +','+ center.lng +\n '&client_id=JAL1UGFNFEMLAWL4TZXUFQYTPHDDMUB3AND4OETDSEFFC1M4'+\n '&client_secret='+\n 'M0UPWFB0MPWC5UR5H51K3WDUXZJACCIVYX4ENUNOAOLUYYSL'+\n '&v=20140806' +\n '&intent=browse'+\n '&radius=50000'+\n '&query=brewing,brewery',\n async: true,\n success: function(data) {\n for(var i=0; i<data.response.venues.length; i++) {\n var venue = {\n name: data.response.venues[i].name,\n address: data.response.venues[i].location.address,\n city: data.response.venues[i].location.city,\n state: data.response.venues[i].location.state,\n zip: data.response.venues[i].location.postalCode,\n lat: data.response.venues[i].location.lat,\n lng: data.response.venues[i].location.lng,\n url: data.response.venues[i].url,\n id: i+1\n };\n model.push(venue);\n }\n success = true;\n initMap.createMarker();\n ko.applyBindings(new ViewModel(success));\n },\n error: function(obj, string, status) {\n success = false;\n ko.applyBindings(new ViewModel(success));\n }\n });\n}", "function display() { //shows map\n 'use strict';\n var jsonFile = $.get(\"data.json.php\");\n var obj = JSON.parse(jsonFile);\n document.getElementById(\"data\").innerHTML = obj;\n}", "function getData(map){\n //load the data\n $.getJSON(\"data/MegaCities.geojson\", function(response){\n\n //calculate minimum data value\n minValue = calculateMinValue(response);\n //call function to create proportional symbols\n createPropSymbols(response);\n });\n}", "function loadNewGeoJsonData(data) {\n // clear vector featers and popups\n if(points && points.length > 0) {\n $.each(points, function(i, p) {\n p.setMap(null); // remove from map\n });\n points = [];\n } else {\n points = [];\n }\n\n if(infoWindows && infoWindows.length > 0) {\n $.each(infoWindows, function(i, n) {\n n.close(); // close any open popups\n });\n infoWindows = [];\n } else {\n infoWindows = [];\n }\n\n $.each(data.features, function(i, n) {\n var latLng1 = new google.maps.LatLng(n.geometry.coordinates[1], n.geometry.coordinates[0]);\n var iconUrl = EYA_CONF.imagesUrlPrefix + '/circle-' + n.properties.color.replace('#', '') + '.png';\n var markerImage = new google.maps.MarkerImage(iconUrl,\n new google.maps.Size(9, 9),\n new google.maps.Point(0, 0),\n new google.maps.Point(4, 5)\n );\n points[i] = new google.maps.Marker({\n map: map,\n position: latLng1,\n title: n.properties.count + ' ' + $.i18n.prop('eya.map.nrOccurrences'),\n icon: markerImage\n });\n\n var solrQuery;\n if($.inArray('|', taxa) > 0) {\n var parts = taxa.split('|');\n var newParts = [];\n parts.forEach(function(j) {\n newParts.push(rank + ':' + parts[j]);\n });\n solrQuery = newParts.join(' OR ');\n } else {\n solrQuery = '*:*'; // rank+':'+taxa;\n }\n var fqParam = '';\n if(taxonGuid) {\n fqParam = '&fq=species_guid:' + taxonGuid;\n } else if(state.speciesGroup !== 'ALL_SPECIES') {\n fqParam = '&fq=species_group:' + state.speciesGroup;\n }\n\n var content =\n '<div class=\"infoWindow\">' +\n $.i18n.prop('eya.speciesTable.header.count.label') + ': ' + n.properties.count +\n '<br />' +\n '<a href=\"' + EYA_CONF.contextPath + '/occurrences/search?q=' + solrQuery + fqParam + '&lat=' + n.geometry.coordinates[1] + '&lon=' + n.geometry.coordinates[0] + '&radius=0.06\">' +\n '<span class=\"fa fa-list\"></span>' +\n '&nbsp;' +\n $.i18n.prop('general.btn.viewRecords') +\n '</a>' +\n '</div>';\n\n infoWindows[i] = new google.maps.InfoWindow({\n content: content,\n maxWidth: 200,\n disableAutoPan: false\n });\n google.maps.event.addListener(points[i], 'click', function(event) {\n if(lastInfoWindow) {\n // close any previously opened infoWindow\n lastInfoWindow.close();\n }\n infoWindows[i].setPosition(event.latLng);\n infoWindows[i].open(map, points[i]);\n lastInfoWindow = infoWindows[i]; // keep reference to current infoWindow\n });\n });\n\n }", "function populateLoad() {\n\t$.ajax({\n\t\ttype: 'GET',\n\t\t//data: JSON.stringify(itemData),\n\t\tcontentType: 'application/json',\n\t\turl: '/monster-list',\n\t\tsuccess: function(data){\n\t\t\t//console.log(data);\n\t\t\tvar monsters = JSON.parse(data);\n\t\t\t//console.log(items[0].id);\n\n\t\t\tfor (var i = 0; i < monsters.length; i++) {\n\t\t\t\t$(\".load-window\").append(\"<p class='v-small'>\"+monsters[i].id+\"</p>\");\n\t\t\t}\n\n\t\t\t$(\".load-window .v-small\").each(function() {\n\t\t\t\t$(this).click(function() {\n\t\t\t\t\tgrabItem($(this));\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t});\n}", "function getData(map) {\n\t// load the data\n\t$.ajax(\"data/rent_cities_data.geojson\",{\n\t\tdataType:\"json\",\n\t\tsuccess: function(response){\n\t\t\t//variables \n\t\t\tvar attributes = processData(response);\n\t\t\t//call functions\n\t\t\tcreatePropSymbols(response, map, attributes);\n\t\t\tcreateSequenceControls(map, attributes);\n\t\t\tcreateLegend(map, attributes);\n\t\t\t//createSearch(map,geofeatures)\n\t\t}\n\t});\n}", "function dataPolices(){\n $.ajax({\n url: \"https://data.cityofchicago.org/resource/9rg7-mz9y.json\",\n type: \"GET\",\n data: {\n \"$where\" : \"latitude != 0 AND longitude != 0\",\n \"$$app_token\" : \"ONMw6rs4vX99YkE7M5cOetVo9\"\n }\n }).done(function(data) {\n for (var i = data.length - 1; i >= 0; i--) {\n var location = new google.maps.LatLng(data[i].latitude, data[i].longitude);\n police[i] = new google.maps.Marker({ \n position: location,\n map: map,\n icon: { url: 'http://icon-icons.com/icons2/35/PNG/512/police_avatar_person_2845.png', scaledSize : new google.maps.Size(35, 35)},\n title: 'Police Station'\n })\n police[i].data = data[i];\n addMarkerPolice(police[i]);\n for (var j = markers.length - 1; j >= 0; j--) {\n var markerLocation = new google.maps.LatLng(markers[j].data.latitude, markers[j].data.longitude);\n var distance = google.maps.geometry.spherical.computeDistanceBetween(markerLocation, location);\n if (distance < 2000) {\n markers[j].security += 20;\n }\n }\n }\n dataCrimes();\n clearMarkers(police);\n });\n}", "function getData(map) {\n\n // load the states\n $.ajax(\"data/state_4326_map.json\", {\n dataType: \"json\",\n success: function(data) {\n // remove current layer if exists\n if (curStateLayer) {\n map.removeLayer(curStateLayer);\n };\n\n // Define the geojson layer and add it to the map\n curStateLayer = L.geoJson(data, {\n style: stateStyle,\n // filter by location\n /*filter: function(feature, layer){\n return filterStateByName(feature, layer);\n },*/\n // on each feature of states\n onEachFeature: stateOnEachFeature\n });\n map.addLayer(curStateLayer);\n\n }\n });\n\n // load the urban\n $.ajax(\"data/urban_4326_map.json\", {\n dataType: \"json\",\n success: function(data) {\n // remove current layer if exists\n if (curUrbanLayer) {\n map.removeLayer(curUrbanLayer);\n };\n\n // Define the geojson layer and add it to the map\n curUrbanLayer = L.geoJson(data, {\n style: urbanStyle,\n // filter by location\n /*filter: function(feature, layer){\n return filterUrbanByName(feature, layer);\n },*/\n // on each feature of states\n onEachFeature: urbanOnEachFeature\n });\n map.addLayer(curUrbanLayer);\n }\n });\n\n}", "function initMap() {\n console.log(\"All set with Google API\");\n //window.clearTimeout(timeout);\n ko.applyBindings(new ViewModel());\n\n // Styling of Google Map\n /*******************************\n * Title: Pale Dawn\n * Author: Krogh, A\n * Date: 10/24/2013\n * Code version: N/A\n * Availability: https://snazzymaps.com/style/1/pale-dawn.\n ********************************/\n var styles = [{\n \"featureType\": \"administrative\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"on\"\n },\n {\n \"lightness\": 33\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#f2e5d4\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#c5dac6\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"visibility\": \"on\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"lightness\": 20\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#c5c6c6\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e4d7c6\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#fbfaf7\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#acbcc9\"\n }\n ]\n }\n ];\n\n\n var mymap = document.getElementById('map');\n // Constructor creates a new map\n map = new google.maps.Map(mymap, {\n center: { lat: 40.626790, lng: 22.953065 },\n zoom: 14,\n styles: styles,\n });\n\n var largeInfowindow = new google.maps.InfoWindow();\n\n // creating initial google map markers\n for (var i = 0; i < locations.length; i++) {\n createMarker(i, largeInfowindow);\n }\n fitMarkersToMap(markers);\n\n}", "function initialHeatmaps(){\r\n setupHeatmap(jsonData.length);\r\n setupGlbHeatmap();\r\n}", "function initialize() {\n\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: {lat: 37.085644, lng: 25.148832}, // Map to Paros.\n\t\tzoom: 12 // Zoom into Paros.\n\t});\n\n\t/* infowindow */\n\tinfoWindow = new google.maps.InfoWindow({\n\t\tmaxWidth: 200\n\t});\n\n\t/* Create the main viewModel and make Knockout binding, when google maps API is loaded. */\n\tviewModel = new ViewModel();\n\tko.applyBindings(viewModel);\n}", "function init(){\n\t/* Initialize model and octopus*/\n\tvar model = new Model(rawData);\n\tvar octopus = new Octopus(model);\n\t/* set up Map */\n\toctopus.map = octopus.initMap();\n\n\t/* initialize map markers */\n\toctopus.places().forEach(function(place){\n\t\toctopus.createMarker(place, function(marker){\n\t\t\tmarker.setMap(octopus.map);\n\t\t\tmarker.addListener('click',function(){\n\t\t\t\toctopus.setCurrentPlace(place);\n\t\t\t});\n\t\t});\n\t});\n\t/* apply knockout bindings */\n\tko.applyBindings(octopus);\n\tviewmodel = octopus;\n}", "function start() {\r\n map = new google.maps.Map(document.getElementById('map'),\r\n {\r\n center:\r\n {\r\n lat: 30.3782, //latitude of the centre of map\r\n lng: 76.7767 //longitude of the centre of map\r\n },\r\n zoom: 14, //zoom no of the map\r\n mapTypeControl: false,\r\n mapTypeId: google.maps.MapTypeId.SATELLITE //satellite view of map\r\n }\r\n );\r\n locinfo = new google.maps.InfoWindow( //create a information window for info on the locations\r\n {\r\n maxWidth: 300 //sets the maximum width of infowindow\r\n });\r\n ko.applyBindings(new MainView()); //apply the bindings\r\n}", "init () {\n var Item = function(data) {\n this.lat = data.lat;\n this.lng = data.lng;\n this.title = data.title;\n this.wikiPage = data.wikiPage;\n this.description = data.description;\n this.url = data.url;\n this.isFocused = ko.observable(false);\n \n this.marker = new google.maps.Marker({\n map: map,\n title: this.title,\n position: {lat: parseFloat(this.lat), lng: parseFloat(this.lng)}\n });\n // When searchString changes, this computed observable sets true or false depending on if searchString exist in location title\n this.show = ko.computed(() => { return this.title.toLowerCase().indexOf(viewModel.searchString().toLowerCase()) >-1; }, this);\n // When this.show changes, this computed observable hides or shows the locations google-map-marker\n this.showMarker = ko.computed(() => { this.show() ? this.marker.setMap(map) : this.marker.setMap(null);}, this);\n this.flickrImg = data.flickrImg;\n // TODO Q: This line of code can´t be optimal\n this.marker.addListener('click', function(e) { viewModel.marker_onclick(this); });\n };\n\n Item.prototype.stopMarkerAnimation = function () {\n this.marker.setAnimation(null);\n };\n \n // In the old version every item had its own computed observable to track if was the current location.\n // Now all items share this function and the stopMarkerAnimation() function instead. PS. Thank you reviewer for the devtip :)\n Item.prototype.animateMarker = ko.computed(() => { viewModel.currLocation() !== null ? viewModel.currLocation().marker.setAnimation(google.maps.Animation.BOUNCE) : null; }, this);\n\n // Loads locations from JSON-file, and map locations to items that are put in an observableArray\n $.ajax({\n url: CONST.url_locations,\n dataType: \"json\",\n timeout: 2000\n })\n .fail(function() {\n alert('failed to load the locations.json file');\n })\n .done(function(response) {\n var arr = response.map(function(item) { return new Item(item); });\n arr.forEach(function(item){ viewModel.locations.push(item); });\n });\n\n this.setElementHeights();\n }", "function loadData(){\n\t$.ajax({\n\t\turl:\"./src/loadassignment.php\",\n\t\tdataType:\"json\",\n\t\tsuccess:function (d) {\n\t\tloadAssignment(d);\n\t\t},\n\t\terror:console.log(\"Error loading json\")\n\t});\n}", "function PopulateGJSONVars() {\n\tvar geojson = [];\n\t$.ajax({\n\t\t'async': false,\n\t\t'global': false,\n\t\t'url': \"Index.json\",\n\t\t'dataType': \"json\",\n\t\t'success': function (data) {\n\t\t\tgeojson = data;\n\t\t}\n\t});\n\t//an unordered list for use in foreach style situations on the data\n\tGJSONUnOrdered = geojson.slice();\n\t//creates a ordered list where the data is sorted by 'id', which becomes its array index.\n\tgeojson.forEach(function(elem){\n\t\tGJSONOrdered[elem.properties.id] = elem;\n\t});\n}", "function init() {\n initMap();\n renderMapElements(vm.listData());\n}", "function displayGeojson(dataIn) {\n var routeLayer = new google.maps.Data();\n //routeLayer.setMap(null);\n var geojsonURL1 = 'http://localhost:9000/routeserver/';\n var geojsonURL2 = 'TMRoutes?=format%3Djson&format=json&rte=';\n var geojsonRteURL = dataIn;\n routeLayer.loadGeoJson(geojsonURL1 + geojsonURL2 + geojsonRteURL);\n routeLayer.setStyle(function(feature){\n return{\n strokeColor: 'blue',\n strokeOpacity: 0.5,\n };\n })\n routeLayer.setMap(map);\n mapObjects.push(routeLayer);\n}" ]
[ "0.6078788", "0.6063336", "0.5899132", "0.5871862", "0.5844824", "0.5825501", "0.5770714", "0.5756883", "0.5754548", "0.5720824", "0.5688869", "0.56272286", "0.5610027", "0.5609219", "0.5587147", "0.555395", "0.55471843", "0.5515513", "0.5497687", "0.549619", "0.5492076", "0.5490351", "0.548106", "0.54778045", "0.54586977", "0.5454496", "0.5450524", "0.54419506", "0.54410845", "0.54356015", "0.5433159", "0.54282403", "0.54006857", "0.539453", "0.5385606", "0.53523576", "0.53461075", "0.5341448", "0.5332239", "0.53321606", "0.5318026", "0.53086925", "0.5307701", "0.53072935", "0.5301608", "0.5300855", "0.5289839", "0.52844507", "0.5278988", "0.52747166", "0.5273641", "0.52683717", "0.5265374", "0.5263095", "0.5257465", "0.52566946", "0.52519345", "0.52474344", "0.52294165", "0.52267736", "0.5221993", "0.5220736", "0.52010673", "0.5200162", "0.5199992", "0.51936054", "0.51935565", "0.5189151", "0.51796407", "0.5177009", "0.5174741", "0.51708144", "0.51700926", "0.51654905", "0.5162288", "0.5156544", "0.5153151", "0.5143749", "0.51391464", "0.5131835", "0.5128499", "0.5125867", "0.51206166", "0.51199996", "0.51053035", "0.5089173", "0.50877786", "0.5085732", "0.5085258", "0.5084225", "0.50834316", "0.50812775", "0.50683516", "0.50633043", "0.50561565", "0.50557804", "0.5054513", "0.50456387", "0.50449914", "0.50447226" ]
0.7577973
0
Render Google map This function is called by the google map's API
function initMap() { var myLatLng = {lat: 37.856365, lng: -98.341694}; var googleMap = new google.maps.Map(document.getElementById('map'), { center: {lat: 37.856365, lng: -98.341694}, zoom: 5 }); app.init(googleMap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rendermap() {\n var mapProp = {\n mapTypeId : google.maps.MapTypeId.ROADMAP\n };\n // map = new google.maps.Map(document.getElementById(\"map-canvas\"), mapProp);\n // // using vanilla js\n map = new google.maps.Map($(\"#map-canvas\")[0], mapProp); // using jQuery\n}", "function view_contact_draw_map() {\n\t\t\n\t\t// Initialize Google Maps\n\t\t\n\t\tvar map_options = {\n\t\t\t\n\t\t\tzoom: 16,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\t\tdisableDefaultUI: true,\n\t\t\tzoomControl: false,\n\t\t\tdraggable: false,\n\t\t\tscrollwheel: false,\n\t\t\tstyles: [\n\t\t\t {\n\t\t\t \"featureType\": \"landscape\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"saturation\": -100\n\t\t\t },\n\t\t\t {\n\t\t\t \"lightness\": 65\n\t\t\t },\n\t\t\t {\n\t\t\t \"visibility\": \"on\"\n\t\t\t }\n\t\t\t ]\n\t\t\t },\n\t\t\t {\n\t\t\t \"featureType\": \"poi\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"saturation\": -100\n\t\t\t },\n\t\t\t {\n\t\t\t \"lightness\": 51\n\t\t\t },\n\t\t\t {\n\t\t\t \"visibility\": \"simplified\"\n\t\t\t }\n\t\t\t ]\n\t\t\t },\n\t\t\t {\n\t\t\t \"featureType\": \"road.highway\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"saturation\": -100\n\t\t\t },\n\t\t\t {\n\t\t\t \"visibility\": \"simplified\"\n\t\t\t }\n\t\t\t ]\n\t\t\t },\n\t\t\t {\n\t\t\t \"featureType\": \"road.arterial\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"saturation\": -100\n\t\t\t },\n\t\t\t {\n\t\t\t \"lightness\": 30\n\t\t\t },\n\t\t\t {\n\t\t\t \"visibility\": \"on\"\n\t\t\t }\n\t\t\t ]\n\t\t\t },\n\t\t\t {\n\t\t\t \"featureType\": \"road.local\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"saturation\": -100\n\t\t\t },\n\t\t\t {\n\t\t\t \"lightness\": 40\n\t\t\t },\n\t\t\t {\n\t\t\t \"visibility\": \"on\"\n\t\t\t }\n\t\t\t ]\n\t\t\t },\n\t\t\t {\n\t\t\t \"featureType\": \"transit\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"saturation\": -100\n\t\t\t },\n\t\t\t {\n\t\t\t \"visibility\": \"simplified\"\n\t\t\t }\n\t\t\t ]\n\t\t\t },\n\t\t\t {\n\t\t\t \"featureType\": \"administrative.province\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"visibility\": \"off\"\n\t\t\t }\n\t\t\t ]\n\t\t\t },\n\t\t\t {\n\t\t\t \"featureType\": \"water\",\n\t\t\t \"elementType\": \"labels\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"visibility\": \"on\"\n\t\t\t },\n\t\t\t {\n\t\t\t \"lightness\": -25\n\t\t\t },\n\t\t\t {\n\t\t\t \"saturation\": -100\n\t\t\t }\n\t\t\t ]\n\t\t\t },\n\t\t\t {\n\t\t\t \"featureType\": \"water\",\n\t\t\t \"elementType\": \"geometry\",\n\t\t\t \"stylers\": [\n\t\t\t {\n\t\t\t \"hue\": \"#ffff00\"\n\t\t\t },\n\t\t\t {\n\t\t\t \"lightness\": -0\n\t\t\t },\n\t\t\t {\n\t\t\t \"saturation\": -97\n\t\t\t }\n\t\t\t ]\n\t\t\t }\n\t\t\t]\n\t\t\t\n\t\t}\n\t\t\n\t\t// Draw New York Map\n\t\t\n\t\t//var new_york_pos = new google.maps.LatLng(40.7372676,-73.9920646);\n\t\tvar new_york_pos = new google.maps.LatLng(40.7365034,-73.9924187);\n\t\t\n\t\tmap_options.center = new_york_pos;\n\t\t\n\t\tvar new_york_map = new google.maps.Map(document.getElementById(\"page-contact-location-map\"), map_options);\n\t\t\n\t\tvar new_york_map_window_content =\n\t\t\t\"<div id='content'>\"+\n\t\t\t\t\"<h5 class='flush-top short'>Bitly's New York Office</h5>\" +\n\t\t\t\t\"<p class='flush-bottom'>\" +\n\t\t\t\t\t\"85 5th Avenue</br>\" +\n\t\t\t\t\t\"New York, NY 10003\" +\n\t\t\t\t\"</p>\" +\n\t\t\t\"</div>\";\n\t\t\n\t\tvar new_york_map_window = new google.maps.InfoWindow({\n\t\t\t\n\t\t\tcontent: new_york_map_window_content\n\t\t\t\n\t\t});\n\t\t\n\t\tgoogle.maps.event.addDomListener(window, \"resize\", function() {\n\t\t \n\t\t var center = new_york_map.getCenter();\n\t\t google.maps.event.trigger(new_york_map, \"resize\");\n\t\t new_york_map.setCenter(center); \n\t\t \n\t\t});\n\t\t\n\t}", "function render() {\n debugMap(map, 10, 20);\n }", "function render_map( $el ) {\n \n // var\n var $markers = $el.find('.marker');\n \n // vars\n var args = {\n zoom : 14, \n maxZoom: 20,\n zoomOnClick: false,\n disableDefaultUI: true,\n center: new google.maps.LatLng(48.864716,2.349014),\n mapTypeId : google.maps.MapTypeId.ROADMAP,\n styles: [{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#e9e9e9\"},{\"lightness\":17}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":20}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":21}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#dedede\"},{\"lightness\":21}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#333333\"},{\"lightness\":40}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f2f2f2\"},{\"lightness\":19}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":17},{\"weight\":1.2}]}]\n };\n \n \n // create map \n var map = new google.maps.Map( $el[0], args);\n \n // add a markers reference\n map.markers = [];\n\t \n \n // add markers\n $markers.each(function(){\n \n add_marker( $(this), map );\n \n });\n \n markerCluster( map.markers, map )\n\n // center map\n center_map( map );\n \n //var markerCluster = new MarkerClusterer(map, markers, options);\n }", "function renderMap(LAT,LNG){\n \n // declaring the google map obl and geting the division where it should be loaded\n map = plugin.google.maps.Map.getMap(mapDiv);\n\n // creating a map obj that will be passed to map \n mapObj = {\n target: {lat: LAT, lng: LNG},\n zoom: 17,\n tilt: 60,\n bearing: 140,\n duration: 5000\n }\n \n // addint a marker to the map\n var marker = map.addMarker({\n position: {lat: LAT, lng: LNG},\n title: \"Your Task Location\",\n animation: plugin.google.maps.Animation.BOUNCE\n });\n\n //passig the map obg to initialize the map\n map.animateCamera(mapObj);\n marker.showInfoWindow();\n\n}", "function displayMap() {\n $('#mapDiv').append(googleMap);\n}", "function render() {\n\tvar containerWidth = $('#interactive-content').width();\n\n if (!containerWidth) {\n containerWidth = DEFAULT_WIDTH;\n }\n\n if (containerWidth <= MOBILE_BREAKPOINT) {\n isMobile = true;\n } else {\n isMobile = false;\n }\n\n // What kind of map are we making?\n var configuration = configure(containerWidth);\n\n // Render the map!\n renderMap(configuration, {\n container: '#graphic',\n width: containerWidth,\n data: topoData\n });\n\n // Resize\n fm.resize();\n}", "function render_map($el) {\n\n\t\t// Map config data from map element\n\t\tvar zoomVal = $el.data('zoom_level') == false ? 12 : $el.data('zoom_level');\n\t\tvar showMarkers = $el.data('show_markers') == null ? true : $el.data('show_markers');\n\t\tvar disableControls = $el.data('disable_controls') == null ? true : $el.data('disable_controls');\n\t\tvar allowPanning = $el.data('allow_panning') == null ? true : $el.data('allow_panning');\n\t\tvar allowDragging = $el.data('allow_dragging') == null ? true : $el.data('allow_dragging');\n\t\tvar allowZooming = $el.data('allow_zooming') == null ? true : $el.data('allow_zooming');\n\n\t\t// Map markers\n\t\tvar $markers = $el.find('.acf-map__marker');\n\n\t\t// Map options\n\t\tvar args = {\n\t\t\tzoom: zoomVal,\n\t\t\tcenter: new google.maps.LatLng(0, 0),\n\t\t\tdisableDefaultUI: disableControls,\n\t\t\tdraggable: allowDragging,\n\t\t\tscrollwheel: allowZooming,\n\t\t\tpanControl: allowPanning,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\t};\n\n\n\t\t// create map\n\t\tvar map = new google.maps.Map($el[0], args);\n\n\t\tmap.markerVisibility = showMarkers;\n\n\n\t\t// add a markers reference\n\t\tmap.markers = [];\n\n\n\t\t// add markers\n\t\t$markers.each(function () {\n\n\t\t\tadd_marker($(this), map);\n\n\t\t});\n\n\n\t\t// center map\n\t\tcenter_map(map);\n\n\n\t\t// return\n\t\treturn map;\n\n\t}", "function render_map( $el ) {\n\t // var\n\t var $markers = $el.find('.marker');\n\t // var styles = []; // Uncomment for map styling\n\t // vars\n\t var args = {\n\t zoom : 16,\n\t center : new google.maps.LatLng(0, 0),\n\t mapTypeId : google.maps.MapTypeId.ROADMAP,\n\t scrollwheel : false,\n\t // styles : styles // Uncomment for map styling\n\t };\n\t // create map\n\t var map = new google.maps.Map( $el[0], args);\n\t // add a markers reference\n\t map.markers = [];\n\t // add markers\n\t $markers.each(function(){\n\t add_marker( $(this), map );\n\t });\n\t // center map\n\t center_map( map );\n\t}", "static get template() {\n return `\n<div class=\"mapouter\"><div class=\"gmap_canvas\"><iframe width=\"300\" height=\"300\" id=\"gmap_canvas\" \nsrc=\"https://maps.google.com/maps?q=[[lat]]%2C[[lng]]&t=&z=[[zoom]]&ie=UTF8&iwloc=&output=embed\" \nframeborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\"></iframe>\n</div><style>.mapouter{text-align:right;height:300px;width:300px;}.gmap_canvas {overflow:hidden;background:none!important;height:300px;width:300px;}</style></div>\n `;\n }", "renderMap(mapElement, locations, selectMarkerHandler) {\r\n if (this.googleMap === null) {\r\n this.externalJsFileLoader.load(this.config.googleMaps.apiUrl, { key: this.config.googleMaps.apiKey }, () => {\r\n this.drawMap(mapElement, locations, selectMarkerHandler);\r\n });\r\n }\r\n else {\r\n this.drawMap(mapElement, locations, selectMarkerHandler);\r\n }\r\n }", "draw() {\n if (!this.getMap() || !this._html) {\n return;\n }\n if (!this._marker && !this._position) {\n return;\n }\n\n const divPixel = this.getProjection().fromLatLngToDivPixel(\n this._position || this._marker.getPosition()\n );\n\n if (divPixel) {\n const widthInfo = this._html.floatWrapper.clientWidth;\n const heightInfo = this._html.floatWrapper.clientHeight;\n\n this._html.floatWrapper.style.top = `${Math.floor(divPixel.y)}px`;\n this._html.floatWrapper.style.left = `${Math.floor(divPixel.x)}px`;\n }\n if (!this._isOpen) {\n this._isOpen = true;\n this.resize();\n this.reposition();\n this.activateCallback('afterOpen');\n GOOGLE_MAP_API.event.trigger(\n this.getMap(),\n `${this._eventPrefix}opened`,\n this\n );\n }\n }", "function render_map($el) {\n // var\n var $markers = $el.find('.marker'); // vars\n\n var args = {\n zoom: 16,\n center: new google.maps.LatLng(0, 0),\n mapTypeId: google.maps.MapTypeId.ROADMAP\n }; // create map\t \t\n\n var map = new google.maps.Map($el[0], args); // add a markers reference\n\n map.markers = []; // add markers\n\n $markers.each(function () {\n add_marker($(this), map);\n }); // center map\n\n center_map(map);\n }", "function render_map( $el ) {\n \n // vars\n var mapStyles = [\n {\n \"featureType\": \"administrative.locality\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"administrative.neighborhood\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"road\",\n \"stylers\": [\n { \"visibility\": \"simplified\" }\n ]\n },{\n \"featureType\": \"transit\",\n \"stylers\": [\n { \"visibility\": \"off\" }\n ]\n },{\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"road.arterial\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"road.local\",\n \"stylers\": [\n { \"visibility\": \"simplified\" }\n ]\n },{\n \"featureType\": \"water\",\n \"elementType\": \"labels\",\n \"stylers\": [\n { \"visibility\": \"off\" }\n ]\n },{\n \"featureType\": \"poi\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"poi.business\",\n \"stylers\": [\n { \"visibility\": \"off\" }\n ]\n },{\n \"featureType\": \"administrative.neighborhood\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n { \"color\": \"#da8080\" },\n { \"visibility\": \"on\" }\n ]\n }];\n \n var args = {\n zoom : ( $el.data( 'map-zoom_level' ) - 2 ),\n center : new google.maps.LatLng( $el.data( 'map-lat' ), $el.data( 'map-lng' ) ),\n mapTypeId : google.maps.MapTypeId.ROADMAP,\n disableDefaultUI: false\n };\n \n // create map\n var map = new google.maps.Map( $el[0], args);\n \n map.data.loadGeoJson('/wp-content/themes/scout-realty/assets/js/vendor/neighborhoods/neighborhoods.' + $el.data( 'map-neighborhood' ) + '.geojson');\n \n map.setOptions( { styles: mapStyles });\n \n var featureStyle = {\n fillColor: '#FF4338',\n strokeWeight: 0\n }\n map.data.setStyle(featureStyle);\n \n \n // center map\n //zoom( map );\n \n}", "render(map)\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}", "function render_map($el) {\n\n // var\n var $markers = $el.find('.marker');\n\n // vars\n var args = {\n zoom: 16,\n center: new google.maps.LatLng(0, 0),\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n // create map\n var map = new google.maps.Map($el[0], args);\n\n // add a markers reference\n map.markers = [];\n\n // add markers\n $markers.each(function () {\n\n add_marker($(this), map);\n });\n\n // center map\n center_map(map);\n}", "function drawMap() {\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 5,\r\n center: { lat: 0, lng: 0 },\r\n mapTypeId: 'roadmap'\r\n });\r\n}", "function initMap() {\r\n var mapDiv = document.getElementById('contact-map');\r\n var map = new google.maps.Map(mapDiv, {\r\n center: {lat: 44.540, lng: -78.546},\r\n zoom: 14\r\n });\r\n var marker = new google.maps.Marker({\r\n position: {lat: 44.540, lng: -78.546},\r\n icon: \"/static/img/app/marker.png\",\r\n map: map\r\n });\r\n map.set('styles', [{\"featureType\":\"landscape\",\"stylers\":[{\"hue\":\"#FFBB00\"},{\"saturation\":43.400000000000006},{\"lightness\":37.599999999999994},{\"gamma\":1}]},{\"featureType\":\"road.highway\",\"stylers\":[{\"hue\":\"#FFC200\"},{\"saturation\":-61.8},{\"lightness\":45.599999999999994},{\"gamma\":1}]},{\"featureType\":\"road.arterial\",\"stylers\":[{\"hue\":\"#FF0300\"},{\"saturation\":-100},{\"lightness\":51.19999999999999},{\"gamma\":1}]},{\"featureType\":\"road.local\",\"stylers\":[{\"hue\":\"#FF0300\"},{\"saturation\":-100},{\"lightness\":52},{\"gamma\":1}]},{\"featureType\":\"water\",\"stylers\":[{\"hue\":\"#0078FF\"},{\"saturation\":-13.200000000000003},{\"lightness\":2.4000000000000057},{\"gamma\":1}]},{\"featureType\":\"poi\",\"stylers\":[{\"hue\":\"#00FF6A\"},{\"saturation\":-1.0989010989011234},{\"lightness\":11.200000000000017},{\"gamma\":1}]}]);\r\n}", "render() {\n // size of the container\n const containerStyle = {\n width: \"400px\",\n height: \"400px\"\n };\n\n return (\n <GoogleMap\n mapContainerStyle={containerStyle}\n center={this.state.center}\n zoom={12}\n >\n {/* Iterator to go through all the points and mark them on the map */}\n {this.state.markers.map((marker, index) => (\n <Marker\n key={index}\n title={marker.title}\n name={marker.name}\n position={marker.position}\n />\n ))}\n <></>\n </GoogleMap>\n );\n }", "function DrawGoogleMap() {\n $(\"#google-map\").empty();\n var script_tag = document.createElement('script');\n script_tag.type = 'text/javascript';\n script_tag.src = \"https://maps.googleapis.com/maps/api/js?key=AIzaSyCHNMMsn8uWjLdbAQUWpT0Vsnc11DzNHcg&libraries=places&callback=initMap\"\n script_tag.setAttribute('defer','');\n script_tag.setAttribute('async','');\n $(\"#googleMap\").append(script_tag);\n}", "function displayMap() {\n var canvas = document.createElement(\"canvas\");\n var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;\n canvas.width = (width*0.891);\n canvas.height = (width*0.891);\n var output2 = document.querySelector(\"#two\");\n output2.appendChild(canvas);\n var context = canvas.getContext(\"2d\");\n var img = document.createElement(\"img\");\n img.src = \"https://maps.googleapis.com/maps/api/staticmap?center=\" + latitude + \",\" + longitude + \"&zoom=17&size=\" + width + \"x\" + width + \"&scale=2&maptype=hybrid&language=english&markers=color:white|\" + latitude + \",\" + longitude + \"&key=AIzaSyDP68CXSK9TynSN4n_Moo7PPakL8SQM0xk\";\n img.onload = function imageDraw() {\n context.drawImage(img, 0, 0, (width*0.891), (width*0.891));\n }\n}", "function gmInitialize() {\n $('#contents').html('<div id=\"map\"></div>');\n var myLatLng = new google.maps.LatLng(29.516596899999996, -95.71289100000001);\n GEO = new google.maps.Geocoder();\n MAP = new google.maps.Map(document.getElementById('contents'), {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: myLatLng,\n zoom: 4\n });\n}", "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}", "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}", "function displayMap(resLat,resLong,pId){\n $(\"#\"+pId).append(\"<iframe width='250' height='250' frameborder='0' style='border:0' src='https://www.google.com/maps/embed/v1/view?zoom=18&center=\" + resLat + \",\" + resLong + \"&key=\" + apiKey_displayMap + \"' allowfullscreen></iframe>\");\n}", "function drawRegionsMap() {\n\n // set data\n var data = google.visualization.arrayToDataTable(mapData);\n console.log(data);\n // set options\n var options = {\n colorAxis: {colors: ['#1c92e7','#49a7eb', '#60b2ee','#76bdf0','#8dc8f3','#a4d3f5','#badef7','#d1e9fa']},\n backgroundColor: 'eff3f6',\n region: 'US',\n resolution: 'provinces'\n };\n\n // set where in html to put chart\n var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));\n\n // draw chart using data & options specified\n chart.draw(data, options);\n }", "function renderMap() {\n\t$('#jvectormap').vectorMap({\n\t\tmap: 'world_mill',\n\t\tmarkers: COUNTRIES,\n\t\tbackgroundColor: '#FFF',\n\t\tzoomMax: 4, zoomMin: 0.7, zoomOnScroll: false, zoomStep: 1.6,\n\t\tregionStyle: {\n\t\t\tinitial: {\n\t\t\t\t'fill': '#c5c5c5', 'fill-opacity': 0.8,\n\t\t\t},\n\t\t\thover: {\n\t\t\t\t'fill': '#c5c5c5', 'cursor': 'initial',\n\t\t\t}\n\t\t},\n\t\tmarkerStyle: {\n\t\t\tinitial: {\n\t\t\t\t'fill': '#3A3A9D', 'fill-opacity': 0.8, 'stroke': '#83D0F4', 'r': 6,\n\t\t\t},\n\t\t\thover: {\n\t\t\t\t'fill': '#3A3A9D', 'stroke': 'black'\n\t\t\t}\n\t\t},\n\t\tfocusOn: {\n\t\t\tx: 0.5, y: 0.5, scale: 0.9,\n\t\t},\n\t\tonRegionTipShow: function(e){e.preventDefault()},\n\t\t// Intercept the tooltip shown on hover by adding company name\n\t\tonMarkerTipShow: function(e, tip, code){\n\t\t\ttip[0].innerHTML = '<div class=\"country-name\">'+ COUNTRIES[code].name + '</div><div>' + COUNTRIES[code].details + '</div>';\n\t\t},\n\t});\n}", "function initMap() {\n\t var map = new google.maps.Map(document.getElementById('map'), {\n\t zoom: mapZoom,\n\t center: clientMapCenter,\n\t styles: [\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#f5f5f5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.icon\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#616161\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.text.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#f5f5f5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"administrative.land_parcel\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#bdbdbd\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#eeeeee\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#757575\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#e5e5e5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"geometry.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#b9f1c1\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#688c6d\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#ffffff\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.arterial\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#757575\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#dadada\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#616161\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.local\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#9e9e9e\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"transit.line\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#e5e5e5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"transit.station\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#eeeeee\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#c9c9c9\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"geometry.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#70d2f0\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#9e9e9e\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t }\n\t\t\t\t]\n\t });\n\n\t var myLocation = new google.maps.Marker({\n\t\t\t position: map.getCenter(),\n\t\t\t icon: {\n\t\t\t path: google.maps.SymbolPath.CIRCLE,\n\t\t\t scale: 5,\n\t\t\t strokeColor: '#00a2d0'\n\t\t\t },\n\t\t\t draggable: true,\n\t\t\t map: map,\n\t\t\t title: 'You are here!',\n\t\t\t });\n\n\n\n\t // var infoWindow = new google.maps.InfoWindow({map: map});\n\n\t // // Try HTML5 geolocation.\n\t // if (navigator.geolocation) {\n\t // navigator.geolocation.getCurrentPosition(function(position) {\n\t // var pos = {\n\t // lat: position.coords.latitude,\n\t // lng: position.coords.longitude\n\t // };\n\n\t // infoWindow.setPosition(pos);\n\t // infoWindow.setContent('You');\n\t // map.setCenter(pos);\n\t // }, function() {\n\t // handleLocationError(true, infoWindow, map.getCenter());\n\t // });\n\t // } else {\n\t // // Browser doesn't support Geolocation\n\t // handleLocationError(false, infoWindow, map.getCenter());\n\t // }\n\n \tvar marker;\n\n \tvar infoWindow = new google.maps.InfoWindow({\n\t\t \tcontent: ''\n\t\t });\n\n\t \n\t clientResults.forEach(function(recyclingHotSpot){\n\t \tmarker = new google.maps.Marker({\n\t\t position: {\n\t\t \tlat: parseFloat(recyclingHotSpot.latitude), \n\t\t \tlng: parseFloat(recyclingHotSpot.longitude)\n\t\t },\n\t\t map: map,\n\t\t title: recyclingHotSpot.name,\n\t\t icon: 'http://127.0.0.1:8081/images/marker.png',\n\t\t clickable: true,\n\t\t\n\t\t });\n\n\t\t marker.addListener('click', function(){\n\t\t \tinfoWindow.close();\n\t\t \tinfoWindow.setContent(recyclingHotSpot.address);\n\t\t \tinfoWindow.open(map, this);\n\t\t \t\n\t\t });\t\n\t });\n\t }", "function view_contact_draw_map() {\n\n // Draw San Francisco Map\n\n var element = document.getElementById(\"contact-location-map-san-francisco\");\n var latitude = 37.7893041;\n var longitude = -122.4003783;\n var tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere San Francisco Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"88 Stevenson St</br>\" +\n \"San Francisco, CA 94107\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n // Draw Hamburg Map\n\n element = document.getElementById(\"contact-location-map-germany\");\n latitude = 53.54386;\n longitude = 10.02979;\n tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere Hamburg Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"Friesenstraße 13, 20097</br>\" +\n \"Hamburg, Germany\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n // Draw NY Map\n\n element = document.getElementById(\"contact-location-map-new-york\");\n latitude = 40.7483005;\n longitude = -73.990655;\n tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere New York Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"132 West 31st St</br>\" +\n \"New York, NY 10001\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n }", "rerender() {\n this.map.render();\n }", "function initGoogleMap(force) {\r\n\r\n if (!force) {\r\n setGoogleMapsAlreadyLoaded(true);\r\n if (!getOtherMapsAlreadyLoaded())\r\n return setGoogleMapVisible();\r\n else\r\n return setSwapMapVisible();\r\n }\r\n\r\n if (typeof google === 'undefined')\r\n return notifyUser(\"Google maps failed to load\", true);\r\n\r\n geocoderGoogle = new google.maps.Geocoder();\r\n infowindowGoogle = new google.maps.InfoWindow();\r\n\r\n var darkMapType = new google.maps.StyledMapType(\r\n [{\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#242f3e'\r\n }]\r\n }, {\r\n elementType: 'labels.text.stroke',\r\n stylers: [{\r\n color: '#242f3e'\r\n }]\r\n }, {\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#746855'\r\n }]\r\n }, {\r\n featureType: 'administrative.locality',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#d59563'\r\n }]\r\n }, {\r\n featureType: 'poi',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#d59563'\r\n }]\r\n }, {\r\n featureType: 'poi.park',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#263c3f'\r\n }]\r\n }, {\r\n featureType: 'poi.park',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#6b9a76'\r\n }]\r\n }, {\r\n featureType: 'road',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#38414e'\r\n }]\r\n }, {\r\n featureType: 'road',\r\n elementType: 'geometry.stroke',\r\n stylers: [{\r\n color: '#212a37'\r\n }]\r\n }, {\r\n featureType: 'road',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#9ca5b3'\r\n }]\r\n }, {\r\n featureType: 'road.highway',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#746855'\r\n }]\r\n }, {\r\n featureType: 'road.highway',\r\n elementType: 'geometry.stroke',\r\n stylers: [{\r\n color: '#1f2835'\r\n }]\r\n }, {\r\n featureType: 'road.highway',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#f3d19c'\r\n }]\r\n }, {\r\n featureType: 'transit',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#2f3948'\r\n }]\r\n }, {\r\n featureType: 'transit.station',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#d59563'\r\n }]\r\n }, {\r\n featureType: 'water',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#17263c'\r\n }]\r\n }, {\r\n featureType: 'water',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#515c6d'\r\n }]\r\n }, {\r\n featureType: 'water',\r\n elementType: 'labels.text.stroke',\r\n stylers: [{\r\n color: '#17263c'\r\n }]\r\n }], {\r\n name: 'Night'\r\n });\r\n\r\n googleMap = new google.maps.Map(document.getElementById('mapGoogle'), {\r\n zoom: 12,\r\n center: {\r\n lat: 37.7881209,\r\n lng: -122.3954958\r\n },\r\n mapTypeControlOptions: {\r\n mapTypeIds: ['roadmap', 'satellite', 'hybrid', 'terrain', 'dark_map']\r\n }\r\n });\r\n\r\n googleMap.mapTypes.set('dark_map', darkMapType);\r\n googleMap.setMapTypeId('dark_map');\r\n}", "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: {lat: 37.652223, lng: -119.026379},\n mapTypeId: 'terrain'\n });\n plotMap(map);\n }", "function initMap() {\n var mapDiv = document.getElementById('contact-map');\n var map = new google.maps.Map(mapDiv, {\n center: {lat: 44.540, lng: -78.546},\n zoom: 14\n });\n\n var marker = new google.maps.Marker({\n position: {lat: 44.540, lng: -78.546},\n icon: \"assets/img/app/marker.png\",\n map: map\n });\n\n map.set('styles', [{\"featureType\":\"landscape\",\"stylers\":[{\"hue\":\"#FFBB00\"},{\"saturation\":43.400000000000006},{\"lightness\":37.599999999999994},{\"gamma\":1}]},{\"featureType\":\"road.highway\",\"stylers\":[{\"hue\":\"#FFC200\"},{\"saturation\":-61.8},{\"lightness\":45.599999999999994},{\"gamma\":1}]},{\"featureType\":\"road.arterial\",\"stylers\":[{\"hue\":\"#FF0300\"},{\"saturation\":-100},{\"lightness\":51.19999999999999},{\"gamma\":1}]},{\"featureType\":\"road.local\",\"stylers\":[{\"hue\":\"#FF0300\"},{\"saturation\":-100},{\"lightness\":52},{\"gamma\":1}]},{\"featureType\":\"water\",\"stylers\":[{\"hue\":\"#0078FF\"},{\"saturation\":-13.200000000000003},{\"lightness\":2.4000000000000057},{\"gamma\":1}]},{\"featureType\":\"poi\",\"stylers\":[{\"hue\":\"#00FF6A\"},{\"saturation\":-1.0989010989011234},{\"lightness\":11.200000000000017},{\"gamma\":1}]}]);\n}", "function initMap() {\n var mapDiv = document.getElementById('contact-map');\n var map = new google.maps.Map(mapDiv, {\n center: {lat: 44.540, lng: -78.546},\n zoom: 14\n });\n\n var marker = new google.maps.Marker({\n position: {lat: 44.540, lng: -78.546},\n icon: \"assets/img/app/marker.png\",\n map: map\n });\n\n map.set('styles', [{\"featureType\":\"landscape\",\"stylers\":[{\"hue\":\"#FFBB00\"},{\"saturation\":43.400000000000006},{\"lightness\":37.599999999999994},{\"gamma\":1}]},{\"featureType\":\"road.highway\",\"stylers\":[{\"hue\":\"#FFC200\"},{\"saturation\":-61.8},{\"lightness\":45.599999999999994},{\"gamma\":1}]},{\"featureType\":\"road.arterial\",\"stylers\":[{\"hue\":\"#FF0300\"},{\"saturation\":-100},{\"lightness\":51.19999999999999},{\"gamma\":1}]},{\"featureType\":\"road.local\",\"stylers\":[{\"hue\":\"#FF0300\"},{\"saturation\":-100},{\"lightness\":52},{\"gamma\":1}]},{\"featureType\":\"water\",\"stylers\":[{\"hue\":\"#0078FF\"},{\"saturation\":-13.200000000000003},{\"lightness\":2.4000000000000057},{\"gamma\":1}]},{\"featureType\":\"poi\",\"stylers\":[{\"hue\":\"#00FF6A\"},{\"saturation\":-1.0989010989011234},{\"lightness\":11.200000000000017},{\"gamma\":1}]}]);\n}", "function init() {\n\n // Google Map options\n // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions\n var mapOptions = {\n disableDefaultUI : true,\n draggable : false,\n disableDoubleClickZoom : true,\n scrollwheel : false,\n zoom : zoom,\n center : new google.maps.LatLng(latitude,longitude),\n styles: [{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":21}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#000000\"},{\"lightness\":16}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#000000\"},{\"lightness\":40}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":19}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17},{\"weight\":1.2}]}]\n },\n\n // Create the map container\n mapContainer = document.createElement('div');\n mapContainer.id = 'map';\n\n // Add the map container inside the contacts section\n document.getElementById('contacts').appendChild(mapContainer);\n\n // Create the Google Map using the map container and options defined above\n var map = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n}", "initMap() {\n let self = this;\n\n let mapview = document.getElementById('map');\n mapview.style.height = window.innerHeight + \"px\";\n let map = new window.google.maps.Map(mapview, {\n center: {lat: 46.0006, lng: 26.134578},\n zoom: 16,\n mapTypeControl: false,\n /*Styling the map. Starter code from google-developers*/\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#95A5A6'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#186A3B'}]\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: '#21618C'}]\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: '#B2BABB'}]\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 });\n\n/*setting up the infowindow*/\n let InfoWindow = new window.google.maps.InfoWindow({});\n\n window.google.maps.event.addListener(InfoWindow, 'closeclick', function () {\n self.closeInfoWindow();\n });\n\n this.setState({\n map: map,\n infowindow: InfoWindow\n });\n\n window.google.maps.event.addDomListener(window, \"resize\", function () {\n var center = map.getCenter();\n window.google.maps.event.trigger(map, \"resize\");\n self.state.map.setCenter(center);\n });\n\n window.google.maps.event.addListener(map, 'click', function () {\n self.closeInfoWindow();\n });\n/*making the markers on the map, adding listener to them*/\n var locations = [];\n this.state.locations.forEach(function (location) {\n var longname = location.name\n var marker = new window.google.maps.Marker({\n position: new window.google.maps.LatLng(location.latitude, location.longitude),\n animation: window.google.maps.Animation.DROP,\n map: map,\n title: longname,\n});\n marker.addListener('click', function () {\n self.openInfoWindow(marker);\n });\n\n location.longname = longname;\n location.marker = marker;\n location.display = true;\n locations.push(location);\n });\n this.setState({\n 'locations': locations\n });\n }", "function initMap() {\n mapOptions = {\n zoom: 5,\n center: new google.maps.LatLng(37.09024, -100.712891),\n panControl: false,\n zoomControl: true,\n mapTypeControlOptions: {\n mapTypeIds: ['roadmap', 'satellite', 'hybrid', 'terrain',\n 'styled_map'\n ]\n },\n zoomControlOptions: {\n style: google.maps.ZoomControlStyle.LARGE,\n position: google.maps.ControlPosition.RIGHT_CENTER\n },\n scaleControl: false\n };\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n bounds = new google.maps.LatLngBounds();\n map.mapTypes.set('styled_map', styledMapType);\n map.setMapTypeId('styled_map');\n }", "function initMap() {\n // define map and render it into the map div\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 40.7501481, lng: -111.8665667},\n zoom: 2,\n backgroundColor: '#af9a6b',\n styles: styles,\n mapTypeId: 'terrain',\n mapTypeControl: true\n });\n // define bounds\n bounds = new google.maps.LatLngBounds();\n // define largeInfowindow\n largeInfowindow = new google.maps.InfoWindow();\n // create all map markers\n createMarkers();\n}", "draw() {\n if (!this.getMap() || !this._html) {\n return;\n }\n if (!this._marker && !this._position) {\n return;\n }\n\n // 1. Assign offset\n const offset = this._opts.offset;\n if (offset) {\n if (offset.left) {\n this._html.wrapper.style.marginLeft = offset.left;\n }\n if (offset.top) {\n this._html.wrapper.style.marginTop = offset.top;\n }\n }\n // 2. Set the background color\n const bg = this._opts.backgroundColor;\n if (bg) {\n this._html.contentWrapper.style.backgroundColor = bg;\n if (this._opts.pointer) {\n this._html.pointerBg.style[`border${capitalizePlacement(this._opts.placement)}Color`] = bg;\n }\n }\n // 3. Padding\n if (this._opts.padding) {\n this._html.contentWrapper.style.padding = this._opts.padding;\n if (this._opts.shadow) {\n this._html.shadowFrame.style.padding = this._opts.padding;\n }\n }\n // 4. Border radius\n if (this._opts.borderRadius) {\n this._html.contentWrapper.style.borderRadius = this._opts.borderRadius;\n if (this._opts.shadow) {\n this._html.shadowFrame.style.borderRadius = this._opts.borderRadius;\n }\n }\n // 5. Font Size\n if (this._opts.fontSize) {\n this._html.wrapper.style.fontSize = this._opts.fontSize;\n }\n // 6. Font Color\n if (this._opts.fontColor) {\n this._html.contentWrapper.style.color = this._opts.fontColor;\n }\n // 7. Pointer\n // Check if the pointer is enabled. Also make sure the value isn't just the boolean true.\n if (this._opts.pointer && this._opts.pointer !== true) {\n if (this._opts.shadow) {\n this._html.shadowPointer.style.width = this._opts.pointer;\n this._html.shadowPointer.style.height = this._opts.pointer;\n }\n if (this._html.pointerBorder) {\n this._html.pointerBorder.style.borderWidth = this._opts.pointer;\n }\n this._html.pointerBg.style.borderWidth = this._opts.pointer;\n }\n\n // 8. Border\n if (this._opts.border) {\n // Calculate the border width\n let bWidth = 0;\n if (this._opts.border.width !== undefined) {\n bWidth = parseAttribute(this._opts.border.width, '0px');\n this._html.contentWrapper.style.borderWidth = bWidth.value + bWidth.units;\n }\n bWidth = Math.round((this._html.contentWrapper.offsetWidth -\n this._html.contentWrapper.clientWidth) / 2.0);\n bWidth = parseAttribute(`${bWidth}px`, '0px');\n\n if (this._opts.pointer) {\n // Calculate the pointer length\n let pLength = Math.min(this._html.pointerBorder.offsetHeight,\n this._html.pointerBorder.offsetWidth);\n pLength = parseAttribute(`${pLength}px`, '0px');\n\n let triangleDiff = Math.round(bWidth.value * (_root2 - 1));\n triangleDiff = Math.min(triangleDiff, pLength.value);\n\n this._html.pointerBg.style.borderWidth =\n (pLength.value - triangleDiff) + pLength.units;\n\n const reverseP = capitalizePlacement(oppositePlacement(this._opts.placement));\n this._html.pointerBg.style[`margin${reverseP}`] =\n triangleDiff + bWidth.units;\n this._html.pointerBg.style[this._opts.placement] =\n -bWidth.value + bWidth.units;\n }\n const color = this._opts.border.color;\n if (color) {\n this._html.contentWrapper.style.borderColor = color;\n if (this._html.pointerBorder) {\n this._html.pointerBorder.style[`border${capitalizePlacement(this._opts.placement)}Color`] = color;\n }\n }\n }\n // 9. Shadow\n if (this._opts.shadow) {\n // Check if any of the shadow settings have actually been set\n const shadow = this._opts.shadow;\n const isSet = (attribute) => {\n const v = shadow[attribute];\n return v !== undefined && v != null;\n };\n\n if (isSet('h') || isSet('v') || isSet('blur') || isSet('spread') || isSet('color')) {\n const hOffset = parseAttribute(shadow.h, _defaultShadow.h);\n const vOffset = parseAttribute(shadow.v, _defaultShadow.v);\n const blur = parseAttribute(shadow.blur, _defaultShadow.blur);\n const spread = parseAttribute(shadow.spread, _defaultShadow.spread);\n const color = shadow.color || _defaultShadow.color;\n const formatBoxShadow = (h, v) => {\n return `${h} ${v} ${blur.original} ${spread.original} ${color}`;\n };\n\n this._html.shadowFrame.style.boxShadow =\n formatBoxShadow(hOffset.original, vOffset.original);\n\n // Correctly rotate the shadows before the css transform\n const hRotated = (_inverseRoot2 * (hOffset.value - vOffset.value)) + hOffset.units;\n const vRotated = (_inverseRoot2 * (hOffset.value + vOffset.value)) + vOffset.units;\n this._html.shadowPointerInner.style.boxShadow = formatBoxShadow(hRotated, vRotated);\n }\n if (this._opts.shadow.opacity) {\n this._html.shadowWrapper.style.opacity = this._opts.shadow.opacity;\n }\n }\n\n const divPixel = this.getProjection()\n .fromLatLngToDivPixel(this._position || this._marker.position);\n if (divPixel) {\n this._html.floatWrapper.style.top = `${Math.floor(divPixel.y)}px`;\n this._html.floatWrapper.style.left = `${Math.floor(divPixel.x)}px`;\n }\n if (!this._isOpen) {\n this._isOpen = true;\n this.resize();\n this.reposition();\n this.activateCallback('afterOpen');\n if (google) {\n google.maps.event.trigger(this.getMap(), `${_eventPrefix}opened`, this);\n }\n }\n }", "function googleMap() {\r\n\t\r\n\t// google maps custom style\r\n\tvar styles = [ \r\n\t\t{ featureType: 'water', elementType: 'geometry', \r\n\t\t\tstylers: [ { hue: '#bbbbbb' }, { saturation: -100 }, { lightness: -4 }, { visibility: 'on' } ] },\r\n\t\t\r\n\t\t{ featureType: 'landscape', elementType: 'geometry', \r\n\t\t\tstylers: [ { hue: '#eeeeee' }, { saturation: -100 }, { lightness: 39 }, { visibility: 'on' } ] },\r\n\t\t\r\n\t\t{ featureType: 'road', elementType: 'geometry', \r\n\t\t\tstylers: [ { hue: '#ffffff' }, { saturation: -100 }, { lightness: 100 }, { visibility: 'on' } ] },\r\n\t\t\r\n\t\t{ featureType: 'poi', elementType: 'geometry', \r\n\t\t\tstylers: [ { hue: '#dddddd' }, { saturation: -100 }, { lightness: 39 }, { visibility: 'on' } ] } \r\n\t\t];\r\n\r\n\t// define variables\r\n\tvar lat = $('#map').data(\"map-lat\"), \t\r\n\t\tlng = $('#map').data(\"map-lng\"),\t\r\n\t\ttitle = $('#map').data(\"map-mark\"),\r\n\t\tzoom = $('#map').data(\"map-zoom\");\r\n\r\n\t// init map with GMaps jquery plugin\r\n\tvar map = new GMaps ({\r\n\t\tel: '#map', \r\n\t\tlat: lat, \r\n\t\tlng: lng,\r\n\t\tzoom: zoom,\r\n\t\tzoomControlOpt: {style : 'SMALL', position: 'TOP_LEFT'},\r\n\t\tpanControl : false,\r\n\t\tstyles: styles,\r\n\t});\r\n\r\n\t// add map marker\r\n\tmap.addMarker({\r\n\t\tlat: lat,\r\n\t\tlng: lng,\r\n\t\ttitle: title,\r\n\t});\r\n}", "function getMap() {\n showJourneyMap();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n \tcenter: new google.maps.LatLng(58.7897104,-96.0892755),\n \tzoom: 4,\n \tmapTypeId: 'terrain',\n\t\t\tmapTypeControl: true,\n \t\tmapTypeControlOptions: {\n \tstyle: google.maps.MapTypeControlStyle.DROPDOWN_MENU,\n \tposition: google.maps.ControlPosition.RIGHT_TOP\n \t\t}\t\t\t\n });\n\t\n\t\tgetJSONData();\n \n}", "function drawMap( sensorLat, sensorLong, sensorName ) {\n\n var data = google.visualization.arrayToDataTable([\n ['Lat', 'Long', 'Name'],\n [ sensorLat, sensorLong, sensorName],\n ]);\n var options = {\n mapType: 'styledMap',\n zoomLevel: 12,\n showTip: true,\n useMapTypeControl: true,\n maps: {\n // Your custom mapTypeId holding custom map styles.\n styledMap: {\n name: 'My Map', // This name will be displayed in the map type control.\n styles: [{\"featureType\":\"landscape\",\"stylers\":[{\"saturation\":-100},{\"lightness\":65},{\"visibility\":\"on\"}]},{\"featureType\":\"poi\",\"stylers\":[{\"saturation\":-100},{\"lightness\":51},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"stylers\":[{\"saturation\":-100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"stylers\":[{\"saturation\":-100},{\"lightness\":30},{\"visibility\":\"on\"}]},{\"featureType\":\"road.local\",\"stylers\":[{\"saturation\":-100},{\"lightness\":40},{\"visibility\":\"on\"}]},{\"featureType\":\"transit\",\"stylers\":[{\"saturation\":-100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"administrative.province\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"on\"},{\"lightness\":-25},{\"saturation\":-100}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#ffff00\"},{\"lightness\":-25},{\"saturation\":-97}]}]\n }\n }\n };\n var map = new google.visualization.Map(document.getElementById('chart-map'));\n map.draw(data, options);\n}", "function createMap (mapData) {\n // load the Google GeoChart package\n //pgconsole.log(mapData);\n google.charts.load('current', {\n 'packages':['geochart'],\n 'mapsApiKey':'AIzaSyCyoQn8h1sxhW6eEPE7mwh2RTWG29qOmfA'\n });\n\n // call function to draw the map\n google.charts.setOnLoadCallback(drawRegionsMap);\n\n // function to create map\n function drawRegionsMap() {\n\n // set data\n var data = google.visualization.arrayToDataTable(mapData);\n console.log(data);\n // set options\n var options = {\n colorAxis: {colors: ['#1c92e7','#49a7eb', '#60b2ee','#76bdf0','#8dc8f3','#a4d3f5','#badef7','#d1e9fa']},\n backgroundColor: 'eff3f6',\n region: 'US',\n resolution: 'provinces'\n };\n\n // set where in html to put chart\n var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));\n\n // draw chart using data & options specified\n chart.draw(data, options);\n }\n\n}", "function inicia_google_maps(){\n\tcria_mapa_colorido(PHP.localizacao_geografica[0], PHP.localizacao_geografica[1]);\n}", "function renderMap() {\n\n //Clear old map data\n deleteMarkers();\n initMap();\n\n var infoWindow = new google.maps.InfoWindow();\n for (var key in streamValues){\n var position = new google.maps.LatLng(streamValues[key].latitude, streamValues[key].longitude);\n bounds.extend(position);\n addMarker(position);\n map.fitBounds(bounds);\n path.push(position);\n\n let infoContent = \"<b>ts</b>: \"+ moment(streamValues[key].ts).format('MMMM Do YYYY, H:mm:ss') + \"</br>\" +\n \"<b>lat</b>: \" + streamValues[key].latitude + \"</br>\" +\n \"<b>long</b>: \" + streamValues[key].longitude + \"</br>\";\n google.maps.event.addListener(markers[key], 'click', (function(marker, key) {\n return function() {\n infoWindow.setContent(infoContent);\n infoWindow.open(map, marker);\n }\n })(markers[key], key));\n }\n\n heatmap = new google.maps.visualization.HeatmapLayer({\n data: path\n });\n\n polyline.setPath(path);\n}", "function initMap() {\r\n\r\n\r\n\t//MAP STYLES\r\n\tvar styledMapType = new google.maps.StyledMapType(\r\n\t\t[//mainbgcolor\r\n\t\t {elementType: 'geometry', stylers: [{color: '#e4e7e7'}]},\r\n\t\t //maintext color\r\n\t\t {elementType: 'labels.text.fill', stylers: [{color: '#381345'}]},\r\n\t\t //main text stroke\r\n\t\t {elementType: 'labels.text.stroke', stylers: [{color: '#f5f1e6'}]},\r\n\t\t {\r\n\t\t\tfeatureType: 'administrative',\r\n\t\t\telementType: 'geometry.stroke',\r\n\t\t\t//dashes\r\n\t\t\tstylers: [{color: '#ffffff'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'administrative.land_parcel',\r\n\t\t\telementType: 'geometry.stroke',\r\n\t\t\t//irrelev\r\n\t\t\tstylers: [{color: '#dcd2be'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'administrative.land_parcel',\r\n\t\t\telementType: 'labels.text.fill',\r\n\t\t\tstylers: [{color: '#ae9e90'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'landscape.natural',\r\n\t\t\telementType: 'geometry',\r\n\t\t\t//big grassy areas (light blue)\r\n\t\t\tstylers: [{color: '#aed9df'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'poi',\r\n\t\t\telementType: 'geometry',\r\n\t\t\t//points of interest (drexel, penn etc)\r\n\t\t\tstylers: [{color: '#7985A3'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'poi',\r\n\t\t\telementType: 'labels.text.fill',\r\n\t\t\t//poi text\r\n\t\t\tstylers: [{color: '#705379'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'poi.park',\r\n\t\t\telementType: 'geometry.fill',\r\n\t\t\t//parks (lighter purple)\r\n\t\t\tstylers: [{color: '#8F99B1'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'poi.park',\r\n\t\t\telementType: 'labels.text.fill',\r\n\t\t\t//park text color\r\n\t\t\tstylers: [{color: '#447530'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'road',\r\n\t\t\telementType: 'geometry',\r\n\t\t\t//little roads (lighter than bg color grey)\r\n\t\t\tstylers: [{color: '#F0F2F2'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'road.arterial',\r\n\t\t\telementType: 'geometry',\r\n\t\t\t//bigger road colors (white)\r\n\t\t\tstylers: [{color: '#fdfcf8'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'road.highway',\r\n\t\t\telementType: 'geometry',\r\n\t\t\t//broad\r\n\t\t\tstylers: [{color: '#EF6197'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'road.highway',\r\n\t\t\t//broad stroke\r\n\t\t\telementType: 'geometry.stroke',\r\n\t\t\tstylers: [{color: '#F7BED4'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'road.highway.controlled_access',\r\n\t\t\telementType: 'geometry',\r\n\t\t\t//676, big bois #F380AC\r\n\t\t\tstylers: [{color: '#E28AB1'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'road.highway.controlled_access',\r\n\t\t\telementType: 'geometry.stroke',\r\n\t\t\t//676 stroke, #EF6197\r\n\t\t\tstylers: [{color: 'E28AB1'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'road.local',\r\n\t\t\telementType: 'labels.text.fill',\r\n\t\t\t//little street name fills\r\n\t\t\tstylers: [{color: '#9B889D'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'transit.line',\r\n\t\t\telementType: 'geometry',\r\n\t\t\t//trains, bus lines such\r\n\t\t\tstylers: [{color: '#C0C7C7'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'transit.line',\r\n\t\t\telementType: 'labels.text.fill',\r\n\t\t\t//text color\r\n\t\t\tstylers: [{color: '#89778F'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'transit.line',\r\n\t\t\telementType: 'labels.text.stroke',\r\n\t\t\t//text stroke , didn't work??\r\n\t\t\tstylers: [{color: '#ffffff'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'transit.station',\r\n\t\t\telementType: 'geometry',\r\n\t\t\t//airport ( light purple)\r\n\t\t\tstylers: [{color: '#B7BCCA'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'water',\r\n\t\t\telementType: 'geometry.fill',\r\n\t\t\t//water\r\n\t\t\tstylers: [{color: '#81B6BA'}]\r\n\t\t },\r\n\t\t {\r\n\t\t\tfeatureType: 'water',\r\n\t\t\telementType: 'labels.text.fill',\r\n\t\t\t//water text\r\n\t\t\tstylers: [{color: '#ffffff'}]\r\n\t\t }\r\n\t\t],\r\n\t\t{name: 'Styled Map'});\r\n\r\n\r\n\r\n\t//INITIALIZE MAP\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: {lat: 39.952583, lng: -75.165222},\r\n\t\t zoom: 12,\r\n\t\t mapTypeControlOptions: {\r\n mapTypeIds: ['roadmap', 'satellite', 'hybrid', 'terrain',\r\n 'styled_map']\r\n }\r\n\t\t});\r\n\t\t\r\n\t//Associate the styled map with the MapTypeId and set it to display.\r\n map.mapTypes.set('styled_map', styledMapType);\r\n map.setMapTypeId('styled_map');\r\n\r\n\t infoWindow = new google.maps.InfoWindow;\r\n\t//FIND USERS LOCATION\t\r\n\t\tif (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t console.log(\"FIRE\");\r\n\t//RECORDS POSITION OF USER\r\n \tvar pos = {\r\n \tlat: position.coords.latitude,\r\n \tlng: position.coords.longitude\r\n\t\t};\r\n\t\t\r\n\t//CREATES USER MARKER\r\n\t\t personMarker = new google.maps.Marker({\r\n \tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.DROP,\r\n\t\t\t\ticon: {url:'graphics/user3.png', scaledSize: new google.maps.Size(35, 35)},\r\n \tposition: pos\r\n\t\t\t});\r\n\t\t\r\n\t\t map.setCenter(pos);\r\n\t\r\n\t//CREATES INDIVIDUAL MARKERS FOR VENUES\r\n\t\t\tfor (i = 0; i < locations.length; i++) { \r\n\t\t\t\tmarker = new google.maps.Marker({\r\n\t\t\t\tposition: new google.maps.LatLng(locations[i][1], locations[i][2]),\r\n\t\t\t\ticon: {url:'graphics/hotspot.png', \r\n\t\t\t\tscaledSize: new google.maps.Size(40, 52)},\r\n\t\t\t\tmap: map\r\n\t\t\t\t});\r\n\t\r\n\t//VENUE INFORMATION - ARTIST NAME \t\t\t\r\n\t\t\tvar add = locations[i][3]\r\n\t\t\tvar date = locations[i][4]\r\n\t\t\tvar ticket = locations [i][5]\r\n\t\t\tvar dis = \"distance\"\r\n\t\t\tvar content = locations[i][0] + \"<br> Artist: \" + add + \"<br>\" + date + \"<br>\" + \"<a href='\" + ticket + \"'><button>Tickets</button></a>'\" \r\n\t\t\tvar prev_infowindow = false; \r\n\t\t\t\t\r\n\t\t\tvar infowindow = new google.maps.InfoWindow()\r\n\r\n\t\t\tgoogle.maps.event.addListener(marker,'click', (function(marker,content,infowindow){ \r\n\t\t\t\treturn function() { \r\n\t\t\t\t //Wrap the content inside an HTML DIV in order to set height and width of InfoWindow.\r\n\t\t\t\t infowindow.setContent(\"<div style = 'width:60vw; min-height:50vh; background-color: rgba(255,255,255, .8);'>\" + content + \"</div>\");\r\n\t\t\t\t infowindow.open(map,marker);\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t\t};\r\n\t\t\t})(marker,content,infowindow)); \r\n\t\t \r\n\t// ADD CIRCLE OVERLAY and bind to marker\r\n\t\t var circle = new google.maps.Circle({\r\n\t\t\tmap: map,\r\n\t\t\tradius: 50, // 10 miles in metres\r\n\t\t\tfillColor: '#45C6C5',\r\n\t\t\tstrokeColor: '#45C6C5'\r\n\t\t });\r\n\t\t circle.bindTo('center', marker, 'position');\r\n\t\t console.log(circle.radius);\r\n\t\t console.log(locations[i][0]);\r\n\t\t \t\r\n\t\t }}, function isMarkerInRadius(personMarker, circle) {\r\n\t\t\t//return google.maps.geometry.spherical.computeDistanceBetween(pos, circle.getCenter()) <= circle.getRadius();\r\n\t\t },\r\n\t\t function() {\r\n handleLocationError(true, infoWindow, map.getCenter());\r\n });\r\n } else {\r\n // Browser doesn't support Geolocation\r\n handleLocationError(false, infoWindow, map.getCenter());\r\n\t\t}\r\n\t\t\r\n\t\tuserPos(function(id){ \r\n var lat = id.coords.latitude;\r\n var lng = id.coords.longitude;\r\n\t\t\t\tvar temp = .0006;\r\n\t\t\t\t\r\n\r\n\t\t\t\tfor (i = 0; i < locations.length; i++) { \r\n\t\t\t\t\tvar newLat = rangeChecker(lat, locations[i][1], temp );\r\n\t\t\t\t\t// console.log(newLat);\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar newLng = rangeChecker(lng,locations[i][2], temp );\r\n\t\t\t\t\t// console.log(newLng);\r\n\r\n\t\t\t\t\tif(newLat == true && newLng == true){\r\n\t\t\t\t\t\tconsole.log(locations[i][0] +' '+ \"HELLO\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else{\r\n\t\t\t\t\t\tconsole.log(locations[i][0]+' '+ \"GOODBYE\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t};\r\n\t\t\t\t\t\r\n\r\n \r\n \r\n //rangeChecker==bool\r\n //\r\n\t });\r\n\t}", "function initMap() {\n // Constructor creates a new map .\n map = new google.maps.Map(($('#map').get(0)), {\n center: map_center,\n zoom: main_zoom,\n styles: [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#523735\"\n }]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#c9b2a6\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#dcd2be\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#ae9e90\"\n }]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#93817c\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#a5b076\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#447530\"\n }]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#fdfcf8\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f8c967\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#e9bc62\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e98d58\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#db8555\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#806b63\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#8f7d77\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#b9d3c2\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#92998d\"\n }]\n }\n ],\n mapTypeControlOptions: {\n mapTypeIds: []\n }\n });\n\n //Create a InfoWindow\n largeInfowindow = new google.maps.InfoWindow();\n //Set each markers\n for (var i = 0; i < locations.length; i++) {\n var position = locations[i].location;\n var title = locations[i].title;\n var marker = new google.maps.Marker({\n position: position,\n title: title,\n animation: google.maps.Animation.DROP,\n map: map,\n id: i,\n });\n // Push the marker to our array of markers.\n markers.push(marker);\n // Create an onclick event to open an infowindow at each marker.\n marker.addListener('click', function() {\n populateInfoWindow(this, largeInfowindow);\n });\n }\n //Add click event for each marker\n for (var j = 0; j < markers.length; j++) {\n $('#' + j).click(function() {\n showMarker($(this).attr(\"id\"));\n });\n }\n\n}", "function generateGoogleMap(){\n\t\t\n\t\tvar lat = $(\"#lat\").html();\n\t\tvar lng = $(\"#long\").html();\n\t\t\n\t\t$(\".demobot_0\").append(\"<div class='mapHolder'></div>\");\n\t\t\n\t\tvar latlng = new google.maps.LatLng(lat, lng);\n\t\t\n\t\tvar myOptions = {\n\t\t\tzoom: 14,\n\t\t\tcenter: latlng,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t };\n\t\tvar map = new google.maps.Map($(\".mapHolder\")[0], myOptions);\n\t\t\n\t\tvar marker = new google.maps.Marker({\n\t\t\tposition: latlng, \n\t\t\tmap: map, \n\t\t\ttitle:\"Here I am!!\"\n\t\t}); \n\t}", "function initialize() {\n\tconsole.log(\"Initializing Google map\");\n\tvar mapOptions = {\n\t\t//set the default center location to Tech Tower\n\t\tcenter : new google.maps.LatLng(33.772457, -84.394699),\n\t\tzoom : 16,\n\t\tmapTypeId : google.maps.MapTypeId.ROADMAP\n\t};\n\tvar mapCanvas = document.getElementById(\"map-canvas\");\n\tvar mapCanvasParent = mapCanvas.parentNode;\n\t//mapCanvas.style.width = mapCanvasParent.style.width;\n\tmapCanvas.style.width = \"100%\";\n\tvar newHeight = screen.availHeight * 0.5;\n\tmapCanvas.style.height = newHeight + \"px\";\n\tmap = new google.maps.Map(mapCanvas, mapOptions);\n updateUserLocationOnMap();\n}", "function initMap() {\r\n // The location of Uluru\r\n var uluru = {lat: 49.443049, lng: 32.058230};\r\n // The map, centered at Uluru\r\n var map = new google.maps.Map(\r\n document.getElementById('map'), {zoom: 6, center: uluru, styles: [\r\n {\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#212121\"\r\n }\r\n ]\r\n },\r\n {\r\n \"elementType\": \"labels.icon\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"on\"\r\n }\r\n ]\r\n },\r\n {\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#757575\"\r\n }\r\n ]\r\n },\r\n {\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#212121\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#757575\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative.country\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#9e9e9e\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative.land_parcel\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"off\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative.locality\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#bdbdbd\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#757575\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi.park\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#181818\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi.park\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#616161\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi.park\",\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#1b1b1b\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"off\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"geometry.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#2c2c2c\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#8a8a8a\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.arterial\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#373737\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#3c3c3c\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway.controlled_access\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#4e4e4e\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.local\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#616161\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#757575\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#000000\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#3d3d3d\"\r\n }\r\n ]\r\n }\r\n]});\r\n\r\n // The marker, positioned at Uluru\r\n var kha = {lat: 50.007089, lng: 36.225469}\r\n var marker = new google.maps.Marker({\r\n \tposition: kha,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar kyiv = {lat: 50.447884, lng: 30.514791}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: kyiv,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar poltava = {lat: 49.580982, lng: 34.544923}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: poltava,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar lviv = {lat: 49.840130, lng: 24.026184}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: lviv,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar chernovtsy = {lat: 48.289256, lng: 25.936503}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: chernovtsy,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar vinnitsa = {lat: 49.232886, lng: 28.470455}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: vinnitsa,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar zhytomyr = {lat: 50.256328, lng: 28.658505}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: zhytomyr,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar chernigov = {lat: 51.498548, lng: 31.276420}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: chernigov,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar summy = {lat: 50.927402, lng: 34.808812}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: summy,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar cherkassy = {lat: 49.443049, lng: 32.058230}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: cherkassy,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar kirovograd = {lat: 48.506276, lng: 32.260746}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: kirovograd,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar kremenchug = {lat: 49.063417, lng: 33.408831}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: kremenchug,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar kryvoy_rog = {lat: 47.910681, lng: 33.387003}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: kryvoy_rog,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar odessa = {lat: 46.488075, lng: 30.717378}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: odessa,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar nikolaev = {lat: 46.972336, lng: 31.989521}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: nikolaev,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar kherson = {lat: 46.630125, lng: 32.615996}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: kherson,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar drepr = {lat: 48.462070, lng: 35.043190}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: drepr,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar zaporizhya = {lat: 47.841248, lng: 35.143990}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: zaporizhya,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar mariypol = {lat: 47.096523, lng: 37.537682}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: mariypol,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar lugansk = {lat: 48.578750, lng: 39.302732}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: lugansk,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n\r\n \tvar donetsk = {lat: 48.013706, lng: 37.805966}\r\n \tvar marker = new google.maps.Marker({\r\n \tposition: donetsk,\r\n \tmap: map,\r\n \ticon: {\r\n\t\t\turl: \"image/icon_map.png\",\r\n\t\t}\r\n \t});\r\n}", "function displayJSONwithMap() {\n\tbio.display();\n\twork.display();\n\tprojects.display();\n\teducation.display();\n\t\n\t// insert the Google may that was provided by Cameron and James.\n\t$(\"#mapDiv\").append(googleMap);\n\t\n\t// insert a class name so sections can be formatted \n\t$(\"#main\").children(\"div\").toggleClass(\"main-section\");\n\t// don't put the \"main-section\" class name on all divs!\n\t$(\"#header\").toggleClass(\"main-section\");\n\t// acutally I'm not using this div, so lose it.\n\t$(\"#header\").next(\"div\").remove();\n}", "function getMap() {\n esri.config.defaults.io.proxyUrl = \"http://maps1.jeddah.gov.sa/proxy/proxy.ashx\";\n if (maps == null) {\n var mapOption = {\n center: new google.maps.LatLng(21.5018418, 39.1675561),\n zoom: 16,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n zoomControl: false,\n streetViewControl: false,\n panControl: false \n };\n maps = new google.maps.Map(document.getElementById(\"map\"), mapOption);\n }\n \n }", "render(){\n\n this.state.stopTemp.color = \"\"; // temp color is blank\n let stops = this.state.stopData.map((d) => <Marker color={this.state.stopTemp.color} key={d.stop_name} lat={d.latitude} lng={d.longitude}>{d.stop_name}</Marker>);\n //var { latitude, longitude, accuracy, error } = userPosition(true); //centered on the bus stop by the UNT union\n\n return (\n <div style={{ height: '100vh', width: '100%' }}>\n <GoogleMapReact classname=\"map\"\n bootstrapURLKeys={{ key: 'AIzaSyDgYMarUznWd6jqCkxDh0GBnfnZ2DGsp0k' }}\n defaultCenter={this.props.center}\n defaultZoom={this.props.zoom}\n >\n {stops}\n </GoogleMapReact>\n </div>\n );\n }", "function initMap() {\n var map;\n map = new google.maps.Map(document.getElementById(\"map-view\"), {\n center: { lat: -34.397, lng: 150.644 },\n zoom: 8\n });\n\n\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 2,\n center: new google.maps.LatLng(2.8,-187.3),\n mapTypeId: 'terrain',\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n // Create a <script> tag and set the USGS URL as the source.\n var script = document.createElement('script');\n\n // This example uses a local copy of the GeoJSON stored at\n // http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojsonp\n script.src = 'https://developers.google.com/maps/documentation/javascript/examples/json/earthquake_GeoJSONP.js';\n document.getElementsByTagName('head')[0].appendChild(script);\n\n map.data.setStyle(function(feature) {\n var magnitude = feature.getProperty('mag');\n return {\n icon: getCircle(magnitude)\n };\n });\n }", "function googlemap() {\n \n // Custom Map Skin\n var customstyle = [{\n \"featureType\": \"all\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#1F2041\"\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#2E4057\"\n }, {\n \"lightness\": -20\n }]\n }, {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#1F2041\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#1F2041\"\n }, {\n \"lightness\": 5\n }]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#E0D3DE\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#782347\"\n }, {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#782347\"\n }, {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#782347\"\n }, {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"administrative.neighborhood\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#782347\"\n }, {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }];\n \n // Coordinates\n var latlng = new google.maps.LatLng(settings.latitute, settings.longitude);\n \n // Map Options\n var myMapOptions = {\n zoom: settings.zoom,\n scrollwheel: false,\n disableDefaultUI: true,\n mapTypeControl: settings.maptypecntrl,\n zoomControl: settings.zoomcntrl,\n zoomControlOptions: {\n style: google.maps.ZoomControlStyle.MEDIUM,\n position: google.maps.ControlPosition.LEFT_TOP\n },\n center: latlng\n };\n \n // Map Selector\n var map = new google.maps.Map(document.getElementById(settings.container), myMapOptions);\n\n // Activate Custom Map Skin If It Is Enabled\n if (settings.dvcustom === true) {\n var mapType = new google.maps.StyledMapType(customstyle);\n map.mapTypes.set('custommap', mapType);\n map.setMapTypeId('custommap');\n }\n\n // Define The Custom Map Marker\n var marker = new MarkerWithLabel({\n position: latlng,\n icon: {\n path: google.maps.SymbolPath.CIRCLE,\n scale: 0,\n },\n map: map,\n draggable: false,\n labelAnchor: new google.maps.Point(latlng),\n labelClass: \"isg-pin\", // the CSS class for the label\n });\n\n // Add Custom Map Marker\n map.addListener('idle', function () {\n if (!selector.find(\".isg-pin > div\").hasClass(\"isg-pulse\")) {\n jQuery(\".isg-pin\", selector).append(\"<div class='isg-pulse'></div>\");\n }\n });\n }", "render() {\n MapPlotter.setUpFilteringButtons();\n MapPlotter.readFiltersValues();\n\n MapPlotter.currentStateName = 'Texas';\n MapPlotter.drawRaceDoughnut();\n\n MapPlotter.drawMap();\n }", "function beginMap() {\r\n appMod.is_error(false);\r\n win = new google.maps.InfoWindow();\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: coordinates,\r\n zoom: 18\r\n });\r\n fetch_resorts();\r\n}", "function initializeMap() {\n var mapOptions = {\n center: new google.maps.LatLng(50,0),\n zoom: 3,\n minZoom: 3,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n disableDefaultUI: true\n };\n\n overlay = new google.maps.OverlayView();\n var mapCanvas = document.getElementById(\"map-canvas\");\n map = new google.maps.Map(mapCanvas, mapOptions);\n\n overlay.draw = function() {};\n overlay.setMap(map);\n}", "function initialize() {\r\n var map_canvas = document.getElementById('googleMap');\r\n\r\n var map_options = {\r\n center: new google.maps.LatLng(44.434596, 26.080533),\r\n zoom: 16,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP,\r\n scrollwheel: false\r\n };\r\n\r\n var map = new google.maps.Map(map_canvas, map_options);\r\n var marker = new google.maps.Marker({\r\n position: new google.maps.LatLng(44.434596, 26.080533),\r\n map: map,\r\n title: 'Hello World!'\r\n });\r\n var styles = [\r\n {\r\n \"stylers\": [\r\n { \"saturation\": -56 },\r\n { \"color\": \"#838080\" },\r\n { \"lightness\": -45 }\r\n ]\r\n },{\r\n \"featureType\": \"landscape\",\r\n \"stylers\": [\r\n { \"color\": \"#938080\" }\r\n ]\r\n },{\r\n \"featureType\": \"landscape.man_made\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n { \"color\": \"#868483\" },\r\n { \"saturation\": -72 },\r\n { \"lightness\": -35 }\r\n ]\r\n },{\r\n \"featureType\": \"landscape.man_made\",\r\n \"elementType\": \"labels.text\",\r\n \"stylers\": [\r\n { \"color\": \"#808080\" },\r\n { \"saturation\": -88 },\r\n { \"lightness\": 100 },\r\n { \"weight\": 0.1 }\r\n ]\r\n },{\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"labels.text\",\r\n \"stylers\": [\r\n { \"saturation\": -88 },\r\n { \"lightness\": 100 },\r\n { \"weight\": 0.1 }\r\n ]\r\n },{\r\n \"featureType\": \"road.highway\",\r\n \"stylers\": [\r\n { \"color\": \"#c99f6c\" },\r\n { \"saturation\": -40 }\r\n ]\r\n },{\r\n \"featureType\": \"road.arterial\",\r\n \"stylers\": [\r\n { \"color\": \"#c99f6c\" },\r\n { \"saturation\": -85 },\r\n { \"lightness\": 41 }\r\n ]\r\n },{\r\n \"featureType\": \"road.local\",\r\n \"stylers\": [\r\n { \"color\": \"#c99f6c\" },\r\n { \"saturation\": -86 },\r\n { \"lightness\": -49 }\r\n ]\r\n },{\r\n \"featureType\": \"road\",\r\n \"elementType\": \"labels\",\r\n \"stylers\": [\r\n { \"lightness\": 100 },\r\n { \"weight\": 0.1 }\r\n ]\r\n },{\r\n \"featureType\": \"landscape\",\r\n \"elementType\": \"labels\",\r\n \"stylers\": [\r\n { \"color\": \"#ae8080\" },\r\n { \"lightness\": 100 }\r\n ]\r\n },{\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"labels.icon\",\r\n \"stylers\": [\r\n { \"color\": \"#558080\" },\r\n { \"lightness\": 100 },\r\n { \"weight\": 0.1 }\r\n ]\r\n },{\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"labels.icon\",\r\n \"stylers\": [\r\n { \"color\": \"#d18080\" },\r\n { \"visibility\": \"off\" }\r\n ]\r\n },{\r\n \"featureType\": \"administrative\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n { \"color\": \"#958080\" },\r\n { \"lightness\": 100 }\r\n ]\r\n },{\r\n }\r\n ]\r\n map.setOptions({styles: styles});\r\n }", "function appendMap() {\n $(\"#mapDiv\").append(googleMap);\n}", "function mapbuild() {\n\t\t$(\"#venues\").hide();\n\t\tvar myOptions = {\n\t\tzoom:11,\n\t\tcenter: new google.maps.LatLng(33.340053, -111.859627),\n\t\tmapTypeId: google.maps.MapTypeId.Hybrid,\n\t\tpanControl: true,\n\t\tzoomControl: true,\n\t\ttilt: 45 //Allow user to pan at 45 degree angle when in street view.\n\t\t},\n\tmap = new google.maps.Map(document.getElementById('map'), myOptions);\n\t}", "function drawMap(locations) {\n\t//DEALING WITH DATA\n\t/*getting latitude and longitude data from locations string \n\tencoded latalongb for each point as one long string*/\n\tlocationsGlobal=locations.trim();\n\tlocationsArray=locationsGlobal.split(\"b\");\n\tcoordinatesArray=[];\n\tvar latitude;\n\tvar longitude;\n\tvar pointArray;\n\tfor (var index = 0; index < locationsArray.length; ++index) {\n\t\tpointArray=locationsArray[index].split(\"a\");\n\t\tif((pointArray.length>1))\n\t\t{\n\t\tlatitude=pointArray[0];\n\t\tlongitude=pointArray[1];\n\t\tcoordinatesArray.push([latitude,longitude]);\n\t\t}\n\t}\n\t\n\t//DRAWING MAP AND TAKING CARE OF PAGE THINGS\n\t//expand and show the div that will display the google map\n\t$('#mapDiv').attr('style',\"height:400px;visibility:visible\");\n\t//display map usage info\n\t$('#mapInfo').attr('style',\"visibility:visible\");\n\t//create the google map\n\tmap = new google.maps.Map(document.getElementById('mapDiv'), {\n\tcenter: {lat: 54.7650, lng: -1.5782},\n\tzoom: 8\n\t});\n\t\n\tvar drawnPoints=[]\n\t//ADDING MARKERS ON TO MAP\n\t//draw one marker for each lat lang pair stored \n\tfor (var index = 0; index < coordinatesArray.length; ++index) {\n\t\t//check if there is already a marker for this point\n\t\tif(!(drawnPoints.indexOf([coordinatesArray[index][0],coordinatesArray[index][1]])>-1))\n\t\t{\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\tposition: new google.maps.LatLng(coordinatesArray[index][0],coordinatesArray[index][1]),\n\t\t\tmap: map,\n\t\t\t});\n\t\t\tdrawnPoints.push([coordinatesArray[index][0],coordinatesArray[index][1]]);\n\t\t}\n\t}\n}", "function initMap() {\n \tvar location = new google.maps.LatLng(20.481564, -97.013209);\n var mapCanvas = document.getElementById('map');\n var mapOptions = {\n \tcenter: location,\n zoom: 17,\n panControl: false,\n scrollwheel: false,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n styles: [\n {\"stylers\": [{ \"hue\": \"#0097ff\" }]},\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [{\"visibility\": \"off\"}]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"lightness\": 100},\n {\"visibility\": \"simplified\"}]\n }\n ] \n }\n var map = new google.maps.Map(mapCanvas, mapOptions);\n var markerImage = 'assets/img/ubicacion/ub.png';\n var marker = new google.maps.Marker({\n \tposition: location,\n map: map,\n icon: markerImage\n });\n }", "function showMap(myLat, myLong) {\n // Create a LatLng object with the GPS coordinates.\n // var myLatLng = new google.maps.LatLng(lat, lon);\n // Create the Map Options\n var mapOptions = {\n zoom: 2,\n center: {lat: myLat, lng: myLong},\n mapTypeId: google.maps.MapTypeId.ROADMAP\n // disableDefaultUI: true\n };\n // Generate the map\n // var heatmap = new google.maps.visualization.HeatmapLayer({\n // data: heatMapData\n // };\n // Setting the map to the html div\n var map = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n // Setting the heatmap layer onto the map (must come after the above line of code)\n // heatmap.setMap(map);\nvar marker = new google.maps.Marker({\n position: {lat: myLat, lng: myLong},\n map: map,\n title: 'Hello World!'\n });\n\n return map;\n }", "function appendMap() {\n\t$(\"#mapDiv\").append(googleMap);\n}", "function createMap() \n{ \n\tvar level = 0; \n\tif (g_res != null) { \n\t\tlevel = TGetLevelByResolution(g_res); \n\t} \n\telse { \n\t\tlevel = g_level; \n\t} \n \n\tvar uri = document.URL.split(\"#\")[1]; \n if( uri ) { \n\t var params = readUriParams(uri); \n\t var lat = params.coordinate[0]; \n var long = params.coordinate[1]; \n level = params.lvl; \n } \n \n\tvar main = document.getElementById(\"mainContent\"); \n\tvar width = main.scrollWidth - 240; \n\tvar height = main.scrollHeight; \n \n\tvar mapContainer = document.getElementById(\"centerMap\"); \n\tmapContainer.style.width = width + \"px\"; \n\tmapContainer.style.height = height + \"px\"; \n map0 = new tf.apps.GeoCloud.App({ fullURL: window.location.href, container: mapContainer}); \n\t//map0 = new TMap(mapContainer, lat || g_lat, long || g_lon, level, on_mapLoad, 0, true, g_engine, g_type); \n}", "function map_initialize()\n{\n\t\tvar googleMapOptions = \n\t\t{ \n\t\t\tcenter: mapCenter, // map center\n\t\t\tzoom: 15, //zoom level, 0 = earth view to higher value\n\t\t\tmaxZoom: 20,\n\t\t\tminZoom: 13,\n\t\t\tzoomControlOptions: {\n\t\t\t\tstyle: google.maps.ZoomControlStyle.SMALL //zoom control size\n\t\t\t},\n\t\t\tscaleControl: true, // enable scale control\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP // google map type\n\t\t};\n\t\t\t\n\t\tmap = new google.maps.Map(document.getElementById(\"map_canvas\"), googleMapOptions);\n\t\tdrop_reports();\n}", "function initMap() {\n // Create a map object and specify the DOM element for display.\n // New map initiated, with some options, waiting for data updating.\n mapGoogle = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 0.0, lng: 0.0},\n zoom: 17,\n mapTypeId: 'terrain',\n scaleControl: true,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, mapTypeIds: ['roadmap', 'hybrid'],\n }\n });\n}", "function drawMap(latlng) {\n\t\t\n var myOptions = {\n zoom: 17,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.SATELLITE\n };\n var map = new google.maps.Map(document.getElementById(\"map-canvas\"), 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 }", "function initMap() {\n var uluru = {lat: 33.753746, lng: -84.386330};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: uluru,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#212121\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#212121\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#fe7f00\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#181818\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#5e6161\"\n },\n {\n \"weight\": 1\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1b1b1b\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#2c2c2c\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#8a8a8a\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#373737\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#3c3c3c\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#4e4e4e\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n },\n {\n \"weight\": 1.5\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#3d3d3d\"\n }\n ]\n }\n ]\n\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n }", "function initialize() {\r\n\r\n var greyScaleMapType = new google.maps.StyledMapType(\r\n [{\"featureType\": \"water\", \"elementType\": \"geometry\", \"stylers\": [{\"color\": \"#e9e9e9\"},{\"lightness\": 17}]},\r\n {\"featureType\": \"landscape\", \"elementType\": \"geometry\", \"stylers\": [{\"color\": \"#f5f5f5\"},{\"lightness\": 20}]},\r\n {\"featureType\": \"road.highway\", \"elementType\": \"geometry.fill\", \"stylers\": [{\"color\": \"#ffffff\"},{\"lightness\": 17}]},\r\n {\"featureType\": \"road.highway\", \"elementType\": \"geometry.stroke\", \"stylers\": [{\"color\": \"#ffffff\"},{\"lightness\": 29},{\"weight\": 0.2}]},\r\n {\"featureType\": \"road.arterial\", \"elementType\": \"geometry\", \"stylers\": [{\"color\": \"#ffffff\"},{\"lightness\": 18}]},\r\n {\"featureType\": \"road.local\", \"elementType\": \"geometry\", \"stylers\": [{\"color\": \"#ffffff\"},{\"lightness\": 16}]},\r\n {\"featureType\": \"poi\", \"elementType\": \"geometry\", \"stylers\": [{\"color\": \"#f5f5f5\"},{\"lightness\": 21}]},\r\n {\"featureType\": \"poi.park\", \"elementType\": \"geometry\", \"stylers\": [{\"color\": \"#dedede\"},{\"lightness\": 21}]},\r\n {\"elementType\": \"labels.text.stroke\", \"stylers\": [{\"visibility\": \"on\"},{\"color\": \"#ffffff\"},{\"lightness\": 16}]},\r\n {\"elementType\": \"labels.text.fill\", \"stylers\": [{\"saturation\": 36},{\"color\": \"#333333\"},{\"lightness\": 40}]},\r\n {\"elementType\": \"labels.icon\", \"stylers\": [{\"visibility\": \"off\"}]},\r\n {\"featureType\": \"transit\", \"elementType\": \"geometry\", \"stylers\": [{\"color\": \"#f2f2f2\"},{\"lightness\": 19}]},\r\n {\"featureType\": \"administrative\", \"elementType\": \"geometry.fill\", \"stylers\": [{\"color\": \"#fefefe\"},{\"lightness\": 20}]},\r\n {\"featureType\": \"administrative\", \"elementType\": \"geometry.stroke\", \"stylers\": [{\"color\": \"#fefefe\"},{\"lightness\": 17},{\"weight\": 1.2}]}], {\r\n name: 'greyScale'\r\n });\r\n\r\n var greyScaleMapTypeId = 'grey_Scale';\r\n\r\n var myLatLng = {lat: 55.748700, lng: 37.622860};\r\n var mapOptions = {\r\n center: myLatLng,\r\n zoom: 10,\r\n mapTypeControlOptions: {\r\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, greyScaleMapTypeId]\r\n },\r\n disableDefaultUI: true\r\n\r\n };\r\n map = new google.maps.Map(document.getElementById('map_contacts'), mapOptions);\r\n map.mapTypes.set(greyScaleMapTypeId, greyScaleMapType);\r\n map.setMapTypeId(greyScaleMapTypeId);\r\n\r\n var marker = new google.maps.Marker({\r\n position: myLatLng,\r\n map: map,\r\n icon: 'img/icons/map-marker.png'\r\n });\r\n }", "function ContactMap() {\t\r\n\t\r\n\t\tif( jQuery('#map_canvas').length > 0 ){\t\t\t\t\t\r\n\t\t\tvar latlng = new google.maps.LatLng(43.270441,6.640888);\r\n\t\t\tvar settings = {\r\n\t\t\t\tzoom: 14,\r\n\t\t\t\tcenter: new google.maps.LatLng(43.270441,6.640888),\r\n\t\t\t\tmapTypeControl: false,\r\n\t\t\t\tscrollwheel: false,\r\n\t\t\t\tdraggable: true,\r\n\t\t\t\tpanControl:false,\r\n\t\t\t\tscaleControl: false,\r\n\t\t\t\tzoomControl: false,\r\n\t\t\t\tstreetViewControl:false,\r\n\t\t\t\tnavigationControl: false};\t\t\t\r\n\t\t\t\tvar newstyle = [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"all\",\r\n\t\t\t\t\t\"elementType\": \"labels.text.fill\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"saturation\": 36\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 40\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"all\",\r\n\t\t\t\t\t\"elementType\": \"labels.text.stroke\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"visibility\": \"on\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 16\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"all\",\r\n\t\t\t\t\t\"elementType\": \"labels.icon\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"visibility\": \"off\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"administrative\",\r\n\t\t\t\t\t\"elementType\": \"geometry.fill\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 20\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"administrative\",\r\n\t\t\t\t\t\"elementType\": \"geometry.stroke\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 17\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"weight\": 1.2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"landscape\",\r\n\t\t\t\t\t\"elementType\": \"geometry\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 20\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"poi\",\r\n\t\t\t\t\t\"elementType\": \"geometry\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 21\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"road.highway\",\r\n\t\t\t\t\t\"elementType\": \"geometry.fill\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 17\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"road.highway\",\r\n\t\t\t\t\t\"elementType\": \"geometry.stroke\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 29\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"weight\": 0.2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"road.arterial\",\r\n\t\t\t\t\t\"elementType\": \"geometry\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 18\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"road.local\",\r\n\t\t\t\t\t\"elementType\": \"geometry\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 16\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"transit\",\r\n\t\t\t\t\t\"elementType\": \"geometry\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 19\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"featureType\": \"water\",\r\n\t\t\t\t\t\"elementType\": \"geometry\",\r\n\t\t\t\t\t\"stylers\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"color\": \"#000000\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"lightness\": 17\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\tvar mapOptions = {\r\n\t\t\t\tstyles: newstyle,\r\n\t\t\t\tmapTypeControlOptions: {\r\n\t\t\t\t\t mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'holver']\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tvar map = new google.maps.Map(document.getElementById(\"map_canvas\"), settings);\t\r\n\t\t\tvar mapType = new google.maps.StyledMapType(newstyle, { name:\"Grayscale\" }); \r\n\t\t\t\tmap.mapTypes.set('holver', mapType);\r\n\t\t\t\tmap.setMapTypeId('holver');\r\n\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tgoogle.maps.event.addDomListener(window, \"resize\", function() {\r\n\t\t\t\tvar center = map.getCenter();\r\n\t\t\t\tgoogle.maps.event.trigger(map, \"resize\");\r\n\t\t\t\tmap.setCenter(center);\r\n\t\t\t});\t\r\n\t\t\tvar contentString = '<div id=\"content-map-marker\" style=\"text-align:center; padding-top:10px; padding-left:10px\">'+\r\n\t\t\t\t'<div id=\"siteNotice\">'+\r\n\t\t\t\t'</div>'+\r\n\t\t\t\t'<h4 id=\"firstHeading\" class=\"firstHeading\" style=\"color:#000!important; font-weight:600; margin-bottom:0px;\">Hello Friend!</h4>'+\r\n\t\t\t\t'<div id=\"bodyContent\">'+\r\n\t\t\t\t'<p color:#999; font-size:14px; margin-bottom:10px\">Here we are. Come to drink a coffee!</p>'+\r\n\t\t\t\t'</div>'+\r\n\t\t\t\t'</div>';\r\n\t\t\tvar infowindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: contentString\r\n\t\t\t});\t\r\n\t\t\tvar companyImage = new google.maps.MarkerImage('images/marker.png',\r\n\t\t\t\tnew google.maps.Size(58,63),<!-- Width and height of the marker -->\r\n\t\t\t\tnew google.maps.Point(0,0),\r\n\t\t\t\tnew google.maps.Point(35,20)<!-- Position of the marker -->\r\n\t\t\t);\r\n\t\t\tvar companyPos = new google.maps.LatLng(43.270441,6.640888);\t\r\n\t\t\tvar companyMarker = new google.maps.Marker({\r\n\t\t\t\tposition: companyPos,\r\n\t\t\t\tmap: map,\r\n\t\t\t\ticon: companyImage, \r\n\t\t\t\ttitle:\"Our Office\",\r\n\t\t\t\tzIndex: 3});\t\r\n\t\t\tgoogle.maps.event.addListener(companyMarker, 'click', function() {\r\n\t\t\t\tinfowindow.open(map,companyMarker);\r\n\t\t\t});\t\r\n\t\t}\r\n\t\t\r\n\t\treturn false\r\n\t\r\n\t}", "function printThisMap(mapId) {\n // add media query for map in style-tag\n var printStyle = document.createElement('style');\n printStyle.id = 'bkgwebmap-printstyle';\n printStyle.innerHTML = '@media print {body *{visibility:hidden; font-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;}img{max-width:100%}.bkgwebmap-maptoprint,.bkgwebmap-maptoprint *{display:inherit;visibility:visible}.bkgwebmap-maptoprint .ol-control,.bkgwebmap-maptoprint .ol-control *{visibility:hidden!important}.print-element{display:block!important;margin-top:15px} sup {display: inline !important} .bkgwebmap-measureoverlay-tooltip {visibility: hidden;} .bkgwebmap-scalevalue {visibility: hidden}}';\n document.head.appendChild(printStyle);\n\n // set some variables\n var mapContainer = document.getElementById(mapId);\n var olAttribution = mapContainer.getElementsByClassName('bkgwebmap-copyrightlist')[0];\n var copyrightDiv = document.createElement('div');\n\n var olScale = mapContainer.getElementsByClassName('bkgwebmap-scalebar')[0];\n var scaleDiv = document.createElement('div');\n\n var olLegend = mapContainer.getElementsByClassName('bkgwebmap-legendcontent')[0];\n var legendDiv = document.createElement('div');\n\n // insert copyright information if available\n if (olAttribution) {\n // create new container for copyright information\n copyrightDiv.classList.add('print-element');\n copyrightDiv.style.display = 'none';\n\n // insert copyright information\n copyrightDiv.innerHTML = '<b>Copyright</b>' + olAttribution.innerHTML;\n }\n\n // insert scale if available\n if (olScale) {\n // create new container for scale\n scaleDiv.classList.add('print-element');\n scaleDiv.classList.add('scale-div-print');\n scaleDiv.style.display = 'none';\n\n\n // insert scale\n scaleDiv.innerHTML = olScale.innerHTML;\n }\n\n // insert legend if available\n if (olLegend) {\n // create new container for legend\n legendDiv.classList.add('print-element');\n legendDiv.style.display = 'none';\n\n // insert legend\n legendDiv.innerHTML = olLegend.innerHTML;\n }\n\n // insert measure result if available\n var measureDiv = document.createElement('div');\n measureDiv.classList.add('print-element');\n measureDiv.style.display = 'none';\n\n var measureTooltip = document.getElementsByClassName('bkgwebmap-measureoverlay-tooltip-static')[0];\n\n if (measureTooltip !== undefined) {\n var measureResult = measureTooltip.innerHTML;\n var measureMessage;\n if (measureResult.indexOf('<sup>') !== -1) {\n measureMessage = 'Gemessene Fläche: ' + measureResult;\n } else {\n measureMessage = 'Gemessene Strecke: ' + measureResult;\n }\n\n measureDiv.innerHTML = measureMessage;\n }\n\n // add scaleDiv, measureDiv, copyrightDiv, le to page\n mapContainer.appendChild(scaleDiv);\n mapContainer.appendChild(measureDiv);\n mapContainer.appendChild(copyrightDiv);\n mapContainer.appendChild(legendDiv);\n\n // add class to set all but this map invisible, print and then remove class again\n mapContainer.classList.add('bkgwebmap-maptoprint');\n\n // print map\n window.print();\n\n // remove created elements again\n document.head.removeChild(document.getElementById('bkgwebmap-printstyle'));\n mapContainer.removeChild(scaleDiv);\n mapContainer.removeChild(measureDiv);\n mapContainer.removeChild(copyrightDiv);\n mapContainer.removeChild(legendDiv);\n mapContainer.classList.remove('bkgwebmap-maptoprint');\n }", "function draw_map() {\n var mapCanvas = document.getElementById(\"map\");\n\n var myLatLng = {lat: 48.190909, lng: 16.337674};\n\n var mapOptions = {\n center: new google.maps.LatLng(48.190909, 16.337674),\n zoom: 14\n };\n\n\tvar map = new google.maps.Map(mapCanvas, mapOptions);\n\treturn map;\n}", "function initMap() {\n var mapDiv = document.getElementById('contact-map-inside');\n var map = new google.maps.Map(mapDiv, {\n center: {\n lat: 40.7058254,\n lng: -74.1180847\n },\n zoom: 12\n });\n}", "function createMap() {\t\n\tvar myLatlng = new google.maps.LatLng(0, 0);\n\tvar myOptions = {\n\t\tzoom: 4,\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP\n\t}\n \tvar map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n\treturn customized(map);\n}", "function renderMap(webcamObject) {\n for (var i = 0; i < webcamObject.webcams.length; i++) {\n var id = \"map-\" + i;\n var lat = webcamObject.webcams[i].location.latitude;\n var lng = webcamObject.webcams[i].location.longitude;\n initMap(lat, lng, id);\n }\n }", "function GeomapsDisplayMap(mapCanvas,options) \n{\n // private members\n var data_ = {'infowindow':'','count':0,'icons':{},'payload':{}};\n var config_ = [];\n var icons_ = [];\n var gicons_ = [];\n var defaultIcon = null;\n var gdir_ = null; \n var map = null; \n var mapCanvas_ = mapCanvas;\n var mapTooltip_ = mapCanvas_+'Tooltip';\n var mapTypes_ = {'G_NORMAL_MAP':G_NORMAL_MAP,'G_HYBRID_MAP':G_HYBRID_MAP,'G_SATELLITE_MAP':G_SATELLITE_MAP,'G_PHYSICAL_MAP':G_PHYSICAL_MAP};\n var markers_ = [];\n var markerClusterer = null;\n var bounds = new GLatLngBounds();\n var clustering_ = false;\n var clusteringMinMarkers_ = 250; // number of markers to trigger clustering when clustering enabled\n var directions_ = false;\n var panoClient_ = null;\n var myPano_ = null;\n var streetViewStatus_ = false;\n var streetViewOverlay_ = false;\n var lastLatLng_ = null;\n var markerClickTracker_ = false;\n \n if (typeof options === \"object\" && options !== null) \n {\n if (typeof options.clustering === \"boolean\") {\n clustering_ = options.clustering;\n }\n if (typeof options.clusteringMinMarkers === \"number\" && options.clusteringMinMarkers > 0) {\n clusteringMinMarkers_ = options.clusteringMinMarkers;\n }\n if (typeof options.directions === \"boolean\") {\n directions_ = options.directions;\n } \n if (typeof options.streetview === \"boolean\") {\n streetViewStatus_ = options.streetview;\n } \n if (typeof options.streetview_overlay === \"boolean\") {\n streetViewOverlay_ = options.streetview_overlay;\n } \n }\n\n icons_['default'] = {\n 'type':'custom', \n 'url':'http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.6|0|FE766A|12|_|',\n 'size':[20,34]\n };\n icons_['default_hover'] = {\n 'type':'custom', \n 'url':'http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.6|0|FDFF0F|12|_|',\n 'size':[20,34]\n };\n icons_['default_featured'] = {\n 'type':'custom',\n 'url':'http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.6|0|5F8AFF|12|_|',\n 'size':[20,34]\n };\n icons_['numbered'] = {\n 'type':'numbered', \n 'url':'http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.6|0|FE766A|12|_|{index}',\n 'size':[20,34]\n };\n icons_['numbered_hover'] = {\n 'type':'numbered', \n 'url':'http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.6|0|FDFF0F|12|_|{index}',\n 'size':[20,34]\n };\n icons_['numbered_featured'] = {\n 'type':'numbered',\n 'url':'http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.6|0|5F8AFF|12|_|{index}',\n 'size':[20,34]\n }; \n icons_['numbered_featured_hover'] = {\n 'type':'numbered', \n 'url':'http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.6|0|FDFF0F|12|_|{index}',\n 'size':[20,34]\n };\n\n this.init = function()\n { \n if(GBrowserIsCompatible()) \n { \n if(map == null)\n {\n map = new GMap2(document.getElementById(mapCanvas_));\n map.setUI(setUIOptions());\n map.setMapType(mapTypes_[data_.mapUI.maptypes.def]);\n\n // Close non-google infowindow\n GEvent.addListener(map, \"dragstart\", function() { \n closeTooltip();\n });\n GEvent.addListener(map, \"movestart\", function() { \n closeTooltip();\n });\n GEvent.addListener(map, \"moveend\", function() { \n closeTooltip();\n });\n \n // Make the copyright wrap instead of overflowing outside the map div \n GEvent.addListener(map, \"tilesloaded\", function() { \n jQuery('.gmnoprint').next('div').css({'white-space':'normal','font-size':'9px'}); \n }); \n \n // Load custom icons\n for (var i in data_.icons) {\n icons_[i] = data_.icons[i];\n } \n \n // Auto-disable clustering based on min clustering markers\n if(clustering_ == true && data_.count > clusteringMinMarkers_) \n { \n for (var i in data_.payload) { \n// if(i.match(/^id[0-9]+$/)!=null){\n var latlng = new GLatLng(data_.payload[i].lat, data_.payload[i].lon);\n bounds.extend(latlng); \n markers_.push(createMarker(latlng,data_.payload[i])); // Must use markers_.push or cluseting doesn't work otherwise\n// }\n }\n this.centerAndZoomOnBounds();\n refreshMap(markers_);\n } else if (data_.count > 0) { \n for (var i in data_.payload) {\n// if(i.match(/^id[0-9]+$/)!=null){\n var latlng = new GLatLng(data_.payload[i].lat, data_.payload[i].lon);\n bounds.extend(latlng); \n markers_[i] = createMarker(latlng,data_.payload[i]);\n map.addOverlay(markers_[i]);\n// }\n }\n this.centerAndZoomOnBounds();\n } \n else {\n this.centerAndZoomOnBounds();\n } \n \n // Initialize directions\n if(directions_ == true)\n { \n gdir_ = new GDirections(map, document.getElementById(mapCanvas_+'_results'));\n GEvent.addListener(gdir_, \"error\", handleDirectionErrors);\n }\n \n panoClient_ = new GStreetviewClient(); \n myPano_ = new GStreetviewPanorama(document.getElementById(mapCanvas+'_streetview'));\n GEvent.addListener(myPano_, \"error\", handleNoFlash); \n if(streetViewStatus_==true)\n {\n // Trigger streetview on current location \n panoClient_.getNearestPanorama(map.getCenter(), showPanoData);\n\n // Enables streetview changes on map clicks, not just marker clicks\n GEvent.addListener(map, \"click\", function(overlay,latlng) {\n if(markerClickTracker_ == false)\n {\n panoClient_.getNearestPanorama(latlng, showPanoData);\n } \n markerClickTracker_ = false;\n }); \n } \n if(streetViewOverlay_==true)\n {\n svOverlay = new GStreetviewOverlay();\n map.addOverlay(svOverlay); \n } \n\n } else {\n map.checkResize();\n this.centerAndZoomOnBounds(); \n }\n } \n } \n \n this.addMarker = function(marker) { data_.payload.push(marker); } \n\n this.setCount = function(count) { data_.count = count; }\n \n this.setData = function(data) \n { \n data_ = data; \n if(undefined==data_.infowindow) data_.infowindow = 'google';\n }\n\n this.getData = function() { return data_; }\n \n this.getCount = function() { return data_.count; }\n\n this.addIcon = function(icon) { icons_.push(icon); } \n \n this.getMap = function() { return map; }\n \n this.findCenter = function()\n {\n var center_lat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2.0;\n var center_lng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2.0;\n if(bounds.getNorthEast().lng() < bounds.getSouthWest().lng()){\n center_lng += 180;\n } \n return new GLatLng(center_lat,center_lng)\n } \n \n this.panToCenter = function()\n {\n map.panTo(this.findCenter()); \n }\n \n this.centerAndZoomOnBounds = function()\n { \n var zoom; \n if(data_.mapUI.zoom.start != '')\n { \n zoom = data_.mapUI.zoom.start;\n } else { \n zoom = map.getBoundsZoomLevel(bounds);\n }\n map.setCenter(this.findCenter(), zoom); \n }\n \n this.toggleSizeMap = function(object, width)\n {\n var streetView = jQuery('#'+mapCanvas_+'_streetview');\n if(jQuery('#'+mapCanvas).width() <= width)\n {\n jQuery('#gm_resizeL').hide('fast',function(){jQuery(this).css('display','none');});\n jQuery('#gm_resizeS').show('fast',function(){jQuery(this).css('display','');});\n\t\t\tjQuery('#gm_mapColumn').animate({width: 600},\"slow\");\n jQuery('#'+mapCanvas_+'_above').animate({width: 600},\"slow\");\n if(streetView.css('display')=='none'){\n streetView.css('width',600) \n } else if(streetView.css('display')!='') {\n streetView.animate({width: 600},\"slow\",function(){ if(lastLatLng_!=null) panoClient_.getNearestPanorama(lastLatLng_, showPanoData);}); \n } \n jQuery('#'+mapCanvas_).animate({width: 600, height: 500},\"slow\",function(){object.init();}); \n } else {\n jQuery('#gm_resizeS').hide('fast',function(){jQuery(this).css('display','none');});\n jQuery('#gm_resizeL').show('fast',function(){jQuery(this).css('display','');}); \n \tjQuery('#gm_mapColumn').animate({width: width},\"slow\");\n jQuery('#'+mapCanvas_+'_above').animate({width: width},\"slow\");\n if(streetView.css('display')=='none'){\n streetView.css('width',width) \n } else if(streetView.css('display')!='') {\n streetView.animate({width: width},\"slow\",function(){if(lastLatLng_!=null) panoClient_.getNearestPanorama(lastLatLng_, showPanoData);}); \n }\n jQuery('#'+mapCanvas_).animate({width: width, height: width},\"slow\",function(){object.init();}); \n } \n }\n \n function setUIOptions()\n {\n var customUI = map.getDefaultUI();\n customUI.maptypes.normal = data_.mapUI.maptypes.map;\n customUI.maptypes.hybrid = data_.mapUI.maptypes.hybrid;\n customUI.maptypes.satellite = data_.mapUI.maptypes.satellite;\n customUI.maptypes.physical = data_.mapUI.maptypes.terrain;\n customUI.zoom.scrollwheel = data_.mapUI.zoom.scrollwheel;\n customUI.zoom.doubleclick = data_.mapUI.zoom.doubleclick;\n customUI.controls.scalecontrol = data_.mapUI.controls.scalecontrol;\n customUI.controls.largemapcontrol3d = data_.mapUI.controls.largemapcontrol3d;\n customUI.controls.smallzoomcontrol3d = data_.mapUI.controls.smallzoomcontrol3d;\n customUI.controls.maptypecontrol = data_.mapUI.controls.maptypecontrol;\n customUI.controls.menumaptypecontrol = data_.mapUI.controls.menumaptypecontrol;\n return customUI; \n }\n \n function refreshMap() \n {\n if (markerClusterer != null) {\n markerClusterer.clearMarkers();\n }\n var zoom = 15;\n var size = 30; // Grid size of a cluster, the higher the quicker \n //var style = document.getElementById(\"style\").value;\n zoom = zoom == -1 ? null : zoom;\n size = size == -1 ? null : size;\n //style = style == \"-1\" ? null: parseInt(style, 10);\n //markerClusterer = new MarkerClusterer(map, markers, {maxZoom: zoom, gridSize: size, styles: styles[style]});\n markerClusterer = new MarkerClusterer(map, markers_, {maxZoom: zoom, gridSize: size});\n }\n \n function createMarker(latlng,markerData)\n { \n if(markerData.icon == '' || markerData.icon == undefined) markerData.icon = 'default';\n if(markerData.featured == 1 && undefined!=icons_[markerData.icon+'_featured'])\n { \n markerData.icon = markerData.icon+'_featured';\n }\n var icon = makeIcon(markerData.icon,markerData.index);\n var marker = new GMarker(latlng, {icon: icon, title: markerData.title});\n marker.icon_name = markerData.icon;\n marker.id = markerData.id;\n marker.data = markerData;\n marker.data.latlng = latlng;\n GEvent.addListener(marker, \"click\", function() { \n showTooltip(marker); \n if(streetViewStatus_ == true)\n { \n panoClient_.getNearestPanorama(latlng, showPanoData);\n lastLatLng_ = latlng;\n markerClickTracker_ = true;\n }\n });\n GEvent.addListener(marker, \"infowindowbeforeclose\", function() {\n markerClickTracker_ = true;\n });\n GEvent.addListener(marker, \"mouseover\", function() {\n switchMarkerImage(marker,'_hover');\n return false;\n });\n GEvent.addListener(marker, \"mouseout\", function() { \n switchMarkerImage(marker,'');\n });\n \n return marker; \n } \n \n function makeIcon(name,index)\n { \n if(gicons_.length && undefined!=gicons_[name] && name != 'numbered') {\n return gicons_[name];\n }\n if(undefined==icons_[name]) name = 'default';\n var icon;\n\n switch(icons_[name].type)\n {\n case 'custom': \n icon = makeCustomIcon(icons_[name]); \n break;\n case 'numbered': \n case 'numbered_featured': \n icon = makeNumberedIcon(icons_[name],index); \n break;\n case 'default': \n default: \n icon = makeDefaultIcon(icons_[name]); \n break;\n }\n gicons_[name] = icon;\n return icon;\n }\n \n function makeCustomIcon(iconData)\n {\n var customIcon = new GIcon();\n customIcon.image = iconData.url;\n customIcon.iconSize = new GSize(iconData.size[0],iconData.size[1]);\n customIcon.iconAnchor = new GPoint(9,34);\n customIcon.infoWindowAnchor = new GPoint(9,2);\n return customIcon; \n }\n \n function makeDefaultIcon(iconData)\n { \n var defaultIcon = new GIcon(G_DEFAULT_ICON);\n defaultIcon.shadow = \"http://www.google.com/mapfiles/shadow50.png\";\n defaultIcon.iconSize = new GSize(iconData.size[0], iconData.size[1]);\n defaultIcon.shadowSize = new GSize(37, 34);\n defaultIcon.iconAnchor = new GPoint(9, 34);\n defaultIcon.infoWindowAnchor = new GPoint(9, 2); \n return new GIcon(defaultIcon, iconData.url);\n }\n \n function makeNumberedIcon(iconData,index)\n { \n if(null == defaultIcon)\n {\n defaultIcon = new GIcon(G_DEFAULT_ICON);\n defaultIcon.shadow = \"http://www.google.com/mapfiles/shadow50.png\";\n defaultIcon.iconSize = new GSize(20, 34);\n defaultIcon.shadowSize = new GSize(37, 34);\n defaultIcon.iconAnchor = new GPoint(9, 34);\n defaultIcon.infoWindowAnchor = new GPoint(9, 2); \n } \n if(index!='')\n {\n return new GIcon(defaultIcon, iconData.url.replace('{index}',(0+index)));\n } else {\n return new GIcon(defaultIcon, iconData.url.replace('{index}',''));\n }\n } \n \n function switchMarkerImage(marker,status)\n { \n if(undefined!=marker && icons_[marker.icon_name+status])\n {\n marker.setImage(icons_[marker.icon_name+status].url.replace('{index}',marker.data.index)); \n }\n } \n \n this.switchMarkerImageById = function(id,status)\n {\n switchMarkerImage(markers_['id'+id],status); \n } \n\n function renderTooltip(data,useTabs)\n { \n // Standard fields\n var roundDecimals = 1;\n var infoWindowContainer = jQuery('#gm_infowindowContainer').clone();\n var infoWindow = infoWindowContainer.find('.gm_infowindow');\n if(data_.mapUI.title.trim == true && data_.mapUI.title.trimchars > 0)\n {\n data.title = truncate(data.title,data_.mapUI.title.trimchars);\n }\n infoWindow.find('.gm-title').html(data.title);\n infoWindow.find('.gm-title').attr('href',data.url);\n\t\tif(false!=data.image){\n\t\t\tinfoWindow.find('.gm_image').html('<img class=\"gm-image\" src=\"'+data.image+'\" />');\n\t\t}\n infoWindow.find('.gm-user-rating-star').css('width',(data.user_rating/data.rating_scale)*100+'%');\n infoWindow.find('.gm-user-rating-value').html(Math.round(0+(data.user_rating)*Math.pow(10,roundDecimals))/Math.pow(10,roundDecimals));\n infoWindow.find('.gm-user-rating-count').html(parseInt(0+data.user_rating_count));\n infoWindow.find('.gm-editor-rating-star').css('width',(data.editor_rating/data.rating_scale)*100+'%');\n infoWindow.find('.gm-editor-rating-value').html(Math.round(0+(data.editor_rating)*Math.pow(10,roundDecimals))/Math.pow(10,roundDecimals));\n\n for(var i in data.field)\n { \n infoWindow.find('.gm-'+i).html(data.field[i]);\n }\n if(useTabs==false)\n {\n return infoWindowContainer.html(); \n } else {\n var tabs = [];\n infoWindowContainer.find('div.gm_tab').each(function()\n { \n tabs.push(new GInfoWindowTab(jQuery(this).attr('title'),jQuery(this).html()));\n });\n return tabs;\n }\n }\n \n this.showTooltipById = function(id)\n { \n showTooltip(markers_['id'+id]); \n } \n \n this.closeTooltip = function()\n {\n closeTooltip(); \n } \n \n function showTooltip(marker)\n {\n if(undefined!=marker)\n { \n switch(data_.infowindow)\n {\n case 'google': \n marker.openInfoWindowHtml(renderTooltip(marker.data,false));\n break;\n case 'google_tabs': \n marker.openInfoWindowTabsHtml(renderTooltip(marker.data,true));\n break;\n default:\n if(jQuery('#'+mapTooltip_).length == 0)\n {\n jQuery(\"#\"+mapCanvas_).append('<div id=\"'+mapTooltip_+'\" class=\"gm_mapInfowindow\"></div>'); \n }\n var tooltip = jQuery('#'+mapTooltip_);\n tooltip.html('');\n tooltip.marker = marker;\n closeTooltip();\n tooltip.html(renderTooltip(marker.data,false));\n // Attach close onclick event\n jQuery('.gm_infowindow').find('.gm-close-tooltip').unbind().click(function(){closeTooltip();});\n positionTooltip(tooltip);\n break;\n }\n }\n } \n \n function positionTooltip(tooltip)\n {\n var mapBounds = map.getBounds();\n if ( !mapBounds.contains(tooltip.marker.getPoint()) ) {\n map.setCenter(tooltip.marker.getPoint());\n }\n // Get relative positioning for tooltip\n var pointDivPixel = map.fromLatLngToContainerPixel(tooltip.marker.getPoint());\n tooltip.css('left',parseInt(pointDivPixel.x-367+parseInt(data_.mapUI.anchor.x))+'px');\n tooltip.css('top',parseInt(pointDivPixel.y-102+parseInt(data_.mapUI.anchor.y))+'px'); \n tooltip.fadeIn('slow');\n }\n \n function closeTooltip(){\n jQuery('#'+mapTooltip_).css('display','none');\n return false;\n }\n \n function truncate(text,len)\n { \n if (text.length > len) \n {\n var copy;\n text = copy = text.substring(0, len);\n text = text.replace(/\\w+$/, '');\n if(text == '') text = copy;\n text += '...';\n }\n return text; \n }\n \n /******************************\n * Street view functions\n ******************************/\n this.setStreetView = function(status)\n { \n streetViewStatus_ = status;\n }\n \n this.getStreetViewById = function(id)\n {\n if(streetViewStatus_ == true)\n {\n var streetView = jQuery('#'+mapCanvas_+'_streetview');\n if(streetView.css('display')!='block') streetView.slideDown();\n panoClient_.getNearestPanorama(markers_['id'+id].data.latlng, showPanoData);\n lastLatLng_ = markers_['id'+id].data.latlng;\n } \n }\n\n function showPanoData(panoData) {\n if (panoData.code != 200) {\n jQuery('#'+mapCanvas_+'_streetview').html('<div id=\"gm_streetview_msg\" style=\"margin:10px;\">'+geomapsLanguage[\"no_streetview\"]+'</div>');\n return;\n } else {\n jQuery('#gm_streetview_msg').remove();\n }\n myPano_.setLocationAndPOV(panoData.location.latlng);\n }\n \n function handleNoFlash(errorCode) {\n if (errorCode == 603) {\n jQuery('#'+mapCanvas_+'_streetview').html('<div id=\"gm_streetview_msg\" style=\"margin:10px;\">Flash doesn\\'t appear to be supported by your browser.</div>');\n return;\n }\n } \n \n /******************************\n * Get direction functions\n ******************************/\n function handleDirectionErrors()\n {\n if (gdir_.getStatus().code == G_GEO_UNKNOWN_ADDRESS)\n showMessage(geomapsLanguage[\"directions_bad_address\"]);\n else if (gdir_.getStatus().code == G_GEO_SERVER_ERROR)\n showMessage(\"A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\\n Error code: \" + gdir_.getStatus().code);\n else if (gdir_.getStatus().code == G_GEO_MISSING_QUERY)\n showMessage(\"The HTTP q parameter was either missing or had no value. This means that no query was specified in the input.\\n Error code: \" + gdir_.getStatus().code);\n else if (gdir_.getStatus().code == G_GEO_BAD_KEY)\n showMessage(\"The given key is either invalid or does not match the domain for which it was given. \\n Error code: \" + gdir_.getStatus().code);\n else if (gdir_.getStatus().code == G_GEO_BAD_REQUEST)\n showMessage(\"A directions request could not be successfully parsed.\\n Error code: \" + gdir_.getStatus().code);\n else showMessage(geomapsLanguage[\"directions_request_error\"]);\n }\n \n this.getDirections = function(fromAddress, toAddress, locale) \n {\n hideErrorMessage();\n var results = jQuery('#'+mapCanvas_+'_results');\n if(results.css('display') == 'none' && jQuery('#'+mapCanvas_).css('width') == '100%') // Change map width and bring direction results into view\n {\n var directionsWidth = results.width();\n var mapWidth = parseInt(jQuery('#'+mapCanvas_).width() - directionsWidth - 20);\n jQuery('#'+mapCanvas_).css('width',mapWidth+'px');\n } \n jQuery('#'+mapCanvas_+'_results').show();\n gdir_.load(\"from: \" + fromAddress + \" to: \" + toAddress, {\"locale\":locale, \"travelMode\": parseInt(jQuery('#gm_direction_travelmode').val())}); \n }\n\n this.swapInputs = function()\n {\n var tmp = jQuery('#from_point').val();\n jQuery('#from_point').val(jQuery('#to_point').val());\n jQuery('#to_point').val(tmp); \n } \n function showMessage(text)\n {\n jQuery('#'+mapCanvas_+'_results').html(text).fadeIn();\n }\n function hideErrorMessage()\n {\n jQuery('#'+mapCanvas_+'_results').html('');\n }\n this.setCenterAndZoom = function(lat,lon,zoom)\n { \n map.setCenter(new GLatLng(lat,lon),zoom);\n }\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 10,\n center: { lat: 41.8781, lng: -87.6298 },\n });\n \n }", "function gmap_initialize() {\n var gmap_options = {\n center: new google.maps.LatLng(40, -80),\n zoom: 2,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n gmap = new google.maps.Map(document.getElementById(\"hud_gca_api_gmap_canvas\"), gmap_options);\n }", "function initMap(){\n var customMapType = new google.maps.StyledMapType([\n {\n \"stylers\": [\n { \"hue\": \"#AAFFFF\" },\n { \"gamma\": 0.66 },\n { \"saturation\": -83 }\n ]\n },{\n \"featureType\": \"water\",\n \"stylers\": [\n { \"lightness\": -16 },\n { \"hue\": \"#0008ff\" }\n ]\n },{\n \"elementType\": \"labels.text\",\n \"stylers\": [\n { \"visibility\": \"simplified\" }\n ]\n }\n ], {\n name: 'Custom Style'\n });\n var customMapTypeId = 'custom_style';\n \n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n zoom: 2,\n disableDefaultUI: true,\n mapTypeControlOptions: {\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, customMapTypeId]\n }\n });\n \n map.mapTypes.set(customMapTypeId, customMapType);\n map.setMapTypeId(customMapTypeId);\n \n //draw polyline according to rome2rio route coordinates\n var mapRoute = new google.maps.Polyline({\n path: polylineCoords,\n });\n\n mapRoute.setMap(map);\n centerMap(mapRoute);\n}", "function initialize() {\n var mapProp = {\n center: new google.maps.LatLng(51.508742, -0.120850),\n zoom: 5,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n mapaNuevoViaje = new google.maps.Map(document.getElementById(\"googleMapViaje\"), mapProp);\n mapaVuelo = new google.maps.Map(document.getElementById(\"googleMapVuelo\"), mapProp);\n mapaReview = new google.maps.Map(document.getElementById(\"googleMapViajeReview\"), mapProp);\n mapaReviewRecom = new google.maps.Map(document.getElementById(\"googleMapViajeReviewRecom\"), mapProp);\n var markerBounds = new google.maps.LatLngBounds();\n}", "function drawRegionsMap() {\n\t\n\t// Junk data\n\tdata = google.visualization.arrayToDataTable([\n\t\t['Place', 'Searches'],\n\t\t['', 0]\n\t]);\n\t\n\t// Init the chart and draw the data\n\tchart = new google.visualization.GeoChart(document.getElementById('chart'));\n\tchart.draw(data, defaultOptions);\n\t\n\t// Init event handlers for the chart\n\tgoogle.visualization.events.addListener(chart, 'select', selectHandler);\n\tgoogle.visualization.events.addListener(chart, 'ready', imReady);\n\t\n\tgoogle.visualization.events.addListener(chart, 'select', function() {\n\t\tchart.setSelection(chart.getSelection());\n\t});\n}", "function initialize() {\n\t\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\t\tzoom: 4,\n\t\t\tminZoom: 4,\n\t\t\tmaxZoom: 10,\n\t\t\tcenter: new google.maps.LatLng(52, 18),\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\t\tpanControl: false,\n\t\t\tzoomControl: true,\n\t\t\tzoomControlOptions: {\n\t\t\t\tstyle: google.maps.ZoomControlStyle.LARGE,\n\t\t\t\tposition: google.maps.ControlPosition.RIGHT_TOP\n\t\t\t},\n\t\t\tstreetViewControl: false,\n\t\t\tmapTypeControl: false,\n\t\t\tdraggable: true,\n\t\t\tscrollwheel: false\n\t\t});\n\n\t\tvar styledMap = new google.maps.StyledMapType(exports.MapSettings.mapStyles, {name: \"Styled Map\"});\n\t\tmap.mapTypes.set('map_style', styledMap);\n\t\tmap.setMapTypeId('map_style');\n\t}", "function generateMap(id) {\n\tif(document.getElementById('includeGoogleMaps').checked == true && images[id].GM_MapURL != \"\") {\n\t\treturn('[img]' + images[id].GM_MapURL + '[/img]');\n\t}\n\treturn \"\";\n}", "showMap(mapCenter) {\n // The location of Uluru\n var uluru = { lat: -25.344, lng: 131.036 };\n // The map, centered at Uluru\n var map = new window.google.maps.Map(\n document.getElementById('map'), { zoom: 15, center: mapCenter });\n this.directionsRenderer.setMap(map);\n // The marker, positioned at Uluru\n var marker = new window.google.maps.Marker({ position: mapCenter, map: map });\n\n }", "function draw() {\n\n if (!mapInfo.existsMap()) {\n var options = {\n zoom: 10,\n gestureHandling: 'cooperative'\n }\n mapInfo.createMap(document.getElementById('mapPlaceholder'),\n options);\n\n }\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(mapInfo.getLonlat().lat, mapInfo.getLonlat().lng), //mapInfo.getLonlat(),\n map: mapInfo.getMap(),\n title: mapInfo.getMarker(),\n id: mapInfo.getId()\n });\n mapInfo.addBound();\n var infowindow = new google.maps.InfoWindow({ content: '<p>' + mapInfo.getMarker() + '</p>' });\n google.maps.event.addListener(marker, 'mouseover', function () { infowindow.open(mapInfo.map, marker); });\n google.maps.event.addListener(marker, 'click', function () { infowindow.open(mapInfo.map, marker); });\n\n}", "function initMap() {\r\n let restPlace = {\r\n lat: 44.4083621,\r\n lng: -79.6709766\r\n };\r\n\r\n let div = document.querySelector('div');\r\n\r\n //create new map object\r\n let map = new google.maps.Map(div, {\r\n zoom: 14,\r\n center: restPlace,\r\n styles: [{\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [{\r\n \"color\": \"#242f3e\"\r\n }]\r\n },\r\n {\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [{\r\n \"color\": \"#746855\"\r\n }]\r\n },\r\n {\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [{\r\n \"color\": \"#242f3e\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"administrative.locality\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [{\r\n \"color\": \"#d59563\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [{\r\n \"color\": \"#d59563\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"poi.park\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [{\r\n \"color\": \"#263c3f\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"poi.park\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [{\r\n \"color\": \"#6b9a76\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [{\r\n \"color\": \"#38414e\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [{\r\n \"color\": \"#212a37\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [{\r\n \"color\": \"#9ca5b3\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [{\r\n \"color\": \"#746855\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [{\r\n \"color\": \"#1f2835\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [{\r\n \"color\": \"#f3d19c\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [{\r\n \"color\": \"#2f3948\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"transit.station\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [{\r\n \"color\": \"#d59563\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [{\r\n \"color\": \"#17263c\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [{\r\n \"color\": \"#515c6d\"\r\n }]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [{\r\n \"color\": \"#17263c\"\r\n }]\r\n }\r\n ]\r\n });\r\n\r\n //create new marker object\r\n let marker = new google.maps.Marker({\r\n position: restPlace,\r\n animation: google.maps.Animation.BOUNCE,\r\n map: map,\r\n label: {\r\n color: 'white',\r\n fontWeight: 'bold',\r\n text: 'MY HOUSE',\r\n }\r\n });\r\n}", "render() {\n return (\n <>\n <div\n className=\"map-container mx-auto\"\n style={{ height: '60vh', width: '75%' }}\n >\n <GoogleMapReact\n bootstrapURLKeys={{ key: REACT_APP_MAP_API }}\n defaultCenter={this.props.center}\n defaultZoom={11.25}\n >\n {this.renderAllListingMarkers()}\n {this.youAreHereMarker()}\n </GoogleMapReact>\n </div>\n </>\n );\n }", "render () {\n return (\n <div style={{ height: '100vh', width: '100%' }}>\n <GoogleMapReact\n bootstrapURLKeys={{ key: 'AIzaSyCtFjJt-cITgKBmX9yFTJPMbcxZtZsU-ks' }}\n defaultCenter={{lat: 32.881200, lng: -117.237575}}\n defaultZoom={11}>\n <Marker\n lat={this.props.latitude}\n lng={this.props.longitude}\n text=\"Location\"\n color='#cb3e39'\n />\n </GoogleMapReact>\n </div>\n );\n }", "render() {\n return (\n <div className=\"container\">\n <header className=\"row\">\n <div className=\"col-md-12\">\n <h1 className=\"text-center\">Grocery Store Finder</h1>\n </div>\n </header>\n <main id=\"map\">\n <GoogleMapReact defaultCenter={{ lat: 59.95, lng: 30.33}} defaultZoom={11}></GoogleMapReact>\n </main>\n </div>\n );\n }", "function setUpGoogleMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 6,\n center: centreFrance,\n styles: myStyle\n })\n}", "function initMap() {\r\n\t mapCanvas.style.visibility='hidden'; \r\n\t baltimore = new google.maps.LatLng(39.299236, -76.609383); \r\n\t var mapOptions = {\r\n\t // baltimore\r\n\t center: baltimore,\r\n\t zoom: 11\r\n\t }\r\n\t map = new google.maps.Map(mapCanvas, mapOptions);\r\n}", "render() {\n return <div id=\"map\" style={style} />;\n }", "function display_map(lat, long, zoom) {\n var mapOptions = {\n center: new google.maps.LatLng(lat, long),\n zoom: zoom,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n var canvas = $('#map_canvas')[0];\n map = new google.maps.Map(canvas, mapOptions);\n}", "function displayMap()\n {\n var sentContract = Geoportal.GeoRMHandler.getConfig([_apiKey], null, 'http://gpp3-wxs.ign.fr/autoconf/$key$/',\n {\n onContractsComplete: initMap\n });\n\n if (sentContract == 0)\n {\n console.error(\"IT.Mapping.addGeoportalMap: no contract sent\");\n }\n }", "function displayMap()\n {\n var sentContract = Geoportal.GeoRMHandler.getConfig([_apiKey], null, 'http://gpp3-wxs.ign.fr/autoconf/$key$/',\n {\n onContractsComplete: initMap\n });\n\n if (sentContract == 0)\n {\n console.error(\"IT.Mapping.addGeoportalMap: no contract sent\");\n }\n }", "function drawMap(mapDivId, mapToDraw) {\r\n var mapdiv = document.getElementById(mapDivId);\r\n mapdiv.innerHTML = mapToDraw.getMapTable();\r\n }", "function initMap() {\n var $googlemaps = $('.googlemap');\n\n if ($googlemaps.length) {\n // Visit https://snazzymaps.com/ for more themes\n var mapStyles = {\n Default: [{\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{\n color: '#e9e9e9'\n }, {\n lightness: 17\n }]\n }, {\n featureType: 'landscape',\n elementType: 'geometry',\n stylers: [{\n color: '#f5f5f5'\n }, {\n lightness: 20\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#ffffff'\n }, {\n lightness: 17\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#ffffff'\n }, {\n lightness: 29\n }, {\n weight: 0.2\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'geometry',\n stylers: [{\n color: '#ffffff'\n }, {\n lightness: 18\n }]\n }, {\n featureType: 'road.local',\n elementType: 'geometry',\n stylers: [{\n color: '#ffffff'\n }, {\n lightness: 16\n }]\n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{\n color: '#f5f5f5'\n }, {\n lightness: 21\n }]\n }, {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{\n color: '#dedede'\n }, {\n lightness: 21\n }]\n }, {\n elementType: 'labels.text.stroke',\n stylers: [{\n visibility: 'on'\n }, {\n color: '#ffffff'\n }, {\n lightness: 16\n }]\n }, {\n elementType: 'labels.text.fill',\n stylers: [{\n saturation: 36\n }, {\n color: '#333333'\n }, {\n lightness: 40\n }]\n }, {\n elementType: 'labels.icon',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{\n color: '#f2f2f2'\n }, {\n lightness: 19\n }]\n }, {\n featureType: 'administrative',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#fefefe'\n }, {\n lightness: 20\n }]\n }, {\n featureType: 'administrative',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#fefefe'\n }, {\n lightness: 17\n }, {\n weight: 1.2\n }]\n }],\n Gray: [{\n featureType: 'all',\n elementType: 'labels.text.fill',\n stylers: [{\n saturation: 36\n }, {\n color: '#000000'\n }, {\n lightness: 40\n }]\n }, {\n featureType: 'all',\n elementType: 'labels.text.stroke',\n stylers: [{\n visibility: 'on'\n }, {\n color: '#000000'\n }, {\n lightness: 16\n }]\n }, {\n featureType: 'all',\n elementType: 'labels.icon',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'administrative',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 20\n }]\n }, {\n featureType: 'administrative',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 17\n }, {\n weight: 1.2\n }]\n }, {\n featureType: 'landscape',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 20\n }]\n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 21\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 17\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 29\n }, {\n weight: 0.2\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 18\n }]\n }, {\n featureType: 'road.local',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 16\n }]\n }, {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 19\n }]\n }, {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 17\n }]\n }],\n Midnight: [{\n featureType: 'all',\n elementType: 'labels.text.fill',\n stylers: [{\n color: '#ffffff'\n }]\n }, {\n featureType: 'all',\n elementType: 'labels.text.stroke',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 13\n }]\n }, {\n featureType: 'administrative',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#000000'\n }]\n }, {\n featureType: 'administrative',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#144b53'\n }, {\n lightness: 14\n }, {\n weight: 1.4\n }]\n }, {\n featureType: 'landscape',\n elementType: 'all',\n stylers: [{\n color: '#08304b'\n }]\n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{\n color: '#0c4152'\n }, {\n lightness: 5\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#000000'\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#0b434f'\n }, {\n lightness: 25\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#000000'\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#0b3d51'\n }, {\n lightness: 16\n }]\n }, {\n featureType: 'road.local',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }]\n }, {\n featureType: 'transit',\n elementType: 'all',\n stylers: [{\n color: '#146474'\n }]\n }, {\n featureType: 'water',\n elementType: 'all',\n stylers: [{\n color: '#021019'\n }]\n }],\n Hopper: [{\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{\n hue: '#165c64'\n }, {\n saturation: 34\n }, {\n lightness: -69\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'landscape',\n elementType: 'geometry',\n stylers: [{\n hue: '#b7caaa'\n }, {\n saturation: -14\n }, {\n lightness: -18\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'landscape.man_made',\n elementType: 'all',\n stylers: [{\n hue: '#cbdac1'\n }, {\n saturation: -6\n }, {\n lightness: -9\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{\n hue: '#8d9b83'\n }, {\n saturation: -89\n }, {\n lightness: -12\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{\n hue: '#d4dad0'\n }, {\n saturation: -88\n }, {\n lightness: 54\n }, {\n visibility: 'simplified'\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'geometry',\n stylers: [{\n hue: '#bdc5b6'\n }, {\n saturation: -89\n }, {\n lightness: -3\n }, {\n visibility: 'simplified'\n }]\n }, {\n featureType: 'road.local',\n elementType: 'geometry',\n stylers: [{\n hue: '#bdc5b6'\n }, {\n saturation: -89\n }, {\n lightness: -26\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{\n hue: '#c17118'\n }, {\n saturation: 61\n }, {\n lightness: -45\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'poi.park',\n elementType: 'all',\n stylers: [{\n hue: '#8ba975'\n }, {\n saturation: -46\n }, {\n lightness: -28\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{\n hue: '#a43218'\n }, {\n saturation: 74\n }, {\n lightness: -51\n }, {\n visibility: 'simplified'\n }]\n }, {\n featureType: 'administrative.province',\n elementType: 'all',\n stylers: [{\n hue: '#ffffff'\n }, {\n saturation: 0\n }, {\n lightness: 100\n }, {\n visibility: 'simplified'\n }]\n }, {\n featureType: 'administrative.neighborhood',\n elementType: 'all',\n stylers: [{\n hue: '#ffffff'\n }, {\n saturation: 0\n }, {\n lightness: 100\n }, {\n visibility: 'off'\n }]\n }, {\n featureType: 'administrative.locality',\n elementType: 'labels',\n stylers: [{\n hue: '#ffffff'\n }, {\n saturation: 0\n }, {\n lightness: 100\n }, {\n visibility: 'off'\n }]\n }, {\n featureType: 'administrative.land_parcel',\n elementType: 'all',\n stylers: [{\n hue: '#ffffff'\n }, {\n saturation: 0\n }, {\n lightness: 100\n }, {\n visibility: 'off'\n }]\n }, {\n featureType: 'administrative',\n elementType: 'all',\n stylers: [{\n hue: '#3a3935'\n }, {\n saturation: 5\n }, {\n lightness: -57\n }, {\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.medical',\n elementType: 'geometry',\n stylers: [{\n hue: '#cba923'\n }, {\n saturation: 50\n }, {\n lightness: -46\n }, {\n visibility: 'on'\n }]\n }],\n Beard: [{\n featureType: 'poi.business',\n elementType: 'labels.text',\n stylers: [{\n visibility: 'on'\n }, {\n color: '#333333'\n }]\n }],\n AssassianCreed: [{\n featureType: 'all',\n elementType: 'all',\n stylers: [{\n visibility: 'on'\n }]\n }, {\n featureType: 'all',\n elementType: 'labels',\n stylers: [{\n visibility: 'off'\n }, {\n saturation: '-100'\n }]\n }, {\n featureType: 'all',\n elementType: 'labels.text.fill',\n stylers: [{\n saturation: 36\n }, {\n color: '#000000'\n }, {\n lightness: 40\n }, {\n visibility: 'off'\n }]\n }, {\n featureType: 'all',\n elementType: 'labels.text.stroke',\n stylers: [{\n visibility: 'off'\n }, {\n color: '#000000'\n }, {\n lightness: 16\n }]\n }, {\n featureType: 'all',\n elementType: 'labels.icon',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'administrative',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 20\n }]\n }, {\n featureType: 'administrative',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 17\n }, {\n weight: 1.2\n }]\n }, {\n featureType: 'landscape',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 20\n }]\n }, {\n featureType: 'landscape',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#4d6059'\n }]\n }, {\n featureType: 'landscape',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#4d6059'\n }]\n }, {\n featureType: 'landscape.natural',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#4d6059'\n }]\n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{\n lightness: 21\n }]\n }, {\n featureType: 'poi',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#4d6059'\n }]\n }, {\n featureType: 'poi',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#4d6059'\n }]\n }, {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{\n visibility: 'on'\n }, {\n color: '#7f8d89'\n }]\n }, {\n featureType: 'road',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#7f8d89'\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#7f8d89'\n }, {\n lightness: 17\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#7f8d89'\n }, {\n lightness: 29\n }, {\n weight: 0.2\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 18\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#7f8d89'\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#7f8d89'\n }]\n }, {\n featureType: 'road.local',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 16\n }]\n }, {\n featureType: 'road.local',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#7f8d89'\n }]\n }, {\n featureType: 'road.local',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#7f8d89'\n }]\n }, {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{\n color: '#000000'\n }, {\n lightness: 19\n }]\n }, {\n featureType: 'water',\n elementType: 'all',\n stylers: [{\n color: '#2b3638'\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{\n color: '#2b3638'\n }, {\n lightness: 17\n }]\n }, {\n featureType: 'water',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#24282b'\n }]\n }, {\n featureType: 'water',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#24282b'\n }]\n }, {\n featureType: 'water',\n elementType: 'labels',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'water',\n elementType: 'labels.text',\n stylers: [{\n visibility: 'off '\n }]\n }, {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'water',\n elementType: 'labels.icon',\n stylers: [{\n visibility: 'off'\n }]\n }],\n SubtleGray: [{\n featureType: 'administrative',\n elementType: 'all',\n stylers: [{\n saturation: '-100'\n }]\n }, {\n featureType: 'administrative.province',\n elementType: 'all',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'landscape',\n elementType: 'all',\n stylers: [{\n saturation: -100\n }, {\n lightness: 65\n }, {\n visibility: 'on'\n }]\n }, {\n featureType: 'poi',\n elementType: 'all',\n stylers: [{\n saturation: -100\n }, {\n lightness: '50'\n }, {\n visibility: 'simplified'\n }]\n }, {\n featureType: 'road',\n elementType: 'all',\n stylers: [{\n saturation: -100\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'all',\n stylers: [{\n visibility: 'simplified'\n }]\n }, {\n featureType: 'road.arterial',\n elementType: 'all',\n stylers: [{\n lightness: '30'\n }]\n }, {\n featureType: 'road.local',\n elementType: 'all',\n stylers: [{\n lightness: '40'\n }]\n }, {\n featureType: 'transit',\n elementType: 'all',\n stylers: [{\n saturation: -100\n }, {\n visibility: 'simplified'\n }]\n }, {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{\n hue: '#ffff00'\n }, {\n lightness: -25\n }, {\n saturation: -97\n }]\n }, {\n featureType: 'water',\n elementType: 'labels',\n stylers: [{\n lightness: -25\n }, {\n saturation: -100\n }]\n }],\n Tripitty: [{\n featureType: 'all',\n elementType: 'labels',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'administrative',\n elementType: 'all',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'landscape',\n elementType: 'all',\n stylers: [{\n color: '#2c5ca5'\n }]\n }, {\n featureType: 'poi',\n elementType: 'all',\n stylers: [{\n color: '#2c5ca5'\n }]\n }, {\n featureType: 'road',\n elementType: 'all',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'transit',\n elementType: 'all',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'water',\n elementType: 'all',\n stylers: [{\n color: '#193a70'\n }, {\n visibility: 'on'\n }]\n }]\n };\n $googlemaps.each(function (index, value) {\n var $googlemap = $(value);\n var latLng = $googlemap.data('latlng').split(',');\n var markerPopup = $googlemap.html();\n var icon = $googlemap.data('icon') ? $googlemap.data('icon') : 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png';\n var zoom = $googlemap.data('zoom');\n var mapStyle = $googlemap.data('theme');\n var mapElement = value;\n\n if ($googlemap.data('theme') === 'streetview') {\n var pov = $googlemap.data('pov');\n var _mapOptions = {\n position: {\n lat: Number(latLng[0]),\n lng: Number(latLng[1])\n },\n pov: pov,\n zoom: zoom,\n gestureHandling: 'none',\n scrollwheel: false\n };\n return new google.maps.StreetViewPanorama(mapElement, _mapOptions);\n }\n\n var mapOptions = {\n zoom: zoom,\n scrollwheel: $googlemap.data('scrollwheel'),\n center: new google.maps.LatLng(latLng[0], latLng[1]),\n styles: mapStyles[mapStyle]\n };\n var map = new google.maps.Map(mapElement, mapOptions);\n var infowindow = new google.maps.InfoWindow({\n content: markerPopup\n });\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(latLng[0], latLng[1]),\n icon: icon,\n map: map\n });\n marker.addListener('click', function () {\n infowindow.open(map, marker);\n });\n return null;\n });\n }\n}" ]
[ "0.7545261", "0.7425938", "0.72546303", "0.71053195", "0.70590353", "0.68960327", "0.68725973", "0.68332267", "0.6823726", "0.67919797", "0.6773188", "0.6769728", "0.67246395", "0.66746", "0.6673334", "0.6670847", "0.66198725", "0.66020983", "0.6586666", "0.65740573", "0.6565438", "0.6560849", "0.6553003", "0.6553003", "0.65325516", "0.6500577", "0.64881253", "0.64796966", "0.6479058", "0.6471212", "0.64432985", "0.643734", "0.64270675", "0.64270675", "0.64267445", "0.6392798", "0.6392366", "0.6384534", "0.6381545", "0.637349", "0.63664097", "0.63651484", "0.636493", "0.6341315", "0.6333323", "0.6332529", "0.6328398", "0.63274735", "0.63242114", "0.63082534", "0.63060343", "0.63045305", "0.6303807", "0.63008755", "0.6298633", "0.6291137", "0.6289226", "0.6286067", "0.62859917", "0.6264033", "0.6262952", "0.6258824", "0.62587965", "0.6257343", "0.62553596", "0.6248197", "0.62475616", "0.62471795", "0.6236256", "0.6235254", "0.62327653", "0.62282985", "0.62115055", "0.62106436", "0.62039995", "0.6202957", "0.620256", "0.62011003", "0.6186011", "0.61814284", "0.6175667", "0.61728495", "0.6168514", "0.6167891", "0.61588883", "0.6157956", "0.61565226", "0.6156253", "0.6153467", "0.6152198", "0.61467785", "0.6143439", "0.6140747", "0.61347353", "0.61281717", "0.6126515", "0.6124326", "0.6121859", "0.6121859", "0.6113941", "0.611194" ]
0.0
-1
Return a string representing a GetFeatureInfo request URL for the current map, based on the passed parameters: serviceUrl: the URL of the WMS service layer: layer to query srs: the SRS of the layer (x,y): (pixel) coordinates of query point
function createWMSGetFeatureInfoRequestURL (serviceUrl, layer, srs, x, y) { var extent = app.map.getExtent(); if (seldon.gisServerType === "ArcGIS") { extent = extent.transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection(seldon.projection)); } return Mustache.render( ('' + serviceUrl + '{{{c}}}LAYERS={{layer}}' + '&QUERY_LAYERS={{layer}}' + '&STYLES=,' + '&SERVICE=WMS' + '&VERSION=1.1.1' + '&REQUEST=GetFeatureInfo' + '&BBOX={{left}},{{bottom}},{{right}},{{top}}' + '&FEATURE_COUNT=100' + '&HEIGHT={{height}}' + '&WIDTH={{width}}' + '&FORMAT=image/png' + '&INFO_FORMAT=application/vnd.ogc.gml' + '&SRS={{srs}}' + '&X={{x}}' + '&Y={{y}}' ), { c : stringContainsChar(serviceUrl, '?') ? '&' : '?', layer : layer, height : app.map.size.h, width : app.map.size.w, left : extent.left, bottom : extent.bottom, right : extent.right, top : extent.top, srs : srs, x : x, y : y } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFeatureInfo(e)\n{\n if (essc_wms != null)\n {\n $('featureInfo').innerHTML = \"Getting feature info...\";\n var url = essc_wms.getFullRequestString({\n REQUEST: \"GetFeatureInfo\",\n BBOX: essc_wms.map.getExtent().toBBOX(),\n I: e.xy.x,\n J: e.xy.y,\n INFO_FORMAT: 'text/xml',\n QUERY_LAYERS: essc_wms.params.LAYERS,\n WIDTH: essc_wms.map.size.w,\n HEIGHT: essc_wms.map.size.h\n });\n OpenLayers.loadURL(url, '', this, gotFeatureInfo);\n Event.stop(e);\n }\n}", "function getFeatureInfo(e)\n{\n if (essc_wms != null)\n {\n $('featureInfo').innerHTML = \"Getting feature info...\";\n featureInfoUrl = essc_wms.getFullRequestString({\n REQUEST: \"GetFeatureInfo\",\n BBOX: essc_wms.map.getExtent().toBBOX(),\n I: e.xy.x,\n J: e.xy.y,\n INFO_FORMAT: 'text/xml',\n QUERY_LAYERS: essc_wms.params.LAYERS,\n WIDTH: essc_wms.map.size.w,\n HEIGHT: essc_wms.map.size.h\n });\n OpenLayers.loadURL(featureInfoUrl, '', this, gotFeatureInfo);\n Event.stop(e);\n }\n}", "function getFeatureInfo(map, layers, projection, forceInfoPopup) {\n let view = map.getView();\n let requestId = 1;\n\n GeoApp.featureInfo = {active:true};\n map.on('singleclick', function(evt) {\n let featureFound = false;\n if (GeoApp.featureInfo.active === false) {return;}\n let resolution = view.getResolution();\n // Filter layers without wms featureinfo //\n let infoLayers = layers.array_.filter(layer => layer.values_.wmsinfoformat !== undefined && layer.values_.wmsinfoformat !== '');\n infoLayers.forEach(layer => {\n let sourceLayers = layer.getSource().params_.LAYERS;\n let requestedLayers = [];\n sourceLayers.match(',') ? requestedLayers = sourceLayers.split(',') : requestedLayers.push(sourceLayers);\n let infoFormat = layer.values_.wmsinfoformat === 'text/html' ? 'text/html' : 'application/vnd.ogc.gml/3.1.1';\n requestedLayers.forEach(queryLayer => {\n // Get feature info URL for the clicked layer //\n let url = layer.getSource().getFeatureInfoUrl(\n evt.coordinate,\n resolution,\n projection,\n {\n 'INFO_FORMAT': infoFormat,\n 'QUERY_LAYERS': queryLayer,\n 'feature_count':1000\n });\n // Continue if there's an URL and the layer is visible //\n if(url && layer.getVisible() === true) {\n fetch(url, {\n headers: {\n //'Access-Control-Allow-Origin': 'http://geodev.nieuwegein.nl'\n }\n })\n .then(function(response) {\n return response.text();\n })\n .then(function(response) {\n // Use the appropriate function to parse the response //\n if (infoFormat === 'text/html') {\n htmlFeatureInfo(response);\n } else if (response.match('gml:featureMembers')){\n featureFound = true;\n gmlFeatureInfo(evt, requestId, response, layer, queryLayer, forceInfoPopup);\n }\n });\n }\n });\n\n });\n // Clears the sidebar, this because if a click hits no features, the sidebar should be cleared anyway //\n if (document.getElementsByClassName('featureinfo-content').length > 0 ) {\n featureFound === false ? removeNode('.featureinfo-content') : false;\n }\n requestId++;\n });\n}", "function buildLayerUrl(id){\n\tvar jsonurl = \"\";\n\tswitch (id){\n\t\tcase \"montypemapbtn\":\n\t\t\tjsonurl = baseurl + \"sites/geo/type/\" + buildParamString(id,delimurl,true,1) + \"/geojson?uri=true\";\n\t\t\treturn jsonurl;\n\t\tcase \"monperiodmapbtn\":\n\t\t\tjsonurl = baseurl + \"sites/geo/period/\" + buildParamString(id,delimurl,true,1) + \"/geojson?uri=true\";\n\t\t\treturn jsonurl;\n\t\tcase \"objtypemapbtn\":\n\t\t\tjsonurl = baseurl + \"artefacts/geo/type/\" + buildParamString(id,delimurl,true,1) + \"/geojson?uri=true\";\n\t\t\treturn jsonurl;\n\t\tcase \"objperiodmapbtn\":\n\t\t\tjsonurl = baseurl + \"artefacts/geo/period/\" + buildParamString(id,delimurl,true,1) + \"/geojson?uri=true\";\n\t\t\treturn jsonurl;\n\t\tcase \"objmaterialmapbtn\":\n\t\t\tjsonurl = baseurl + \"artefacts/geo/material/\" + buildParamString(id,delimurl,true,1) + \"/geojson?uri=true\";\n\t\t\treturn jsonurl;\n\t}\t\n}", "function gotFeatureInfo(response)\n{\n var xmldoc = response.responseXML;\n var lon = xmldoc.getElementsByTagName('longitude')[0];\n var lat = xmldoc.getElementsByTagName('latitude')[0];\n var val = xmldoc.getElementsByTagName('value')[0];\n if (lon) {\n $('featureInfo').innerHTML = \"<b>Lon:</b> \" + lon.firstChild.nodeValue + \n \"&nbsp;&nbsp;<b>Lat:</b> \" + lat.firstChild.nodeValue + \"&nbsp;&nbsp;<b>Value:</b> \" +\n toNSigFigs(parseFloat(val.firstChild.nodeValue), 4);\n if (timeSeriesSelected()) {\n // Construct a GetFeatureInfo request for the timeseries plot\n // Get a URL for a WMS request that covers the current map extent\n var urlEls = featureInfoUrl.split('&');\n // Replace the parameters as needed. We generate a map that is half the\n // width and height of the viewport, otherwise it takes too long\n var newURL = urlEls[0];\n for (var i = 1; i < urlEls.length; i++) {\n if (urlEls[i].startsWith('TIME=')) {\n newURL += '&TIME=' + $('firstFrame').innerHTML + '/' + $('lastFrame').innerHTML;\n } else if (urlEls[i].startsWith('INFO_FORMAT')) {\n newURL += '&INFO_FORMAT=image/png';\n } else {\n newURL += '&' + urlEls[i];\n }\n }\n // Image will be 400x300, need to allow a little elbow room\n $('featureInfo').innerHTML += \"&nbsp;&nbsp;<a href='#' onclick=popUp('\"\n + newURL + \"',450,350)>Create timeseries plot</a>\";\n }\n } else {\n $('featureInfo').innerHTML = \"Can't get feature info data for this layer <a href=\\\"javascript:popUp('whynot.html', 200, 200)\\\">(why not?)</a>\";\n }\n}", "function getLayerURL() {\n if(mapCX===undefined || mapCY===undefined) {\n return layerURL = \"/wmts/{Layer}/{Style}/{TileMatrix}/{TileCol}/{TileRow}.png\";\n } else {\n return layerURL = \"/wmts/{Layer}/{Style}/{CX}/{CY}/{TileMatrix}/{TileCol}/{TileRow}.png\";\n }\n }", "function buildURL(service) {\n var types = {\n github: 'https://github.com/',\n twitter: 'https://twitter.com/'\n };\n\n if(service.type in types && !/https?:\\/\\//.test(service.loc)) {\n return types[service.type] + service.loc; \n }\n\n return service.loc;\n }", "function jsonUrl(tableName) {\n var url = \"/geoserver/wfs\"\n url += \"?request=GetFeature\"\n url += \"&version=1.1.0\"\n url += \"&outputFormat=JSON\"\n url += \"&typeName=opencop:\"\n url += tableName\n return url\n }", "function getFeatureInfo(mapReq, callback){\n\tvar getFeatureInfoError = validateMapQuery(mapReq);\n\tif(!getFeatureInfoError){\n\t\tcreateMap(mapReq, function(createMapError, map){\n\t\t\tif(createMapError){\n\t\t\t\tcallback(createMapError);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmap.queryMapPoint(mapReq.i, mapReq.j, {}, function(err, results) {\n\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\tconsole.log(results)\n\t\t\t\t\tvar attributes = [];\n\t\t\t\t\tfor(var resultsIndex = 0; resultsIndex < results.length; ++resultsIndex){\n\t\t\t\t\t\tif(mapReq.query_layers.indexOf(results[resultsIndex].layer) != -1){\n\t\t\t\t\t\t\tvar features = results[resultsIndex].featureset; // assuming you're just grabbing the first object in the array\n\t\t\t\t\t\t\tvar feature;\n\t\t\t\t\t\t\twhile ((feature = features.next())) {// grab all of the attributes and push to a temporary array\n\t\t\t\t\t\t\t\tattributes.push(feature.attributes());\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\tcallback(null, attributes);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t} else{\n\t\tcallback(getFeatureInfoError)\n\t}\n}", "function getMapURL (coords) {\n\t\treturn [\n\t\t\t'https://maps.googleapis.com/maps/api/staticmap?center=' + coords,\n\t\t\t'zoom=4',\n\t\t\t'size=600x400',\n\t\t\t'scale=2',\n\t\t\t'format=jpg',\n\t\t\t'maptype=satellite',\n\t\t\t['markers=size:mid','color:red','label:A', coords].join('%7C'),\n\t\t\t'key=AIzaSyCO5ILMljA8FDnUe72qUgGtQwzkjR3HpIQ'\n\t\t].join('&');\n\t}", "function getWaypointsString() {\n\t\t\tvar layer = this.theMap.getLayersByName(this.ROUTE_POINTS)[0];\n\n\t\t\t//serialize these features to string\n\t\t\tvar wpString = \"\";\n\t\t\tfor (var i = 0; i < layer.features.length; i++) {\n\t\t\t\tvar ft = layer.features[i].geometry;\n\t\t\t\tft = new OpenLayers.LonLat(ft.x, ft.y);\n\t\t\t\tft = util.convertPointForDisplay(ft);\n\t\t\t\twpString = wpString + ft.lon + ',' + ft.lat + ',';\n\t\t\t}\n\t\t\t//slice away the last separator ','\n\t\t\twpString = wpString.substring(0, wpString.length - 3);\n\t\t\treturn wpString;\n\t\t}", "function markerQuery(layer) {\n let lat, lon, reqURL;\n lat = layer.getLatLng().lat;\n lon = layer.getLatLng().lng;\n // Creates a request URL for the API\n reqURL = '/api/bydistance';\n if (lon) {\n reqURL += '?lon=' + lon;\n if (lat) {\n reqURL += '&lat=' + lat;\n }\n }\n return reqURL;\n }", "function gmlFeatureInfo(event, requestId, featureInfo, layer, queryLayer, forceInfoPopup) {\n let layerTitle = layer.values_.title;\n let features = new WMSGetFeatureInfo().readFeatures(featureInfo);\n let fieldSet = layer.values_.fields !== undefined ? layer.values_.fields[queryLayer] : [];\n let fieldKeys = [];\n for (let key in fieldSet) {\n fieldKeys.push(key);\n }\n let featureInfoArray = [];\n // Compare the returned field to the fields defined in settings and add the defined fields to featureInfoArray //\n features.forEach(feature => {\n if (fieldKeys.length > 0) {\n for (let key in feature.values_) {\n if (!fieldKeys.includes(key)) {\n delete feature.values_[key];\n } else {\n let fieldKey = fieldSet[key];\n feature.values_[fieldKey] = feature.values_[key];\n delete feature.values_[key];\n }\n }\n }\n featureInfoArray.push(feature.values_);\n });\n\n if (document.getElementsByClassName(`request-number-${requestId}`).length > 0) {\n addFeatures(featureInfoArray,layerTitle);\n } else {\n // Check for sidebar or popup to show the feature info //\n if (document.getElementsByClassName('sidebar').length > 0 && forceInfoPopup === false) {\n // Add the feature info body to the sidebar //\n let sidebar = document.querySelector('.sidebar');\n sidebar.classList.contains('ol-collapsed') ? sidebarToggle() : false;\n if (document.getElementsByClassName('featureinfo-content').length > 0 ) {\n removeNode('.featureinfo-content');\n }\n createNode('.sidebar-body','div',['featureinfo-content']);\n createNode('.featureinfo-content','div',[`request-number-${requestId}`]);\n }\n createNode(`.request-number-${requestId}`, 'div', ['featureinfo-body']);\n addFeatures(featureInfoArray,layerTitle,event);\n }\n // Add a table per feature to the feature info body //\n function addFeatures(featureArray,layerName,event) {\n let featureNumber = 1;\n if (document.getElementsByClassName('feature-details').length > 0) {\n featureNumber = document.getElementsByClassName('feature-details').length + 1 ;\n }\n featureArray.forEach(feature => {\n let node = createNode('.featureinfo-body', 'details', [`feature-${featureNumber}`,'feature-details']);\n createNode(`.feature-${featureNumber}`, 'summary', ['feature-summary'], `${layerName}`);\n createNode(`.feature-${featureNumber}`, 'table', ['feature-table'], `<tbody></tbody>`);\n for (let key in feature) {\n createNode(`.feature-${featureNumber} table tbody`, 'tr', [], `<td>${key}</td><td>${feature[key]}</td>`);\n }\n featureNumber === 1 ? node.setAttribute('open',true) : false;\n featureNumber++;\n });\n }\n}", "function generateMapsApiUrl(parameters, credentials) {\n const base = `${serverURL(credentials)}api/v1/map`;\n return `${base}?${parameters.join('&')}`;\n}", "_getURL(request_options) {\n const build = request_options.genome_build || this._config.build;\n let source = this._config.source;\n this._validateBuildSource(build, source);\n\n // If a build name is provided, it takes precedence (the API will attempt to auto-select newest dataset based on the requested genome build).\n // Build and source are mutually exclusive, because hard-coded source IDs tend to be out of date\n const source_query = build ? `&build=${build}` : ` and id in ${source}`;\n\n const base = super._getURL(request_options);\n return `${base}?filter=chromosome eq '${request_options.chr}' and position le ${request_options.end} and position ge ${request_options.start}${source_query}`;\n }", "function getOutputUrl(paramMap) {\n let out = \"output.html?\";\n paramMap.forEach((val, key, map) => out += [key, val].join(\"=\") + \"&\");\n return out.substring(0, out.length - 1); // Exclude the trailing &\n}", "function getStreetViewURL(loc, heading=0, useHeading=false) {\n let w = 300;\n let h = 300;\n let fov = 90;\n let pitch = 0;\n let url = \"https://maps.googleapis.com/maps/api/streetview?\";\n url += \"location=\" + loc[1] + \",\" + loc[0];\n url += \"&size=\" + w + \"x\" + h;\n url += \"&heading=\" + heading;\n url += \"&fov=\" + fov;\n url += \"&pitch=\" + pitch;\n url += \"&key=\" + keys.google;\n return url;\n}", "_getURL(request_options) {\n const build = request_options.genome_build || this._config.build;\n let source = this._config.source;\n this._validateBuildSource(build, source);\n\n // If a build name is provided, it takes precedence (the API will attempt to auto-select newest dataset based on the requested genome build).\n // Build and source are mutually exclusive, because hard-coded source IDs tend to be out of date\n const source_query = build ? `&build=${build}` : ` and source in ${source}`;\n\n const base = super._getURL(request_options);\n return `${base}?filter=chrom eq '${request_options.chr}' and start le ${request_options.end} and end ge ${request_options.start}${source_query}`;\n }", "_getURL(request_options) {\n const build = request_options.genome_build || this._config.build;\n const source = this._config.source;\n this._validateBuildSource(build, source);\n\n // If a build name is provided, it takes precedence (the API will attempt to auto-select newest dataset based on the requested genome build).\n // Build and source are mutually exclusive, because hard-coded source IDs tend to be out of date\n const source_query = build ? `&build=${build}` : ` and id eq ${source}`;\n\n const base = super._getURL(request_options);\n return `${base}?format=objects&sort=pos&filter=chrom eq '${request_options.chr}' and pos ge ${request_options.start} and pos le ${request_options.end}${source_query}`;\n }", "function getClickHandlerQueryStringParameters(layerSpec) {\n var year = layerSpec.year;\n var cartogramFlag = DomFacade.getFlagForCartogramCheckbox();\n var polyYear, shapeType, fieldName, tableName;\n if(DomFacade.isCartogramCheckboxChecked()) {\n polyYear = layerSpec.cartogramPolyYear;\n fieldName = layerSpec.fieldName;\n shapeType = layerSpec.cartogramShapeType;\n tableName = layerSpec.cartogramTable;\n } else {\n polyYear = layerSpec.mercatorPolyYear;\n fieldName = layerSpec.fieldName;\n shapeType = layerSpec.mercatorShapeType;\n tableName = layerSpec.mercatorTable;\n }\n\n // These always exist, so it should not be dangerous to use these.\n var retval = \"shapeType=\" + shapeType +\n \"&polyYear=\" + polyYear +\n \"&fieldName=\" + fieldName +\n \"&year=\" + year +\n \"&cartogram=\" + cartogramFlag + \"&\";\n\n if (layerSpec.tableName) {\n retval += 'tableName=' + tableName +'&';\n }\n if (layerSpec.day) {\n retval += 'day=' + layerSpec.day + '&';\n }\n return retval\n\n}", "function requestSucceeded(json) {\n\t\t\t//console.log(json);\n\t\t\t// 1.2 if statement to pull back the name of the service for image services and other map services\n\t\t\tif(imageServ.checked){\n\t\t\tparentLayerName = json.name;\n\t\t\t}\n\t\t\telse{\n\t\t\tparentLayerName = json.mapName;\n\t\t\t}\n\t\t\t//console.log(json);\n\t\t\tserviceWKID = json.fullExtent.spatialReference.wkid;\n\t\t\tsingleFusedMapCache = JSON.stringify(json.singleFusedMapCache);\n\t\t\txmin = json.fullExtent.xmin;\n\t\t\tymin = json.fullExtent.ymin;\n\t\t\txmax = json.fullExtent.xmax;\n\t\t\tymax = json.fullExtent.ymax;\n\t\t\tcapabilities = json.capabilities;\n\t\t\t\n\t\t\t// 1.1.2 Checks for allowRasterFunction. Inferring Image service type. \n\t\t\tif(typeof(json.allowRasterFunction) != \"undefined\"){\n\t\t\t\n\t\t\timageServiceBool = true;\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\n\t\t\timageServiceBool = false;\n\t\t\t\n\t\t\t};\n\t\t\t\n\t\t\t// WKID validation\n\t\t\tif (serviceWKID!=mapWKID){\n\t\t\tmessage.innerHTML = '<div style=\"color:orange; width: 100%;\"><b>WARNING: Basemap and Service have different Spatial References</b></div>';\n\t\t\t}\n\t\t\t\n\t\t\t// Setting Service extent from JSON response\n\t\t\tserviceExtent = new Extent(xmin,ymin,xmax,ymax, new SpatialReference({ wkid:serviceWKID }));\n\t\t\t\n\t\t\t// Checking if layer has already been added \n\t\t\t for(var j = 0; j < map.layerIds.length; j++) {\n\t\t\t\tvar layer = map.getLayer(map.layerIds[j]);\n\t\t\t\t\n\t\t\t\tif (layer.url == serviceURL){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service already added</b></div>';\n\t\t\t\tthrow \"ERROR: Service already added\"\n\t\t\t\t\n\t\t\t\t}\n\t\t\t }\n\t\t\t \n\t\t\t//if dynMapServ radio button is checked\n\t\t\tif(dynMapServ.checked) {\n\t\t\t\t// 1.1.2 changed method for detecting an image service\n\t\t\t\tif(imageServiceBool == true){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is an image service. Select image service</b></div>';\n\t\t\t\tthrow \"ERROR: Service is an image service. Select image service.\"\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// If singleFusedMapCache is true, (inferring service has been cached)\n\t\t\t\t//1.1.3 added else if\n\t\t\t\telse if(singleFusedMapCache == \"true\"){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is cached. Select tiled/cached map service</b></div>';\n\t\t\t\tthrow \"ERROR: Service is cached. Select tiled/cached map service.\"\n\t\t\t\t//1.1.3 added else\n\t\t\t\t}else{\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\tvar dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(serviceURL);\n\t\t\t\tdynamicMapServiceLayer.name = parentLayerName; // 1.1.1 - Sets dynamic service name\n\t\t\t\tdynamicMapServiceLayer.id = window.addedLayerIdPrefix + dynamicMapServiceLayer.name;\n\t\t\t\tmap.addLayer(dynamicMapServiceLayer);\n\t\t\t\t\t// layer loaded listener \n\t\t\t\t\tdynamicMapServiceLayer.on(\"load\", function(){\n\t\t\t\t\t\tconsole.log(\"Dynamic map service Loaded successfully\");\n\t\t\t\t\t\tmessage.innerHTML = '<div style=\"color:green; width: 100%;\"><b>Service Loaded successfully</b></div>';\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t//if tileMapServ radio button is checked\n\t\t\t}else if(tileMapServ.checked) {\n\t\t\t\n\t\t\t\t// 1.1.2 changed method for detecting an image service\n\t\t\t\tif(imageServiceBool == true){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is an image service. Select image service</b></div>';\n\t\t\t\tthrow \"ERROR: Service is an image service. Select image service.\"\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If singleFusedMapCache is false, (inferring service is dynamic)\n\t\t\t\t//1.1.3 added else if\n\t\t\t\telse if(singleFusedMapCache == \"false\"){ \n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is dynamic. Select dynamic map service</b></div>';\n\t\t\t\tthrow \"ERROR: Service is dynamic. Select dynamic map service.\"\n\t\t\t\t//1.1.3 added else\n\t\t\t\t}else{ \n\t\t\t\t\t\n\t\t\t\tvar tiledMapServiceLayer = new ArcGISTiledMapServiceLayer(serviceURL);\n\t\t\t\ttiledMapServiceLayer.name = parentLayerName;// 1.1.1 - Sets tiled service name\n\t\t\t\t\ttiledMapServiceLayer.id = window.addedLayerIdPrefix + tiledMapServiceLayer.name;\n\t\t\t\tmap.addLayer(tiledMapServiceLayer);\n\t\t\t\t\t// layer loaded listener \n\t\t\t\t\ttiledMapServiceLayer.on(\"load\", function(){\n\t\t\t\t\t\tconsole.log(\"Tiled map service Loaded successfully\");\n\t\t\t\t\t\tmessage.innerHTML = '<div style=\"color:green; width: 100%;\"><b>Service Loaded successfully</b></div>';\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t}\n\t\t\t//if imageServ radio button is checked\t\n\t\t\t}else if(imageServ.checked) {\n\t\t\t\t// 1.1.2 changed method for detecting an image service\n\t\t\t\tif(imageServiceBool == false){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is not an image service.</b></div>';\n\t\t\t\tthrow \"ERROR: Service is not an image service.\"\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// 1.2 cached image services brought in as tiled map services to display cache\n\t\t\t\telse if(imageServiceBool == true && singleFusedMapCache == \"true\"){\n\t\t\t\t\t\n\t\t\t\tvar imageServiceLayer = new ArcGISTiledMapServiceLayer(serviceURL);\n\t\t\t\timageServiceLayer.name = parentLayerName;// 1.1.1 - Sets tiled service name\n\t\t\t\timageServiceLayer.id = window.addedLayerIdPrefix + parentLayerName;\n\t\t\t\tmap.addLayer(imageServiceLayer);\n\t\t\t\t\t// layer loaded listener \n\t\t\t\t\timageServiceLayer.on(\"load\", function(){\n\t\t\t\t\t\tconsole.log(\"Cached image service Loaded successfully\");\n\t\t\t\t\t\tmessage.innerHTML = '<div style=\"color:orange; width: 100%;\"><b>Warning: Image service is cached therefore has been added as a tiled/cached map service.</b></div>';\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t//1.2 if image service is not cached, add it as an image service\n\t\t\t\telse{\n\t\t\t\tvar imageServiceLayer = new ArcGISImageServiceLayer(serviceURL);\n\t\t\t\timageServiceLayer.name = parentLayerName; // 1.1.1 - Sets tiled service name\n\t\t\t\timageServiceLayer.id = window.addedLayerIdPrefix + parentLayerName;\n\t\t\t\tmap.addLayer(imageServiceLayer);\n\t\t\t\t\t// layer loaded listener \n\t\t\t\t\timageServiceLayer.on(\"load\", function(){\n\t\t\t\t\t\tconsole.log(\"Image service Loaded successfully\");\n\t\t\t\t\t\tmessage.innerHTML = '<div style=\"color:green; width: 100%;\"><b>Service Loaded successfully</b></div>';\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t// Zoom to full extent of map service\n\t\tmap.setExtent(serviceExtent);\n\t\t\t\n\t\t}", "function getMapInfo(srcSelected, desSelected, stime) {\n var srcLat, srcLng, desLat, desLng;\n $.ajax({\n type: \"GET\",\n url: \"http://bart.lettyli.xyz/station?source=\"+srcSelected,\n dataType: \"json\",\n success: function(data) {\n var info = data.station;\n srcLat = info.gtfs_latitude;\n srcLng = info.gtfs_longitude;\n //console.log(srcLat);\n \n $.ajax({\n type: \"GET\",\n url: \"http://bart.lettyli.xyz/station?source=\"+desSelected,\n dataType: \"json\",\n success: function(data) {\n var info = data.station;\n desLat = info.gtfs_latitude;\n desLng = info.gtfs_longitude;\n\n\t\t\tmyMap(srcLat, srcLng, desLat, desLng, stime);\n }\n });\n\t\t}\n\t});\n}", "FetchStreetView(location) {\n\t\tconst endpoint = `//maps.googleapis.com/maps/api/streetview?size=300x300\n\t\t&location=${location.lat},${location.lng}&key=AIzaSyAI4ADzGBzGZeWFsAlrvnNW_1p0MRd4jX4`;\n\n\t\treturn endpoint;\n\t}", "function gotFeatureInfo(response)\n{\n var xmldoc = response.responseXML;\n var lon = xmldoc.getElementsByTagName('longitude')[0];\n var lat = xmldoc.getElementsByTagName('latitude')[0];\n var val = xmldoc.getElementsByTagName('value')[0];\n if (lon) {\n $('featureInfo').innerHTML = \"<b>Lon:</b> \" + toNSigFigs(lon.firstChild.nodeValue, 4) + \n \"&nbsp;&nbsp;<b>Lat:</b> \" + toNSigFigs(lat.firstChild.nodeValue, 4) + \"&nbsp;&nbsp;<b>Value:</b> \" +\n toNSigFigs(val.firstChild.nodeValue, 4);\n } else {\n $('featureInfo').innerHTML = \"Can't get feature info data for this layer <a href=\\\"javascript:popUp('whynot.html')\\\">(why not?)</a>\";\n }\n \n}", "function getgeoinfoFoss (event){\n\t\t //console.log(\"getgeoinfoUSGS\");\n\t\t// console.log(event.graphic.attributes);\n\t\t var attr = event.graphic.attributes;\n\t\t var lon=event.mapPoint.x;\n\t\t var lat=event.mapPoint.y;\t\t\n\t\t map.infoWindow.setTitle(\"Fossil Information \");\n\t\t map.infoWindow.setContent( \"<b>Formation:</b>\"+attr.Formation+\"<br/><b>Collection Name:</b>\"+attr.nam+\"<br/><b>Early interval:</b>\"+attr.oei);\n\n\t\t map.infoWindow.show(event.mapPoint, map.getInfoWindowAnchor(event.screenPoint));\n }", "function prettyPrintOneService(feature, layer) {\r\n\t\tif (feature.properties) {\r\n\t\t\tvar popupString = '<div class=\"popup\" style=\"text-align : left\">';\r\n\r\n\t\t\tif (feature.properties.images!=null) {\r\n\t\t\t\tvar images = feature.properties.images;\r\n\t\t\t\tpopupString += '<img width=\"300\" src=\"' + dirImageSea + images[0] + '\" />';\r\n\t\t\t}\r\n\r\n\t\t\tpopupString += '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" style=\"table-layout: fixed; width: 300px\">';\r\n\t\t\t// popupString += '<table width=\"100%\" border=\"1\" cellpadding=\"1\" cellspacing=\"0\">';\r\n\t\t\tpopupString += '<tr><td width=\"40%\">ID</td><td>' + feature.properties.ID + '</td></tr>';\r\n\t\t\tpopupString += '<tr><td>NAME</td><td>' + feature.properties.name + '</td></tr>';\r\n\t\t\tpopupString += '<tr><td>CATEGORY</td><td>' + feature.properties.Category +'-'+ feature.properties.CategorySub+ '</td></tr>';\r\n\t\t\tpopupString += '<tr><td>ADDRESS</td><td>' + feature.properties.StreetNo +', '+ feature.properties.StreetName +' S('+ feature.properties.PostalCode + ')</td></tr>';\r\n\t\t\tpopupString += '<tr><td>CREATEDATETIME</td><td>' + feature.properties.CreateDateTime + '</td></tr>';\r\n\r\n\t\t\t// display coordinates\r\n\t\t \tif (feature.geometry) {\r\n\t\t\t\tpopupString += '<tr><td>Lat-Lon</td><td style=\"word-wrap: break-word\">' + feature.geometry.coordinates[1] +','+ feature.geometry.coordinates[0] + '</td></tr>';\r\n\t\t\t}\r\n\r\n\t\t\tpopupString += '</table></div>';\r\n\r\n\t\t\tlayer.bindPopup(popupString);\r\n\t\t}\r\n\t}", "function getMapUrl(areaParam, countryCodes, colorOrder) {\r\n var base = 'http://chart.apis.google.com/chart';\r\n var chartType = '?cht=t';\r\n\tvar dimensions = '&chs=440x220';\r\n\r\n\t// Default country color: black, \r\n\t// Gradient from blue (visited) to yellow (no visited)\r\n var colors = '&chco=white,blue,yellow'; \r\n var order = '&chd=s:' + colorOrder;\r\n var countries = '&chld=' + countryCodes;\r\n var area = '&chtm=' + areaParam;\r\n\t// Water is light blue\r\n var background = '&chf=bg,s,EAF7FE';\r\n\r\n var url = base + chartType + dimensions + colors + area + \r\n\t background + order + countries;\r\n\r\n return url;\r\n }", "function setGEarthURL()\n{\n if (essc_wms != null) {\n // Get a URL for a WMS request that covers the current map extent\n var mapBounds = map.getExtent();\n var urlEls = essc_wms.getURL(mapBounds).split('&');\n var gEarthURL = urlEls[0];\n for (var i = 1; i < urlEls.length; i++) {\n if (urlEls[i].startsWith('FORMAT')) {\n // Make sure the FORMAT is set correctly\n gEarthURL += '&FORMAT=application/vnd.google-earth.kmz';\n } else if (urlEls[i].startsWith('TIME') && timeSeriesSelected()) {\n // If we can make an animation, do so\n gEarthURL += '&TIME=' + $('firstFrame').innerHTML + '/' + $('lastFrame').innerHTML;\n } else if (urlEls[i].startsWith('BBOX')) {\n // Set the bounding box so that there are no transparent pixels around\n // the edge of the image: i.e. find the intersection of the layer BBOX\n // and the viewport BBOX\n gEarthURL += '&BBOX=' + getIntersectionBBOX();\n } else if (!urlEls[i].startsWith('OPACITY')) {\n // We remove the OPACITY argument as Google Earth allows opacity\n // to be controlled in the client\n gEarthURL += '&' + urlEls[i];\n }\n }\n if (timeSeriesSelected()) {\n $('googleEarth').innerHTML = '<a href=\\'' + gEarthURL + '\\'>Open animation in Google Earth</a>';\n } else {\n $('googleEarth').innerHTML = '<a href=\\'' + gEarthURL + '\\'>Open in Google Earth</a>';\n }\n }\n}", "function onEachStation(feature, layer) {\n if (feature.properties && feature.properties[\"SITE NAME\"]) {\n var baseURL = \"http://www.co.thurston.wa.us/monitoring/\";\n var link = \"\";\n switch (feature.properties[\"SITE CODE\"]) {\n case '13u': link = '<a href=\"' + baseURL + 'precip/precip-lawrence.html\">Details</a>'; break;\n case '11w': link = '<a href=\"' + baseURL + 'precip/precip-Rainier.htm\">Details</a>'; break;\n case '05u': link = '<a href=\"' + baseURL + 'precip/precip-yelm.htm\">Details</a>'; break;\n case '23u': link = '<a href=\"' + baseURL + 'precip/precip-percival.htm\">Details</a>'; break;\n case '27u': link = '<a href=\"' + baseURL + 'precip/precip-bostonharbor.html\">Details</a>'; break;\n case '32u': link = '<a href=\"' + baseURL + 'precip/precip-greencove.html\">Details</a>'; break;\n case '45u': link = '<a href=\"' + baseURL + 'precip/precip-blackriver.html\">Details</a>'; break;\n case '45w': link = '<a href=\"' + baseURL + 'precip/precip-rochester.htm\">Details</a>'; break;\n case '55u': link = '<a href=\"' + baseURL + 'precip/precip-tenino.html\">Details</a>'; break;\n case '59u': link = '<a href=\"' + baseURL + 'precip/precip-skookumchuck.html\">Details</a>'; break;\n case '60u': link = '<a href=\"' + baseURL + 'precip/precip-skookumchuck.html\">Details</a>'; break;\n case '65u': link = '<a href=\"' + baseURL + 'precip/precip-grandmound.html\">Details</a>'; break;\n case '69u': link = '<a href=\"' + baseURL + 'precip/precip-summit.html\">Details</a>'; break;\n }\n layer.bindPopup('<strong>' + \n feature.properties[\"SITE CODE\"] + \": \" +\n feature.properties[\"SITE NAME\"] + \n '</strong>' + \"</br>\" +\n link);\n }\n}", "generateReqUrl() {\n this.url = `https://api.openweathermap.org/data/2.5/weather?q=${this.loc}&appid=${this.apiKey}${this.units}${this.lang}${this.mode}`;\n this.query ? this.url += `&${queryString.stringify(this.query)}` : this.url;\n \n }", "function getServiceUrl(service, data) {\n var endPoint = service.endPoint;\n var serviceUrl = CONFIG.USE_MOCK_SERVICES ? ('mock-api/' + service.mockPath) : CONFIG.REST_SERVER;\n\n if (CONFIG.USE_MOCK_SERVICES) {\n if (endPoint === 'userConsole' && data) {\n endPoint += ('-' + data.consoleId);\n }\n endPoint += '.json';\n }\n\n return serviceUrl + endPoint;\n }", "function showInfo(layer) {\n if (layer.id == \"info_pipe\"){\n //For default layer pipeline\n document.getElementById(\"inf_title\").innerHTML = \"tuberia\";\n document.getElementById(\"inf_id\").innerHTML = \"Layer ID: tfm:tuebria\";\n document.getElementById(\"inf_abs\").innerHTML = \"Abstract: Red de aguas\";\n document.getElementById(\"inf_cp\").innerHTML = \"Contact Person: Claudius Ptolomaeus\";\n document.getElementById(\"inf_org\").innerHTML = \"Organization: The ancient geographes INC\";\n document.getElementById(\"inf_email\").innerHTML = \"Email: [email protected]\";\n document.getElementById(\"inf_phone\").innerHTML = \"Telephone: \";\n document.getElementById(\"inf_ac\").innerHTML = \"Access Constraints: NONE\";\n document.getElementById(\"inf_wms\").innerHTML = \"WMS: http://localhost:8080/geoserver/wms?service=wms&version=1.3.0&request=GetCapabilities\";\n document.getElementById(\"inf_legend\").innerHTML = \"Legend:<br><img src='http://localhost:8080/geoserver/tfm/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&STRICT=false&style=Diametros'>\";\n return;\n }\n if (layer.id == \"info_comm\"){\n //For default layer comments\n document.getElementById(\"inf_title\").innerHTML = \"comments\";\n document.getElementById(\"inf_id\").innerHTML = \"Layer ID: tfm:comments\";\n document.getElementById(\"inf_abs\").innerHTML = \"Abstract: Comments of the interest points\";\n document.getElementById(\"inf_cp\").innerHTML = \"Contact Person: Claudius Ptolomaeus\";\n document.getElementById(\"inf_org\").innerHTML = \"Organization: The ancient geographes INC\";\n document.getElementById(\"inf_email\").innerHTML = \"Email: [email protected]\";\n document.getElementById(\"inf_phone\").innerHTML = \"Telephone: \";\n document.getElementById(\"inf_ac\").innerHTML = \"Access Constraints: NONE\";\n document.getElementById(\"inf_wms\").innerHTML = \"WMS: http://localhost:8080/geoserver/wms?service=wms&version=1.3.0&request=GetCapabilities\";\n document.getElementById(\"inf_legend\").innerHTML = \"Legend:<br><img src='http://localhost:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=tfm:comments'> Comment\";\n return;\n }\n //The position in the array info, is the same of the layer id,\n //because is ordered it is only necessary fill the data\n document.getElementById(\"inf_title\").innerHTML = info[layer.id][0];\n document.getElementById(\"inf_id\").innerHTML = \"Layer ID: \"+info[layer.id][1];\n document.getElementById(\"inf_abs\").innerHTML = \"Abstract: \"+info[layer.id][2];\n document.getElementById(\"inf_cp\").innerHTML = \"Contact Person: \"+info[layer.id][3];\n document.getElementById(\"inf_org\").innerHTML = \"Organization: \"+info[layer.id][4];\n document.getElementById(\"inf_email\").innerHTML = \"Email: \"+info[layer.id][5];\n document.getElementById(\"inf_phone\").innerHTML = \"Telephone: \"+info[layer.id][6];\n document.getElementById(\"inf_ac\").innerHTML = \"Access Constraints: \"+info[layer.id][7];\n document.getElementById(\"inf_wms\").innerHTML = \"WMS: \"+info[layer.id][8];\n document.getElementById(\"inf_legend\").innerHTML = \"Legend:<br><img style='max-width:100%' src='\"+info[layer.id][9]+\"'>\";\n}", "function apiURL(service) { //Función para formar la ruta completa a la API \n return BaseApiUrl + service;\n}", "function defineSource(mapSource) {\n if(mapSource.type === 'wfs') {\n // add a wfs type source\n return {\n format: new ol.format.GML2({}),\n projection: 'EPSG:4326',\n url: function(extent) {\n // http://localhost:8080/mapserver/cgi-bin/tinyows?\n // service=WFS&version=1.1.0&request=GetFeature&typename=gm:minnesota_places\n\n let url_params = Object.assign({}, mapSource.params,\n {typename: mapSource.layers[0].name}, {\n 'srsname': 'EPSG:3857',\n 'outputFormat': 'text/xml; subtype=gml/2.1.2',\n 'service': 'WFS',\n 'version': '1.1.0',\n 'request': 'GetFeature',\n 'bbox': extent.concat('EPSG:3857').join(',')\n });\n\n return mapSource.urls[0] + '?' + util.formatUrlParameters(url_params);\n },\n strategy: ol.loadingstrategy.bbox\n };\n }\n // empty object\n return {}\n}", "function generateMapImageLink(locLat, locLng, imgWidth, imgHeight, zoom){\n\tvar url = \"https://maps.googleapis.com/maps/api/staticmap?\";\n\turl += (\"center=\" + locLat + \",\" + locLng);\n\turl += (\"&size=\" + imgWidth + \"x\" + imgHeight);\n\turl += (\"&zoom=\" + zoom);\n\turl += (\"&markers=\" + locLat + \",\" + locLng);\n\t// url += (\"&key=YOUR_API_KEY\");\n\treturn url;\n}", "function ShowServiceRequestDetails(mapPoint, attributes, title) {\n // alert(title);\n map.infoWindow.hide();\n if (!isMobileDevice) {\n // dojo.byId('divCreateRequestContainer').style.display = \"none\";\n // dojo.byId('divServiceRequestContent').style.display = \"none\";\n }\n selectedMapPoint = mapPoint;\n // for (var i in attributes) {\n // if (!attributes[i]) {\n // attributes[i] = \"\";\n // }\n // }\n\n //selectedRequestStatus = attributes.STATUS;\n //map.getLayer(tempGraphicsLayerId).clear();\n map.infoWindow.resize(225, 120);\n //var screenPoint;\n //(isMobileDevice) ? map.centerAt(mapPoint) : map.setExtent(GetBrowserMapExtent(mapPoint));\n\n setTimeout(function () {\n screenPoint = map.toScreen(mapPoint);\n screenPoint.y = map.height - screenPoint.y;\n // if (isMobileDevice)\n // screenPoint = map.toScreen(mapPoint);\n // else {\n // screenPoint = map.toScreen(mapPoint);\n // screenPoint.y = map.height - screenPoint.y;\n // }\n map.infoWindow.show(screenPoint);\n //alert(title + \" new\");\n map.infoWindow.setTitle(title);\n // dojo.connect(map.infoWindow.imgDetailsInstance(), \"onclick\", function () {\n // map.infoWindow.hide();\n // if (isMobileDevice) {\n // selectedMapPoint = null;\n // map.infoWindow.hide();\n // ShowServiceRequestContainer();\n // }\n // else {\n // map.infoWindow.resize(300, 300);\n // screenPoint = map.toScreen(mapPoint);\n // screenPoint.y = map.height - screenPoint.y;\n // map.infoWindow.reSetLocation(screenPoint);\n // dojo.byId('divServiceRequestContent').style.display = \"block\";\n // }\n // ServiceRequestDetails(attributes);\n // });\n\n // map.infoWindow.resize(225, 120);\n // dojo.byId('divServiceRequestContent').style.display = \"block\";\n //ServiceRequestDetails(attributes);\n map.infoWindow.setContent(attributes);\n }, 0);\n}", "static REMOTE_SERVER_URL(collection, parameter, urlParametersAsString) {\n\t\tconst port = 1337;\n\t\tlet url = `http://localhost:${port}/${collection}/`;\n\t\tif (parameter) {\n\t\t\turl += `${parameter}/`;\n\t\t}\n\t\tif (urlParametersAsString) {\n\t\t\turl += `?${urlParametersAsString}`;\n\t\t}\n\t\treturn url;\n\t}", "function constructGetGistIDByNamesParams(areaName, locationName, gistName) {\n var queryParams = '<?xml version=\"1.0\" encoding=\"utf-8\"?>';\n queryParams += '<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">';\n queryParams += '<soap:Body>';\n queryParams += '<GetPointByAreasLocationAndPointName xmlns=\"http://tempuri.org/\">';\n queryParams += '<areaName>' + areaName + '</areaName>';\n queryParams += '<locationName>' + locationName + '</locationName>';\n queryParams += '<pointName>' + gistName + '</pointName>';\n queryParams += '</GetPointByAreasLocationAndPointName>';\n queryParams += '</soap:Body>';\n queryParams += '</soap:Envelope>';\n return queryParams;\n}", "function createUriParams() { \n var loc = mapApp.GetParameters(), \n ids = getCurrentDataSets(), \n uri = []; \n \n uri[0] = loc; \n \n //dataSetsList\n for (var i = 0; i < ids.length; i++) { \n uri[i+1] = dataSetsList[ids[i]].data.getParams(); \n } \n\n //userDataset\n var userDataset;\n for (var strIndex in userDatasets) {\n var userDataset = userDatasets[strIndex],\n dataId = userDataset.info[0],\n funcName = userDataset.info[1],\n str = \"\";\n\n\n str = dataId + \":a\" + \":\" + funcName;\n for(var i = 2; i < userDataset.info.length; ++i) {\n\n if(toString.apply(userDataset.info[i]) === '[object Array]') {\n str += \":=\" + userDataset.info[i][0];\n for(var j = 1; j < userDataset.info[i].length; ++j) {\n str += \"-\" + userDataset.info[i][j];\n }\n }\n else {\n str += \":\" + userDataset.info[i];\n }\n }\n str.replace(/#/g, \"\");\n uri[uri.length] = str;\n }\n\n return encodeURI(uri.join('/')); \n}", "function buildRequestForecastUrl(coordinates, units) {\n return `https://api.openweathermap.org/data/2.5/onecall?lat=${coordinates.lat}&lon=${coordinates.lon}&exclude=minutely,alerts&units=${units}&appid=0b0ed20c25bb6e26c07c28eff9ffc718`;\n}", "function getFoursquareRequestURL(coordinates, radius, type, date_string) {\n //Set up the full request URL\n const url = `${API_DATA.REQUEST_BASE_URL}${coordinates.latitude},${coordinates.longitude}&intent=${API_DATA.INTENT}&radius=${radius}&query=${type}&client_id=${API_DATA.CLIENT_ID}&client_secret=${API_DATA.CLIENT_SECRET}&v=${date_string}`;\n \n return url;\n }", "function getApiUrl(latitude, longitude, units) {\n if (units == \"imperial\") {\n return w + \"lat=\" + latitude + \"&lon=\" + longitude + unitsF + APPID;\n } else if (units == \"metric\")\n return w + \"lat=\" + latitude + \"&lon=\" + longitude + unitsC + APPID;\n else\n return w + \"lat=\" + latitude + \"&lon=\" + longitude + APPID;\n}", "function addQueryLayerToMap(jsonurl, layername, values){\n\t//colours = addLyrCols(values);\n\tvar fSource = new ol.source.Vector({\n\t\turl: jsonurl,\n\t\tformat: new ol.format.GeoJSON({\n\t\t\tdefaultDataProjection: 'EPSG:27700'\n\t\t})\n\t});\n\t\n\tvar fLayer = new ol.layer.Vector({\n\t\ttitle: layername,\n\t\tsource: fSource,\n\t\tstyle: styleFunction\n\t});\n\tmap.addLayer(fLayer);\n\n\t\n}", "function getServiceUrl(serviceName) {\n\t var urlType = arguments.length <= 1 || arguments[1] === undefined ? 'publicURL' : arguments[1];\n\t var appConfig = arguments.length <= 2 || arguments[2] === undefined ? getAppConfig() : arguments[2];\n\t\n\t var serviceUrl = appConfig[serviceName] || getFromServiceCatalog(serviceName, urlType);\n\t if (!serviceUrl) {\n\t throw Error('URL for service ' + serviceName + ' can not be found');\n\t }\n\t return serviceUrl;\n\t}", "function renderServiceDetails(service) {\n let results = service;\n let output = \"\";\n output += getServiceDetails(results);\n renderCarouselImages(service);\n}", "function buildLayerName(id){\n\tvar layername = \"\";\n\tswitch (id){\n\t\tcase \"montypemapbtn\":\n\t\t\tlayername = \"Monuments by Type: \" + buildParamString(id,\", \",false,0);\n\t\t\treturn layername;\n\t\tcase \"monperiodmapbtn\":\n\t\t\tlayername = \"Monuments by Period: \" + buildParamString(id,\", \",false,0);\n\t\t\treturn layername;\n\t\tcase \"objtypemapbtn\":\n\t\t\tlayername = \"Objects by Type: \" + buildParamString(id,\", \",false,0);\n\t\t\treturn layername;\n\t\tcase \"objperiodmapbtn\":\n\t\t\tlayername = \"Objects by Period: \" + buildParamString(id,\", \",false,0);\n\t\t\treturn layername;\n\t\tcase \"objmaterialmapbtn\":\n\t\t\tlayername = \"Objects by Material: \" + buildParamString(id,\", \",false,0);\n\t\t\treturn layername;\n\t}\t\t\n}", "function addMapListener(e) { \n polygonsList = null; //Clear polygon list\n var layerIdAux,layerIndexAux;\n //If the user is selecting limit polygons\n if(isLimitPolygon){\n document.getElementById('infoLimit').innerHTML = loadingText;\n layerIdAux = layerLimitId;\n layerIndexAux = layerLimitIndex;\n }\n else{ //If the user is selecting normal polygons\n document.getElementById('info').innerHTML = loadingText;\n layerIdAux = layerId;\n layerIndexAux = layerIndex;\n }\n var params = {\n REQUEST: \"GetFeatureInfo\",\n EXCEPTIONS: \"application/vnd.ogc.se_xml\",\n BBOX: map.getExtent().toBBOX(),\n X: e.xy.x,\n Y: e.xy.y,\n INFO_FORMAT: 'text/html',\n QUERY_LAYERS: map.layers[layerIndexAux].params.LAYERS,\n FEATURE_COUNT: 50,\n Styles: '',\n Layers: layerIdAux,\n srs: 'EPSG:900913',\n WIDTH: map.size.w,\n HEIGHT: map.size.h,\n format: 'image/png'\n };\n OpenLayers.loadURL(geoIpAddress+\"/geoserver/wms\", params, this, setHTML, setHTML);\n OpenLayers.Event.stop(e);\n}", "function GetLayers(cap, baseUrl){\n\t// Get the titile of the data service\n\tvar dataServiceTitle = cap.serviceIdentification.title;\n\t\n\t// Check if there are any feature types in the data service\n\tif (cap.featureTypeList.featureTypes.length == 0)\n\t\talert(\"There are no feature types in '\" + dataServiceTitle + \"'.\");\n\n\telse{\t\t\n\t\t// Get each feature layer listed in the capabilities\n\t\tfor (var i = 0; i < cap.featureTypeList.featureTypes.length; i++) {\n\t\t\tvar featureName = cap.featureTypeList.featureTypes[i].name;\n\t\t\tvar featureNS = cap.featureTypeList.featureTypes[i].featureNS;\n\t\t\t\n\t\t\thits = undefined;\n\t\t\t// Get the number of features in the layer\n\t\t\tGetHits(baseUrl, featureName);\n\t\t\n\t\t\tvar r = true;\n\t\t\tif (hits > 2500)\n\t\t\t\tr = confirm(\"There are \"+hits+\" \"+featureName+\" features. They make take awhile to draw.\\n-Hit cancel\\n-Zoom to a smaller area\\n-Turn on the set extent toggle on the toolbar.\\n-Select the layer again.\\nOr hit OK to attempt to draw anyway.\");\n\t\t\tif (hits == 0){\n\t\t\t\tif (bounds != undefined)\n\t\t\t\t\talert(\"There were 0 \"+featureName+\"s features returned. Try changing the set extent or turn off the set extent toggle on the toolbar.\");\n\t\t\t\telse\n\t\t\t\t\talert(\"There were 0 \"+featureName+\"s features returned. There may be a problem with the server.\");\n\t\t\t\tr = false;\n\t\t\t}\n\n\t\t\tif (r == true) {\n\t\t\t\t// Create the server request for the layer\n\t\t\t\twfsLayers[l] = new OpenLayers.Layer.Vector(featureName+\" (\"+dataServiceTitle+\")\", {\n\t\t\t\t\tstrategies: [new OpenLayers.Strategy.Fixed()],\n\t\t\t\t\tprotocol: new OpenLayers.Protocol.WFS({\n\t\t\t\t\t\t//version: \"1.1.0\", // !!!!!!!!!!!!!! Features aren't drawn if use 1.1.0 !!!!!!!!!!!!!!!!!!\n\t\t\t\t\t\turl: baseUrl,\n\t\t\t\t\t\tfeatureType: featureName,\n\t\t\t\t\t\tfeatureNS: featureNS,\n\t\t\t\t\t\tgeometryName: \"shape\"\n\t\t\t\t\t}),\n\t\t\t\t\tevents: new OpenLayers.Events({\n\t\t\t\t\t\tbeforefeatureadded: Busy()\n\t\t\t\t\t}),\n\t\t\t\t\tstyleMap: SetStyle(),\n\t\t\t\t\tvisibility: true\n\t\t\t\t});\n\t\t\t\t//console.log(bounds);\n\t\t\t\tif (bounds != undefined) {\n\t\t\t\t\tbboxFilter = new OpenLayers.Filter.Spatial({\n\t\t\t\t\t\ttype: OpenLayers.Filter.Spatial.BBOX,\n\t\t\t\t\t\tvalue: bounds\n\t\t\t\t\t});\n\t\t\t\t\twfsLayers[l].filter = bboxFilter;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tmap.addLayer(wfsLayers[l]);\n\t\t\t\tMakeSelectable();\n\t\t\t\t//console.log(map);\n\t\t\t\t\n\t\t\t\t// Set the number of features as the title in the legend\n\t\t\t\twfsLayers[l].events.register(\"featureadded\", wfsLayers[l], function (e) {\n\t\t\t\t\te.object.styleMap.styles.default.rules[0].title = e.object.features.length.toString() + \" features\";\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Set the cursor to busy while the layer is loading\n\t\t\t\twfsLayers[l].events.register(\"loadstart\", wfsLayers[l], function (e) {\n\t\t\t\t\tBusy();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Set the cursor back to the default after layer has been loaded\n\t\t\t\twfsLayers[l].events.register(\"loadend\", wfsLayers[l], function (e) {\n\t\t\t\t\tReady();\n\t\t\t\t\t\n\t\t\t\t\t// Set the maximum bounds for all the loaded layers & Zoom to those bounds\n\t\t\t\t\tSetLayersExtent(e.object);\n\t\t\t\t\tZoomToLayersExtent();\t\t\t\t\n\n\t\t\t\t\tif ((e.object == undefined) || (e.object.features.length == 0)) {\n\t\t\t\t\t\talert(featureName+\" wasn't loaded correctly. There maybe a problem with the server.\");\n\t\t\t\t\t\t//map.removeLayer(e.object);\n\t\t\t\t\t\t//activeLayer = undefined;\n\t\t\t\t\t\t//l--;\n\t\t\t\t\t\t//console.log(wfsLayers);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tl++;\n\t\t\t}\n\t\t\telse\n\t\t\t\tGetSubregion(cap.featureTypeList.featureTypes[i]);\n\t\t}\n\t}\t\n}", "function getMapImageURL()\n{\n\n var bTemp = false;\n\n var fMCities = \"F\";\n var fMHighways = \"F\";\n var fStreets = \"F\";\n var fRoads = \"F\";\n var fRoadNames = \"F\";\n\n bTemp = document.getElementById(\"chkCities\").checked;\n if (bTemp)\n {\n fMCities = 'T';\n }\n\n //Set appropriate default for secondary highways\n if (scale >=250)\n {\n \tfMHighways = 'F';\n }\n else\n {\n fMHighways = 'T';\n }\n //Should only look at the checkbox for 500 & 250 miles\n bTemp = document.getElementById(\"chkHighways\").checked;\n if (bTemp && (scale == 250 || scale == 500))\n {\n fMHighways = 'T';\n }\n if (scale == 50)\n {\n\t\t bTemp = document.getElementById(\"chkRoads\").checked;\n\t\t if (bTemp)\n\t\t {\n\t\t\t fRoads = 'T';\n\t\t }\n\t }\n if (scale < 50)\n {\n\t\tfRoads = 'T';\n\t }\n\t if ((scale == 5) || (scale == 3))\n\t {\n\t\t bTemp = document.getElementById(\"chkRoadNames\").checked;\n\t\t if (bTemp)\n\t\t {\n\t\t\t fRoadNames = 'T';\n\t\t }\n\t }\n\t if (scale < 2)\n\t {\n bTemp = document.getElementById(\"chkStreets\").checked;\n if (bTemp)\n {\n fStreets = 'T';\n }\n }\n\n\t fShowPinpoint='F';\n\t if (geocodedAddr == true && (zoomLevels[0] != scale))\n\t {\n\t \tfShowPinpoint='T';\n\t }\n\n \t var urlString = imageStreamURL\n \t\t+ \"?mapcenterx=\" + centerX + \"&mapcentery=\" + centerY\n \t\t+ \"&geocenterx=\" + geoCenterX + \"&geocentery=\" + geoCenterY\n \t\t+ \"&endlinex=&endliney=&scale=\" + scale\n \t\t+ \"&width=\" + imgWidth + \"&height=\" + imgHeight + \"&showPinpoint=\" + fShowPinpoint\n \t\t+ \"&resellerid=\" + resellerId\n \t\t+ \"&layers=\"\n \t\t\t+ fMCities\n \t\t\t+ fMHighways\n \t\t\t+ fStreets\n \t\t\t+ fRoads\n \t\t\t+ fRoadNames;\n\n for (ii=0; ii< covcheckboxes.length; ii++)\n {\n\t\t\turlString += \"&\" + covcheckboxes[ii] + \"=\" + ( document.getElementById(covcheckboxes[ii]).checked ? \"Y\" : \"N\" );\n \t }\n\n\treturn urlString;\n}", "function onMapClick(e) {\n lat = e.latlng.lat.toFixed(4);\n long = e.latlng.lng.toFixed(4);\n //After each click, we update the Request URL.\n q_val = `${lat},${long}`;\n req_url = base_url + api_type + '?key=' + api_key + '&q=' + q_val;\n /*\n console.log(e.latlng.lat, e.latlng.lng);\n console.log(req_url);\n */\n getWeather(req_url);\n}", "function getStationsUrl(ext) {\r\n //attr = $(\"#attr\").val();\r\n var url = baseERDDAP;\r\n url += ext+'?station,time,'+attr\r\n \r\n if (($(\"#onlyQC\").prop('checked')) && (flagsArr.indexOf(attr) > -1)) {\r\n url += '&'+attr+'_flagPrimary=1';\r\n }\r\n //url += appendTime;\r\n url += timeUrl();\r\n return url;\r\n}", "function mapFunctionDisplay(x, y, add) {\n// body...\nrequire([\n\"esri/Map\",\n\"esri/views/MapView\",\n\"esri/widgets/Search\",\n\"esri/layers/FeatureLayer\",\n\"esri/Graphic\",\n\"esri/layers/GraphicsLayer\",\n\"esri/geometry/Point\",\n\"esri/symbols/SimpleMarkerSymbol\",\n\"dojo/domReady!\"\n], function(Map, MapView, Search, FeatureLayer, Graphic, GraphicsLayer, Point, SimpleMarkerSymbol) {\nvar map = new Map({\n smartNavigation: false,\n basemap: \"dark-gray-vector\"\n});\n\n map.on(\"load\", function() {\n console.log('')\n });\n// Add the layer to the map\nvar trailsLayer = new FeatureLayer({\n url: \"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0\",\n});\n\nmap.add(trailsLayer); // Optionally add layer to map\n\nvar view = new MapView({\n container: \"viewDiv\",\n center: [-98.35, 39.50],\n map: map,\n zoom: 3\n});\n// Search\nvar search = new Search({\n view: view\n});\nsearch.defaultSource.withinViewEnabled = true; // Limit search to visible map area only\nview.ui.add(search, \"top-right\"); // Add to the map\n// Add the trailheads as a search source\n// search.sources.push({\n// featureLayer: trailsLayer,\n// searchFields: [\"TRL_NAME\"],\n// displayField: \"TRL_NAME\",\n// exactMatch: false,\n// outFields: [\"TRL_NAME\", \"PARK_NAME\"],\n// resultGraphicEnabled: true,\n// name: \"Trailheads\",\n// placeholder: \"Santa\",\n// });\n// Find address\nfunction showPopup(address, pt) {\n view.popup.open({\n title: \"Find Address Result\",\n content: address + \"<br><br> Lat: \" + Math.round(pt.latitude * 100000)/100000 + \" Lon: \" + Math.round(pt.longitude * 100000)/100000,\n location: pt\n });\n}\n// view.on(\"click\", function(evt){\n// search.clear();\n// view.popup.clear();\n// var locatorSource = search.defaultSource;\n// locatorSource.locator.locationToAddress(evt.mapPoint)\n// .then(function(response) {\n// var address = response.address.Match_addr;\n// // Show the address found\n// showPopup(address, evt.mapPoint);\n// }, function(err) {\n// // Show no address found\n// showPopup(\"No address found for this location.\", evt.mapPoint);\n// });\n// });\nvar graphicsLayer = new GraphicsLayer();\n map.add(graphicsLayer);\n /*************************\n * Add a 3D point graphic\n *************************/\n // London\n var point = new Point({\n\n }),\n markerSymbol = new SimpleMarkerSymbol({\n color: [226, 119, 40],\n outline: { // autocasts as new SimpleLineSymbol()\n color: [255, 255, 255],\n width: 2\n }\n });\n var pointGraphic = new Graphic({\n\n symbol: markerSymbol\n });\n graphicsLayer.add(pointGraphic);\n})\n}", "function makeMapUrl (lat, lon) {\n var ZOOM = \"12z\";\n var degMinSec = getDegMinSec(lat, \"lat\") + \"+\" + getDegMinSec(lon, \"lon\");\n return 'https://www.google.com/maps/place/' + degMinSec + '/@' + lat + ',' + lon + ',' + ZOOM;\n }", "function makeMapUrl (lat, lon) {\n var ZOOM = \"12z\";\n var degMinSec = getDegMinSec(lat, \"lat\") + \"+\" + getDegMinSec(lon, \"lon\");\n return 'https://www.google.com/maps/place/' + degMinSec + '/@' + lat + ',' + lon + ',' + ZOOM;\n }", "function makeLink() {\n// var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n/*\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf('/')+1)\n + \"?lat=\" + mapProfile.getCenter().lat().toFixed(6)\n + \"&lng=\" + mapProfile.getCenter().lng().toFixed(6)\n + \"&zoom=\" + mapProfile.getZoom()\n + \"&type=\" + MapTypeId2UrlValue(mapProfile.getMapTypeId());\n if (filename != \"FlightAware_JBU670_KLAX_KJFK_20120229_kml.xml\") a += \"&filename=\"+filename;\n document.getElementById(\"link\").innerHTML = '<a href=\"' +a+ '\">Link to this page<\\/a>';\n*/\n }", "function showCurrentLocation(request, featureId, layername, point) {\n\t\t\t//IE doesn't know responseXML, it can only provide text that has to be parsed to XML...\n\t\t\tvar results = request.responseXML ? request.responseXML : util.parseStringToDOM(request.responseText);\n\n\t\t\tvar resultContainer = $('#geolocationResult');\n\t\t\tresultContainer.empty();\n\n\t\t\tvar addressResult = util.getElementsByTagNameNS(results, namespaces.xls, 'Address');\n\t\t\taddressResult = addressResult ? addressResult[0] : null;\n\t\t\tvar address = util.parseAddress(addressResult);\n\n\t\t\t//use as waypoint button\n\t\t\tvar useAsWaypointButton = new Element('span', {\n\t\t\t\t'class' : 'clickable useAsWaypoint',\n\t\t\t\t'title' : 'use as waypoint',\n\t\t\t\t'id' : featureId,\n\t\t\t\t'data-position' : point.x + ' ' + point.y,\n\t\t\t\t'data-layer' : layername\n\t\t\t});\n\t\t\taddress.insert(useAsWaypointButton);\n\n\t\t\t//set data-attributes\n\t\t\taddress.setAttribute('data-layer', layername);\n\t\t\taddress.setAttribute('id', featureId);\n\t\t\taddress.setAttribute('data-position', point.x + ' ' + point.y);\n\n\t\t\tresultContainer.append(address);\n\n\t\t\t//event handling\n\t\t\t$('.address').mouseover(handleMouseOverElement);\n\t\t\t$('.address').mouseout(handleMouseOutElement);\n\t\t\t$('.address').click(handleSearchResultClick);\n\t\t\t$('.useAsWaypoint').click(handleUseAsWaypoint);\n\t\t}", "function getInfo(point, callback) {\n var url = $.StringFormat('api/Map/GetRegionByPoint/{0}/{1}/{2}',\n 1, point[0], point[1]);\n url = getUrl(url);\n var url = getUrl(url);\n serviceInvoker.get(url, {}, {\n success: function (response) {\n callback(response)\n }\n }, null, true, true);\n }", "function pushURL() {\n var baseUrl = location.protocol + \"//\" + location.host + location.pathname;\n\n var searchParams = new URLSearchParams();\n\n mapX = map.getView().getCenter()[0];\n mapY = map.getView().getCenter()[1];\n mapZoom = map.getView().getZoom();\n\n searchParams.set(\"x\", mapX);\n searchParams.set(\"y\", mapY);\n if (mapZoom != undefined) {\n searchParams.set(\"zoom\", mapZoom);\n }\n if (mapCX != undefined) {\n searchParams.set(\"cx\", mapCX);\n }\n if (mapCY != undefined) {\n searchParams.set(\"cy\", mapCY);\n }\n searchParams.set(\"formula\", mapLayer);\n searchParams.set(\"style\", mapStyle);\n\n var parameter = \"?\" + searchParams.toString();\n\n var url = baseUrl + parameter;\n\n window.history.pushState({}, window.title, url);\n}", "function _trigStartGetInfoRequest(layersToRequest) {\n var responseFeatureCollections = _createResponseFeatureCollections(layersToRequest);\n eventHandler.TriggerEvent(ISY.Events.EventTypes.FeatureInfoStart, responseFeatureCollections);\n }", "function onConstructWeatherUrl(location, withLatLong = false) {\n let params = {};\n if(withLatLong) {\n params = {\n lat: location.latitude,\n lon: location.longitude,\n APPID: process.env.API_KEY,\n units: process.env.TEMPERATURE_UNIT\n }; \n } else {\n params = {\n q: location,\n APPID: process.env.API_KEY,\n units: process.env.TEMPERATURE_UNIT\n }; \n }\n let query = Object.keys(params)\n .map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k]))\n .join('&');\n return query; \n}", "function landCustomGetTileUrl(pos, zoom) \n{\n var sl_zoom = slConvertGMapZoomToSLZoom(zoom);\n\n var regions_per_tile_edge = Math.pow(2, sl_zoom - 1);\n \n var x = pos.x * regions_per_tile_edge;\n var y = pos.y * regions_per_tile_edge;\n\n // Adjust Y axis flip location by zoom value, in case the size of the whole\n // world is not divisible by powers-of-two.\n var offset = slGridEdgeSizeInRegions;\n offset -= offset % regions_per_tile_edge;\n y = offset - y;\n\n // Google tiles are named (numbered) based on top-left corner, but ours\n // are named by lower-left corner. Since we flipped in Y, correct the\n // name. JC\n y -= regions_per_tile_edge;\n \n // We name our tiles based on the grid_x, grid_y of the region in the\n // lower-left corner.\n x -= x % regions_per_tile_edge;\n y -= y % regions_per_tile_edge; \n\n // Pick a server\n \n if (((x / regions_per_tile_edge) % 2) == 1)\n var host_name = slTileHost1;\n else\n var host_name = slTileHost2; \n\n // Get image tiles from Amazon S3\n f = host_name + \"/map-\" + sl_zoom + \"-\" + x + \"-\" + y + \"-objects.jpg\";\n return f;\n}", "async function urlFromOrgId (client, serverNumber, orgId, layerName) {\n const url = `https://services${serverNumber}.arcgis.com/${orgId}/arcgis/rest/services/${layerName}/FeatureServer/0?f=json`\n let { body } = await client( { url } )\n body = JSON.parse(`[${body}]`)\n const { serviceItemId } = body[0]\n let ret = `https://opendata.arcgis.com/datasets/${serviceItemId}_0.csv`\n console.log(`Calling ${ret}`)\n return ret\n}", "function getLinkInfo(){\n console.log(\"Triggerring PDE LinkInfo call for layer: \"+layerSelected);\n var includeStabTopo = (document.getElementById('includeStabTopo').checked) ? \"&link2stabletopologyid=1\" : \"\";\n var url = [pdeURL,'tiles.json?layers=',linkInfoLayers.join(),\n '&levels=',levels.join(),\n '&tilexy=',tileXY.join(),\n '&app_id=',\n app_id,\n '&app_code=',\n app_code,\n \"&callback=processLinkInfoResponse\",\n includeStabTopo\n ].join('');\n // Send request.\n script = document.createElement(\"script\");\n script.src = url;\n document.body.appendChild(script);\n Spinner.showSpinner();\n}", "function openLayersInit(bounds, baseLayer, printView) {\n // registering ajax history...\n if (kiezatlas.historyApiSupported) {\n window.addEventListener(\"popstate\", function(e) {\n // Note: state is null if a) this is the initial popstate event or\n // b) if back is pressed while the begin of history is reached.\n if (e.state) {\n kiezatlas.pop_history(e.state);\n }\n });\n }\n if (onBerlinDe) {\n // SERVER_URL = \"http://localhost:8080/kiezatlas\";\n // SERVER_URL = \"http://212.87.44.116:8080\";\n baseUrl = SERVER_URL + \"/atlas/\";\n SERVICE_URL = baseUrl + \"rpc/\";\n }\n // General Map Options\n // OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;\n var options = {\n projection: new OpenLayers.Projection(\"EPSG:900913\"),\n displayProjection: new OpenLayers.Projection(\"EPSG:4326\"), units: \"m\",\n maxResolution: 156543.0339, numZoomLevels: 18 // to initialize map without controls controls: []\n // maxExtent: openBounds // an internal error occurs when using OpenStreetMap BaseLayer togegher with maxExtent\n };\n map = new OpenLayers.Map('map', options);\n // ### Note that TMS-Layers have different projections\n // var mapnik = new OpenLayers.Layer.TMS(\"OpenStreetMap\", \"http://tah.openstreetmap.org/Tiles/tile/\", {\n // BaseLayer\n var mapnik = new OpenLayers.Layer.OSM(\"OpenStreetMap\", \"http://b.tile.openstreetmap.de/tiles/osmde/\", {\n type: 'png', getURL: osm_getTileURL, displayOutsideMaxExtent: false,\n attribution: 'Tile server sponsored by STRATO / <b>Europe only</b> / <a href=\"http://www.openstreetmap.de/germanstyle.html\">About style</a>',\n maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)\n });\n // <iframe width='500' height='300' frameBorder='0' src='http://a.tiles.mapbox.com/v3/kiezatlas.map-feifsq6f.html#3/0/0'></iframe>\n var mapbox = new OpenLayers.Layer.XYZ(\"MapBox Streets\",\n [\n \"http://a.tiles.mapbox.com/v3/kiezatlas.map-feifsq6f/${z}/${x}/${y}.png\",\n \"http://b.tiles.mapbox.com/v3/kiezatlas.map-feifsq6f/${z}/${x}/${y}.png\",\n \"http://c.tiles.mapbox.com/v3/kiezatlas.map-feifsq6f/${z}/${x}/${y}.png\",\n \"http://d.tiles.mapbox.com/v3/kiezatlas.map-feifsq6f/${z}/${x}/${y}.png\"\n ], {\n attribution: \"Tiles &copy; <a href='http://mapbox.com/'>MapBox</a> | \" +\n \"Data &copy; <a href='http://www.openstreetmap.org/'>OpenStreetMap</a> \" +\n \"and contributors, CC-BY-SA\",\n sphericalMercator: true,\n wrapDateLine: true,\n transitionEffect: \"resize\",\n buffer: 1,\n numZoomLevels: 17\n }\n );\n /** Backup of old MapServer Configuration..\n var mapnik = new OpenLayers.Layer.TMS(\"OpenStreetMap\", \"http://tile.openstreetmap.org/\", {\n type: 'png', getURL: osm_getTileURL, displayOutsideMaxExtent: false,\n attribution: '<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a>',\n maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)\n // note: maxExtent error, this bounds cannot be smaller than the whole world, otherwise projection error occurs ??\n }); **/\n\n if (baseLayer == \"osm\") {\n map.addLayers([ mapnik ]); // googleBaseLayer\n } else {\n //\n /** var googleBaseLayer = new OpenLayers.Layer.Google(\"Google Streets\", { numZoomLevels: 25, animationEnabled: true,\n // sphericalMercator:true, << obsolete maxExtent: openBounds, << cannot be set..\n termsOfUse: jQuery(\"#kafooter\").get(0), poweredBy: jQuery(\"#kafooter\").get(0) googleBaseLayer,\n }); **/\n map.addLayers([ mapnik, mapbox ]);\n }\n\n jQuery(\"#moreLabel\").click(clickOnMore);\n // layerSwitcher, NavigationHistory, Panel\n map.zoomToExtent(bounds.transform(map.displayProjection, map.getProjectionObject()));\n // if (onBerlinDe) { map.zoomTo(LEVEL_OF_CITY_ZOOM); }\n if (!printView) {\n // MapControl Setup\n // nav = new OpenLayers.Control.NavigationHistory();\n myLayerSwitcher = OpenLayers.Control.CustomLayerSwitcher = OpenLayers.Class(OpenLayers.Control.LayerSwitcher, {\n CLASS_NAME: \"OpenLayers.Control.CustomLayerSwitcher\"\n });\n // a parental control must be added to the map\n // map.addControl(nav);\n //\n // panel = new OpenLayers.Control.Panel( {div: document.getElementById(\"navPanel\"), zoomWorldIcon: false });\n // panel = new OpenLayers.Control.PanPanel( { \"zoomWorldIcon\": false, \"zoomStopHeight\": 4, \"panIcons\": true});\n myLayerSwitcher = new OpenLayers.Control.LayerSwitcher({\n 'div':OpenLayers.Util.getElement('mapSwitcher'), activeColor: \"white\"\n });\n zoomBox = new OpenLayers.Control.ZoomBox();\n // but here, we remove the default panzoom control again\n var controls = map.getControlsByClass(\"OpenLayers.Control.PanZoom\");\n map.removeControl(controls[0]);\n //\n map.addControl(myLayerSwitcher);\n map.addControl(zoomBox);\n // map.addControl(panel);\n reSetMarkers();\n }\n }", "getGoogleMapsImageUrl(latitude, longitude){\n let zoomLevel = 3;\n let size = \"175x150\";\n let mapType = \"roadmap\";\n let googleMapAPIKey = \"AIzaSyDvYQZRLnesuRRp07bu9qlbL7XJ_TkBYNU\";\n\n return `https://maps.googleapis.com/maps/api/staticmap?zoom=${zoomLevel}&size=${size}&maptype=${mapType}&markers=${latitude},${longitude}&key=${googleMapAPIKey}`;\n }", "function toQueryString(map) {\n let str = '';\n if (map) {\n for (const key in map) {\n if (map.hasOwnProperty(key) && map[key] !== undefined && map[key] !== null) {\n str += `${(str ? '&' : '')}${key}=${map[key]}`;\n }\n }\n }\n return str;\n}", "function LoadLegendSiFlore(url,LayerName) {//caution with the quotes in the LayerName\n $('#legendFondsCarte').append('<img class=\"fondLegend\" lay=\"'+LayerName+'\" src=\"'+url+'&LAYERS=' + encodeURI(LayerName) + '&TRANSPARENT=FALSE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&FORMAT=image%2Fpng&LEGEND_OPTIONS=forceLabels%3Aon&SCALE=800000000000\"/>');\n}", "function OnClickMap(e) {\n window.centerLat = parseFloat(e.location.lat);\n window.centerLng = parseFloat(e.location.lng);\n CreateURI(centerLat, centerLng);\n} // OnClickMap", "function generateURL(searchParams) {\n let searchParamString = \"\";\n for (let key in searchParams) {\n // skip loop if the property is from prototype\n if (!searchParams.hasOwnProperty(key)) continue;\n if (searchParams[key].length === 0) continue;\n searchParamString = searchParamString + key + \"=\" + searchParams[key] + \"&\"\n }\n // remove the last &\n searchParamString = searchParamString.slice(0, -1);\n return (\"https://data.kingcounty.gov/resource/gkhn-e8mn.json?\" + searchParamString);\n }", "function getMethodAndLocationQueryStringFragment() {\n\tvar location = getLocation();\n\tif (isValidPostalCode(location)) {\n\t\treturn \"&op=performancesbypostalcodesearch&postalcode=\" + location;\n\t} else {\n\t\tvar index = location.indexOf(\",\");\n\t\tvar city = Utils.trimWhiteSpace(location.substring(0, index));\n\t\tvar state = location.substring(index+1);\n\t\tif (state && state.length) {\n\t\t\tstate = Utils.trimWhiteSpace(state);\n\t\t} else {\n\t\t\tstate = \"\";\n\t\t}\n\t\treturn \"&op=performancesbycitystatesearch&city=\" + city + \"&state=\" + state;\n\t}\n}", "function constructGetAreaParams() {\n var queryParams = '<?xml version=\"1.0\" encoding=\"utf-8\"?>';\n queryParams += '<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">';\n queryParams += '<soap:Body>';\n queryParams += '<GetAreas xmlns=\"http://tempuri.org/\" />';\n queryParams += '</soap:Body>';\n queryParams += '</soap:Envelope>';\n return queryParams;\n}", "function assembleQueryURL() {\n\n // Store the location of the truck in a variable called coordinates\n var coordinates = [truckLocation];\n var distributions = [];\n keepTrack = [truckLocation];\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(warehouseLocation);\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 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 }", "function gethref(url, params) {\n\tvar paramstr = '?'\n\tfor (var key in params) {\n\t\tconsole.log(key)\n\t\tparamstr += key + '=' + (params[key]? params[key] : '') + '&'\n\t}\n\tparamstr = paramstr.slice(0, paramstr.length - 1)\n\treturn url + paramstr;\n}", "function getUrlParas() \n{ \n\tvar url_lat = null, \n \turl_lon = null, \n \turl_res = null, \n \turl_level = null, \n \turl_address = null, \n \turl_panel = null, \n \turl_panel_hide = null, \n \turl_legend = null, \n \turl_type = null, \n \turl_debug = null, \n\t\turl_tflogo = null; \n\t \n\turl = document.location.href; \n\tdebug(url); \n\tvar paraStr = null; \n\tif (url.indexOf(\"#\") != -1) { \n\t\tparaStr = url.substring(url.indexOf(\"#\") + 1); \n\t} \n\telse { \n\t\tparaStr = url.substring(url.indexOf(\"?\") + 1); \n\t} \n\tdebug(paraStr); \n\tvar queryStr = \"&\" + paraStr; \n\turl_lat = queryStr.getQueryString(\"lat\"); \n\turl_lon = queryStr.getQueryString(\"lon\"); \n\turl_res = queryStr.getQueryString(\"res\"); \n\turl_level = parseInt(queryStr.getQueryString(\"lvl\")); \n\turl_address = unescape(queryStr.getQueryString(\"address\")).replace(/\\+/g, \" \"); \n\turl_panel = queryStr.getQueryString(\"panels\"); \n\turl_panel_hide = queryStr.getQueryString(\"!panels\"); \n\turl_legend = queryStr.getQueryString(\"legend\"); \n\turl_type = queryStr.getQueryString(\"type\"); \n\turl_debug = queryStr.getQueryString(\"debug\"); \n\turl_tflogo = queryStr.getQueryString(\"tflogo\"); \n\turl_engine = queryStr.getQueryString(\"fmap\"); \n \n\tvar center = null \n\tcenter = queryStr.getQueryString(\"cen\").split(','); \n \n\turl_lat = parseFloat(center[0]); \n\turl_lon = parseFloat(center[1]); \n\t \n\tg_lat = (!url_lat ?g_lat:url_lat); \n\tg_lon = (!url_lon ?g_lon:url_lon); \n\tg_res = (!url_res ?g_res:url_res); \n\tg_level = (!url_level ?g_level:url_level); \n\tg_address = (!url_address ?g_address:url_level); \n\tg_panel = (!url_panel?g_panel:url_panel); \n\tg_panel_hide = (!url_panel_hide?g_panel_hide:url_panel_hide); \n\tg_legend = (!url_legend?g_legend:url_legend); \n\tg_type = (!url_type?g_type:url_type); \n\tg_debug = (!url_debug?g_debug:url_debug); \n\tg_tflogo = (url_tflogo==\"1\"?true:false); \n\tg_engine = (!url_engine?g_engine:url_engine); \n}", "function createInfoWindow (marker){\n // Create the InfoWindow\n var infoWindow = new google.maps.InfoWindow();\n // Create StreetViewService to show a street view window for marker location or nearest places within 50 meter\n var StreetViewService = new google.maps.StreetViewService();\n var radius = 50;\n //Create an onclick event listener to open\n marker.addListener('click', function(){\n infoWindow.marker = marker;\n infoWindow.setContent('<div Id=\"infoWindowDiv\"><h5>' + marker.title +'</h5></div>');\n\n //** One options to be displayed in InfoWindow **//\n /* 1) Displaying Wikipedia articals: */\n var wikiURL = 'http://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title + '&format=json&callback=wikiCallback';\n var wikiRequestTimeout = setTimeout(function() {\n alert(\"failed to load wikipedia resources\");\n }, 8000);\n $.ajax({\n url: wikiURL,\n dataType: \"jsonp\",\n success: function(response) {\n var articalsList = response[1];\n var atricalTitle ;\n $('#infoWindowDiv').append('<div Id=\"wikiDiv\"><ul id=\"wikiListItem\"></ul></div>');\n for (var i = 0 , length = articalsList.length; i < length && i < 4 ; i++ ){\n atricalTitle = articalsList[i];\n $('#wikiListItem').append('<li><a href=\"http://en.wikipedia.org/wiki/'+atricalTitle+'\">'+atricalTitle+'</a></li>');\n }\n clearTimeout(wikiRequestTimeout);\n },\n });\n infoWindow.open(map, marker);\n });\n\n\n //** Other options to be displayed in InfoWindow **//\n /* 2) Displaying an Image usign URL parameters: (Note: Not working well for some reasons)\n -------> Should be placed before infoWindow.Open()\n\n $('#pano').append('<img src= https://maps.googleapis.com/maps/api/streetview?'+\n 'size=200x150&location='+marker.position+'&heading=151.78&pitch=-0.76'+\n '&key=AIzaSyBpcOjPqBYX5nfyfSKIUp3NXwUIiQHP0lQ></img>'); */\n\n /* 3) Displaying an Street view object: (Note: Not working well for some reasons)\n -------> Should be placed before infoWindow.Open()\n StreetViewService.getPanoramaByLocation(marker.position, radius, getViewStreet);\n function getViewStreet(data, status){\n if (status === 'Ok'){\n infoWindow.setContent('<div><h5>' + marker.title +'</h5><div Id=\"pano\"></div></div>');\n var nearViewStreetLocation = data.location.latLng;\n var heading = google.map.geometry.spherical.computeHeading(nearViewStreetLocation, marker.position);\n var panoramaOptions = {\n position : nearViewStreetLocation,\n pov :{ heading: heading, pitch: 30 }\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'),panoramaOptions);\n map.setStreetView(panorama);\n }\n else{\n infoWindow.setContent('<div><h5>' + marker.title +'</h5><div>No Street View Found</div></div>');\n }\n }*/\n\n }", "function DisplayGEOJsonLayers(){\n map.addLayer({ \n //photos layer\n \"id\": \"photos\",\n \"type\": \"symbol\",\n \"source\": \"Scotland-Foto\",\n \"layout\": {\n \"icon-image\": \"CustomPhoto\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg'); // Place polygon under this labels.\n\n map.addLayer({ \n //selected rout section layer\n \"id\": \"routes-today\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'housenum-label'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"routes\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(120, 180, 244, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"routes-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'routes'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"walked\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(80, 200, 50, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"walked-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'walked'); // Place polygon under this labels.\n\n map.addLayer({\n \"id\": \"SelectedMapLocationLayer\",\n \"type\": \"symbol\",\n \"source\": \"SelectedMapLocationSource\",\n \"layout\": {\n \"icon-image\": \"CustomPhotoSelected\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg');\n //ClickbleMapItemCursor(); //Now that the layers a loaded, have the mouse cursor change when hovering some of the layers\n NewSelectedMapLocation();\n\n}", "function buildQueryURL() {\n // if(queryParams != '') {\n // queryURL is the url we'll use to query the API\n var queryParams = $(\"#countryInput\").val();\n\n // var queryURL = \"https://coronavirus-tracker-api.herokuapp.com/v2/locations?source=jhu&timelines=true&country=\";\n var queryURL = \"https://covid-19.dataflowkit.com/v1/\";\n\n\n\n // console.log(queryParams)\n return queryURL + queryParams;\n\n // }else{\n // $(\"#error\").html('Field cannot be empty');\n // }\n }", "function url(x, y, z) {\n return `https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/${z}/${x}/${y}${devicePixelRatio > 1 ? \"@2x\" : \"\"}?access_token=pk.eyJ1IjoicGF3YXJvIiwiYSI6ImNramI5NDIyMDdqMGYydnBkeGVrcGNydDUifQ.k7aT1uH2iIZEAnUC38-QJw`\n }", "function constructGetLocationByAreaParams(areaName) {\n var queryParams = '<?xml version=\"1.0\" encoding=\"utf-8\"?>';\n queryParams += '<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">';\n queryParams += '<soap:Body>';\n queryParams += '<GetLocationByAreas xmlns=\"http://tempuri.org/\">';\n queryParams += '<areaName>' + areaName + '</areaName>';\n queryParams += '</GetLocationByAreas>';\n queryParams += '</soap:Body>';\n queryParams += '</soap:Envelope>';\n return queryParams;\n\n}", "function makeWMSchart(event, lyrName) {\r\n\tif (event.request.status == 200){\r\n\t\tvar doc = event.request.responseXML;\r\n if (event.request.responseText.match(/ServiceException/g)) {\r\n chartError(\"Error: WMS getFeatureInfo ServiceException\");\r\n } else {\t\t\r\n \t\tmakeXMLChart(doc, lyrName);\r\n \t}\r\n\t} \r\n\telse { \r\n\t\tchartBusyDone();\r\n\t\tconsole.log(event);\r\n\t\tchartError(\"Error: WMS get feature info\");\r\n\t}\r\n}", "function geocodeQueryBuild(selText) {\n var queryURL = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + selText + \"&key=\" + googleapiKey;\n return queryURL;\n }", "function definePopup(evt, layerInfo, features, wmsLayers, count, id){\n var data = '';\n if(layerInfo.length === 1){\n if(count < 2) {\n if(features[layerInfo+'0'] !== undefined) {\n queries[id] = [evt.coordinate, layerInfo, features[layerInfo + '0']];\n displaySimplePopup(id);\n }else{\n var url = wmsLayers[layerInfo].getSource().getGetFeatureInfoUrl(evt.coordinate,\n GlobalMap.getView().getResolution(),\n GlobalMap.getView().getProjection(),\n {'INFO_FORMAT': 'text/javascript'});\n $.ajax({\n url: url,\n dataType: 'jsonp',\n jsonpCallback: 'parseResponse',\n success: function (data) {\n if(dataJson === null) {\n dataJson = data;\n setTimeout(definePopup(evt, layerInfo, features, wmsLayers, count, id), 1000);\n }\n }\n });\n if(dataJson !== null) {\n var feature;\n if (wmsLayers[layerInfo].getSource().coordKeyPrefix_.indexOf('geoserver') > -1) {\n feature = geoJsonFormat.readFeatures(dataJson)[0];\n }else{\n feature = esriJsonFormat.readFeatures(dataJson)[0];\n }\n queries[id] = [evt.coordinate, layerInfo, feature];\n displaySimplePopup(id);\n }\n }\n }else{\n for(var i = 0; i < count; i++){\n queries[id] = [evt.coordinate, layerInfo, features[layerInfo+i]];\n data = data + popupForm.definePopupMultiForm(layerInfo, id, features[layerInfo+i].get(queryData[layerInfo][1]), evt);\n id++;\n }\n popupForm.displayPopupForm(overlay, evt.coordinate, data);\n }\n }else if(layerInfo.length > 1){\n for (var l = 0; l < layerInfo.length; l++) {\n if(wmsLayers[layerInfo[l]] !== null && wmsLayers[layerInfo[l]] !== undefined){\n var urlWms = wmsLayers[layerInfo[l]].getSource().getGetFeatureInfoUrl(evt.coordinate,\n GlobalMap.getView().getResolution(),\n GlobalMap.getView().getProjection(),\n {'INFO_FORMAT': 'text/javascript'});\n $.ajax({\n url: urlWms,\n dataType: 'jsonp',\n jsonpCallback: 'parseResponse',\n success: function (data) {\n if(dataJson === null) {\n dataJson = data;\n setTimeout(definePopup(evt, layerInfo, features, wmsLayers, count, id), 1000);\n }\n }\n });\n if(dataJson !== null) {\n var featureWms;\n if (wmsLayers[layerInfo[l]].getSource().coordKeyPrefix_.indexOf('geoserver') > -1) {\n featureWms = geoJsonFormat.readFeatures(dataJson)[0];\n }else{\n featureWms = esriJsonFormat.readFeatures(dataJson)[0];\n }\n queries[id] = [evt.coordinate, layerInfo, featureWms];\n queries[id] = [evt.coordinate, layerInfo[l], featureWms];\n data = data + popupForm.definePopupMultiForm(layerInfo[l], id, featureWms.get(queryData[layerInfo[l]][1]), evt);\n id++;\n }\n }else{\n for(var m = 0; m < count; m++){\n if(features[layerInfo[l]+m] !== null && features[layerInfo[l]+m] !== undefined){\n var queryFeature = features[layerInfo[l]+m];\n queries[id] = [evt.coordinate, layerInfo[l], queryFeature];\n data = data + popupForm.definePopupMultiForm(layerInfo[l], id, queryFeature.get(queryData[layerInfo[l]][1]), evt);\n id++;\n }\n }\n }\n }\n popupForm.displayPopupForm(overlay, evt.coordinate, data);\n }\n }", "static getRequestURL() {\n return `${process.env.REACT_APP_GEOSERVER_URL}`;\n }", "function getGeoserverMiniatura(denuncia, width){\n\n\tconsole.log(denuncia);\n\t\n\ttipo = denuncia.geometria.type;\n\tcoords = denuncia.geometria.coordinates;\n\t//alert(coords + ' ' + tipo);\n\tvar extension = [];\n\tvar tabla = '';\n\tif(tipo == 'Point'){\n\t\textension = new ol.geom.Point(coords).getExtent();\n\t\ttabla = 'denuncias_puntos';\n\t}\n\tif(tipo == 'LineString'){\n\t\textension = new ol.geom.LineString(coords).getExtent();\n\t\ttabla = 'denuncias_lineas';\n\t}\n\tif(tipo == 'Polygon'){\n\t\textension = new ol.geom.Polygon(coords).getExtent();\n\t\ttabla = 'denuncias_poligonos';\n\t}\n\t//alert(extension);\n\textension[0] = extension[0] - 0.001; //Xmin\n\textension[1] = extension[1] - 0.001; //Ymin\n\textension[2] = extension[2] + 0.001; //Xmax\n\textension[3] = extension[3] + 0.001; //Ymax\n\t\t\n\tvar dif = Math.abs(extension[2] - extension[0]) / Math.abs(extension[3] - extension[1]) ;\n\tvar height = Math.round(width / dif);\n\t//alert(ip);\n\treturn ip + \"/geoserver/jahr/wms?service=WMS&version=1.1.0&request=GetMap\" +\n\t\t\"&layers=jahr:OI.OrthoimageCoverage,jahr:\" + tabla + \"&styles=&bbox=\" + \n\t\textension + \"&width=\" + width + \"&height=\" + height + \n\t\t\"&srs=EPSG:4258&format=image/png&cql_filter=1=1;gid='\" + denuncia.gid + \"'\";\n\n}", "function getInfo(location) {\n var homePage;\n var hereNow;\n var htmlStr;\n var menuLink;\n var title = location.name();\n var type = location.fourSqInfo.categories[0].shortName;\n\n if (location.fourSqInfo.menu) {\n menuLink = location.fourSqInfo.menu.url;\n }\n\n hereNow = location.fourSqInfo.hereNow.summary;\n homePage = location.fourSqInfo.url;\n\n htmlStr = \"\";\n\n if (title) {\n htmlStr = htmlStr.concat(\"<h3>\" + title + \"</h3>\");\n }\n if (type) {\n htmlStr = htmlStr.concat(\"<p>\" + type + \"</p>\");\n }\n if (homePage) {\n htmlStr = htmlStr.concat(\"<a href='\" + homePage + \"'>Website</a>\");\n }\n if (homePage && menuLink) {\n htmlStr = htmlStr.concat(\" and \");\n }\n if (menuLink) {\n htmlStr = htmlStr.concat(\"<a href='\" + menuLink + \"'>Menu</a>\");\n }\n if (hereNow) {\n htmlStr = htmlStr.concat(\"<p>\" + hereNow + \"</p>\");\n }\n htmlStr = htmlStr.concat(\"<p> Info provided by Foursquare </p>\");\n return htmlStr;\n}", "function getLatLngString(startLat, startLng, endLat, endLng) {\n return startLat + ',' + startLng + ';' + endLat + ',' + endLng;\n}", "function generateInfoBox()\n{\n\tvar out = '<a href=\"' + url + '\" class=\"gmap-title\">' + title + '</a><div class=\"gmap-description\">' + description + '</div>';\n\n\tif ('undefined' != typeof address)\n\t{\n\t\tout += '<div class=\"gmap-address\">' + address + ', ' + city + ', ' + state + ', ' + zip + '</div>';\n\t}\n\n\treturn out;\n}", "function api_query(src, params, callback) {\n var url = '';\n if (src === 1) {\n url = 'http://services.arcgis.com/VTyQ9soqVukalItT/arcgis/rest/services/MultiFamilyProperties/FeatureServer/0/query?';\n }\n params['f'] = 'geojson';\n var param_string = JSON.stringify(params);\n var options = {\n host: url,\n path: param_string\n };\n http.request(options, function(response) {\n var str = ''\n response.on('data', function (chunk) {\n str += chunk;\n });\n\n response.on('end', function () {\n callback(str);\n });\n });\n}", "function xyz_getTileURL(bounds) {\n\tvar res = this.map.getResolution();\n\tvar x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));\n\tvar y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));\n\tvar z = this.map.getZoom();\n\t\n\tif (this.map.baseLayer.name == 'Bing Roads' || this.map.baseLayer.name == 'Bing Aerial' || this.map.baseLayer.name == 'Bing Aerial With Labels') {\n\t z = z + 1;\n\t}\n\t\n\tvar limit = Math.pow(2, z);\n\tconsole.log(\"xyz: \"+ this.url + z + \"/\" + x + \"/\" + y + \".\" + this.type);\n\t x = ((x % limit) + limit) % limit;\n\t y = Math.pow(2,z) - y - 1;\n\t return this.url + z + \"/\" + x + \"/\" + y + \".\" + this.type;\n}", "function activateAddLayerUrl(options) {\n mapImplementation.ActivateAddLayerUrl(options);\n }", "function returnZoomParamsHtml(zp, infoWin) {\r\n var infoWin = zp.infoWin;\r\n var allextent = zp.allextent;\r\n var autozoom = zp.autozoom;\r\n var zoomall = zp.zoomall;\r\n var ref2opener = (infoWin != 'window' ? '' : 'opener.');\n if (allextent) PMap.extentSelectedFeatures = allextent;\r\n \r\n var html = '';\r\n if (zoomall) {\r\n var zStr = '<table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" width=\\\"100%\\\"><tr><td class=\\\"zoomlink\\\">';\r\n zStr += \"<a href=\\\"javascript:\";\r\n zStr += ref2opener + 'zoom2extent(0,0,\\'' + allextent + '\\')';\r\n zStr += '\\\"><img src=\\\"images/zoomtoall.gif\\\"alt=\\\"za\\\"></a></td><td class=\\\"TDAL\\\">' + localeList['zoomSelected'] + '</td></tr></table>';\r\n \r\n html += zStr;\r\n }\r\n \r\n // Add image for onload event\r\n var azStr = '<img src=\\\"images/blank.gif\\\" onload=\\\"'; \r\n if (autozoom) {\r\n if (autozoom == 'auto') {\r\n azStr += ref2opener + 'zoom2extent(0,0,\\'' + allextent + '\\');';\r\n } else if (autozoom == 'highlight') {\r\n azStr += ref2opener + 'updateMap(' + ref2opener + 'PM_XAJAX_LOCATION + \\'x_load.php?' + SID + '&mode=map&zoom_type=zoompoint\\', \\'\\')';\r\n }\r\n } else {\r\n azStr += ref2opener + '$(\\'#zoombox\\').hidev();';\r\n }\r\n \r\n azStr += '\\\" />';\r\n html += azStr;\r\n \r\n return html;\r\n}", "function getUrl()\n {\n var version = typeof($.getCMSVersion) === \"function\"?$.getCMSVersion():\"\";\n \n //Build a valid service URL based on the value stored in the delivery\n var url = deliveryServicesURL + \"/perc-comments-services/comment\";\n\n url += \"?site=\" + settings.site;\n if(!isBlank(settings.pagepath))\n url += \"&pagepath=\" + settings.pagepath;\n if(!isBlank(settings.username))\n url += \"&username=\" + settings.username;\n if(!isBlank(settings.sortby))\n {\n url += \"&sortby=\" + settings.sortby;\n url += \"&ascending=\" + settings.ascending;\n }\n if(!isBlank(settings.tag))\n url += \"&tag=\" + settings.tag;\n if(!isBlank(settings.state))\n url += \"&state=\" + settings.state; \n if(!isBlank(settings.moderated))\n url += \"&moderated=\" + settings.moderated;\n if(!isBlank(settings.lastCommentId))\n url += \"&lastCommentId=\" + settings.lastCommentId;\n url += \"&callback=?\"; //must be last\n return url;\n }", "function buildQueryString() {\n\t/* create reference object to store query string parameters*/\n\tlet queryStringObject = {};\n\t/* get all the values from the filters */\n\tqueryStringObject.longitude = $('input[data-coordinates-long]').attr('data-coordinates-long');\n\tqueryStringObject.latitude = $('input[data-coordinates-lat]').attr('data-coordinates-lat');\n\t/* only add optional filters if requested by the user */\n\tif ($('#filter-rooms').val() != '') {\n\t\tqueryStringObject.rooms = $('#filter-rooms').val();\n\t}\n\tif ($('#filter-beds').val() != '') {\n\t\tqueryStringObject.beds = $('#filter-beds').val();\n\t}\n\tif ($('#filter-distance').val() != '') {\n\t\tqueryStringObject.distance = $('#filter-distance').val();\n\t}\n\t/* build string of services in '1,2,3' format*/\n\tqueryStringObject['services'] = '';\n\t$.each($(\"input[name='services']:checked\"), function(){\n\t\tqueryStringObject['services'] += $(this).val() + ',';\n\t});\n\t/* only pass the services key if at least one service is flagged */\n\tif(queryStringObject.services.length == ''){\n\t\tdelete queryStringObject['services'];\n\t}\n\tlet queryString = '?' + $.param(queryStringObject);\n\tcallOwnHouseAPI(queryString)\n}", "function writeResults(){\n\tbounds = map.getBounds();\n\n var html = \"<table class = 'table table-striped'><tr><td><b>Location</b></td><td><b>Inches of snow</b></td></tr>\";\n\n\tmapLayers.forEach(function(item){\n\t\tlayer = item.layer;\n\t\t\tlayer.eachLayer(function(marker){ \n\t\t\t\tif (bounds.contains(marker.getLatLng())) {\n\t\t\t\t\thtml += \"<tr><td>\" + marker.feature.properties.Name + \"</td><td>\" + String(marker.feature.properties.Amount) + \"</td></tr>\";\n\t\t\t\t\t//northeastWeatherStationLayer.addTo(map);\n\t\t\t\t}\n\n\t\t\t});\n\t\t}\n\t);\n\n\thtml += \"</table>\";\n\t\t\t\n\tdocument.getElementById('results').innerHTML = html;\n\n\t$(\"#results\").fadeIn(\"900\");\n}", "function urlMaker() {\n url_string = \"\"\n\n // adding the first character\n url_string = url_string.concat(\"?\")\n\n // concatinating the filternames\n configSet.filters.forEach(element => {\n url_string = url_string.concat('filter_name_list=', element, '&')\n })\n\n // concatinating the thresholds\n configSet.confidence_thresholds.forEach(element => {\n url_string = url_string.concat('confidence_threshold_list=', element, '&')\n })\n\n // concatinating the column name\n url_string = url_string.concat('column_name=', configSet.col_name, '&')\n\n // concatinating the CSV URL/Path\n url_string = url_string.concat('csv_url=', encodeURIComponent(configSet.csv_url))\n\n // remove the extra & sign in the loop\n // url_string = url_string.slice(0, -1)\n return url_string\n}", "function GetHits(baseUrl, featureName){\n\t// If bounds have not been set with the set extent toggle, find the number of hits without limiting by bounds,\n\t// but if bounds have been set then find the number of hits within the bounds\n\tif (bounds == undefined)\n\t\tvar hitsUrl = baseUrl + \"?service=wfs&version=1.1.0&request=GetFeature&typeName=\"+featureName+\"&resultType=hits\";\n\telse\n\t\tvar hitsUrl = baseUrl + \"?service=wfs&version=1.1.0&request=GetFeature&typeName=\"+featureName+\"&resultType=hits&BBOX=\"+bounds.left+\",\"+bounds.bottom+\",\"+bounds.right+\",\"+bounds.top;\n\t\n\ttry {\n\t\tOpenLayers.Request.GET({\n\t\t\turl: hitsUrl,\n\t\t\tasync: false,\n\t\t\tcallback: function(resp) {\n\t\t\t\t// Response OK\n\t\t\t\tif (resp.status == 200) {\t\t\t\t\n\t\t\t\t\t//console.log(resp);\n\t\t\t\t\tif (resp.responseXML != null) {\n\t\t\t\t\t\tvar xmlHits = resp.responseXML.documentElement;\n\t\t\t\t\t\thits = xmlHits.attributes.getNamedItem(\"numberOfFeatures\").nodeValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (resp.status == 404){\n\t\t\t\t\talert(\"Requested resource not available. Try again later.\")\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(\"Invalid url.\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\tcatch (e) {\n\t\talert(\"Problem determining the number of hits\");\n\t}\n}", "function createInfoData(i)\n{\n var content = \"\";\n content = \"<font face='Tahoma'><small>\" +\n \"<b><a href=\\\"javascript:openWindow('../displaymap.html?zoom=11&latitude=\" + pointarray[i].latitude + \"&longitude=\" + pointarray[i].longitude + \"&end', '\" + pointarray[i].text + \"', 640, 480);\\\">\" +\n pointarray[i].text + \n \"</a></b><br>\" +\n pointarray[i].latstr + \"<br>\" +\n pointarray[i].lngstr + \"</small></font>\";\n//GLog.write(\"Content:\" + content);\n return content;\n}", "function loadStdSrv(){\r\n\tgetData();\r\n\tfunction getData(){\r\n\t\tvar requestURL = \"https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJ8VRLb5JvcVMRoM171irqpAc&fields=name,geometry,address_component&key=AIzaSyDGvqMTt1orMIidhIJKLK7NwySTZSbR0yA\",\r\n\t\t\trequest = new XMLHttpRequest();\r\n\t\t\trequest.open('GET', requestURL);\r\n\t\t\trequest.responseType = 'json';\r\n\t\t\trequest.send();\t\r\n\t\t\r\n\t\t\trequest.onload = function(){\r\n\t\t\t\tvar placeData = request.response;\r\n\t\t\t\tconsole.log(placeData);\r\n\t\t\t\t//store lat and lng coordinates\r\n\t\t\t\t\t lat = placeData.result.geometry.location.lat,\r\n\t\t\t\t\t lng = placeData.result.geometry.location.lng;\r\n\t\t\t\r\n\t\t\t\tinitMap(lat, lng, placeData);\r\n\t\t\t};\t\r\n\t\t\t\r\n\t\t\t//CONTENT\r\n\t\t\tvar content = document.getElementById(\"info\");\r\n\t\t\tcontent.querySelector(\"h2\").innerHTML = \"Student Services\";\r\n\t\t\tcontent.querySelector(\"h3\").innerHTML = \"Stan Grad/Heritage Hall\";\r\n\t\t\tcontent.querySelector(\"p\").innerHTML = \"Student Services, located on the second floor of Heritage Hall, assists new and future students from start to end for any concerns pertaining to classes, tuition, and other related questions.\";\r\n\t\t}\t\r\n\t\r\n\t//GOOGLE MAP\r\n\tfunction initMap(lat, lng, placeData){\r\n\t\tvar mapOptions = {\r\n\t\t\t/* Initial zoom level */\r\n \t\t\tzoom: 17.5,\r\n \t\t\tcenter: {lat:51.064520, lng:-114.089253} \r\n\t\t\t};\r\n\r\n\t\tvar beacon = {lat:+lat, lng:+lng};\r\n\t\tmap = new google.maps.Map(\r\n\t\t\tmapPlace, mapOptions\r\n\t\t\t);\r\n\t\t\r\n\t\t//EMBED MAP IMAGES\r\n\t\tvar level1Overlay;\r\n\t\tvar level2Overlay;\r\n\t\t\r\n\t\t//Map Options\r\n\t\tvar overlayOptions = {\r\n \t\t\topacity:1\r\n \t\t\t};\r\n\t\t//Map bounds\t\r\n\t\t\r\n\t\tvar level1Bounds = new google.maps.LatLngBounds(\r\n \t\tnew google.maps.LatLng(51.064058, -114.090097), //SW\r\n \t\tnew google.maps.LatLng(51.065581, -114.088460) //NE\r\n \t\t);\r\n\t\tvar level2Bounds = new google.maps.LatLngBounds(\r\n \t\tnew google.maps.LatLng(51.064065, -114.090074), //SW\r\n \t\tnew google.maps.LatLng(51.065583, -114.088474) //NE\r\n\t\t\t\r\n \t\t);\r\n\t\t//Level 1 Map and show by default\r\n\t\tlevel1Overlay = new google.maps.GroundOverlay('assets/images/stanGradMap_level_1.png',level1Bounds,overlayOptions);\r\n\t\tlevel1Overlay.setMap(map);\r\n\t\t\r\n\t\t//Level 2 Map\r\n\t\tlevel2Overlay = new google.maps.GroundOverlay('assets/images/stanGradMap_level_2.png',level2Bounds,overlayOptions);\r\n\t\t\r\n\t\t//MAP LEVEL TOGGLE\r\n\t\t\r\n\t\tvar level1Button = true;\r\n\t\tdocument.getElementById(\"level1\").addEventListener(\"click\", function(){\r\n\t\t\t//lock current button\r\n\t\t\tdocument.getElementById('level1').disabled = true;\r\n\t\t\tdocument.getElementById('level2').disabled = false;\r\n\t\t\tif(level1Button){\r\n\t\t\t\tlevel2Overlay.setMap(null);\r\n\t\t\t\tlevel1Overlay.setMap(map);\r\n\r\n\t\t\t\tdeleteMarkers();\r\n\t\t\t\tdeletePaths();\t\r\n\r\n\t\t\t\tlevel2Button = true;\r\n\t\t\t\tlevel1Button = false;\r\n\r\n\t\t\t\tlevel1Map();\r\n\t\t\t\t\r\n\t\t\t\t\t//reset entrance\r\n\t\t\t\tdocument.getElementById(\"selectEntrance\").selectedIndex = 0;\r\n\t\t\t\tdocument.getElementById('selectEntrance').style.visibility='visible';\r\n\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tvar level2Button = true;\r\n\t\tdocument.getElementById(\"level2\").addEventListener(\"click\", function(){\r\n\t\t\t//lock current button\r\n\t\t\tdocument.getElementById('level1').disabled = false;\r\n\t\t\tdocument.getElementById('level2').disabled = true;\r\n\t\t\t\r\n\t\t\tif(level2Button){\r\n\t\t\t\tlevel1Overlay.setMap(null);\r\n\t\t\t\tlevel2Overlay.setMap(map);\r\n\t\t\t\r\n\t\t\t\tdeleteMarkers();\r\n\t\t\t\tdeletePaths();\r\n\t\t\t\r\n\t\t\t\tlevel1Button = true;\r\n\t\t\t\tlevel2Button = false;\r\n\t\t\t\t\r\n\t\t\t\tlevel2Map();\r\n\t\t\t\t\r\n\t\t\t\t//hide entrance dropdown\r\n\t\t\t\tdocument.getElementById('selectEntrance').style.visibility='hidden';\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//LEVEL 1 MAP MARKERS\r\n\t\t\t\r\n\t\tfunction level1Map(){\r\n\t\t\t//Entrance Marker: East \r\n\t\t\teEntranceStdSrvCoords = {lat:51.064390, lng:-114.088590};\r\n\r\n\t\t\teEntranceStdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: eEntranceStdSrvCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Current Location',\r\n\t\t\t\ticon: 'assets/images/maps_icons/entrance_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(eEntranceStdSrv);\r\n\t\t\teEntranceStdSrv.setMap(null);\r\n\t\t\t//infowindow\t\r\n\t\t\t//button\r\n\t\t\teEntranceStdSrv.addListener('click',function(){\r\n\r\n\t\t\t\tescalator1StdSrv.setMap(map);\r\n\t\t\t\tescalator1StdSrv.setAnimation( google.maps.Animation.BOUNCE );\r\n\t\t\t\t\r\n\t\t\t\tmap.setZoom(18.5);\r\n\t\t\t\tmap.panTo(eEntranceStdSrvCoords);\r\n\t\t\t\t\r\n\t\t\t\teEntranceStdSrv.setIcon('assets/images/maps_icons/current_position_small.png');\r\n\t\t\t\tescalator1StdSrv.setIcon('assets/images/maps_icons/escalator_small.png');\r\n\t\t\t\t\r\n\t\t\t\teEntranceStdSrvWindow.open(map, eEntranceStdSrv);\r\n\t\t\t\tescalator1StdSrvWindow.close(map, escalator1StdSrv);\r\n\t\t\t\t\r\n\t\t\t\tpathLevel1StdSrv.setMap(map);\r\n\t\t\t})\r\n\t\t\t//content\r\n\t\t\tvar eEntranceStdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>East Entrance</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/east_entrance.jpg\">'+\r\n\t\t\t'<p>Welcome to SAIT! Proceed down the hall towards the escalator.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\t\t\t//init info window\r\n\t\t\teEntranceStdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: eEntranceStdSrvContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//Entrance Marker: West \r\n\t\t\twEntranceStdSrvCoords = {lat:51.064490, lng:-114.090072};\r\n\r\n\t\t\twEntranceStdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: wEntranceStdSrvCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Current Location',\r\n\t\t\t\ticon: 'assets/images/maps_icons/entrance_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(wEntranceStdSrv);\r\n\t\t\twEntranceStdSrv.setMap(null);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//infowindow\t\r\n\t\t\twEntranceStdSrv.addListener('click',function(){\r\n\t\t\t\twCheck1StdSrv.setMap(map);\r\n\t\t\t\twCheck1StdSrv.setAnimation( google.maps.Animation.BOUNCE );\r\n\t\t\t\tescalator1StdSrv.setMap(map);\r\n\t\t\t\tescalator1StdSrv.setAnimation( google.maps.Animation.BOUNCE );\r\n\t\t\t\t\r\n\t\t\t\twEntranceStdSrv.setIcon('assets/images/maps_icons/current_position_small.png');\r\n\t\t\t\t//nEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\tescalator1StdSrv.setIcon('assets/images/maps_icons/escalator_small.png');\r\n\t\t\t\twCheck1StdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\t\r\n\t\t\t\tmap.setZoom(18.5);\r\n\t\t\t\tmap.panTo(wEntranceStdSrvCoords);\r\n\r\n\t\t\t\twEntranceStdSrvWindow.open(map, wEntranceStdSrv);\r\n\t\t\t\t//nEntranceStdSrvWindow.close(map, nEntranceStdSrv);\r\n\t\t\t\tescalator1StdSrvWindow.close(map, escalator1StdSrv);\r\n\t\t\t\twCheck1StdSrvWindow.close(map, wCheck1StdSrv);\r\n\t\t\t\t\r\n\t\t\t\tpathLevel1StdSrvWest.setMap(map);\r\n\t\t\t\t//pathLevel1StdSrvNorth.setMap(null);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\t//content\r\n\t\t\tvar wEntranceStdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>West Entrance</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/west_entrance.jpg\">'+\r\n\t\t\t'<p>Welcome to SAIT! Head towards the doors to your left.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\t\t\r\n\t\t\twEntranceStdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: wEntranceStdSrvContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Checkpoint Marker: Secondary Entrance \r\n\t\t\t\r\n\t\t\tvar wCheck1StdSrvCoords = {lat:51.064585, lng:-114.089945};\r\n\r\n\t\t\twCheck1StdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: wCheck1StdSrvCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Secondary Entrance',\r\n\t\t\t\ticon: 'assets/images/maps_icons/entrance_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(wCheck1StdSrv);\r\n\t\t\twCheck1StdSrv.setMap(null);\r\n\t\t\t\r\n\t\t\t//events\t\r\n\t\t\twCheck1StdSrv.addListener('click',function(){\r\n\t\t\t\t\r\n\t\t\t\t//map orientation\r\n\t\t\t\tmap.setZoom(18.5);\r\n\t\t\t\tmap.panTo(wCheck1StdSrvCoords);\r\n\t\t\t\t//current position toggle\r\n\t\t\t\t\r\n\t\t\t\twEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\twCheck1StdSrv.setIcon('assets/images/maps_icons/current_position_small.png');\r\n\t\t\t\tescalator1StdSrv.setIcon('assets/images/maps_icons/escalator_small.png')\r\n\t\t\t\t//infowindow toggle\r\n\t\t\t\twCheck1StdSrvWindow.open(map, wCheck1StdSrv);\r\n\t\t\t\twEntranceStdSrvWindow.close(map, wEntranceStdSrv);\r\n\t\t\t\tescalator1StdSrvWindow.close(map, escalator1StdSrv);\r\n\t\t\t\t\r\n\t\t\t})\r\n\t\t\tvar wCheck1StdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1 style=\"padding-bottom: .5rem;\">Secondary Entrance</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/west_door.jpg\">'+\r\n\t\t\t'<p>Head down the hallway, and then turn right towards the escalator.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\r\n\t\t\twCheck1StdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: wCheck1StdSrvContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//West Flightpath\r\n\t\t\tpathLevel1StdSrvWestCoords = [\r\n\t\t\t wEntranceStdSrvCoords,\r\n\t\t\t\twCheck1StdSrvCoords,\r\n\t\t\t\t{lat:51.064585, lng:-114.089424},\r\n\t\t\t\t{lat:51.064439, lng:-114.089424}\r\n\t\t\t];\r\n\t\t\t\r\n \t\tpathLevel1StdSrvWest = new google.maps.Polyline({\r\n\t\t\t path: pathLevel1StdSrvWestCoords,\r\n\t\t\t geodesic: true,\r\n\t\t\t strokeColor: '#FF0000',\r\n\t\t\t strokeOpacity: 1.0,\r\n\t\t\t strokeWeight: 3\r\n \t});\r\n\t\t\tpaths.push(pathLevel1StdSrvWest);\r\n\t\t\t\r\n\t\t\t\r\n\t\t//North\r\n\t\t//South\r\n\t\t//West\r\n\t\t\t\r\n\t\t\t//Checkpoint Marker: Escalator\r\n\t\t\tescalator1StdSrvCoords = {lat:51.064439, lng:-114.089424};\r\n\t\t\t\r\n\t\t\tescalator1StdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: escalator1StdSrvCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Escalator',\r\n\t\t\t\ticon: 'assets/images/maps_icons/escalator_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(escalator1StdSrv);\r\n\t\t\tescalator1StdSrv.setMap(null);\r\n\t\t\t\r\n\t\t\t//Info window\t\r\n\t\t\t//button \r\n\t\t\tescalator1StdSrv.addListener('click',function(){\r\n\t\t\t\t//map orientation\r\n\t\t\t\tmap.setZoom(18.5);\r\n\t\t\t\tmap.panTo(escalator1StdSrvCoords);\r\n\t\t\t\t//current position toggle\r\n\t\t\t\tnEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\teEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\twEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\twCheck1StdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\tsCheck1StdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\tescalator1StdSrv.setIcon('assets/images/maps_icons/current_position_small.png')\r\n\t\t\t\tsEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\t//infowindow toggle\r\n\t\t\t\tescalator1StdSrvWindow.open(map, escalator1StdSrv);\r\n\t\t\t\twCheck1StdSrvWindow.close(map, wCheck1StdSrv);\r\n\t\t\t\tsCheck1StdSrvWindow.close(map, sCheck1StdSrv);\r\n\t\t\t\twEntranceStdSrvWindow.close(map, wEntranceStdSrv);\r\n\t\t\t\teEntranceStdSrvWindow.close(map, eEntranceStdSrv);\r\n\t\t\t\tnEntranceStdSrvWindow.close(map, nEntranceStdSrv);\r\n\t\t\t\tsEntranceStdSrvWindow.close(map, sEntranceStdSrv);\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t//content\r\n\t\t\tvar escalator1StdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>Escalator</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/escalator_1.jpg\" >'+\r\n\t\t\t'<p>Take the escalator to the 2nd floor. Please change to floor level 2.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\t\t\t//init info window\r\n\t\t\tescalator1StdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: escalator1StdSrvContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//Level 1 flightpath\r\n\t\t\tpathLevel1StdSrvCoords = [\r\n\t\t\t {lat:51.064390, lng:-114.088590},\r\n\t\t\t {lat:51.064390, lng:-114.089326},\r\n\t\t\t {lat:51.064439, lng:-114.089424}\r\n\t\t\t];\r\n \t\tpathLevel1StdSrv = new google.maps.Polyline({\r\n\t\t\t path: pathLevel1StdSrvCoords,\r\n\t\t\t geodesic: true,\r\n\t\t\t strokeColor: '#FF0000',\r\n\t\t\t strokeOpacity: 1.0,\r\n\t\t\t strokeWeight: 3\r\n \t});\r\n\t\t\tpaths.push(pathLevel1StdSrv);\r\n\t\t\tpathLevel1StdSrv.setMap(null);\r\n\t\t\t\r\n\t\t\t//Checkpoint Marker: Secondary South Entrance \r\n\t\t\t\r\n\t\t\tvar sCheck1StdSrvCoords = {lat:51.064225, lng:-114.089470};\r\n\r\n\t\t\tsCheck1StdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: sCheck1StdSrvCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Secondary Entrance',\r\n\t\t\t\ticon: 'assets/images/maps_icons/entrance_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(sCheck1StdSrv);\r\n\t\t\tsCheck1StdSrv.setMap(null);\r\n\t\t\t\r\n\t\t\t//events\t\r\n\t\t\tsCheck1StdSrv.addListener('click',function(){\r\n\t\t\t\t//map orientation\r\n\t\t\t\tmap.setZoom(18.5);\r\n\t\t\t\tmap.panTo(sCheck1StdSrvCoords);\r\n\t\t\t\t//current position toggle\r\n\t\t\t\t\r\n\t\t\t\tsEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\tsCheck1StdSrv.setIcon('assets/images/maps_icons/current_position_small.png');\r\n\t\t\t\tescalator1StdSrv.setIcon('assets/images/maps_icons/escalator_small.png');\r\n\t\t\t\t//infowindow toggle\r\n\t\t\t\tsCheck1StdSrvWindow.open(map, sCheck1StdSrv);\r\n\t\t\t\tsEntranceStdSrvWindow.close(map, sEntranceStdSrv);\r\n\t\t\t\tescalator1StdSrvWindow.close(map, escalator1StdSrv);\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\tvar sCheck1StdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>Secondary Entrance</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/south_door.jpg\">'+\r\n\t\t\t'<p>Through these doors you will enter Study Hall. Exit Study Hall and continue to follow the path towards the escalator.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\r\n\t\t\tsCheck1StdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: sCheck1StdSrvContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//Entrance Marker: North \r\n\t\t\tnEntranceStdSrvCoords = {lat:51.064865, lng:-114.089270};\r\n\t\t\t\r\n\t\t\tnEntranceStdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: nEntranceStdSrvCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Current Location',\r\n\t\t\t\ticon: 'assets/images/maps_icons/entrance_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(nEntranceStdSrv);\r\n\t\t\tnEntranceStdSrv.setMap(null);\r\n\t\t\t\r\n\t\t\t//Marker Events\t\r\n\t\t\tnEntranceStdSrv.addListener('click',function(){\r\n\t\t\t\tescalator1StdSrv.setMap(map);\r\n\t\t\t\tescalator1StdSrv.setAnimation( google.maps.Animation.BOUNCE );\r\n\t\t\t\t\r\n\t\t\t\tmap.setZoom(18.5);\r\n\t\t\t\tmap.panTo(nEntranceStdSrvCoords);\r\n\t\t\t\t\r\n\t\t\t\tnEntranceStdSrv.setIcon('assets/images/maps_icons/current_position_small.png');\r\n\t\t\t\teEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\tescalator1StdSrv.setIcon('assets/images/maps_icons/escalator_small.png');\r\n\t\t\t\t\r\n\t\t\t\tnEntranceStdSrvWindow.open(map, nEntranceStdSrv);\r\n\t\t\t\teEntranceStdSrvWindow.close(map, eEntranceStdSrv);\r\n\t\t\t\tescalator1StdSrvWindow.close(map, escalator1StdSrv);\r\n\t\t\t\t\r\n\t\t\t\tpathLevel1StdSrvNorth.setMap(map);\r\n\t\t\t\t//pathLevel1StdSrvEast.setMap(null);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar nEntranceStdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>North Entrance</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/north_entrance.jpg\">'+\r\n\t\t\t'<p>Welcome to SAIT! Proceed towards the escalator.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\t\t\t\r\n\t\t\tnEntranceStdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: nEntranceStdSrvContent\r\n\t\t\t});\r\n\r\n\t\t\t//Level 1 flightpath: from North Entrance\r\n\t\t\tpathLevel1StdSrvNorthCoords = [\r\n\t\t\t {lat:51.064865, lng:-114.089270},\r\n\t\t\t {lat:51.064439, lng:-114.089424}\r\n\t\t\t];\r\n \t\tpathLevel1StdSrvNorth = new google.maps.Polyline({\r\n\t\t\t path: pathLevel1StdSrvNorthCoords,\r\n\t\t\t geodesic: true,\r\n\t\t\t strokeColor: '#FF0000',\r\n\t\t\t strokeOpacity: 1.0,\r\n\t\t\t strokeWeight: 3\r\n \t});\r\n\t\t\tpaths.push(pathLevel1StdSrvNorth);\r\n\t\t\t\r\n\t\t\t//Entrance Marker: South \r\n\t\t\tsEntranceStdSrvCoords = {lat:51.064065, lng:-114.089265};\r\n\t\t\t\r\n\t\t\tsEntranceStdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: sEntranceStdSrvCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Current Location',\r\n\t\t\t\ticon: 'assets/images/maps_icons/entrance_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(sEntranceStdSrv);\r\n\t\t\tsEntranceStdSrv.setMap(null);\r\n\t\t\t\r\n\t\t\t//Marker Events\t\r\n\t\t\tsEntranceStdSrv.addListener('click',function(){\r\n\t\t\t\tescalator1StdSrv.setMap(map);\r\n\t\t\t\tescalator1StdSrv.setAnimation( google.maps.Animation.BOUNCE );\r\n\t\t\t\tsCheck1StdSrv.setMap(map);\r\n\t\t\t\tsCheck1StdSrv.setAnimation( google.maps.Animation.BOUNCE );\r\n\t\t\t\t\r\n\t\t\t\tmap.setZoom(18.5);\r\n\t\t\t\tmap.panTo(sEntranceStdSrvCoords);\r\n\t\t\t\t\r\n\t\t\t\tsEntranceStdSrv.setIcon('assets/images/maps_icons/current_position_small.png');\r\n\t\t\t\teEntranceStdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\tescalator1StdSrv.setIcon('assets/images/maps_icons/escalator_small.png');\r\n\t\t\t\tsCheck1StdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\t\r\n\t\t\t\tsEntranceStdSrvWindow.open(map, sEntranceStdSrv);\r\n\t\t\t\teEntranceStdSrvWindow.close(map, eEntranceStdSrv);\r\n\t\t\t\tescalator1StdSrvWindow.close(map, escalator1StdSrv);\r\n\t\t\t\tsCheck1StdSrvWindow.close(map, sCheck1StdSrv);\r\n\t\t\t\t\r\n\t\t\t\tpathLevel1StdSrvSouth.setMap(map);\r\n\t\t\t\tpathLevel1StdSrv.setMap(null);\r\n\t\t\t\tpathLevel1StdSrvNorth.setMap(null);\r\n\t\t\t\tpathLevel1StdSrvWest.setMap(null);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar sEntranceStdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>South Entrance</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/south_entrance.jpg\">'+\r\n\t\t\t'<p>Welcome to SAIT! Proceed through the doors on your left.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\t\t\t\r\n\t\t\tsEntranceStdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: sEntranceStdSrvContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//Level 1 flightpath: from South Entrance\r\n\t\t\tpathLevel1StdSrvSouthCoords = [\r\n\t\t\t\tsEntranceStdSrvCoords,\r\n\t\t\t\t{lat:51.064175, lng:-114.089265},\r\n\t\t\t {lat:51.064225, lng:-114.089470},\r\n\t\t\t\t {lat:51.064323, lng:-114.089470},\r\n\t\t\t\t{lat:51.064323, lng:-114.089568},\r\n\t\t\t\t{lat:51.064380, lng:-114.089568},\r\n\t\t\t {lat:51.064439, lng:-114.089424}\r\n\t\t\t];\r\n \t\tpathLevel1StdSrvSouth = new google.maps.Polyline({\r\n\t\t\t path: pathLevel1StdSrvSouthCoords,\r\n\t\t\t geodesic: true,\r\n\t\t\t strokeColor: '#FF0000',\r\n\t\t\t strokeOpacity: 1.0,\r\n\t\t\t strokeWeight: 3\r\n \t});\r\n\t\t\tpaths.push(pathLevel1StdSrvSouth);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tlevel1Map();\r\n\t\t\r\n\t\t//LEVEL 2 MAP MARKERS\t\r\n\r\n\t\tfunction level2Map(){\r\n\t\t\t//destinationStdSrv Marker\r\n\t\t\t destinationStdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: beacon, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Student Services',\r\n\t\t\t\ticon: 'assets/images/maps_icons/destination_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(destinationStdSrv);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Info window\t\r\n\t\t\t//button \r\n\t\t\tdestinationStdSrv.addListener('click',function(){\r\n\t\t\t\tescalator2StdSrv.setIcon('assets/images/maps_icons/escalator_small.png');\r\n\t\t\t\theritage.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\t\r\n\t\t\t\tdestinationStdSrvWindow.open(map, destinationStdSrv);\r\n\t\t\t\theritageWindow.close(map, heritage);\r\n\t\t\t\tescalator2StdSrvWindow.close(map, escalator2StdSrv);\r\n\t\t\t});\r\n\t\t\r\n\t\t\t//content\r\n\t\t\tvar destinationStdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>Student Services</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/student_services.jpg\">'+\r\n\t\t\t'<p>Destination. Thank you for using Wayfinder.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\t\t\t//init info window\r\n\t\t\tdestinationStdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: destinationStdSrvContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//Checkpoint Marker: Escalator Level 2\r\n\t\t\tvar escalator2StdSrvCoords = {lat:51.064535, lng:-114.089460};\r\n\t\t\t\r\n\t\t\tescalator2StdSrv = new google.maps.Marker({ \r\n\t\t\t\tposition: escalator2StdSrvCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'Escalator 2',\r\n\t\t\t\ticon: 'assets/images/maps_icons/escalator_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(escalator2StdSrv);\r\n\t\t\t\r\n\t\t\t//Info window\t\r\n\t\t\t//button \r\n\t\t\tescalator2StdSrv.addListener('click',function(){\r\n\t\t\t\tescalator2StdSrv.setIcon('assets/images/maps_icons/current_position_small.png');\r\n\t\t\t\theritage.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\t\r\n\t\t\t\tpathLevel2StdSrv.setMap(map);\r\n\t\t\t\t\r\n\t\t\t\tescalator2StdSrvWindow.open(map, escalator2StdSrv);\r\n\t\t\t\tdestinationStdSrvWindow.close(map, destinationStdSrv);\r\n\t\t\t\theritageWindow.close(map, heritage);\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\tmarkers.push(escalator2StdSrv);\r\n\t\t\t\r\n\t\t\t//content\r\n\t\t\tvar escalator2StdSrvContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>Escalator</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/level_2.jpg\">'+\r\n\t\t\t'<p>Cross the bridge and then turn right.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\t\t\t//init info window\r\n\t\t\tescalator2StdSrvWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: escalator2StdSrvContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Checkpoint Marker: Heritage\r\n\t\t\tvar heritageCoords = {lat:51.064340, lng:-114.089122};\r\n\t\t\t\r\n\t\t\theritage = new google.maps.Marker({ \r\n\t\t\t\tposition: heritageCoords, \r\n\t\t\t\tmap: map,\r\n\t\t\t\tanimation: google.maps.Animation.BOUNCE,\r\n\t\t\t\ttitle: 'heritage',\r\n\t\t\t\ticon: 'assets/images/maps_icons/entrance_small.png'\r\n\t\t\t});\r\n\t\t\tmarkers.push(heritage);\r\n\t\t\t\r\n\t\t\t//Info window\t\r\n\t\t\t//button \r\n\t\t\theritage.addListener('click',function(){\r\n\t\t\t\t\r\n\t\t\t\tescalator2StdSrv.setIcon('assets/images/maps_icons/entrance_small.png');\r\n\t\t\t\theritage.setIcon('assets/images/maps_icons/current_position_small.png');\r\n\t\t\t\t\r\n\t\t\t\theritageWindow.open(map, heritage);\r\n\t\t\t\tdestinationStdSrvWindow.close(map, destinationStdSrv);\r\n\t\t\t\tescalator2StdSrvWindow.close(map, escalator2StdSrv);\r\n\t\t\t});\r\n\t\t\t//content\r\n\t\t\tvar heritageContent = '<div class=\"content\">'+\r\n\t\t\t'<h1>Heritage Hall Entrance</h1>'+\r\n\t\t\t'<div>'+\r\n\t\t\t'<img src=\"assets/images/heritage.jpg\">'+\r\n\t\t\t'<p>Proceed through the Heritage Hall entrance and you will arrive at your destination.</p>'+\r\n\t\t\t'</div>'+\r\n\t\t\t'</div>';\r\n\t\t\t//init info window\r\n\t\t\theritageWindow = new google.maps.InfoWindow({\r\n\t\t\t\tcontent: heritageContent\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//Level 2 flightpath\r\n\t\t\tpathLevel2StdSrvCoords = [\r\n\t\t\t\t{lat:51.064578, lng:-114.089424},\r\n\t\t\t\t{lat:51.064578, lng:-114.089120},\r\n\t\t\t\t{lat:51.064220, lng:-114.089120},\r\n\t\t\t\tbeacon\r\n\t\t\t];\r\n \t\tpathLevel2StdSrv = new google.maps.Polyline({\r\n\t\t\t path: pathLevel2StdSrvCoords,\r\n\t\t\t geodesic: true,\r\n\t\t\t strokeColor: '#FF0000',\r\n\t\t\t strokeOpacity: 1.0,\r\n\t\t\t strokeWeight: 3\r\n \t});\r\n\t\t\tpaths.push(pathLevel2StdSrv);\r\n\t\t\tpathLevel2StdSrv.setMap(null);\r\n\t\t}\r\n\t}\r\n}", "function mapViaUrl() {\r\n\r\n // The order of the follwing ifs is from specific to less specific location given in uri\r\n // If search query contains room -> show it on map\r\n if ($location.search().room) {\r\n // $log.debug('Show map via url room', $location.search());\r\n $scope.mapViaRoom($location.search().room);\r\n\r\n // If search query contains level (aka mapUri) -> show it on map\r\n } else if ($location.search().level) {\r\n //$log.debug('Show map via url mapUri', $location.search().level);\r\n $scope.mapViaLevel($location.search().level);\r\n \r\n // If search query contains level (aka mapUri) -> show it on map\r\n } else if ($location.search().part) {\r\n //$log.debug('Show map via url part', $location.search().part);\r\n $scope.mapViaPart($location.search().part);\r\n \r\n // Else init with first building part\r\n } else {\r\n var thisBuildingPart = ctrl.buildingParts[Object.keys(ctrl.buildingParts)[0]];\r\n\r\n if (thisBuildingPart) {\r\n initMap(thisBuildingPart);\r\n } else {\r\n $analytics.eventTrack('Roomfinder Error!', { category: 'ERROR', label: \"Can't find building \" + thisBuildingPart});\r\n $location.path(\"/404\");\r\n }\r\n }\r\n }" ]
[ "0.58978796", "0.58761376", "0.58641654", "0.5815814", "0.55984324", "0.5595393", "0.54485154", "0.53228074", "0.53182685", "0.5278114", "0.5267468", "0.5250905", "0.52450705", "0.52346385", "0.5212982", "0.5202399", "0.51577806", "0.5073578", "0.5063595", "0.50612813", "0.5022517", "0.5021901", "0.501723", "0.49813893", "0.49773276", "0.49632043", "0.495547", "0.4952179", "0.4939672", "0.49048558", "0.49008492", "0.4866051", "0.4860253", "0.4839994", "0.4836697", "0.48099422", "0.48092073", "0.480016", "0.47945976", "0.47910562", "0.4772679", "0.47696725", "0.4765675", "0.47589", "0.47580272", "0.475412", "0.4753828", "0.47428605", "0.4738843", "0.47352797", "0.47180253", "0.47157556", "0.47127306", "0.47127306", "0.4706995", "0.4703132", "0.47005615", "0.46954438", "0.4692882", "0.46920338", "0.4679128", "0.46735176", "0.46690238", "0.4661579", "0.46582657", "0.4657706", "0.46522138", "0.46468583", "0.46449184", "0.46388716", "0.46379888", "0.46318346", "0.4626113", "0.46147394", "0.4608983", "0.46071523", "0.4596416", "0.45958248", "0.45902535", "0.45858", "0.4578854", "0.45737118", "0.45652348", "0.45628524", "0.4558337", "0.45537263", "0.4545621", "0.4540362", "0.45328847", "0.45166722", "0.45072997", "0.45034504", "0.45006865", "0.4497815", "0.44885528", "0.44796", "0.44766623", "0.44698086", "0.4468893" ]
0.8137526
0
Setup the global Notification test fixture.
function setupNotification (options) { options = options || {}; global.window.Notification = { permission: options.permission || 'denied' }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setup() {\n this.setupLayout();\n this.setupNotifications();\n }", "function setupNotification() {\n if (!Notification) {\n console.log(\"This browser does not support notifications\")\n }\n\n if (Notification.permission !== \"granted\") Notification.requestPermission();\n}", "function setUp() {\n}", "function setUp() {\n this.popupClient = new bite.client.BugDetailsPopup();\n this.mockCaller = new mockCallBack();\n}", "setup() {\n\t\tthis.bpm = Persist.exists('bpm') ? Persist.get('bpm') : 100;\n\t\tthis.startTime = Persist.exists('startTime') ? Persist.get('startTime') : Date.now();\n\t\tthis.tempos = {\n\t\t\tmaster: 'four',\n\t\t\t...TEMPO_CONFIG\n\t\t}\n\t\tObject.keys(this.tempos).filter(k => k !== 'master').forEach(tempoKey => {\n\t\t\tthis.tempos[tempoKey].getBeatDuration = this.tempos[tempoKey].getBeatDuration.bind(this)\n\t\t})\n\n\t\tif (ENV.IS_HOST) {\n\t\t\tthis.attachHostEventHandlers();\n\t\t} else {\n\t\t\t$io.onBPMChange(this.dataReceived.bind(this))\n\t\t\t$io.onMasterTempoChange(this.dataReceived.bind(this))\n\t\t}\n\t}", "function testEnvironment() {\n debugLog(\"PDN: Testing execution environment\");\n if((\"Notification\" in window)) {\n debugLog(\"PDN: Notifications availible\");\n notifSupport = true;\n } else {\n debugLog(\"PDN: Notifications not availible\", \"warn\");\n notifSupport = false;\n }\n}", "function _testSuiteInit() {\n return ImptTestHelper.retrieveDeviceInfo(PRODUCT_NAME, DEVICE_GROUP_NAME).\n then(() => ImptTestHelper.createDeviceGroup(PRODUCT_NAME, DEVICE_GROUP_NAME)).\n then((dgInfo) => { dg_id = dgInfo.dgId; }).\n then(() => ImptTestHelper.deviceAssign(DEVICE_GROUP_NAME)).\n then(() => Shell.cp('-Rf', `${__dirname}/fixtures/devicecode.nut`, ImptTestHelper.TESTS_EXECUTION_FOLDER)).\n then(() => Shell.cp('-Rf', `${__dirname}/fixtures/agentcode.nut`, ImptTestHelper.TESTS_EXECUTION_FOLDER));\n }", "function setUp()/* : void*/\n {\n }", "function setUp(){\n return app.env.IS_TESTING = true;\n}", "function _setup () {\n }", "async onPrepare() {\n // Importing all required packages and utils that are used in the whole test\n const chai = require('chai');\n const MailListener = require('mail-listener5').MailListener;\n const chaiAsPromised = require('chai-as-promised');\n const path = require('path');\n chai.use(chaiAsPromised);\n global.superagent = require('superagent');\n global.until = protractor.ExpectedConditions;\n global.assert = chai.assert;\n global.utils = require('./tests/utils/utils');\n global.waitUntil = require('./tests/utils/wait-utils');\n global.mailUtils = require('./tests/utils/mail-utils');\n global.restUtils = require('./tests/utils/rest-utils');\n global.mailListener = new MailListener({\n username: \"[email protected]\",\n password: \"Password\",\n host: \"hostname\",\n port: 993,\n tls: true,\n connTimeout: 10000, // Default by node-imap\n authTimeout: 5000, // Default by node-imap,\n debug: null, // Or your custom function with only one incoming argument. Default: null\n tlsOptions: { rejectUnauthorized: false },\n mailbox: \"INBOX\", // mailbox to monitor\n searchFilter: [\"UNSEEN\", \"ALL\"], // the search filter being used after an IDLE notification has been retrieved\n markSeen: true, // all fetched email will be marked as seen and not fetched next time\n fetchUnreadOnStart: false, // use it only if you want to get all unread email on lib start. Default is `false`,\n });\n\n // Integrated wait for Angular based functions. Need to be set to false, since it times out if no ANgular based functions are found.\n // Need to be disabled before browser start.\n await browser.waitForAngularEnabled(false);\n }", "setupNotifications() {\n dojo.subscribe('pawnMoved', this, 'notifPawnMoved');\n dojo.subscribe('pawnEaten', this, 'notifPawnEaten');\n // Delay end of game for interface stock stability before switching to game result\n this.notifqueue.setSynchronous('endOfGame', END_OF_GAME_DELAY);\n }", "function setupForTesting() {\n (0, _emberDebug.setTesting)(true);\n\n var adapter = (0, _adapter.getAdapter)();\n // if adapter is not manually set default to QUnit\n if (!adapter) {\n (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? new _adapter2.default() : new _qunit.default());\n }\n\n if (_emberViews.jQuery) {\n (0, _emberViews.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);\n\n (0, _pending_requests.clearPendingRequests)();\n\n (0, _emberViews.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);\n }\n }", "function setupForTesting() {\n (0, _emberDebug.setTesting)(true);\n\n var adapter = (0, _adapter.getAdapter)();\n // if adapter is not manually set default to QUnit\n if (!adapter) {\n (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? new _adapter2.default() : new _qunit.default());\n }\n\n if (_emberViews.jQuery) {\n (0, _emberViews.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);\n\n (0, _pending_requests.clearPendingRequests)();\n\n (0, _emberViews.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);\n }\n }", "function setupForTesting() {\n (0, _emberDebug.setTesting)(true);\n\n var adapter = (0, _adapter.getAdapter)();\n // if adapter is not manually set default to QUnit\n if (!adapter) {\n (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? new _adapter2.default() : new _qunit.default());\n }\n\n if (_emberViews.jQuery) {\n (0, _emberViews.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);\n\n (0, _pending_requests.clearPendingRequests)();\n\n (0, _emberViews.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);\n }\n }", "function _testSuiteInit() {\n return ImptTestCommandsHelper.createTestProductAndDG((commandOut) => {\n if (commandOut && commandOut.dgId) {\n dg_id = commandOut.dgId;\n }\n else fail('TestSuiteInit error: Failed to get product and dg ids');\n }).\n then(() => ImptTestCommandsHelper.copyFiles('fixtures/create')).\n then(() => ImptTestHelper.runCommand(`impt test create --dg ${dg_id} -q`, ImptTestHelper.emptyCheck));\n }", "function setUp() {\r\n originalHtml = document.body.innerHTML;\r\n ShadowTemplates = null;\r\n // Mock out generateNewId for testing\r\n Template.prototype.idCount = 1;\r\n templateManager = new TemplateManager({});\r\n function chooseColor(label) {\r\n if (label == undefined) return 'undefined-color';\r\n if (label == 'warning') return 'orange';\r\n if (label == 'error') return 'red';\r\n return 'green';\r\n }\r\n getBlinkFormatters().register('chooseColor', chooseColor);\r\n}", "function setupForTesting() {\n if (!Test) {\n Test = requireModule('ember-testing/test')['default'];\n }\n\n _emberMetalCore.default.testing = true;\n\n // if adapter is not manually set default to QUnit\n if (!Test.adapter) {\n Test.adapter = _emberTestingAdaptersQunit.default.create();\n }\n\n requests = [];\n Test.pendingAjaxRequests = requests.length;\n\n _emberViewsSystemJquery.default(document).off('ajaxSend', incrementAjaxPendingRequests);\n _emberViewsSystemJquery.default(document).off('ajaxComplete', decrementAjaxPendingRequests);\n _emberViewsSystemJquery.default(document).on('ajaxSend', incrementAjaxPendingRequests);\n _emberViewsSystemJquery.default(document).on('ajaxComplete', decrementAjaxPendingRequests);\n }", "function commonSetUp() {\n\t\tvar self = this;\n\t\tself.oHTMLTestObject\n\t}", "beforeEach() {\n server = new Pretender();\n }", "setup() {}", "setup() {}", "setup() {}", "function NotificationEventFactory() {}", "init() {\n super.init();\n\n // noinspection JSUnusedGlobalSymbols\n this.interval = setInterval(function() {\n console.error('tick');\n }, 5000);\n\n // Tell the unit test that we are alive\n process.send('Reporting for duty');\n }", "function setupJobs() {\n setupDailyCleanUp();\n setupDailyReminderPing();\n}", "init() {\n this.testMainPage('/api/v1');\n\n this.artistTest = new ArtistTest(this._app, '/api/v1/artists');\n this.testArtists();\n\n this.albumTest = new AlbumTest(this._app, '/api/v1/albums', new Artist(this.artistTest.getArtistContent()));\n this.testAlbums();\n }", "function commonSetup(env) {\n remoteStorage.caching.enable('/');\n // email module\n env.email = remoteStorage.email;\n // email scope (to test if stuff was stored correctly)\n env.emailScope = remoteStorage.scope('/email/');\n }", "_setup() {\n this.self.ipc.register(this.returnID, data => {\n this._handleResponse(data)\n });\n\n let data = {}\n\n data.globalType = this.globalType;\n data.clusterID = this.clusterID;\n data.responseID = this.returnID;\n data.data = this.broadcastString\n\n this.self.ipc.broadcast('advancedIPCListen', data);\n\n\n this.timeout = setTimeout(() => {\n if (this.responses.length < this.expectedReturns) {\n return this.emit('failed', 'Timeout waiting for all responses.');\n }\n }, 30000);\n }", "function setupInitial() {\n\tchrome.storage.local.get({enableNotifications:false},function(obj){\n\t\tenableNotifications = obj.enableNotifications;\n\t});\n\n\tchrome.storage.local.get({\n\t\tdisabled: false\n\t}, function (obj) {\n\t\tif (!obj.disabled) {\n\t\t\tsetUpQuoListener();\n\t\t} else {\n\t\t\tlog('Quoor is disabled');\n\t\t}\n\t});\n}", "function setUp() {\n info = new vsaq.questionnaire.items.InfoItem(ID, [], CAPTION);\n}", "function setup() {\n\t\t\tconsole.log('3pccTest: before: Mosca server is up and running');\n\t\t\tdone();\n\t\t}", "function setUp() {\nbitgo = new BitGoJS.BitGo({ env: 'test', accessToken: configData.accessToken });\n}", "function setupTests() {\n it(\"sets up tests correctly\", function (done) {\n var promises = [];\n targetPlatforms.forEach(function (platform) {\n promises.push(platform.getEmulatorManager().bootEmulator(TestConfig.restartEmulators));\n });\n console.log(\"Building test project.\");\n // create the test project\n promises.push(createTestProject(TestConfig.testRunDirectory)\n .then(function () {\n console.log(\"Building update project.\");\n // create the update project\n return createTestProject(TestConfig.updatesDirectory);\n }).then(function () { return null; }));\n Q.all(promises).then(function () { done(); }, function (error) { done(error); });\n });\n }", "setup(config) {\r\n setup(config);\r\n }", "async setup() {\n this.hooks = await this.github.genHooks();\n this.is_setup = true;\n }", "function setUp() {\n window.loadTimeData.getString = id => id;\n window.loadTimeData.data = {};\n\n new MockChromeStorageAPI();\n new MockCommandLinePrivate();\n\n widget = new importer.TestCommandWidget();\n\n const testFileSystem = new MockFileSystem('testFs');\n nonDcimDirectory = new MockDirectoryEntry(testFileSystem, '/jellybeans/');\n\n volumeManager = new MockVolumeManager();\n MockVolumeManager.installMockSingleton(volumeManager);\n\n const downloads = volumeManager.getCurrentProfileVolumeInfo(\n VolumeManagerCommon.VolumeType.DOWNLOADS);\n assert(downloads);\n destinationVolume = downloads;\n\n mediaScanner = new TestMediaScanner();\n mediaImporter = new TestImportRunner();\n}", "function setupNotifications() {\n // Create sound element\n var notificationSound = document.createElement(\"audio\");\n notificationSound.src = \"https://anison.fm/chatbox/sounds/Madome-JaJan.mp3\";\n // Check tracks\n console.log(\"Registering notification handler\");\n setInterval(() => {\n var anisonStatusData = localStorage.getItem(\"anisonStatusData\");\n if (anisonStatusData) {\n anisonStatusData = JSON.parse(anisonStatusData);\n if (anisonStatusData.on_air.track !== lastTrack) {\n lastTrack = anisonStatusData.on_air.track;\n if (anisonStatusData.on_air.track.indexOf(\"On-Air\") >= 0) {\n var options = {\n body: anisonStatusData.on_air.anime + \" - \" + anisonStatusData.on_air.track,\n icon: \"https://anison-a.akamaihd.net/images/main_visual.png\"\n };\n var notification = new Notification(\"Anison.FM On-Air!\", options);\n setTimeout(notification.close.bind(notification), 5000);\n notificationSound.play();\n }\n }\n }\n }, 1000);\n }", "function _testSuiteInit() {\n return ImptTestHelper.retrieveDeviceInfo(PRODUCT_NAME, DEVICE_GROUP_NAME).\n then(() => ImptTestHelper.createDeviceGroup(PRODUCT_NAME, DEVICE_GROUP_NAME));\n }", "function setUpMocks() {\n\n global.window = {\n self: 'https://me.edu',\n top: 'https://you.edu',\n name: 'DCE-iframe-API-ZYXABC',\n parent: {\n postMessage: (msg) => {}\n }\n };\n global.paella = _.cloneDeep(mockPaellaObject);\n global.class = function (classDef) {\n function createClass() {\n return _.cloneDeep(classDef);\n };\n global.paella.plugins['test'] = createClass();\n };\n}", "_setup() {\n this._controller.setup();\n }", "function _testSuiteInit() {\n return ImptTestHelper.getAccountAttrs().\n then((account) => { email = account.email; userid = account.id; }).\n then(() => ImptTestHelper.runCommand(`impt product create -n ${PRODUCT_NAME}`, ImptTestHelper.emptyCheck)).\n then(() => ImptTestHelper.runCommand(`impt dg create -n ${DEVICE_GROUP_NAME} -p ${PRODUCT_NAME}`, (commandOut) => {\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt product create -n ${PRODUCT2_NAME}`, (commandOut) => {\n product_id = ImptTestHelper.parseId(commandOut);\n if (!product_id) fail(\"TestSuitInit error: Failed to create product\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt dg create -n ${DEVICE_GROUP2_NAME} -p ${PRODUCT2_NAME}`, (commandOut) => {\n dg_id = ImptTestHelper.parseId(commandOut);\n if (!dg_id) fail(\"TestSuitInit error: Failed to create device group\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt dg create -n ${DEVICE_GROUP3_NAME} -p ${PRODUCT2_NAME}`, (commandOut) => {\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => Shell.cp('-Rf', `${__dirname}/fixtures/devicecode.nut`, ImptTestHelper.TESTS_EXECUTION_FOLDER)).\n then(() => ImptTestHelper.runCommand(`impt build deploy -g ${DEVICE_GROUP_NAME} -t ${BUILD_TAG}`, (commandOut) => {\n build_id = ImptTestHelper.parseId(commandOut);\n if (!build_id) fail(\"TestSuiteInit error: Failed to create build\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt build deploy -g ${DEVICE_GROUP2_NAME} -f -t ${BUILD2_TAG} -x devicecode.nut`, (commandOut) => {\n build2_id = ImptTestHelper.parseId(commandOut);\n if (!build2_id) fail(\"TestSuiteInit error: Failed to create build\");\n build2_sha = ImptTestHelper.parseSha(commandOut);\n if (!build2_sha) fail(\"TestSuiteInit error: Failed to parse build sha\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt build deploy -g ${DEVICE_GROUP3_NAME} -t ${BUILD3_TAG}`, (commandOut) => {\n build3_id = ImptTestHelper.parseId(commandOut);\n if (!build3_id) fail(\"TestSuiteInit error: Failed to create build\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt dg delete -g ${DEVICE_GROUP3_NAME} -q`, ImptTestHelper.emptyCheck));\n }", "function setupDefault() {\n}", "setup() {\n this.enqueueTearDownTask(() => this.clearStubs())\n }", "before (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tsuper.before,\t\t\t// run standard setup for test of fetching users\n\t\t\tthis.createForeignTeam,\t// create another team where the current user will not be a member of the team\n\t\t\tthis.setPath\t\t\t// set the path to use when issuing the test request\n\t\t], callback);\n\t}", "function setup () {\n app.set('visitHome', visitHome)\n app.set('visitConnect', visitConnect)\n app.set('visitGame', visitGame)\n }", "function _testSuiteInit() {\n return ImptTestHelper.runCommand(`impt product create -n ${PRODUCT_EXIST_NAME} -s \"${PRODUCT_EXIST_DESCR}\"`, ImptTestHelper.emptyCheck).\n then(() => ImptTestHelper.getAccountAttrs(username)).\n then((account) => { email = account.email; userid = account.id; });\n }", "function init() {\n easy.console.log(MODULE, 'initialization');\n\n scopeWindow = window.jasmine ? window.jasmine.window : window;\n\n easy.events.on(site.events.PRODUCT_PAGE_VIEW, _handleProductPage);\n easy.events.on(site.events.SUPER_PAGE_VIEW, _handleSuperPage);\n }", "setup() {\n\n // create the settings object\n var settings = {\n port: this.mqttPort,\n backend: {\n type: 'mongo',\n url: 'mongodb://localhost:' + this.mongodbPort + '/mqtt',\n pubsubCollection: this.mongoPersistanceName,\n mongo: {}\n },\n logger: {\n name: this.logName,\n level: this.logLevel,\n }\n };\n\n // create the instance\n this.mqttServer = new mqttBroker.Server(settings);\n\n var self = this;\n\n var moscaPersistenceDB = new mqttBroker.persistence.Mongo({\n url: 'mongodb://localhost:' + this.mongodbPort + '/moscaPersistence',\n ttl: {\n subscriptions: this.ttlSub,\n packets: this.ttlPacket\n }\n },\n function () {\n console.log('[HubManager] server persistence is ready on port ' + self.mongodbPort)\n }\n );\n moscaPersistenceDB.wire(this.mqttServer);\n this.mqttServer.on('ready', function(){\n // TODO fix this because it's ugly\n // but cheers Time Kadel ([email protected]) <-- this guy is world class! grab him whilst you can\n self.__broker_setup(self)\n }); // engage the broker setup procedure\n }", "beforeAll() {}", "function setup()\n{\n\treturn {\n\t\t// Mandatory parameters\n\t\tdescription: \"Carte Novea\",\n\t\tproduct: \"010100AA\",\n\t\tconfig: \"config.js\",\n\t\ttests:[\n\t\t\t\t//test,//, test2, test3, test4\n\t\t\t\ttest_nested_module.my_tests\n\t\t\t],\n\t\t// Optional parameters\n\t\tadmin_pass: \"\", // leave empty == no admin mode, sinon \"caravane\"\n\t};\n}", "beforeEach() {\n App = startApp();\n }", "beforeEach() {}", "function _testSuiteInit() {\n return ImptTestHelper.runCommand(`impt project create --product ${PRODUCT_NAME} --create-product --name ${DG_NAME} --descr \"${DG_DESCR}\" ${outputMode}`, (commandOut) => {\n ImptTestHelper.emptyCheck(commandOut);\n });\n }", "before() {\n /**\n * Setup the Chai assertion framework\n */\n const chai = require(\"chai\")\n global.expect = chai.expect\n global.assert = chai.assert\n global.should = chai.should()\n }", "function setup() {}", "function SetUp()\n{\n APIToken = GetDataFromBrowserLocalStorage(\"jobbz_member_api_token\");\n JobzzMember = JSON.parse(GetDataFromBrowserLocalStorage(\"jobzz_member\"));\n\n GetContractorJobsHistory(JobzzMember.MemberId, APIToken);\n}", "function setup() {\n // If we're in an iframe, set up an object in the parent window that we can use to\n // keep track of state even if the iframe is refreshed.\n if (parent && !(parent === window)) {\n if (! parent.ApplinksUtils) {\n parent.ApplinksUtils = { };\n }\n }\n \n $(document).bind('applinks.auth.completion', onAuthCompletion);\n\n initAuthRequestElements();\n checkForPendingConfirmations();\n }", "function setReminderTest( features ){\n log.debug('Setting Reminder Test')\n var reminders = (features.show_chrome_new_user_tooltip) ? 'chrome_tooltip_new_user_v3' : false\n reminders = (features.show_chrome_existing_user_tooltip) ? 'chrome_tooltip_existing_user_v3' : reminders\n reminders = (reminders) ? reminders : 'control'\n setSetting('reminders', reminders)\n\n if(!features.invalid) trackToReminderTest()\n\n }", "function SetUp()\n{\n APIToken = GetDataFromBrowserLocalStorage(\"jobbz_member_api_token\");\n JobzzMember = JSON.parse(GetDataFromBrowserLocalStorage(\"jobzz_member\"));\n\n GetContractorBillingInfo(JobzzMember.MemberId, APIToken);\n}", "setup() {\n this.projectController.setup();\n this.filterController.setup();\n }", "function beforeEachTest (assert) {\n\t// Re-initialise our classes\n\tmapModel = new MapModel(TEST_TILECOUNT);\n\tpixiMapView = new PixiMapView(mapModel, renderer, TEST_WINDOW_SIZE, DEFAULT_TILE_SIZE, ASSET_PATHS);\n}", "init() {\n module_utils.patchModule(\n 'mqtt',\n 'MqttClient',\n mqttClientWrapper,\n mqttModule => mqttModule\n );\n }", "setup() {\n const trezorSendAction = this.actions.ada.trezorSend;\n trezorSendAction.sendUsingTrezor.listen(this._sendUsingTrezor);\n trezorSendAction.cancel.listen(this._cancel);\n }", "function _testInit() {\n return ImptTestHelper.runCommand(`impt dg create -n ${DEVICE_GROUP_NAME} -s \"${DEVICE_GROUP_DESCR}\" -p ${PRODUCT_NAME}`, (commandOut) => {\n dg_id = ImptTestHelper.parseId(commandOut);\n if (!dg_id) fail(\"TestInit error: Failed to create device group\");\n ImptTestHelper.emptyCheck(commandOut);\n }).\n then(() => ImptTestHelper.runCommand(`impt build deploy --dg ${dg_id}`, (commandOut) => {\n deploy_id = ImptTestHelper.parseId(commandOut);\n if (!deploy_id) fail(\"TestInit error: Failed to create build\");\n ImptTestHelper.emptyCheck(commandOut);\n }));\n }", "initialize () {\n return Promise.all([\n lib.Utils.buildShopFixtures(this.app)\n .then(fixtures => {\n this.shopFixtures = fixtures\n return lib.Utils.loadShopFixtures(this.app)\n }),\n lib.Utils.buildCountryFixtures(this.app)\n .then(fixtures => {\n this.countryFixtures = fixtures\n return lib.Utils.loadCountryFixtures(this.app)\n })\n ])\n }", "setupNotification(...eventTypes) {\n for (const type of eventTypes) {\n this.context.on(type, ({ binding, context }) => {\n // No need to schedule notifications if no observers are present\n if (!this._observers || this._observers.size === 0)\n return;\n // Track pending events\n this.pendingNotifications++;\n // Take a snapshot of current observers to ensure notifications of this\n // event will only be sent to current ones. Emit a new event to notify\n // current context observers.\n this.emitEvent('notification', {\n type,\n binding,\n context,\n observers: new Set(this._observers),\n });\n });\n }\n }", "setup () {\n // NOOP\n }", "function Setup() {\n}", "before (callback) {\n\t\tthis.testBegins = Date.now();\n\t\tthis.init(callback);\n\t}", "setupDependencyBootStatusPubSubs() {\n // this is called from initialize() so routerInitial tasks hasn't ran yet, so wait here until router ready.\n routerClientInstance_1.default.onReady(() => {\n // define wildcard responder for all dependency pubsubs and checkpoint pubsubs\n routerClientInstance_1.default.addPubSubResponder(new RegExp(`${_constants_1.STATUS_CHANNEL_BASE}.*`), UNITIALIZED_BOOT_STATE);\n routerClientInstance_1.default.addPubSubResponder(new RegExp(`${_constants_1.CHECKPOINT_CHANNEL_BASE}.*`), UNITIALIZED_BOOT_STATE);\n routerClientInstance_1.default.addPubSubResponder(_constants_1.STAGE_CHANNEL, { stage: \"uninitialized\" });\n });\n }", "function setup() {\n akamai.edgeGridInit();\n mongo.purgeClientsCollections();\n console.log('Mosca server is up and running');\n\n}", "function init_testing_setup(){\r\n window._svc = {};\r\n _svc.sysInfo = { platform : function(a){\r\n console.log(\"Called _svc system callback in test\");\r\n for(i=0;i<2000;i++){console.log(\"loop\");}\r\n TerminalApp.terminal_id =123123;\r\n }}\r\n // _svc.sysInfo.platform(); // Get terminal id\r\n TerminalApp.url = \"ws://localhost:8090\"\r\n TerminalApp.switchToBrowser = function(){\r\n console.log(\"called switchToBrowser\");\r\n }\r\n TerminalApp.switchToPayment = function(){\r\n console.log(\"called switchToPayment\");\r\n }\r\n}", "function setup() {\n // server.authenticate = authenticate;\n // server.authorizePublish = authorizePublish;\n // server.authorizeSubscribe = authorizeSubscribe;\n log.info('Mosca server is up and running on '+env.mhost+':'+env.mport+' for mqtt and '+env.mhost+':'+env.hport+' for websocket');\n\n}", "function beforeEach() public {\r\n al = new AnimeLoot();\r\n alpc = new AnimeLootPhysicalCharacteristics(address(al));\r\n }", "async setUp () {\n this.whois = require('whois-json')\n this.pcapParser.on('ipv4Packet', this.countIPv4Address.bind(this))\n }", "function setup() {\n\tconsole.log('Mosca server is up and running on host : ' + pubsubsettings.host + ' port : ' + pubsubsettings.port)\n}", "function global_setup() {\n\t// don't use i, because global value conlicts with test runner\n\tfor(xyz = 0; xyz < 10; xyz++) {\n\t\tfoo->();\n\t}\n\ttrace(xyz);\n}", "setupEnvironment() {}", "function setupListeners() {\n setupAppHomeOpenedListener();\n setupClearGoalsButtonListener();\n}", "function initializeTests(projectManager, supportedTargetPlatforms, describeTests) {\n // DETERMINE PLATFORMS TO TEST //\n /** The platforms to test on. */\n var targetPlatforms = [];\n supportedTargetPlatforms.forEach(function (supportedPlatform) {\n if (testUtil_1.TestUtil.readMochaCommandLineFlag(supportedPlatform.getCommandLineFlagName()))\n targetPlatforms.push(supportedPlatform);\n });\n // Log current configuration\n console.log(\"Initializing tests for \" + testUtil_1.TestUtil.getPluginName());\n console.log(TestConfig.TestAppName + \"\\n\" + TestConfig.TestNamespace);\n console.log(\"Testing \" + TestConfig.thisPluginPath + \".\");\n targetPlatforms.forEach(function (platform) {\n console.log(\"On \" + platform.getName());\n });\n console.log(\"test run directory = \" + TestConfig.testRunDirectory);\n console.log(\"updates directory = \" + TestConfig.updatesDirectory);\n if (TestConfig.onlyRunCoreTests)\n console.log(\"--only running core tests--\");\n if (TestConfig.shouldSetup)\n console.log(\"--setting up--\");\n if (TestConfig.restartEmulators)\n console.log(\"--restarting emulators--\");\n // FUNCTIONS //\n function cleanupTest() {\n console.log(\"Cleaning up!\");\n ServerUtil.updateResponse = undefined;\n ServerUtil.testMessageCallback = undefined;\n ServerUtil.updateCheckCallback = undefined;\n ServerUtil.testMessageResponse = undefined;\n }\n /**\n * Sets up tests for each platform.\n * Creates the test project directory and the test update directory.\n * Starts required emulators.\n */\n function setupTests() {\n it(\"sets up tests correctly\", function (done) {\n var promises = [];\n targetPlatforms.forEach(function (platform) {\n promises.push(platform.getEmulatorManager().bootEmulator(TestConfig.restartEmulators));\n });\n console.log(\"Building test project.\");\n // create the test project\n promises.push(createTestProject(TestConfig.testRunDirectory)\n .then(function () {\n console.log(\"Building update project.\");\n // create the update project\n return createTestProject(TestConfig.updatesDirectory);\n }).then(function () { return null; }));\n Q.all(promises).then(function () { done(); }, function (error) { done(error); });\n });\n }\n /**\n * Creates a test project directory at the given path.\n */\n function createTestProject(directory) {\n return projectManager.setupProject(directory, TestConfig.templatePath, TestConfig.TestAppName, TestConfig.TestNamespace);\n }\n /**\n * Creates and runs the tests from the projectManager and TestBuilderDescribe objects passed to initializeTests.\n */\n function createAndRunTests(targetPlatform) {\n describe(\"Goby\", function () {\n before(function () {\n ServerUtil.setupServer(targetPlatform);\n return targetPlatform.getEmulatorManager().uninstallApplication(TestConfig.TestNamespace)\n .then(projectManager.preparePlatform.bind(projectManager, TestConfig.testRunDirectory, targetPlatform))\n .then(projectManager.preparePlatform.bind(projectManager, TestConfig.updatesDirectory, targetPlatform));\n });\n after(function () {\n ServerUtil.cleanupServer();\n return projectManager.cleanupAfterPlatform(TestConfig.testRunDirectory, targetPlatform).then(projectManager.cleanupAfterPlatform.bind(projectManager, TestConfig.updatesDirectory, targetPlatform));\n });\n testBuilder_1.TestContext.projectManager = projectManager;\n testBuilder_1.TestContext.targetPlatform = targetPlatform;\n // Build the tests.\n describeTests(projectManager, targetPlatform);\n });\n }\n // BEGIN TESTING //\n describe(\"Goby \" + projectManager.getPluginName() + \" Plugin\", function () {\n this.timeout(100 * 60 * 1000);\n if (TestConfig.shouldSetup)\n describe(\"Setting Up For Tests\", function () { return setupTests(); });\n else {\n targetPlatforms.forEach(function (platform) {\n var prefix = (TestConfig.onlyRunCoreTests ? \"Core Tests \" : \"Tests \") + TestConfig.thisPluginPath + \" on \";\n describe(prefix + platform.getName(), function () { return createAndRunTests(platform); });\n });\n }\n });\n}", "async setup() { }", "function setUp(){\n\t\t// reset game\n\t\tgameReset();\n\n\t\t// create player\n\t\tsnakeHead = Head.create(0,10, Config.startingLife, 0, map);\n\t\tsnakeHead.onGameoverCallback = gameEnd;\n\n\t\t// first few moves to create a working body\n\t\tvar startLife = Config.startingLife;\n\t\tfor (var i = 0; i < startLife; i++) {\n\t\t\tsnakeHead.move(gameMetrics);\n\t\t\t// move body parts\n\t\t\tBody.all(function(element){\n\t\t\t\telement.step();\n\t\t\t});\n\t\t}\n\n\t\t// place food\n\t\tvar newFood = Food.create(0, 0, map);\n\t\t// randomize food location\n\t\tnewFood.move(gameMetrics);\n\t}", "function before() {\n\n server = sinon.fakeServer.create();\n }", "function initTest() {\n if (options.keyboardSupport) {\n addEvent('keydown', keydown);\n }\n }", "function initTest() {\n if (options.keyboardSupport) {\n addEvent('keydown', keydown);\n }\n }", "function initTest() {\n if (options.keyboardSupport) {\n addEvent('keydown', keydown);\n }\n }", "function initializeFunz() {\n\t\tconsole.log('Initialized -------->', Notification.permission);\n\n\t\t//Check for Notification permission\n\t\tif (Notification.permission === 'denied') {\n\t\t\talert('User blocked the notification');\n\t\t\treturn false;\n\t\t}\n\n\t\t//Check for push notification support\n\t\tif (!('pushManager' in window)) {\n\t\t\talert('Push notification is not supported');\n\t\t\treturn false;\n\t\t}\n\t}", "function init() {\n\t\tuserAgentCheck();\n\t\ttestThis();\n\t}", "before (callback) {\n\t\t// replace the test email with something random...\n\t\tsuper.before((error) => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.data.email = this.userFactory.randomEmail();\n\t\t\tcallback();\n\t\t});\n\t}", "function init() {\n setupListeners();\n }", "function setup() {\n console.log('Mosca server is up and running');\n server.authenticate = authenticate;\n server.authorizePublish = authorizePublish;\n server.authorizeSubscribe = authorizeSubscribe;\n}", "function test_notification_banner_service_event_should_be_shown_in_notification_bell() {}", "sendNotifications() {\n var _a, _b;\n return this.notifications.send(services_notifications_1.NotificationType.EMAIL, {\n to: (_b = (_a = this.config.thrizer) === null || _a === void 0 ? void 0 : _a.email) === null || _b === void 0 ? void 0 : _b.to,\n subject: 'send test email',\n text: 'test',\n });\n }", "function setup() {\n\n\t\t\t\t\t}", "function runBaseTests() {\n px_validation = document.getElementById('px_validation_1');\n\n suite('Base Automation Tests for px-validation', function() {\n\n test('Polymer exists', function() {\n assert.isTrue(Polymer !== null);\n });\n test('px-validation fixture is created', function() {\n assert.isTrue(document.getElementById('px_validation_1') !== null);\n });\n\n });\n}", "constructor(setup) {\n this.setup = setup;\n }", "function _testSuiteProjectInit() {\n return ImptTestHelper.runCommand(`impt project create --product ${PRODUCT_NAME} --name ${DEVICE_GROUP_NAME} -q`, ImptTestHelper.emptyCheck);\n }", "function _testSuiteInit() {\n return ImptTestHelper.runCommand(`impt product create --name ${PRODUCT_NAME}`, (commandOut) => {\n product_id = ImptTestHelper.parseId(commandOut);\n if (!product_id) fail(\"TestSuitInit error: Failed to create product\");\n ImptTestHelper.emptyCheck(commandOut);\n }).\n then(() => ImptTestHelper.runCommand(`impt dg create --name ${DG_NAME} --descr \"${DG_DESCR}\" --product ${PRODUCT_NAME} ${outputMode}`, (commandOut) => {\n dg_id = ImptTestHelper.parseId(commandOut);\n if (!dg_id) fail(\"TestSuitInit error: Failed to create device group\");\n ImptTestHelper.emptyCheck(commandOut);\n }));\n }", "afterEach() {}" ]
[ "0.66008073", "0.6420947", "0.6063453", "0.6061382", "0.604477", "0.5881562", "0.58416516", "0.5809288", "0.5793239", "0.5790415", "0.57823956", "0.5749585", "0.5735981", "0.5735981", "0.5735981", "0.57286215", "0.56707954", "0.56110406", "0.5605891", "0.5576941", "0.5574333", "0.5574333", "0.5574333", "0.551371", "0.54840815", "0.5482911", "0.5479784", "0.54646605", "0.54646415", "0.5452216", "0.54491246", "0.5447011", "0.54412454", "0.5429847", "0.5402022", "0.53995556", "0.53775156", "0.53683627", "0.53672725", "0.5361064", "0.5351978", "0.53481346", "0.5334463", "0.53074", "0.5290606", "0.52686", "0.5258815", "0.5256632", "0.5255111", "0.5250001", "0.5245236", "0.5241226", "0.52384615", "0.5219458", "0.5219406", "0.52157426", "0.5207546", "0.5201641", "0.52000415", "0.51994777", "0.5196551", "0.5194452", "0.51942503", "0.5189178", "0.5181137", "0.5168292", "0.5166785", "0.51551527", "0.5151733", "0.5144447", "0.5139312", "0.5121263", "0.50941724", "0.5092608", "0.5075251", "0.50749356", "0.50743264", "0.50650895", "0.5062812", "0.5061692", "0.5041498", "0.50414217", "0.50404835", "0.5021589", "0.5007172", "0.5007172", "0.5007172", "0.50017864", "0.49998215", "0.49994308", "0.49958593", "0.49955383", "0.499371", "0.49892232", "0.49891478", "0.4977609", "0.4973939", "0.49666128", "0.49638414", "0.4963771" ]
0.54572386
29
Redirect to the correct page once we establish where that should be.
componentDidUpdate(prevProps) { const { activeWallet, activeWalletSettings, hasWallets, history, isWalletOpen, lightningGrpcActive, walletUnlockerGrpcActive, startActiveWallet } = this.props // If we have just determined that the user has an active wallet, attempt to start it. if (typeof activeWallet !== 'undefined') { if (activeWalletSettings) { if (isWalletOpen) { startActiveWallet() } else { return history.push(`/home/wallet/${activeWallet}`) } } // If we have an at least one wallet send the user to the homepage. // Otherwise send them to the onboarding processes. return hasWallets ? history.push('/home') : history.push('/onboarding') } // If the wallet unlocker became active, switch to the login screen if (walletUnlockerGrpcActive && !prevProps.walletUnlockerGrpcActive) { return history.push(`/home/wallet/${activeWallet}/unlock`) } // If an active wallet connection has been established, switch to the app. if (lightningGrpcActive && !prevProps.lightningGrpcActive) { if (activeWalletSettings.type === 'local') { return history.push('/syncing') } else { return history.push('/app') } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "redirect() {\n const hash = Radio.request('utils/Url', 'getHash');\n\n // Redirect back only if it's notebooks page\n if (hash.search(/notebooks/) !== -1) {\n Radio.request('utils/Url', 'navigate', {\n trigger : false,\n url : '/notebooks',\n includeProfile : true,\n });\n }\n }", "_redirect_to_page() {\n var stored_startingPage = localStorage.getItem(\"startingPage\");\n if (stored_startingPage) {\n console.log('TrackingApp: Redirecting to user preferred page: ', stored_startingPage);\n this.set('route.path', stored_startingPage);\n }\n }", "function redirectPage() {\n window.location = s.linkLocation;\n }", "function redirector(e)\n{\n\tconsole.log(\"classicify.redirector(): checking if redirect necessary\");\n\tif (isTargetURL(window.location.href))\n\t{\n\t\tvar url = makeClassic(window.location.href);\n\t\tconsole.log(\"classicify.redirector(): redirecting to \" + url);\n\t\twindow.location.replace(url);\n\t}\n}", "redirect () {\n this.props.preClick()\n if (this.props.delay) {\n setTimeout(() => {\n this.context.updateCurrentPage(this.props.redirectPage)\n }, this.props.delay)\n } else {\n this.context.updateCurrentPage(this.props.redirectPage)\n }\n }", "function redirect(dest) {\n\thideCurrent(locate);\n\tactive_nav(dest);\n\t//show desired page element\n\tswitch(dest) {\n\t\tcase 'Home':\n\t\t\tshowElement('#slide-show');\n\t\t\tbreak;\n\t\tcase 'Login':\n\t\t\thideElement('#slide-show');\n\t\t\tshowElement('.full-page');\n\t\t\tshowElement('.login');\n\t\t\tbreak;\n\t\tcase 'SignUp':\n\t\t\thideElement('#slide-show');\n\t\t\tshowElement('.full-page');\n\t\t\tshowElement('.register');\n\t\t\tbreak;\n\t\tcase 'Dashboard':\n\t\t\tshowElement('.sidebar');\n\t\t\tshowElement('#task-dashboard');\n\t\t\tuser_retrieve('dashboard');\n\t\t\ttask_retrieve('ongoing');\n\t\t\tbreak;\n\t\tcase 'Account':\n\t\t\t$('#n_password').prop('disabled', true);\n\t\t\t$('#r_password').prop('disabled', true);\n\t\t\tuser_retrieve('account');\n\t\t\tbreak;\n\t\tcase 'Lead':\n\t\t\tdisplay_leaderboard();\n\t\t\tbreak;\n\t\tcase 'NewTask':\n\t\t\tshowElement('.full-page');\n\t\t\tshowElement('.task-create');\n\t\t\tbreak;\n\t\tcase 'EditTask':\n\t\t\tshowElement('.task-update');\n\t\t\tbreak;\n\t\tcase 'Task':\n\t\t\tshowElement('.full-page');\n\t\t\tshowElement('.sidebar');\n\t\t\tshowElement('#task-dashboard');\n\t\t\tuser_retrieve('dashboard');\n\t\t\ttask_retrieve('ongoing');\n\t\t\tbreak;\n\t\tcase 'About':\n\t\t\thideElement('.sidebar');\n\t\t\thideElement('#slide-show');\n\t\t\tshowElement('.content-about');\n\t\t\tbreak;\n\t\tcase 'Logout':\n\t\t\tlogout();\n\t\t\tbreak;\t\t\t\t\n\t}\n}", "function doDefaultRedirect() {\n\n var node = getNodeForItem($scope.getActiveItem());\n var state, childNode;\n\n if (node) {\n if (node === $scope.getSelectedTabNode()) {\n // The current node is a tab. \n // Find the first report, chart or screen\n childNode = findFirstReportScreenOrChartInTree(node);\n\n if (childNode) {\n state = sp.result(childNode, 'item.state');\n } else {\n state = sp.result(node, 'children.0.item.state');\n }\n } else if (node === $scope.getSelectedMenuNode()) {\n // Get the first tab\n state = sp.result(node, 'children.0.item.state');\n }\n\n if (state) {\n $state.go(state.name, state.params);\n $location.replace();\n }\n }\n }", "function redirectByUrl() {\n location.href = u;\n }", "function gotoURL(location) {document.location=location;}", "function redirectToOrderPage() {\n window.location = \"/order\";\n}", "function redirectPage(res) {\n\t// redirects page to home route without the user having to refresh page\n\tres.redirect('/');\n}", "function pageRedirect() {\n window.location.href = \"ErrorPage.html\";\n}", "function redirectToPhysioExperts() {\n\t\t\t$state.go(\"homepages.physioexperts\");\n\t\t}", "function redirect() {\n\tvar schemaBuilder = lf.schema.create('fashionfitness', 1);\n\tschemaBuilder.createTable('login').\n\t\taddColumn('id', lf.Type.INTEGER).\n\t\taddColumn('username', lf.Type.STRING).\n\t\taddColumn('password', lf.Type.STRING).\n\t\taddColumn('active', lf.Type.BOOLEAN).\n\t\taddPrimaryKey(['id']);\n\t// Connect to the database and add an account\n\tschemaBuilder.connect().then(function(db) {\n\t\tvar account = db.getSchema().table('login');\n\t\treturn db.select().\n\t\t\t\tfrom(account).\n\t\t\t\twhere(account.active.eq(true)).\n\t\t\t\texec().\n\t\tthen(function(results) {\n\t\t\tresults.forEach(function(row) {\n\t\t\t\tconsole.log(\"Utente loggato, reindirizzo alla dashboard\");\n\t\t\t\t// window.location.href = \"home.html\" // Adds an item to the history\n\t\t\t\twindow.location.replace(\"home.html\"); // It replaces the current history item, you can't go back\n\t\t\t});\n\t\t});\n\t});\n}", "function redirectToLogin() {\n\tvar redirect_page = buildRedirectPage();\n\tdocument.body.append(redirect_page);\n\n\tconsole.log(\"Attempted redirect.\");\n}", "function pageOneSubmitPressed() {\r\n window.location.href = \"2nd.html\";\r\n}", "function redirectNextComparison( ) {\n\n redirectToComparison( $(\"#next-page\").attr( \"href\") );\n}", "function pageRedirect() {\n sleep(500).then(() => { window.location.replace(\"/dashboard\"); });\n}", "function redirectFinal() {\n window.location.href = 'badlib.html';\n}", "function pageRedirect(page) {\n window.location.href = page;\n}", "function acceptPage (req, res, nextFn) {\n res.redirect('/')\n nextFn()\n}", "function change() {\r\n console.log(\"correct\");\r\n window.location = \"main/main.html\";\r\n}", "function redirect() {\n res.statusCode = 301;\n res.setHeader('Location', req.url + '/');\n res.end('Redirecting to ' + req.url + '/');\n }", "redirect(oldUrl, newUrl){\n /*if(this._caseInsensitive){\n oldUrl = oldUrl.toLowerCase();\n newUrl = newUrl.toLowerCase();\n }\n\n if(oldUrl === newUrl) throw new Error(\"Redirect loop found as both urls are the same\");\n\n if(typeof oldUrl === \"string\"){\n this._getParameters(oldUrl, (params, newRoute)=>{\n oldUrl = newRoute;\n });\n }\n\n if (this._requestPath().match(`${oldUrl}$`)){\n return window.location.href= newUrl;\n }*/\n return this;\n }", "onOk() {\n doneRedirect();\n }", "switchBackToShopmanagament() {\n window.location.assign(\"#/eventmgmt/shop\")\n }", "function do_redirect(lang) {\n if (current_page !== undefined && languages[lang].indexOf(current_page) >= 0) {\n window.location.pathname = lang +'/'+ current_page;\n }\n else if (current_page !== undefined && languages[lang].indexOf('quickstart') >= 0) {\n window.location.pathname = lang +'/quickstart';\n }\n else if (current_page !== undefined) {\n window.location.pathname = lang +'/'+ languages[lang][0];\n } else {\n window.location.pathname = lang +'/quickstart';\n }\n }", "function redirect(location) { window.location.href = location;}", "function redirect(url) {\r\n url = url || 'index.html';\r\n location.href = url;\r\n }", "function redirectToDetailPage() {\n console.log(\"in global.redirectToDetailPage\");\n // switch the browser to the detail page\n window.location ='detail.html';\n }", "function pageRedirect(){\r\n if(score == 50){\r\n window.location.href = \"lv3.html\";\r\n } \r\n}", "function redirectToLandingPage() {\n return router.push(\"/\");\n }", "function redirectToFaq() {\n\t\t\t$state.go(\"homepages.faq\");\n\t\t}", "function forwardPageAfterSignUp(){\n setTimeout(\"window.location ='/goals'\",1000);\n}", "redirect() {\n if (get(this, 'session.isAuthenticated')) {\n this.transitionTo('index');\n }\n }", "function pageRedirect() {\n var initials = document.querySelector(\"#initials\").value;\n\n if (initials) {\n saveScoreInLocalStorage();\n window.location.href = \"high-scores.html?\";\n } else {\n alert(\"Please provide your initials\");\n }\n}", "function redirect_to_add_truck(pageContext) {\n // redirect\n window.location.href = pageContext + '/employee/truck/add';\n}", "function myNewPage() {\n\twindow.location.assign(\"http://www.google.md\");\n}", "function goToFirstPage(){\r\n console.log(\"working\");\r\n location.replace(\"../html/StartHere.html\");\r\n}", "function nextPage(targetPage){\n\n switch(targetPage) {\n case \"things\":\n window.location = \"thingsToDoPage.html?parkCode=\" + parkCode + \"&parkName=\" + parkName;\n break;\n case \"learn\":\n window.location = \"learnMorePage.html?parkCode=\" + parkCode + \"&parkName=\" + parkName;\n break;\n }\n}", "function redirectPage () {\n\twindow.location = link;\n}", "function fixLoginRedirect(){\n if(currentPage==\"login\"){\n if(loggedIn()){\n switchPage(afterLogin);\n }\n }\n setTimeout(fixLoginRedirect,100);\n}", "function redirectToOldLink() {\n \tvar linkRedirect = $routeParams.continue;\n \tif(linkRedirect != null && linkRedirect !== undefined && linkRedirect !== '') {\n \t\twindow.location.href = decodeURIComponent(linkRedirect);\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "function managerredirect(){\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"GET\", \"/\", true);\n xhttp.send();\n\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n window.location.replace(\"/manager.html\");\n }\n };\n}", "async function handleRedirectAfterLogin() {\n\t await handleIncomingRedirect();\n\n\t session = getDefaultSession();\n\n\t if (session.info.isLoggedIn) {\n\t // Update the page with the status.\n\t await setLoggedIn(true);\n\t await setWebId(session.info.webId);\n\t let newPodUrl = getPODUrlFromWebId(session.info.webId);\n\t await setPodUrl(newPodUrl);\n\t }\n\t}", "function redirectAfterPayment() {\n clearCart();\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/index.html\";\n window.location = fullPath;\n}", "function redirect(){\n window.location.href = \"../../maincontents.htm\";\n}", "function gotoPage(pageURL) {\n console.log(\"Moving to \" + pageURL);\n window.location.assign(pageURL);\n}", "function checkPage() {\n var path = window.location.pathname;\n if (path.search('/$') == -1\n && path.search('index.html') == -1\n && path.search('signup.html') == -1)\n {\n if (isLoggedIn()) {\n if (path.search('/personal/') == -1 && path.search(sessionStorage['usertype']) == -1) {\n window.location.assign('../personal/courses.html');\n return;\n }\n }\n else {\n window.location.assign('../index.html');\n return;\n }\n } else if (isLoggedIn()) {\n window.location.assign('personal/courses.html');\n return;\n }\n}", "function changePage(){\n\t\twindow.location = \"processing.html\";\n\t}", "fallback() {\n document.location = this.url;\n }", "fallback() {\n document.location = this.url;\n }", "function redirect() {\n res.statusCode = 301;\n res.setHeader('Location', req.url + '/');\n res.end('Redirecting to ' + req.url + '/');\n }", "function redirection(req, res, next) {\n req.session.returnTo = req.originalUrl;\n return next();\n}", "function redirectUserToThePageAccordingToHisRole() {\n UserService.requestUser((res) => {\n if (!res.data.success) {\n return NotificationService.info(res.data.data.data.message);\n }\n\n UserService.save(res.data.data);\n\n let isSuperAdmin = UserService.isSuperAdmin;\n if (isSuperAdmin()) {\n $window.location.hash = '#/';\n $window.location.pathname = '/admin/';\n } else {\n $window.location.hash = '#/';\n $window.location.pathname = '/app/';\n }\n });\n }", "function redirectPreviousComparison( ) {\n\n redirectToComparison( $(\"#previous-page\").attr( \"href\") );\n}", "function updatePageUrl() {\n var path = '/' + site.document.id;\n if (window.location.pathname !== path) {\n if (history) history.replaceState(null, null, path);\n else window.location.replace(path);\n }\n}", "function redirect(id) {\n\tlocation.assign(\"question.php?id=\"+id);\t\n}", "success() {\n // no need for response data\n // redirect to index page when done\n wx.redirectTo({\n url: '/pages/index/index'\n });\n }", "function loadUrl(newLocation)\n {\n window.location = newLocation;\n return false;\n }", "function switchEm()\n{\n// seed the first attempt\n// with a random page\n//\n\tvar strTemp=pages[newPage()];\n//\n// check for the page in the url of \n// the current page.\n//\n\twhile (window.location.href.indexOf(strTemp)!=-1){\n//\n// If it's there, pick a new page and loop\n//\n\tstrTemp=pages[newPage()]\n\t}\n\twindow.location.href=strTemp\n}", "function redirect(){\n window.location = \"view_foods.html\";\n}", "redirect(e) {\n var curLink = e.currentTarget.innerText;\n var campus = this.props.campus.city;\n switch (curLink) {\n case \"Campuses\": hashHistory.replace(\"/\"); break;\n case \"Apartments\": hashHistory.replace(\"/apartments/\" + campus); break;\n case \"Waitlist\": hashHistory.replace(\"/waitlist\"); break;\n case \"Work Orders\": hashHistory.replace(\"/workorders\"); break;\n case \"Tour/FAQ\": hashHistory.replace(\"/portaladmin\"); break;\n case \"Portal\": hashHistory.replace(\"/portal\"); break;\n case \"Tour\": hashHistory.replace(\"/tour\"); break;\n case \"FAQ\": hashHistory.replace(\"/faq\"); break;\n default: break;\n }\n }", "function redirect () {\n res.statusCode = 301\n res.setHeader('Location', req.url + '/')\n res.end('\\n')\n }", "function getAccountPage() {\n console.log(\"Redirecting to account page\");\n location.href = \"ProfilePage.html\";\n}", "function getAccountPage() {\n console.log(\"Redirecting to account page\");\n location.href = \"ProfilePage.html\";\n}", "function goToPage($this){\n if($this.val() !== null){document.location.href = $this.val()}\n }", "function goToPage($this){\n if($this.val() !== null){document.location.href = $this.val()}\n }", "function goLocationPage(page){\n window.location.href = page;\n}", "function checkPage(){\n\n if($location.path()==\"/home\"){\n $scope.page='order';\n $location.path('/order'); // redirects /home to /order\n }\n else if($location.path()==\"/order\"){\n $scope.page='order';\n }\n else if($location.path()==\"/cart\"){\n $scope.page='cart';\n }\n else if($location.path()==\"/confirmation\"){\n getConfirmation(); // call function to retrieve confirmation variables\n $scope.page='confirmation';\n }\n else{\n $scope.page='order';\n }\n }", "redirect(to) {\n location.href = to;\n }", "function _redirect(error) {\n console.log(error);\n window.location = \"/login.html\"; \n}", "function redirectTo(result,source) { \n \n if(eventData.eventEditionId != undefined) {\n delete eventData[\"eventEditionId\"];\n if($(eventData.dis).hasClass(\"past_edition\")) {\n $('#TenTimes-Modal').modal('hide');\n verifiedReviewSubmit();\n }\n else if((getSearchParams('ed') != undefined) || ($(eventData.dis).hasClass(\"ed-action\"))) {\n showThank('event');\n hitMyData();\n }\n return true;\n }\n showloading();\n/*\n var stopRedirection=['interested_attend'];\n if(stopRedirection.indexOf(source)> -1){\n hideloading();\n return true; \n }\n*/\n redirecturi='';\n if(source == undefined || source == \"\" ){\n redirecturi=site_url_attend +'/dashboard/event?ref='+result.encode_id+'&thankyou=1';\n window.location.assign(redirecturi);\n return true;\n }\n if(source.search(/attend/)>-1)\n source='going';\n\n if(source=='bookmark')\n source='bookmark';\n else if(source.search(/interest/)>-1 || source.search(/follow/)>-1)\n source='interested';\n else if(source.search(/stall/)>-1 || source.search(/Stall/)>-1)\n source='stall-enquiry';\n else if(source.search(/going/)>-1 && (pageType=='listing' || pageType==\"top100\" || pageType==\"top100country\" || pageType==\"top100industry\" || pageType==\"venue_detail\" || pageType==\"org_detail\")) {\n var eventurl=eventData.url;\n eventurl=eventurl.replace(window.location.origin,'');\n eventurl=eventurl.replace(window.host,'');\n eventurl=eventurl.replace('/','');\n if(result.question == 0)\n redirecturi=site_url_attend +'/dashboard/event?ref='+result.encode_id+'&thankyou=1'; \n else\n redirecturi=site_url_attend +'/'+eventurl+\"/\"+source+\"?source=autosubmit\"+getOneClickSource(source)+\"_\"+pageType; \n }\n if(pageType=='listing' || pageType==\"top100\" || pageType==\"top100country\" || pageType==\"top100industry\" || pageType==\"venue_detail\"){}else{\n if(source!='follow'){ \n if(result.question == 0)\n redirecturi=site_url_attend +'/dashboard/event?ref='+result.encode_id+'&thankyou=1'; \n else\n redirecturi=site_url_attend +'/'+$('#event_url').val()+\"/\"+source+\"?source=autosubmit\"+getOneClickSource(source)+\"_\"+pageType;\n }else{\n redirecturi=site_url_attend +'/dashboard/event?ref='+result.encode_id+'&thankyou=1'; \n }\n }\n window.location.assign(redirecturi);\n}", "function redirectHome(request, response) {\n\t\tresponse.redirect('/home');\n\t}", "function changePage(newIndex) {\n var resultsURL = '#/results/' + $scope.client_name + '/' +\n $scope.forms[newIndex].name + '/' + $scope.client_id +\n '/' + $scope.forms[newIndex].id + '/' + $scope.assessment_id;\n $window.location.assign(resultsURL);\n }", "function pageLoad() {\n\t\t\t\t\twindow.location.assign(\"blue.html\");\n\t\t\t\t}", "function goPage(url) {\n //alert(\"goPage(\" + url + \")\");\n if (url != null) window.location = url;\n}", "function redirect(url) {\n url = url || '/start';\n $location.path( url );\n }", "function changePage2(){\n window.location = \"indexresults.html\";\n }", "function redirectTopage(pagename) {\n\t\n\t\n\t $(\".ui-loader\").show();\t\n\t \n\t\n\t \t\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/\" + pagename;\n if(pagename=='index.html')\n {\n //localStorage.setItem('foo',1);\n\t\t $(\".ui-loader\").hide();\n }\n Page.redirect(pagename, 'slide', 'down')\n \n //window.location = fullPath;\n}", "async function handleRedirection() {\r\n await insertNewClientIntoDB();\r\n const email = sessionStorage.getItem('email');\r\n const user = await getUserWithMail(email);\r\n\r\n if (user.Role == \"admin\") {\r\n // redirect to admin dashboard if the user is admin\r\n window.location = \"/adminDashboard.html\";\r\n } else if (user.Role == \"instructor\") {\r\n // redirect to instructor dashboard if the user is instructor\r\n window.location = \"/instructorDashboard.html\";\r\n } else if (user.Role == \"user\") {\r\n\r\n // get if the user has membership or not\r\n const isMember = await hasmembership(user.Email);\r\n\r\n if (isMember) {\r\n // redirect to client dashboard if the user is client and also have a membership\r\n window.location = \"/clientDashboard.html\";\r\n } else {\r\n // redirect to buy membership page if the user is client and don't have a membership\r\n window.location = \"/membership.html\";\r\n }\r\n }\r\n\r\n}", "function redirectTo(theurl) { window.location = theurl.app_url+\"&option[loader]=\"+encodeURI(window.location.href); }", "function newLocation() {\r\n\tdocument.location.href = \"http://www.\" + adURL[thisAd];\r\n\treturn false;\r\n}", "function\tForward(url)\n{\n\twindow.location.href = url;\n}", "function redirectSearches(){\r\n\t\r\n\tvar searchList = getUrlParameter(\"search\");\r\n\tvar eventAddress = getUrlParameter(\"event\");\r\n\tvar isManual = getUrlParameter(\"manual\");\r\n\t\r\n\t\r\n\t//Nearby Search\r\n\tif (searchList != undefined && eventAddress == undefined){\r\n\t\tsearchMap(searchList,false);\r\n\t}\r\n\t\r\n\t//Address Search\r\n\tif (searchList != undefined && searchList != \"None Given\" && eventAddress == \"true\"){\r\n\t\tsearchMap(searchList,true);\r\n\t}\r\n\t\r\n\t//Manual Lists\r\n\tif (searchList != undefined && eventAddress == undefined && isManual ==\"true\"){\r\n\t\tgetList(searchList);\r\n\t}\r\n\t\r\n\t//Load Address Book\r\n\t//loadAddressList(); Thynote: on click for tab now \r\n}", "function redirectToBooking1() {\n\t\t// InitiateCheckout\n\t\t// Track when people enter the checkout flow (ex. click/landing page on checkout button)\n\t\ttry {\n\t\t\tfbq('track', 'InitiateCheckout');\n\t\t} catch(err) {}\n\t\t\t\n\t\tif(vm.model.selectedLocation != 'Choose Location' && \n\t\t\t(vm.model.selectedDate != undefined || vm.model.selectedDate != \"\") &&\n\t\t\t (vm.model.timeslot != \"Select Time\")) {\n\t\t\tvar obj = {\n\t\t\t\tlocation: vm.model.selectedLocation,\n\t\t\t\tdate: vm.model.selectedDate,\n\t\t\t\tdatesEnabled: localVariables.enableDatesArray,\n\t\t\t\ttimeslot: vm.model.timeslot,\n\t\t\t\ttimeslotArray: vm.model.timeslotArray,\n\t\t\t\tcityid: localVariables.cache.cityToIdMap[\"Pune\"],\n\t\t\t\tapptCost: vm.model.apptCost\n\t\t\t};\n\t\t\t/* \n\t\t\t* Set the master controller flag to true\n\t\t\t* It indicates the booking details are filled and navigate to the desired location.\n\t\t\t* On loading the booking pages, checkHomeDataFilled() is excecuted to check this flag. \n\t\t\t*/\n\t\t\t$scope.$parent.cpc.flags.booknowSectionfieldsValid = true;\n\t\t\t$cookies.put('booking_session', 'in_progress', { path: \"/\"});\n\t\t\tcustportalGetSetService.setBooknowObj(obj);\n\t\t\t$state.go('booking.booking1');\n\t\t} else {\n\t\t\t$scope.$parent.cpc.flags.booknowSectionfieldsValid = false;\n\t\t\t$scope.$parent.cpc.flags.bookNowError = true;\n\t\t\t$timeout(function () { $scope.$parent.cpc.flags.bookNowError = false; }, 5000);\n\t\t\t//alert(\"Please fill the Booking Details to proceed.\");\n\t\t}\n\t}", "function pageLoad() {\n\t\t\t\t\twindow.location.assign(\"fly.html\");\n\t\t\t\t}", "function gotFileEntry(fileEntry) \n \t{\n\t\twindow.location.href=strNextPage;\n \t}", "function timeoutRedirect()\n\t\t{\n \t\t$location.path(\"/merchants/\" + merchantId + \"/thankyou\");\n\t\t}", "function redirectBack() {\n try {\n window.location.href = '../Main/whatsapp.html';\n if (!window.location.href)\n throw new Error('The page where you want to redirect it doesn´t exist!');\n }\n catch (error) {\n console.error(error);\n }\n}", "function redirect(req, res) {\n res.redirect('/');\n }", "function signupredirect(){\n\n var xhttp = new XMLHttpRequest();\n\n xhttp.open(\"GET\", \"/signup.html\", true);\n xhttp.send();\n\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n window.location.replace(\"/signup.html\");\n }\n };\n}", "function checkURL(req, res, next) {\n // If path is nearest then route on, otherwise redirect to Github repo\n if (req.path == '/nearest') {\n next();\n }\n else {\n res.redirect(301, 'https://github.com/MichaelGordon/Height-API');\n }\n}", "function redirectToStaticLose(){\n window.location = \"http://onestepfurther.science/kea/02-animation/strangelove/static-plane-lose.html\";\n}", "function redirect(entry) {\n setLoginRoute(entry);\n setLoginError('');\n setLoginMessage('');\n setResendEmailLink(false);\n setReEnterEmailLink(false);\n setChangeEmailLink(false);\n setLoginDropdown(true);\n }", "function redirect(entry) {\n setLoginRoute(entry);\n setLoginError('');\n setLoginMessage('');\n setResendEmailLink(false);\n setReEnterEmailLink(false);\n setChangeEmailLink(false);\n setLoginDropdown(true);\n }", "function redirectToNext(req, res) {\n var redirectTo = req.session.next || '';\n req.session.next = null; // Null it so that we do not use it again.\n res.redirect(redirectTo);\n}", "function redirectToBooking1() {\n\t\t\t// InitiateCheckout\n\t\t\t// Track when people enter the checkout flow (ex. click/landing page on checkout button)\n\t\t\ttry {\n\t\t\t\tfbq('track', 'InitiateCheckout');\n\t\t\t} catch(err) {}\n\n\t\t\t// Google Analytics - 'Book My Session' event\n\t\t\ttry {\n\t\t\t\tga('send', 'event', 'Book My Session', 'click');\n\t\t\t} catch(err) {}\n\t\t\t\n\t\t\t/*vm.fromDt = $('.dt1').val();*/\n\t\t\tif(vm.selectedLocation != 'Choose Location' && \n\t\t\t\t(vm.selectedDate != undefined || vm.selectedDate != \"\") &&\n\t\t\t\t (vm.timeslot != \"Select Time\")) {\n\t\t\t\tvar obj = {\n\t\t\t\t\tlocation: vm.selectedLocation,\n\t\t\t\t\tdate: vm.selectedDate,\n\t\t\t\t\tdatesEnabled: enableDatesArray,\n\t\t\t\t\ttimeslot: vm.timeslot,\n\t\t\t\t\ttimeslotArray: vm.timeslotArray,\n\t\t\t\t\tcityid: cache.cityToIdMap[\"Pune\"],\n\t\t\t\t\tapptCost: vm.apptCost\n\t\t\t\t};\n\t\t\t\tvm.flags.booknowSectionfieldsValid = true;\n\t\t\t\tcustportalGetSetService.setBooknowObj(obj);\n\t\t\t\t$cookies.put('booking_session', 'in_progress', { path: \"/\"});\n\t\t\t\t$state.go('booking.booking1');\n\t\t\t} else {\n\t\t\t\tvm.flags.booknowSectionfieldsValid = false;\n\t\t\t\tvm.flags.bookNowError = true;\n\t\t\t\t$timeout(function () { vm.flags.bookNowError = false; }, 5000);\n\t\t\t\t//alert(\"Please fill the Booking Details to proceed.\");\n\t\t\t}\n\t\t}", "function toClientHome(){\n\t document.location.href = parentUrl(parentUrl(document.location.href));\n }", "function nav(){\n var path = currentTest().path;\n window.location = path;\n }", "function redirectError() {\n $state.go('500');\n }" ]
[ "0.688686", "0.688005", "0.68734115", "0.66168904", "0.6590932", "0.64717966", "0.64498144", "0.64107895", "0.6407647", "0.6356509", "0.63378304", "0.6324629", "0.6323785", "0.6253995", "0.6249762", "0.6243455", "0.62314206", "0.622608", "0.62212086", "0.6219932", "0.6216191", "0.6192638", "0.61645234", "0.61635745", "0.6158542", "0.61572486", "0.61571884", "0.6146621", "0.61339086", "0.6133634", "0.61251444", "0.6115574", "0.6114603", "0.6113067", "0.61107284", "0.6097008", "0.6093717", "0.60718405", "0.60673535", "0.60664266", "0.6059228", "0.6058119", "0.6057991", "0.6052957", "0.6050893", "0.6049565", "0.6042657", "0.6028353", "0.6022448", "0.602236", "0.60125804", "0.60125804", "0.6006556", "0.60012347", "0.5998794", "0.5997557", "0.5994058", "0.5991404", "0.59875154", "0.59799546", "0.59759027", "0.59744173", "0.5971194", "0.59597754", "0.59525114", "0.59525114", "0.59514695", "0.59514695", "0.5944189", "0.5937472", "0.59373695", "0.5936552", "0.5927753", "0.5926537", "0.5913325", "0.5907635", "0.59064096", "0.59053284", "0.5900098", "0.5891484", "0.5886811", "0.588667", "0.5880699", "0.58788747", "0.5872518", "0.58703125", "0.58698606", "0.58639765", "0.58596617", "0.58521736", "0.5844929", "0.5844368", "0.5835857", "0.58249664", "0.58222735", "0.58222735", "0.5821778", "0.58196867", "0.5810466", "0.5803401", "0.5803163" ]
0.0
-1
here is a helper function to shuffle an array it returns the same array with values shuffled it is based on an algorithm called Fisher Yates if you want ot research more
function shuffle(array) { let counter = array.length; // While there are elements in the array while (counter > 0) { // Pick a random index let index = Math.floor(Math.random() * counter); // Decrease counter by 1 counter--; // And swap the last element with it let temp = array[counter]; // temp = array[counter] = array[index]; array[index] = temp; } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shuffle(array){\n\t\t\t\t\t\t\t\t \tvar currentIndex = array.length;\n\t\t\t\t\t\t\t\t \tvar temporaryValue;\n\t\t\t\t\t\t\t\t \t//var randIndex;\n\n\t\t\t\t\t\t\t\t \twhile (currentIndex > 0){\n\t\t\t\t\t\t\t\t \t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\t\t\t\t\t\t \t\tcurrentIndex --;\n\n\t\t\t\t\t\t\t\t \t\ttemporaryValue = array[currentIndex];\n\t\t\t\t\t\t\t\t \t\tarray[currentIndex] = array[randomIndex];\n\t\t\t\t\t\t\t\t \t\tarray[randomIndex] = temporaryValue;\n\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t \t\treturn array;\n}", "static shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffle(arr){\n\t\t\t\t\t\t for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);\n\t\t\t\t\t\t return arr;\n\t\t\t\t\t\t}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "function shuffle(array){\n\tvar currentIndex = array.length;\n\tvar temporaryValue;\n\t//var randIndex;\n\n\twhile (currentIndex > 0){\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex --;\n\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\t\treturn array;\n}", "function shuffle(array){\n\tvar currentIndex = array.length;\n\tvar temporaryValue;\n\t//var randIndex;\n\n\twhile (currentIndex > 0){\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex --;\n\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\t\treturn array;\n}", "function shuffle(array){\n\tvar currentIndex = array.length;\n\tvar temporaryValue;\n\t//var randIndex;\n\n\twhile (currentIndex > 0){\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex --;\n\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\t\treturn array;\n}", "function shuffle( arr ) {\n\t\tlet currentIndex = arr.length,\n\t\t\ttemporaryVal,\n\t\t\trandomIndex;\n\n\t\twhile( 0 < currentIndex-- ) {\n\t\t\trandomIndex = Math.floor( Math.random() * ( currentIndex + 1 ) );\n\t\t\ttemporaryVal = arr[currentIndex];\n\t\t\tarr[currentIndex] = arr[randomIndex];\n\t\t\tarr[randomIndex] = temporaryVal;\n\t\t};\n\n\t\treturn arr;\t\t\n\t}", "function shuffle (array) {\n \n var currentIndex = array.length;\n var temporaryValue;\n var randomIndex;\n \n while (0 !== currentIndex) {\n \n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n \n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n \n }\n \n return array;\n \n}", "function shuffle( arr )\n{\n var pos, tmp;\n\t\n for( var i = 0; i < arr.length; i++ )\n {\n pos = Math.round( Math.random() * ( arr.length - 1 ) );\n tmp = arr[pos];\n arr[pos] = arr[i];\n arr[i] = tmp;\n }\n return arr;\n}", "function shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * i);\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffle(array) {\n\n\tlet currIndex = array.length;\n\tlet tempVal, randomIndex;\n\n\twhile (currIndex !== 0) {\n\n\t\trandomIndex = Math.floor(Math.random() * currIndex);\n\t\tcurrIndex -= 1;\n\n\t\ttempVal = array[currIndex];\n\t\tarray[currIndex] = array[randomIndex];\n\t\tarray[randomIndex] = tempVal;\n\t}\n\n\treturn array;\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffle(arr) {\n var j, x, i;\n for (i = arr.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = arr[i];\n arr[i] = arr[j];\n arr[j] = x;\n }\n return arr;\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n console.log(\"shuffled\");\n return array;\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "function shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffle(array) {\n var j, x, i;\n for (i = array.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = array[i];\n array[i] = array[j];\n array[j] = x;\n }\n return array;\n}", "function shuffle(array)\n{\n var currentIndex = array.length, temporaryValue, randomIndex; \n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1; \n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n } \n return array;\n}", "function shuffle(array) {\n for(var counter=array.length-1; counter > 0; counter--) {\n var index = Math.floor(Math.random() * counter);\n var temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n return array;\n }", "shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex ;\n\n while (0 !== currentIndex) {\n\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n\t\tvar currentIndex = array.length, temporaryValue, randomIndex;\n\n\t\twhile (currentIndex !== 0) {\n\t\t\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\t\tcurrentIndex -= 1;\n\t\t\t\ttemporaryValue = array[currentIndex];\n\t\t\t\tarray[currentIndex] = array[randomIndex];\n\t\t\t\tarray[randomIndex] = temporaryValue;\n\t\t\t}\n\n\t\t return array;\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "function shuffleArray(array) { \n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffle(array) {\n\t\tvar random = array.length,\n\t\t\ttemp,\n\t\t\tindexs;\n\t\twhile (random) {\n\t\t\tindex = Math.floor(Math.random() * random--);\n\t\t\ttemp = array[random];\n\t\t\tarray[random] = array[index];\n\t\t\tarray[index] = temp;\n\t\t}\n\t\treturn array;\n\t}", "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(srandom() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex ;\n\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n\t var currentIndex = array.length, temporaryValue, randomIndex ;\n\t // While there remain elements to shuffle...\n\t while (0 !== currentIndex) {\n\t // Pick a remaining element...\n\t randomIndex = Math.floor(Math.random() * currentIndex);\n\t currentIndex -= 1;\n\t // And swap it with the current element.\n\t temporaryValue = array[currentIndex];\n\t array[currentIndex] = array[randomIndex];\n\t array[randomIndex] = temporaryValue;\n\t }\n\t return array;\n\t\t}", "function shuffle(arr) {\n var j, tempArr, i;\n for (i = arr.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n tempArr = arr[i];\n arr[i] = arr[j];\n arr[j] = tempArr;\n }\n return arr;\n }", "function shuffleMe(array) {\n\n\t\tvar currentIndex = array.length,\n\t\t\ttemporaryValue, randomIndex;\n\n\t\twhile (0 !== currentIndex) {\n\n\t\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\tcurrentIndex -= 1;\n\n\t\t\ttemporaryValue = array[currentIndex];\n\t\t\tarray[currentIndex] = array[randomIndex];\n\t\t\tarray[randomIndex] = temporaryValue;\n\t\t}\n\n\t\treturn array;\n\t}", "function shuffle(array) {\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n \r\n // While there remain elements to shuffle...\r\n while (0 !== currentIndex) {\r\n \r\n // Pick a remaining element...\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n \r\n // And swap it with the current element.\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n \r\n return array;\r\n }", "shuffleArray(array){\n var count = array.length,\n randomnumber,\n temp;\n while( count ){\n randomnumber = Math.random() * count-- | 0;\n temp = array[count];\n array[count] = array[randomnumber];\n array[randomnumber] = temp;\n }\n return array;\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n \n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n \n return array;\n}", "function shuffle(array) {\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n while (0 !== currentIndex) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "function shuffle(arr){\n \tvar current_idx = arr.length;\n \twhile(0 !== current_idx){\n\t\tvar random_idx = Math.floor(Math.random() * current_idx);\n \tcurrent_idx -= 1;\n\t\tvar temp = arr[current_idx];\n \tarr[current_idx] = arr[random_idx];\n arr[random_idx] = temp;\n\t}\n\treturn arr;\n}", "function shuffle(array) {\r\n var currentIndex = array.length,\r\n temporaryValue, randomIndex;\r\n\r\n // While there remain elements to shuffle...\r\n while (0 !== currentIndex) {\r\n\r\n // Pick a remaining element...\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n\r\n currentIndex -= 1;\r\n\r\n // And swap it with the current element.\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "function shuffle(arr) {\n for (var i = 0; i < arr.length; ++i) {\n var randomIndex = Math.floor(Math.random() * arr.length);\n swap(arr, i, randomIndex);\n }\n\n return arr;\n }", "function shuffle(array) {\n\tvar currentIndex = array.length, temporaryValue, randomIndex;\n\n\twhile (currentIndex !== 0) {\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex -= 1;\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\treturn array;\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "function shuffle(array) {\n\tvar currentIndex = array.length,\n\t\ttemporaryValue, randomIndex;\n\twhile (currentIndex !== 0) {\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex -= 1;\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\treturn array;\n}", "function shuffle(array) {\n\tvar currentIndex = array.length,\n\t\ttemporaryValue, randomIndex;\n\t// to shuffle randomly\n\twhile (currentIndex !== 0) {\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex -= 1;\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\treturn array;\n}", "function shuffle(array) {\n\tvar currentIndex = array.length, temporaryValue, randomIndex;\n\n\twhile (currentIndex !== 0) {\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex -= 1;\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\n\treturn array;\n}", "function shuffle(array) {\n\tvar currentIndex = array.length, temporaryValue, randomIndex;\n\n\twhile (currentIndex !== 0) {\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex -= 1;\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\n\treturn array;\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n \n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n \n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n \n // And swap it with the current element.\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n \n return array;\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffleArr(arr) {\n for (var i = 0; i<arr.length; i++) {\n var j = randInt(i);\n var temp = arr[i];\n arr[i]=arr[j];\n arr[j]=temp;\n }\n\n return arr;\n }", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "function shuffleArray(array) {\r\n\t\tfor (var i = array.length - 1; i > 0; i--) {\r\n\t\t\tvar j = Math.floor(Math.random() * (i + 1));\r\n\t\t\tvar temp = array[i];\r\n\t\t\tarray[i] = array[j];\r\n\t\t\tarray[j] = temp;\r\n\t\t}\r\n\t\treturn array;\r\n\t}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n\tvar currentIndex = array.length,\n\t\ttemporaryValue, randomIndex;\n\n\twhile (currentIndex !== 0) {\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex -= 1;\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\n\treturn array;\n}", "function shuffle(array) {\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n return array;\r\n}", "function shuffle(array){\n let len = array.length - 1;\n for(let i = len; i > 0; i--) {\n const j = Math.floor(Math.random() * i)\n const temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n return array;\n}", "function shuffle(array) {\n//randomizes the order of the figures in the array\n let currentIndex = array.length, randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n [array[currentIndex], array[randomIndex]] = [\n array[randomIndex], array[currentIndex]];\n }\n return array;\n}", "function shuffle (array) {\r\n var i = 0\r\n , j = 0\r\n , temp = null\r\n\r\n for (i = array.length - 1; i > 0; i -= 1) {\r\n j = Math.floor(Math.random() * (i + 1))\r\n temp = array[i]\r\n array[i] = array[j]\r\n array[j] = temp\r\n }\r\n }", "function shuffle(array) {\n\tfor (var i = array.length-1; i > 0; i--) {\n\t\tvar rand = Math.floor(Math.random() * (i + 1));\n\t\tvar temp = array[i];\n\t\tarray[i] = array[rand];\n\t\tarray[rand] = temp;\n\t}\n\treturn array;\n}", "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffleArray(array) {\r\n for (var i = array.length - 1; i > 0; i--) {\r\n var j = Math.floor(Math.random() * (i + 1));\r\n var temp = array[i];\r\n array[i] = array[j];\r\n array[j] = temp;\r\n }\r\n return array;\r\n }", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n}", "function shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n}", "function shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n}", "function shuffle(array) {\n let currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "function shuffle(array) {\r\n var currentIndex = array.length,\r\n temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffleArray(array) {\n var j, x, i;\n for (i = array.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = array[i];\n array[i] = array[j];\n array[j] = x;\n }\n return array;\n}", "shuffleArray(array) {\n for(var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n }", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue,\n randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue,\n randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n console.log(\"shuffle function working\"); //testing function\n }", "randomShuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n // And swap it with the current element.\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex; \n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "function shuffle(array) {\n let currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffleArray(array){\n for(var i = array.length-1; i>0; i--){\n var j = Math.floor(Math.random() * (i+1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffle(array) { \n for (let i=array.length-1; i>0; i--) {\n let j = Math.floor(Math.random() * (i+1));\n [array[i], array[j]] = [array[j], array[i]]; // destructing to swap 2 elements\n }\n return array;\n}", "function shuffleArray(array){\n var i = array.length;\n var j = 0;\n \n while(i--) {\n j = Math.floor(Math.random() * (i + 1));\n \n temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array\n}", "function shuffle(array) {\n var currentIndex = array.length;\n var temporaryValue;\n var randomIndex;\n\n // While the index is above 0\n while (currentIndex !== 0) {\n\n // Uses Math.Random to generate random number between 0 and current index: randomIndex\n randomIndex = Math.floor(Math.random() * currentIndex);\n\n // Decrease index/counter\n currentIndex -= 1\n\n // Swap value from current index of loop with one at random index\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffleArray(array){\n\t\tvar currentIndex = array.length, temporaryValue, randomIndex;\n\t\twhile (0 !== currentIndex) {\n\t\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\tcurrentIndex -= 1;\n\t\t\ttemporaryValue = array[currentIndex];\n\t\t\tarray[currentIndex] = array[randomIndex];\n\t\t\tarray[randomIndex] = temporaryValue;\n\t\t}\n\n\t\treturn array;\n\t}", "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffle(array) {\n let currentIndex = array.length;\n let temporaryValue;\n let randomIndex;\n\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1)); //round down --> get cur position in array + 1 (next position)\n [array[i], array[j]] = [array[j], array[i]]; //swap those positions \n }\n return array;\n }" ]
[ "0.87211084", "0.8681844", "0.8630306", "0.8548764", "0.85450006", "0.85450006", "0.85450006", "0.85113394", "0.8506239", "0.8480198", "0.8478456", "0.8476418", "0.845436", "0.84507453", "0.84393394", "0.8432883", "0.843198", "0.8429092", "0.84288573", "0.8423802", "0.8415672", "0.8413855", "0.8405266", "0.840442", "0.8399825", "0.8394872", "0.83934987", "0.83915776", "0.8391025", "0.8390849", "0.8385122", "0.8384106", "0.8383239", "0.83819914", "0.83776295", "0.83762467", "0.83725667", "0.8372099", "0.83704233", "0.8365606", "0.8361114", "0.8358653", "0.8357378", "0.8353498", "0.8353498", "0.83428454", "0.8342742", "0.83411473", "0.8339628", "0.83368033", "0.83368033", "0.8328943", "0.83273256", "0.832346", "0.8321766", "0.8320106", "0.83184546", "0.83184147", "0.83183914", "0.83158517", "0.8314678", "0.8314678", "0.8313754", "0.8311783", "0.83117545", "0.8311034", "0.8310715", "0.8310715", "0.8307415", "0.8307415", "0.8307415", "0.830631", "0.8305051", "0.83048344", "0.83034474", "0.83034056", "0.8299889", "0.8299889", "0.8299889", "0.8299889", "0.8299889", "0.8299889", "0.8299889", "0.8299889", "0.82987446", "0.82987446", "0.82948554", "0.8294791", "0.82942414", "0.8293921", "0.8292804", "0.8291214", "0.82894593", "0.82888997", "0.8288139", "0.8286907", "0.8286907", "0.8286907", "0.8286907", "0.82846534", "0.8283264" ]
0.0
-1
this function loops over the array of colors it creates a new div and gives it a class with the value of the color it also adds an event listener for a click for each card
function createDivsForColors(colorArray) { gameContainer.innerHTML = ''; let cardId = 0; shuffle(COLORS); scoreBoard.innerText = ''; if(lowScores.length >= 1) { scoreBoard.innerHTML = '<p><br></p>'; const lowScore = document.createElement('p'); lowScore.className = "score"; lowScore.innerText = `The lowest score is ${lowScores[0]} and lowest average guess per card is ${lowGuess[0]}.`; scoreBoard.prepend(lowScore); } for (let color of COLORS) { // create a new div const newDiv = document.createElement("div"); // give it a class attribute for the value we are looping over newDiv.classList.add(color); newDiv.setAttribute('id', cardId); cardId ++; // call a function handleCardClick when a div is clicked on newDiv.addEventListener("click", handleCardClick); // append the div to the element with an id of game gameContainer.append(newDiv); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCards(colors) {\n let gameBoard = document.getElementById(\"game\");\n\n for (let color of colors) {\n let newDiv = document.createElement(\"div\");\n newDiv.classList.add(`${color}`);\n newDiv.addEventListener(\"click\", function (e) {\n handleCardClick(e);\n });\n gameBoard.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\r\n for (let color of colorArray) {\r\n const newDiv = document.createElement(\"div\");\r\n newDiv.classList.add(color);\r\n newDiv.addEventListener(\"click\", handleCardClick);\r\n gameContainer.append(newDiv);\r\n }\r\n}", "function createCards(colors) {\n const gameBoard = document.getElementById(\"game\");\n\n for (let color of colors) {\n let currClass = \"\" + color;\n let currDiv = document.createElement(\"div\");\n currDiv.className = currClass;\n currDiv.addEventListener(\"click\", handleCardClick);\n gameBoard.appendChild(currDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n const newDiv = document.createElement(\"div\");\n newDiv.classList.add(color);\n newDiv.addEventListener(\"click\", handleCardClick);\n gameContainer.append(newDiv);\n }\n}", "function createDisplay(colorArray){\n \n for (let color of colorArray) {\n \n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color[0]);\n\n // newDiv.style.backgroundColor=color[1];\n // newDiv.className+= ' show';\n\n //add color class to divs\n newDiv.className+=' color';\n\n // call a function handleCardClick when a div is clicked on\n // newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n startBtn.addEventListener('click', function () {\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n })\n\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n\n }\n}", "function createCards(colors) {\n const gameBoard = document.getElementById(\"game\");\n\n for (let color of colors) {\n var card = document.createElement(\"div\");\n // card.style.backgroundColor = \"black\"\n card.classList = \"card\"\n card.setAttribute(\"data-color\", [color]);\n card.addEventListener(\"click\", handleCardClick);\n\n gameBoard.appendChild(card);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n \n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createCards(colors) {\n const gameBoard = document.getElementById(\"game\");\n\n\n for (let color of colors) {\n const card = document.createElement(\"div\");\n card.className = \"card-container\";\n card.value = color;\n card.innerHTML = '<div class=\"card-elements\" name=\"' + color + '\"><div class=\"card-back\" value=\"' + color + '\"></div><div id=\"card-front\" class=\"' + color + ' card-front\" value=\"' + color + '\"></div></div>';\n card.addEventListener(\"click\", handleCardClick);\n gameBoard.appendChild(card);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n //newDiv.classList.toggle(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a data attribute for the value we are looping over\n newDiv.setAttribute('data-color', color);\n\n newDiv.classList.add('card');\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement('div');\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener('click', handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n newDiv.isClicked = false;\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n newDiv.classList.add(\"hide\");\n newDiv.setAttribute(\"data-color\", color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n\tfor (let color of colorArray) {\n\t\t// create a new div\n\t\tconst newDiv = document.createElement('div');\n\n\t\t// give it a class attribute for the value we are looping over\n\t\tnewDiv.classList.add(color);\n\t\t// call a function handleCardClick when a div is clicked on\n\t\tnewDiv.addEventListener('click', handleCardClick);\n\n\t\t// append the div to the element with an id of game\n\t\tgameContainer.append(newDiv);\n\t}\n}", "function createDivsForColors(colorArray) {\n for (let color of colorArray) {\n \n // create a blank card\n const newDiv = document.createElement('div');\n \n // add color to card\n newDiv.classList.add(color);\n\n // add color to back of card\n newDiv.style.backgroundColor = 'white';\n\n // add event listener to card\n newDiv.addEventListener('click', handleCardClick);\n\n // place card on the table\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(colorArray) {\n\tfor (let color of colorArray) {\n\t\t// create a new div\n\t\tconst newDiv = document.createElement('div');\n\n\t\t// give it a class attribute for the value we are looping over\n\t\t// newDiv.classList.add(color);\n\t\tnewDiv.classList.add('back');\n\t\tnewDiv.style.color = color;\n\t\t// call a function handleCardClick when a div is clicked on\n\t\tnewDiv.addEventListener('click', handleCardClick);\n\n\t\t// append the div to the element with an id of game\n\t\tgameContainer.append(newDiv);\n\t}\n}", "function createDivsForColors(colorArray) {\n cardCnt = 0;\n totalFlips = 0;\n \n for (let color of colorArray) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.setAttribute(\"data-color\",color); \n newDiv.classList.add('card');\n\n newDiv.setAttribute(CARDSTATE, CARDCOVERED); // initial state of card\n newDiv.setAttribute(CARDID, cardCnt.toString());\n\n gameContainer.append(newDiv);\n cardCnt++;\n }\n setStartButton()\n \n}", "function createDivsForColors(shuffledColorsArray) {\n\tfor (let color of shuffledColorsArray) {\n\t\t// create a new div\n\t\tconst newDiv = document.createElement('div');\n\n\t\t// give it a class attribute for the value we are looping over\n\t\tnewDiv.classList.add(color);\n\t\tnewDiv.style.backgroundColor = defaultCardColor;\n\n\t\t// call a function handleCardClick when a div is clicked on\n\t\tnewDiv.addEventListener('click', handleCardClick);\n\n\t\t// append the div to the element with an id of game\n\n\t\tgameContainer.append(newDiv);\n\t}\n}", "function createDivsForColors(colorArray) {\n\tfor (let color of colorArray) {\n\t\t// create a new div\n\t\tconst newDiv = document.createElement('div');\n\n\t\t// give it a class attribute for the value we are looping over\n\t\tnewDiv.classList.add(color);\n\t\tnewDiv.classList.add('flipCard');\n\t\tlet newDivchild1 = document.createElement('div');\n\t\tnewDivchild1.classList.add('card');\n\t\tlet newDivchild2 = document.createElement('div');\n\t\tnewDivchild2.classList.add('side', 'front');\n\t\tlet newDivchild3 = document.createElement('div');\n\t\tnewDivchild3.classList.add('side', 'back');\n\t\tnewDivchild1.appendChild(newDivchild2);\n\t\tnewDivchild1.appendChild(newDivchild3);\n\t\tnewDiv.appendChild(newDivchild1);\n\t\t// call a function handleCardClick when a div is clicked on\n\t\t//newDiv.addEventListener(\"click\", handleCardClick);\n\n\t\t// append the div to the element with an id of game\n\t\tgameContainer.append(newDiv);\n\t}\n}", "function createDivsForColors(shuffledColors) {\n for (let color of shuffledColors) {\n // create a new div\n const newDiv = document.createElement(\"div\");\n\n // give it a class attribute for the value we are looping over\n newDiv.classList.add(color);\n\n // call a function handleCardClick when a div is clicked on\n newDiv.addEventListener(\"click\", handleCardClick);\n\n // append the div to the element with an id of game\n gameContainer.append(newDiv);\n }\n}", "function createDivsForColors(imgArray) {\n\tfor (let img of imgArray) {\n\t\t// create a new div\n\t\tconst newDiv = document.createElement('div');\n\n\t\t// give it a class attribute for the value we are looping over\n\t\tnewDiv.classList.add(img);\n\n\t\t// call a function handleCardClick when a div is clicked on\n\t\tnewDiv.addEventListener('click', handleCardClick);\n\n\t\t// append the div to the element with an id of game\n\t\tgameContainer.append(newDiv);\n\t}\n}", "function displayColorsOnScren() {\n boxContainer.innerHTML = '';\n\n for (let i = 0; i < 5; i++) {\n let color = generateColors();\n let div = document.createElement('div');\n div.classList.add('card');\n div.innerHTML = `\n\n <div class='inner-color' style=\"background-color:${color}\"></div>\n <p>${generateColors()}</p>\n\n \n `;\n div.addEventListener('click', copyToClipboard);\n\n boxContainer.appendChild(div);\n }\n}", "function makeCards() {\n let shuffledArray = shuffle(arrayClassNames);\n\n deck.innerHTML = \"\";\n for (let x = 0; x < shuffledArray.length; x++) {\n const newCard = document.createElement('li');\n const newIcon = document.createElement('i');\n newCard.cover = shuffledArray[x];\n newCard.classList.add('card');\n newIcon.classList.add('fa');\n newIcon.classList = shuffledArray[x];\n const newDeck = document.querySelector('.deck');\n newDeck.appendChild(newCard);\n newCard.appendChild(newIcon);\n newCard.addEventListener('click', checkCard);\n }\n}", "fillCards() {\n this.cardsNodes = document.querySelectorAll('.card');\n\n const cards = this.cardsNodes;\n const colors = this.createColorsArray();\n const pairedColors = colors.pairedColors;\n const creationTime = colors.time;\n\n console.info(`colors generated in ${creationTime.toFixed(2)} seconds`);\n\n cards.forEach(card => {\n // randomly set colors to cards\n const randomIndex = Math.floor(Math.random() * pairedColors.length);\n\n card.setAttribute('data-card-color', pairedColors[randomIndex]);\n card.addEventListener('click', evt => this.pickCard(evt.target));\n\n // remove color from array after each iteration\n pairedColors.splice(randomIndex, 1);\n });\n }", "function createBoard() {\n\n//loop through the cards array.\n for (var i=0; i<cards.length; i++) {\n//div element that will be used as a card.\n var cardElement = document.createElement('div');\n//add a class to the card element.\n cardElement.className = 'card';\n\n//attribute that equals the card value.\n cardElement.setAttribute('data-card', cards[i]);\n//click event listener to each card.\n cardElement.addEventListener('click', isTwoCards);\n\n//append the card to the board\n board.appendChild(cardElement);\n board.appendChild(cardElement);\n }\n\n}", "function createColorset() {\r\n\tfor (let i = 0, n = colors.length; i < n; i++) {\r\n\t\tlet swatch = document.createElement('div'); //create new div\r\n\t\tswatch.className = 'swatch ' + colors[i]; //classname swatch + color bsp: swatch black\r\n\t\tif (i == 0) {\r\n\t\t\tswatch.className += 'swatch ' + colors[i] + ' active';\r\n\t\t}\r\n\t\tswatch.style.backgroundColor = colors[i]; //dem jeweiligen swatch die hintergrundfarbe geben\r\n\t\tswatch.addEventListener('click', setSwatch); //durch klick die setSwatch aufrufen\r\n\t\tdocument.getElementById('colors').appendChild(swatch); //dem div \"colors\" das div swatch anhängen\r\n\t}\r\n\tfunction setSwatch(e) {\r\n\t\tlet swatch = e.target; //identifiy swatch\r\n\t\tmyCol = swatch.style.backgroundColor; //set color\r\n\t\tlet x = document.getElementsByClassName('swatch');\r\n\t\tfor (let i = 0; i < x.length; i++) {\r\n\t\t\tx[i].className = 'swatch';\r\n\t\t}\r\n\t\tswatch.className += ' active';\r\n\t}\r\n}", "function initBoard(){\n deckDiv = createCardElement({\"color\":\"black\"});\n pileDiv = createCardElement({\"color\":\"black\"});\n\n boardDiv.append(deckDiv);\n boardDiv.append(pileDiv);\n\n deckDiv.addEventListener(\"click\", drawCard);\n\n /* change color button */\n let colorChooserDiv = document.getElementById('choose-colors');\n for (let child of Array.from(colorChooserDiv.children)) {\n //console.log('child:', child);\n //console.log(child.tagName);\n if (child.tagName == 'BUTTON') {\n //console.log('child:', child);\n child.addEventListener('click', setChosenColor);\n }\n }\n}", "function moreColors() {\n\tfetch(\n\t\t'https://beta.adalab.es/Easley-ejercicios-de-fin-de-semana/data/palettes.json'\n\t)\n\t\t.then((response) => response.json())\n\t\t.then((data) => {\n\t\t\tconst palette2 = data.palettes;\n\n\t\t\tconst divWrapper2 = document.createElement('div');\n\t\t\tdivWrapper2.classList.add('div__wrapper2');\n\t\t\tdocument.body.appendChild(divWrapper2);\n\n\t\t\tfor (let i = 0; i < palette2.length; i++) {\n\t\t\t\t// console.log(palette2[i].name);\n\n\t\t\t\tconst name2 = document.createElement('h3');\n\t\t\t\tconst nameContent2 = document.createTextNode(palette2[i].name);\n\t\t\t\tname2.appendChild(nameContent2);\n\n\t\t\t\tdivWrapper2.appendChild(name2);\n\n\t\t\t\tconst newPalette = palette2[i].colors;\n\t\t\t\t// console.log(newPalette);\n\n\t\t\t\tfor (let i = 0; i < newPalette.length; i++) {\n\t\t\t\t\tconst div2 = document.createElement('div');\n\t\t\t\t\tdiv2.classList.add('color__item');\n\t\t\t\t\tdiv2.style.backgroundColor = `#${newPalette[i]}`;\n\t\t\t\t\tdivWrapper2.appendChild(div2);\n\n\t\t\t\t\t// 7\n\n\t\t\t\t\tfunction markColor() {\n\t\t\t\t\t\tdiv2.classList.toggle('mark');\n\t\t\t\t\t}\n\n\t\t\t\t\tdiv2.addEventListener('click', markColor);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n}", "function displayNewcards(cardsnum){\n for (i = 0; i < cardsnum; i++) { \n document.querySelector('.card'+i).style.backgroundColor=randomcards[i];\n };\n }", "function handleCardClick(event) {\n\n // you can use event.target to see which element was clicked\n console.log(\"you just clicked\", event.target);\n\n //change background color to the color value of the array\n event.target.style.backgroundColor = event.target.className;\n\n if(value1==''){\n event.target.setAttribute('id','one');\n value1 = event.target.className;\n console.log(`the value kept for click 1 is ${value1} and click 2 is ${value2}`);\n }\n else if(value2=='' && event.target.id!='one')\n {\n value2 = event.target.className;\n console.log(`the value kept for click 1 is ${value1} and click 2 is ${value2}`);\n\n if(value1==value2){\n value1 = '';\n value2 = '';\n document.querySelector('#one').removeAttribute('id');\n }\n else{\n //reset to no background color after 1 second\n setTimeout(function(){\n document.querySelector('#one').style.backgroundColor ='';\n event.target.style.backgroundColor = '';\n document.querySelector('#one').removeAttribute('id');\n }, 1000);\n value1 ='';\n value2 =''; \n }\n\n }\n\n}", "function handleCardClick(event) {\n\n //pushes clicked div into an array\n cardClickedTempRecord.push(event.target);\n\n //keeps a count of number of cards selected to avoid more than two being exposed (see if condition at bottom of function)\n clickCount++;\n totalClicks++;\n\n clicks.innerText = totalClicks;\n\n // you can use event.target to see which element was clicked\n let cardColor = event.target.className; //this retieves the class(color);\n\n //variable created for selected card\n let targetCard = event.target;\n\n// if same card clicked twice, changes color to null\n if(targetCard.style.backgroundColor){\n targetCard.style.backgroundColor = null;\n }\n \n //sets color of card\n //it is here that I need to prevent the color of a third card being revealed\n // perhaps a separate function that iterates through the divs to check how many have the color set\n targetCard.style.backgroundColor = cardColor;\n \n // revealColorWithDelay()\n\n // configures two cards with the same color with the class \"match\"\n //examines two selected cards in a temp array to assess if color is the same\n //also, ensures the two cards are not the same card\n if(cardClickedTempRecord.length>1 && cardClickedTempRecord[0].className === cardClickedTempRecord[1].className && cardClickedTempRecord[0] != cardClickedTempRecord[1]){\n cardClickedTempRecord[0].classList.add('match');\n cardClickedTempRecord[1].classList.add('match');\n }\n \n//ensures no more than two cards can be turned over to show their color\nif(clickCount === 2){\n revertCardColor();\n clickCount = 0;\n cardClickedTempRecord.splice(0);\n };\n}", "function createDeck(array) {\n let deck = document.getElementById('deck');\n deck.innerHTML = '';\n let tempElement;\n\n array.forEach(function(element){\n tempElement = deck.appendChild(document.createElement(\"li\"));\n tempElement.setAttribute(\"class\",\"card\");\n\n // Event listener\n tempElement.addEventListener('click', function(event){\n moveCounter.innerHTML = ++moves;\n // change number of stars after certain amount of moves\n if (moves === 30){\n starDom[2].setAttribute(\"class\",\"fa fa-star-o\");\n stars--;\n } else if (moves === 40) {\n starDom[1].setAttribute(\"class\",\"fa fa-star-o\");\n stars--;\n }\n displaySymbol(this);\n });\n\n tempElement = tempElement.appendChild(document.createElement(\"i\"));\n tempElement.setAttribute(\"class\",element);\n });\n}", "function crateColorBtns() {\n console.log(colorRang)\n for (var i = 0; i < colorRang.length; i++) {\n var nuDiv = document.createElement('div');\n colorSelectionDiv.appendChild(nuDiv);\n nuDiv.id = \"color-\" + i;\n nuDiv.className = \"color-choices\";\n nuDiv.style.backgroundColor = colorRang[i];\n \n }\n}", "function cardColor (catCard) {\n for (var c = 0; c < catCard.length; c++) {\n if ([c] % 2 == 0) {\n catCard[c].classList.add(\"odd-blue\");\n } else {\n catCard[c].classList.add(\"even-yellow\");\n };\n }}", "function toggleCardColor () {\n let i = 1\n $('.color-toggle').children().each(function () {\n $(`.color-${i}`).hide()\n if ($(this).hasClass(`color-pick-${i}`)) {\n $(`.color-${i}`).show()\n }\n i++\n })\n}", "function renderCardsToGame() {\n deck.innerHTML ='';\n cardsShuffled = shuffle(fullDeck); //an array\n console.log(cardsShuffled);\n //appends shuffled cards to the game board(deck)\n for(let i = 0; i < cardsShuffled.length; i++){\n cardEl = document.createElement('li');\n cardEl.classList.add('card');\n cardEl.id = \"card-\" + i;\n frontImageEl = document.createElement('i');\n frontImageEl.classList.add('front-card');\n backImageEl = document.createElement('i');\n backImageEl.classList.add('fa', cardsShuffled[i], 'back-card', 'toggle-view');\n cardEl.appendChild(frontImageEl);\n cardEl.appendChild(backImageEl);\n deck.appendChild(cardEl);\n\n //adds event listener to all cards\n cardEl.addEventListener('click', clickResponse);\n }\n }", "function setCardEvents() {\n // shuffles the array\n myShuffledCards = shuffle(iconsArray);\n\n // updates HTML from the old to the new card so the shuffled array is displayed\n for (let x = 0; x < cards.length; x++) {\n const oldCard = document.getElementsByClassName(\"card\")[x];\n const updatedHtml = myShuffledCards[x];\n newCard = oldCard.querySelector(\"i\").className = updatedHtml;\n\n cards[x].addEventListener(\"click\", cardEventListener);\n }\n\n /* this little helper loop logs where each icon is for testing purposes\n * activate if you don't want to do the guesswork ;)\n for (let i = 0; i < iconsArray.length; i++) {\n const item = iconsArray[i];\n console.log(item);\n } */\n}", "function clickColors() {\n if (flashingAmount > clickedAmount) {\n clickedColorsArray.push(this.classList.value);\n console.log(\n findClickColor(flashedColorsArray[clickedAmount]),\n clickedColorsArray[clickedAmount]\n );\n if (\n findClickColor(flashedColorsArray[clickedAmount]) ==\n clickedColorsArray[clickedAmount]\n ) {\n clickedAmount++;\n if (\n flashedColorsArray.length == flashedColorsArray.length &&\n flashingAmount == clickedAmount\n ) {\n if (flashingAmount < 5) {\n flashingAmount++;\n clickedAmount = 0;\n clickedColorsArray = [];\n for (let i = 0; i < colorArray.length; i++) {\n colorArray[i].removeEventListener(\"click\", clickColors);\n }\n flashColors();\n } else {\n moduleDone();\n }\n }\n } else {\n moduleMistake();\n }\n }\n }", "function handleCardClick(e) {\n //adds CSS style to the DIV clicked\n let currentColor = e.target;\n currentColor.style.backgroundColor = currentColor.classList[0]; //classList indexes are the colors\n\n //if first picked color or second picked color is true,\n //add class name of revealed\n if (!firstColor || !secondColor) {\n currentColor.classList.add('revealed');\n firstColor = firstColor || currentColor;\n secondColor = currentColor === firstColor ? false : currentColor;\n }\n\n if (firstColor && secondColor) {\n color1 = firstColor.className;\n color2 = secondColor.className;\n\n //Event is removed if both colors are the same. Color stays on the screen\n if (color1 === color2) {\n revealedColors += 2;\n firstColor.removeEventListener('click', handleCardClick);\n secondColor.removeEventListener('click', handleCardClick);\n firstColor = false;\n secondColor = false;\n } else {\n setTimeout(function () {\n firstColor.style.backgroundColor = '';\n secondColor.style.backgroundColor = '';\n firstColor.classList.remove('revealed');\n secondColor.classList.remove('revealed');\n firstColor = false;\n secondColor = false;\n }, 1000);\n }\n }\n if (revealedColors === COLORS.length) alert('GAME OVER');\n}", "function fillCards(){\n let shuffledCards = shuffle(cardList);\n \n for(let e = 0; e < cards.length; e++){\n let i = document.createElement('i');\n i.setAttribute(\"class\", `${shuffledCards[e]}`);\n cards[e].appendChild(i);\n }\n \n cards.forEach(e => e.addEventListener('click', clickCard));\n stars.forEach(e => e.classList.add('win'));\n}", "function createGameBoard() {\n //shuffle the card\n const shuffledCards = shuffle(symbols);\n\n //create card\n for (let i = 0; i < shuffledCards.length; i++) {\n const card = document.createElement('li');\n card.classList.add(\"card\");\n card.innerHTML = `<i class=\"${shuffledCards[i]}\"></i>`;\n cardsContainer.appendChild(card);\n\n //call click function on the card\n click(card);\n }\n}", "function renderEntity() {\n let txt = \"\"\n for (let i = 0; i < cartas.length; i++) {\n txt += `<li class =\"list-group-item gat\">${cartas[i].name}</li>`\n }\n cardList.innerHTML = txt\n\n let names = document.getElementsByClassName(\"gat\");\n for (const name of names) {\n name.addEventListener(\"click\", function () {\n console.log(this.innerText)\n //this.style.background-color = \"#12bbad\"\n for (const name of names) {\n name.style.backgroundColor = \"white\"\n }\n this.style.backgroundColor = \"#ffa500\"\n fillEntity(this.innerText)\n btnAlter.addEventListener(\"click\", function(){ \n alterCard(name.innerText, inputname.value, inputDesc.value,inputLink.value)\n renderEntity()\n })\n })\n }\n\n\n\n}", "function clickCard() {\n\tfor (let i = 0; i < liCards.length; i++) {\n\t\tliCards[i].addEventListener('click', function (event) {\n\t\t\tevent.preventDefault();\n\t\t\tlet checkCard = event.target;\n\t\t\tif (checkCard.nodeName === 'LI' && checkCard.className !== 'card open show' && checkCard.className !== 'card match' && checkCard.className !== 'card red') {\n\t\t\t\tif (clicks < 2) {\n\t\t\t\t\tcheckCard.setAttribute('class', 'card open show');\n\t\t\t\t\tcheckArrey.push(liCards[i].firstChild.className);\n\t\t\t\t\tconsole.log(liCards[i].firstChild.className);\n\t\t\t\t\tconsole.log(checkArrey);\n\t\t\t\t\tclicks += 1;\n\t\t\t\t\tconsole.log(clicks);\n\t\t\t\t}\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tcomparison();\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t}\n}", "function drawCards () {\r\n for ( let i = 0; i < cards.length; i++ ) {\r\n let element = document.createElement(\"div\");//Create a new div element\r\n \r\n element.className = \"card\";//Add the text node to the newly created div\r\n element.innerHTML = \"\";//Turn down all cards\r\n element.index = i;//Store cards number as \"index\"\r\n element.onclick = click;//Call the following click() function once a user clicks a card\r\n \r\n $field.appendChild( element );\r\n }\r\n}", "function pushColor(){\n\t\tvar showColor = document.getElementsByClassName('miniDiv');\n\t\tfor(var l = 0; l < showColor.length; l++){\n\t\t\tshowColor[l].addEventListener(\"click\", function(event){\n\t\t\tevent.target.style.backgroundColor = currColor;\n\t\t\t});\n\t\t}\n\n\t}", "function showShades() {\n console.log(\"showShades()\");\n shades.forEach((shade) => {\n\n var shadeContainer = document.createElement(\"div\")\n shadeContainer.classList.add(\"shade-container\");\n shadeContainer.style.backgroundColor = shade.fields.hex;\n document.querySelector(\".container\").append(shadeContainer);\n\n //\n\n var shadeTitle = document.createElement(\"h1\");\n shadeTitle.classList.add(\"shade-title\");\n shadeTitle.innerText = shade.fields.shade_title;\n shadeContainer.append(shadeTitle);\n\n //\n var shadeDescription = document.createElement(\"h2\");\n shadeDescription.classList.add(\"shade-description\");\n shadeDescription.innerText = shade.fields.shade_description;\n shadeContainer.append(shadeDescription);\n\n //\n var shadeImage = document.createElement(\"img\");\n shadeImage.classList.add(\"shade-image\");\n shadeImage.src = shade.fields.shade_image[0].url;\n shadeContainer.append(shadeImage);\n\n shadeContainer.addEventListener(\"click\", function() {\n shadeTitle.classList.toggle(\"active\");\n shadeDescription.classList.toggle(\"active\");\n shadeImage.classList.toggle(\"active\");\n\n // add event listener to add active class to song container\n shadeContainer.addEventListener(\"click\", function(event) {\n shadeDescription.classList.toggle(\"active\");\n shadeImage.classList.toggle(\"active\");\n });\n\n // get genre field from airtable\n // loop through the array and add each genre as\n // a class to the shade container\n var shadeColor = shade.fields.color;\n shadeColor.forEach(function(color) {\n shadeContainer.classList.add(color);\n });\n\n // clicking on filter by pop\n // change background of pop genres to red\n // else change to white\n var filterBlack = document.querySelector(\".js-black\");\n filterBlack.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"black\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n });\n\n // filter by indie music\n var filterBlue = document.querySelector(\".js-blue\");\n filterBlue.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"blue\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n\n });\n var filterBrown = document.querySelector(\".js-brown\");\n filterBrown.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"brown\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n });\n\n var filterGreen = document.querySelector(\".js-green\");\n filterGreen.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"green\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n });\n\n var filterGrey = document.querySelector(\".js-grey\");\n filterGrey.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"grey\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n });\n\n var filterOrange = document.querySelector(\".js-orange\");\n filterOrange.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"orange\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n });\n\n var filterGreen = document.querySelector(\".js-green\");\n filterGreen.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"green\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n });\n\n var filterGreen = document.querySelector(\".js-green\");\n filterGreen.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"green\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n });\n\n var filterGreen = document.querySelector(\".js-green\");\n filterGreen.addEventListener(\"click\", function() {\n if (shadeContainer.classList.contains(\"green\")) {\n shadeContainer.style.background = \"red\";\n } else {\n shadeContainer.style.background = \"white\";\n }\n });\n\n\n\n // filter reset\n var filterReset = document.querySelector(\".js-reset\");\n filterReset.addEventListener(\"click\", function() {\n songContainer.style.background = \"white\";\n });\n });\n })\n}", "function createBoard() {\n for(let i = 0; i < cardArray.length; i++){\n var card = document.createElement('img')\n\n card.setAttribute('src', 'images/pokeball.png') // giving a \"style\" and its value - black is the back of the card\n card.setAttribute('data-id', i)\n\n card.addEventListener('click', flipCard) //when there is \"click\" the function flipcard is called\n\n grid.appendChild(card) // linking the gameboard to the css\n }\n }", "function loopThroughColors() {\n\tcolorTiles.forEach(function(tile){ // turns off click function for tiles\n\t\ttile.off('click');\n\t})\n\tnewArray.forEach(function(target, index, arr){\n\t\tshowColor(target, (index+1), arr);\n\t});\n}", "function randomize() {\n const deck = document.querySelector('.deck');\n shuffle(cardArr);// randomize the array of cards\n deck.innerHTML = ''; // clearing the deck\n cardArr.forEach(card => {\n card.className = 'card'; // any class except of 'card' will be removed\n deck.appendChild(card); // appending cards to the deck one by one\n card.addEventListener('click', showCards)// adding the click listener to all cards\n });\n}", "function populateHtml (array){\n //prendo il div che devo popolare\n const cardsContainer = $(\".cards-container\");\n cardsContainer.html('');\n //itero sull'array degli oggetti (che contiene anche i colori)\n for (const icon of array) {\n //estrapolo le informazioni che mi servono per creare le mie cards\n let {name, prefix, family, color} = icon;\n //definisco tramite i backticks e i valori degli oggetti che aspetto avranno le cards nella pagina html\n const iconaHtml = `\n <div class=\"card\">\n <i class='${family} ${prefix}${name} ${color}'></i>\n <h5>${name}</h5>\n </div>`;\n \n //aggiungo a cardsContainer\n cardsContainer.append(iconaHtml);\n }\n }", "function setupColors(){\n for (var i = 0; i < squares.length; i++) {\n\n squares[i].addEventListener('click', function() {\n var clickedColor = this.style.backgroundColor;\n if (clickedColor === pickedColor) {\n prompt.textContent = \"CORRECT!!\";\n newGame.textContent = \"Play Again?\";\n changeColor(clickedColor);\n } else {\n this.style.backgroundColor = \"#4abdac\";\n prompt.textContent = \"Try again...\";\n }\n });\n }\n}", "function getCards() {\n const whichCard = document.querySelectorAll('.card');\n for (let i = 0; i < whichCard.length; i++){\n whichCard[i].addEventListener('click', function(e) {\n updateCards(e.target);\n })\n }\n}", "function makeDivs(dimension){\n\n let container = document.querySelector(\".container\");\n\n let numDivs = dimension * dimension;\n\n for (i = 0; i < numDivs; i++) {\n\n let etchDiv = document.createElement(\"div\");\n \n etchDiv.classList.add(\"etch-div\");\n \n etchDiv.classList.add(\"color-new\");\n \n container.appendChild(etchDiv);\n\n }\n\n for(i = 0; i < numDivs; i++){\n\n document.querySelectorAll(\".etch-div\")[i].addEventListener(\"mouseover\", function (e) {\n\n e.target.classList.remove(\"color-new\");\n\n e.target.classList.add(\"color-drawn\");\n\n });\n }\n}", "function initGame() {\n // Loop through each card and create its HTML\n for (let i = 0; i < cardsList.length; i++) {\n const card = document.createElement('li');\n // Add each card's HTML to the page\n card.classList.add('card');\n card.innerHTML = `<i class = \"${cardsList[i]}\" ></i>`; \n creation.appendChild(card);\n addClickEevent(card);\n\n } // End for loop\n }", "colorPicker(){\n this.picker.forEach(e=>{\n e.addEventListener(\"click\", (e)=>{\n e.preventDefault();\n if (e.target.classList.contains(\"co\")){\n this.colorTwoHolder.classList.remove(\"active\");\n this.colorOneHolder.classList.add(\"active\");\n }\n if (e.target.classList.contains(\"ct\")){\n this.colorOneHolder.classList.remove(\"active\");\n this.colorTwoHolder.classList.add(\"active\");\n } \n })\n })\n }", "function getColor(arrayOfElements,oneElement) {\n // let getDataColor = oneElement.getAttribute(\"data-color\");\n arrayOfElements.forEach((oneofarrayelements) => {\n oneofarrayelements.addEventListener(\"click\",(e) => {\n let getDataColor = e.target.getAttribute(\"data-color\");\n oneElement.style.backgroundColor = `${getDataColor}`;\n });\n });\n}", "function generaCard(array){\n iconsContainer.innerHTML = \"\"\n //creo card per ogni...\n for (i = 0; i < array.length; i++){\n\t\tlet {family, prefix, type, color, name} = array[i];\n const content = ` \n <div class=\"icon-card d-flex\">\n <i class=\"${family} ${prefix}${name}\" style= \"color:${color}\"></i>\n <h4>${name}</h4>\n </div>\n `;\n\n iconsContainer.innerHTML += content;\n }\n}", "function clickPalette() {\n colorPalette.addEventListener('click', (selectedColor) => {\n const eventTarget = selectedColor.target;\n const color = document.getElementsByClassName('color');\n for (let index = 0; index < color.length; index += 1) {\n color[index].classList.remove('selected');\n if (eventTarget.className === 'color') {\n eventTarget.classList.add('selected');\n }\n }\n });\n}", "function setcolor(colors, pickedColor, n){\r\n for(let i=0;i<n;i++)\r\n {\r\n squares[i].style.background = colors[i];\r\n squares[i].addEventListener(\"click\", function(){\r\n const clickedColor = this.style.background;\r\n \r\n if(clickedColor === pickedColor){\r\n\t\t\t\tmessageDisplay.textContent = \"Correct!\";\r\n\t\t\t\treset.textContent = \"Play Again?\"\r\n\t\t\t\tchangeColors(clickedColor);\r\n\t\t\t\th1.style.background = clickedColor;\r\n\t\t\t} else {\r\n\t\t\t\tthis.style.background = \"black\";\r\n\t\t\t\tmessageDisplay.textContent = \"Try Again\"\r\n\t\t\t}\r\n })\r\n }\r\n}", "function handleCardClick(event) {\n event.target.classList.toggle(\"hide\"); // hides color. Turns card to white\n event.target.classList.add(\"clicked\"); // adds class of 'clicked' to cards\n openCards.push(event.target); // push cards to array\n if (openCards.length === 2) {\n // if array = 2 cards\n if (\n // if both cards in array are the same color\n openCards[0].getAttribute(\"data-color\") ===\n openCards[1].getAttribute(\"data-color\")\n ) {\n counter++; // add click to counter if both cards are the same color\n setTimeout(function () {\n if (counter === 5) {\n // counter = 5 clicks (all same cards are clicked)\n alert(\"You won the game!\"); // module alert saying you won\n }\n }, 500); // do the above after .5 seconds so all code executes\n\n openCards[0].style.pointerEvents = \"none\"; //disable click on each open card\n openCards[1].style.pointerEvents = \"none\"; // since they match\n } else {\n //disable click\n let firstUnmatched = openCards[0]; // 1st card in array if they dont match\n let secondUnmatched = openCards[1]; // 2nd card in array if they dont match\n firstUnmatched.classList.remove(\"clicked\"); // remove class on 1st card\n secondUnmatched.classList.remove(\"clicked\"); // remove class on 2nd card\n gameContainer.style.pointerEvents = \"none\"; // disable click\n setTimeout(function () {\n // unmatched = white\n firstUnmatched.classList.toggle(\"hide\"); // hide toggle between color/white\n secondUnmatched.classList.toggle(\"hide\"); // hide toggle between color/white\n gameContainer.style.pointerEvents = \"auto\"; //enable click...\n }, 1000); // ...after 1 second so player can click again\n }\n openCards = []; // reset array to take in new cards\n }\n}", "function createDivsForColors() {\n playBtn();\n}", "function handleCardClick(event) {\n\n let card = event.target;\n\n // make sure only two cards can be flipped at a time\n if (cards.length < 2) {\n cards.push(card);\n card.style.backgroundColor = card.classList[0];\n }\n\n setTimeout(function() {\n\n // compare cards. If they are not the same color, flip them back over\n if (cards.length == 2) {\n \n //shows number of guesses player has made so far\n guesses++;\n document.querySelector('h2').innerHTML = 'Total Guesses: ' + guesses;\n\n if (cards[0].classList[0] != cards[1].classList[0]) {\n for (card of cards) {\n card.style.backgroundColor = 'white';\n }\n }\n }\n\n // clear array so new cards can be compared\n cards.pop(cards[0]);\n cards.pop(cards[1]);\n\n }, 2000);\n}", "function handleCardClick(event) {\n\t// you can use event.target to see which element was clicked\n\tconsole.log('you just clicked', event.target);\n\n\tnumClicks++;\n\n\tconsole.log(numClicks);\n\tif (numClicks === 1) {\n\t\tfirstPick = event.target;\n\t\tfirstColor = firstPick.className;\n\t\tfirstPick.style.backgroundColor = firstPick.className;\n\t\tfirstPick.removeEventListener('click', handleCardClick);\n\t}\n\telse if (numClicks === 2) {\n\t\tsecondPick = event.target;\n\t\tsecondColor = secondPick.className;\n\t\tconsole.log(firstColor, secondColor);\n\t\tconsole.log(firstPick);\n\t\tsecondPick.style.backgroundColor = secondPick.className;\n\t\tnumClicks = 0;\n\t\t// firstPick.addEventListener('click', handleCardClick);\n\n\t\tconst allDivs = document.querySelectorAll('div div');\n\t\tconsole.log(allDivs);\n\t\tfor (let div of allDivs) {\n\t\t\tdiv.removeEventListener('click', handleCardClick);\n\t\t}\n\t\tsetTimeout(function() {\n\t\t\tfor (let div of allDivs) {\n\t\t\t\tdiv.addEventListener('click', handleCardClick);\n\t\t\t}\n\t\t}, 1000);\n\n\t\tif (firstColor !== secondColor) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tfirstPick.style.backgroundColor = '';\n\t\t\t\tsecondPick.style.backgroundColor = '';\n\t\t\t}, 1000);\n\t\t}\n\t\telse numClicks = 0;\n\n\t\t// if it doesn't match, setTimeout\n\t}\n}", "generateColorsSelector() {\n const configContainer = document.createElement('ul');\n configContainer.className = 'color_selector_container';\n\n for (let i = 0; i < this.nbPixelColors; i++) {\n const colorSelector = document.createElement('li');\n const itemClass = 'color_selector_item';\n colorSelector.className = itemClass;\n colorSelector.dataset.selectedColor = i + 1;\n\n // Attach event\n colorSelector.addEventListener('click', (e) => this.handleColorSelector(e, itemClass));\n\n configContainer.appendChild(colorSelector);\n }\n\n document.body.append(configContainer);\n }", "function cardGenerator(numberOfCards){\n //Creo los elementos\n const trendCardDiv = document.createElement('div');\n const trendGIfImg = document.createElement('img');\n const trendHoverDiv = document.createElement('div');\n const dayTagContainerDiv = document.createElement('div');\n const tagsHoverP = document.createElement('p');\n //los añado a sus respectivos lugares\n containerTrending.appendChild(trendCardDiv);\n trendCardDiv.appendChild(trendGIfImg);\n trendCardDiv.appendChild(trendHoverDiv);\n trendHoverDiv.appendChild(dayTagContainerDiv);\n dayTagContainerDiv.appendChild(tagsHoverP);\n //defino sus clases\n trendCardDiv.classList.add(\"trend-card\");\n trendGIfImg.id = `trend-gif${numberOfCards+1}`;\n trendHoverDiv.classList.add('trend-hover');\n dayTagContainerDiv.id = `day-tag-container-${numberOfCards+1}`;\n tagsHoverP.classList.add('tags-hover');\n\n if(!nightTheme){\n dayTagContainerDiv.classList.add(`day-tag-container`);\n switchThemeTagContainer.push(document.getElementById(`day-tag-container-${numberOfCards+1}`));\n }else{\n dayTagContainerDiv.classList.add(`night-tag-container`);\n switchThemeTagContainer.push(document.getElementById(`night-tag-container-${numberOfCards+1}`));\n };\n}", "function renderCards(deck, list) {\n list.forEach((elem, index) => {\n \n let li = document.createElement('li');\n let i = document.createElement('i');\n li.className = 'card';\n deck.appendChild(li);\n li.appendChild(i);\n i.className = \"fa fa-\" + list[index];\n\n li.addEventListener('click', e => {\n clicked++;\n addToSelectedCards(index);\n })\n \n });\n}", "function highlightCards () {\n const cl = createKnown()\n const diff = $(cl).not(knownList).get()\n $('.card').removeClass('card-new-highlighted')\n diff.forEach(task => {\n const id = task.substring(1, task.length)\n $(`#${id}`).addClass('card-new-highlighted')\n if (!$(`#${id}`).is(':visible')) {\n for (let i = 1, t = 5; i <= t; i++) {\n if ($(`#${id}`).hasClass(`color-${i}`)) {\n highlightNewGlyph($(`#${id}`).prop('id'), i)\n return\n }\n }\n }\n })\n ipcRenderer.send('badge-count', diff.length || 0)\n}", "function createCard(array) {\n const deck = document.querySelector('.deck');\n const card = document.createElement('li');\n const cardItem = document.createElement('i');\n const fragment = document.createDocumentFragment();\n\n card.setAttribute('class', 'card');\n cardItem.setAttribute('class', `icon ${array}`);\n\n card.appendChild(cardItem);\n\n fragment.appendChild(card);\n deck.appendChild(fragment);\n}", "function newCanvas(){\nvar pixel;\nvar canvas = document.getElementById('canvas');\n\n for (var i = 0; i < 210; i++) {\n\n pixel = document.createElement('div');\n pixel.className = 'pixel';\n canvas.appendChild(pixel);\n //pixel.addEventListener('click', changeColor(pixel));\n }\n//console.log(\"running\");\n\n var changeColor = function() {\n //var attribute = this.getAttribute(\"data-myattribute\");\n this.style.backgroundColor = \"red\";\n\n };\n\n var classname = document.getElementsByClassName(\"pixel\");\n\n for (var i = 0; i < classname.length; i++) {\n classname[i].addEventListener('click', changeColor, false);\n }\n\n}", "function displayCards() {\n for (let i = 0; i < deckOfCards.length; i++) {\n let deck = document.querySelector(\".deck\");\n let liCard = document.createElement(\"li\");\n deck.appendChild(liCard);\n let cardName = deckOfCards[i];\n liCard.className = \"card fa fa-\" + cardName + \" hide\";\n liCard.addEventListener(\"click\", showCard);\n }\n}", "function cardClick() {\n cards = document.querySelectorAll('.card');\n for (let i = 0; i < cards.length; i++) {\n cards[i].addEventListener('click', () => createModal(people[i]));\n }\n}", "function toggleColor(card, color){\n card.children[0].classList.remove(\"green\");\n card.children[0].classList.remove(\"blue\");\n card.children[0].classList.remove(\"red\");\n card.children[0].classList.add(color);\n}", "function startGame() {\nvar randArray = _.shuffle(letters);\nfor (var i = 0; i <= 9; i++) {\n var card = $(\"<div>\");\n card.addClass(\"column\");\n card.attr('id', i);\n card.appendTo($(\"#game\"));\n card.on('click', function(){\n\n cardClick(this, randArray);\n });\n};\n\n}", "function createListeners() {\n for(var i = 0; i < squares.length; i++) {\n squares[i].addEventListener(\"click\", function() {\n if(this.style.backgroundColor === pickedColor) {\n colorChange(pickedColor);\n messageDisplay.textContent = \"Correct!\";\n header.style.backgroundColor = pickedColor;\n resetButton.textContent = \"Play Again?\";\n } \n else {\n this.style.backgroundColor = \"#232323\";\n messageDisplay.textContent = \"Try Again!\";\n }\n });\n };\n}", "function buildCards(){\n for (const card of cards){\n const newCards = document.createElement('li');\n newCards.setAttribute('class', 'card fa fa-' + card);\n deck.appendChild(newCards);\n }\n}", "function colorClicked(event) {\n switch (event.target.id) {\n case \"blueBtn\":\n isBlueSelected = !isBlueSelected;\n updateColorSelectionUI(event.target.id, isBlueSelected);\n break;\n case \"redBtn\":\n isRedSelected = !isRedSelected;\n updateColorSelectionUI(event.target.id, isRedSelected);\n break;\n case \"greenBtn\":\n isGreenSelected = !isGreenSelected;\n updateColorSelectionUI(event.target.id, isGreenSelected);\n break;\n case \"blackBtn\":\n isBlackSelected = !isBlackSelected;\n updateColorSelectionUI(event.target.id, isBlackSelected);\n break;\n }\n\n //If none are selected, select all colors and update UI\n checkColorSelectionAndReset();\n\n //Gather Playable Cards Again\n gatherAllPlayableCards();\n shufflePlayableCards();\n\n //Reset All UI\n removeCardFromUI();\n\n cardPosition = 0;\n selectedCard = playableCards[cardPosition];\n showSelectedCard(selectedCard);\n\n resetUI();\n}", "function whenClicked(card){ \r\n \r\n card.addEventListener(\"click\", function(){\r\n \r\n \r\n if (openedCards.length===1){\r\n \r\n \r\n const currentCard=this;\r\n const previousCard=openedCards[0];\r\n\r\n \r\n card.classList.add(\"open\", \"show\", \"disable\");\r\n openedCards.push(this);\r\n\r\n compare(currentCard,previousCard);\r\n\r\n \r\n }else{\r\n card.classList.add(\"open\", \"show\", \"disable\");\r\n openedCards.push(this);\r\n }\r\n }\r\n\r\n );\r\n\r\n}", "function handleCardClick(event) {\n \n if(firstDivColor==null){\n \n //if firstDiv is empty first set background color\n const divColor=event.target.classList[0];\n event.target.style.backgroundColor=divColor;\n firstDivColor=divColor;\n\n // get index of div in parent div\n const parent = event.target.parentNode;\n // The equivalent of parent.children.indexOf(child)\n index = Array.prototype.indexOf.call(parent.children, event.target);\n \n \n }\n else{\n\n // get index of div in parent div\n const parent = event.target.parentNode;\n // The equivalent of parent.children.indexOf(child)\n const index2 = Array.prototype.indexOf.call(parent.children, event.target);\n\n //Making sure user cant click on the same tile\n if(index!=index2){\n //if first div is not empty first set background color\n const divColor=event.target.classList[0];\n event.target.style.backgroundColor=divColor;\n \n //if the divs color match \n if(divColor==firstDivColor){\n //if its a match add a class to remove the onclick listener\n divsOpened++;\n event.target.className+=\" Done\";\n event.target.parentNode.children[index].className+=\" Done\";\n console.log(event.target.classList);\n console.log(event.target.parentNode.children[index].classList);\n firstDivColor=null;\n openedDiv=0;\n \n \n }\n else{\n //if the colors dont match remove the colors after one second and reset the firstDiv variables\n const firstDiv=event.target.parentNode.children[index];\n openedDiv++;\n score--;\n storageScore=localStorage.getItem('score');\n \n if(score<parseInt(localStorage.getItem('LowestScore'))){\n localStorage.setItem('LowestScore',score);\n }\n \n let a=setTimeout(function(){\n firstDiv.style.backgroundColor=null;\n openedDiv=0;\n clearTimeout(a);\n },1000);\n \n let b=setTimeout(function(){\n event.target.style.backgroundColor=null;\n clearTimeout(b);\n },1000);\n index=null;\n firstDivColor=null;\n }\n }\n else{\n openedDiv=1;\n return;\n }\n }\n //displaying score at end of game\n if(divsOpened==5){\n let b=setTimeout(function(){\n alert(\"Your score is \"+score);\n if (confirm(\"Restart!\")) {\n replay();\n } else {\n }\n clearTimeout(b);\n },500);\n \n\n }\n \n}", "function Card(element, index) {\n this.element = element; //the div tag element of the card (board-card div)\n this.colorClass = \"color-0\"; //by default the color will be the one with the class class-0 as in CSS\n this.isFaceup = false; //true when face up\n this.isMatched = false; //true when succesfully matched\n //index of the card in the list of children of the gamebord div\n //this helps only with finding the card when we are pairing cards\n this.index = index;\n\n this.setColor = function(colorClass) {\n this.colorClass = colorClass;\n //for robustness check that the card obect is really associated to a div element !\n if (this.element === undefined) {\n window.alert(\"undefined card!\");\n return;\n }\n //get the faceup div of this card\n const faceUpElement = this.element.getElementsByClassName(\"faceup\")[0];\n\n //add the new color class to the list of classes of the faceup div\n faceUpElement.classList.add(colorClass); //important to understand\n };\n this.flip = function() {\n //flip a card for and set the flag\n this.isFaceup = !this.isFaceup;\n if (this.isFaceup) {\n //when the face up we assign the color class to the object to change its color\n this.element.classList.add(\"flipped\");\n }\n };\n this.setHandler = function() {\n //register this object as a handler of the click event\n //this will automatic invoke the handEvent method when a click occurs\n this.element.addEventListener(\"click\", this, false);\n };\n this.handleEvent = function(event) {\n //we come here when an event occurs on this card\n switch (event.type) {\n case \"click\": //if the event is a click\n if (!firstClick) {\n startTimer();\n firstClick = true;\n }\n if (this.isFaceUp || this.isMatched) {\n console.log(\n \"card \" + this.index + \"(\" + this.colorClass + \") clicked\"\n );\n //if the card is already face up or matched\n return;\n } //otherwise\n this.isFaceUp = true; //put face up flag\n this.element.classList.add(\"flipped\"); //flip the card\n\n // call the function that checks if there is a match\n handleCardFlipped(this);\n }\n };\n this.reset = function() {\n //there was no match, we flip back the card and set their flags to false\n this.isFaceUp = false;\n this.isMatched = false;\n this.element.classList.remove(\"flipped\");\n };\n this.matchFound = function() {\n //in case of much this persists the face up and matched state of the card to true\n this.isFaceUp = true;\n this.isMatched = true;\n };\n}", "function addClass(className, classColor = _via_color_array[_via_class_names.size % 6]){\n \n //checks for duplicates of class name, will not create class if class name already exists\n if (_via_class_names.has(className)){\n return;\n }\n if (className == \"\"){\n return;\n }\n else{\n _via_class_names.set(className,[0, classColor]);\n \n\n }\n\n //Create DOM elements for the class for buttons to edit the class\n document.getElementById(\"classes_label\").innerHTML = \"Classes \" + \" (\" + _via_class_names.size + \")\";\n var button = document.createElement(\"input\");\n var count = document.createElement(\"p\");\n var trash = document.createElementNS ('http://www.w3.org/2000/svg', \"svg\");\n var edit = document.createElementNS ('http://www.w3.org/2000/svg', \"svg\");\n var name_input = document.createElement(\"input\");\n var name_submit = document.createElement(\"input\");\n var dummy = document.createElement(\"p\");\n\n var colorswitch = document.createElement(\"div\");\n var colorpicker = document.createElement(\"div\");\n var colorwrapper = document.createElement(\"div\");\n colorwrapper.className = \"color-wrapper\";\n\n\n /*dummy to make sure every class starts on a separate line*/\n dummy.className = \"dummy\";\n colorswitch.className = \"class-color-holder\";\n colorswitch.id = className + \"_colorswitch\";\n colorpicker.id = className + \"_colorpicker\";\n colorpicker.className = \"color-picker\";\n\n colorswitch.style.background = _via_class_names.get(className)[1];\n\n var colorList = [ '#000000', '#993300', '#333300', '#003300', '#003366', '#000066', '#333399', '#333333', \n'#660000', '#FF6633', '#666633', '#336633', '#336666', '#0066FF', '#666699', '#666666', '#CC3333', '#FF9933', '#99CC33', \n'#669966', '#66CCCC', '#3366FF', '#663366', '#999999', '#CC66FF', '#FFCC33', '#FFFF66', '#99FF66', '#99CCCC', '#66CCFF', \n'#993366', '#CCCCCC', '#FF99CC', '#FFCC99', '#FFFF99', '#CCffCC', '#CCFFff', '#99CCFF', '#CC99FF', '#FFFFFF' ];\n\n var div_array = [];\n\n for (var i = 0; i < colorList.length; i++ ) {\n var li = document.createElement(\"li\");\n div_array.push(li);\n li.className = \"color-item\";\n li.style.backgroundColor = colorList[i];\n colorpicker.appendChild(li);\n\n //we have to make another array of objects now\n }\n\n for (var j = 0; j < div_array.length; j++){\n div_array[j].addEventListener(\"click\",function(){\n var click_count = _via_class_names.get(className)[0];\n var click_color = _via_class_names.get(className)[1];\n _via_class_names.set(className, [click_count, this.style.backgroundColor]);\n //change up the metadata now\n //iterate through image metadata of current image and see where the region has an id that matches w the selected class\n colorswitch.style.fill = this.style.backgroundColor;\n colorswitch.style.background = this.style.backgroundColor;\n colorpicker.style.display = \"none\";\n draw_all_regions();\n\n });\n }\n\n\n colorswitch.addEventListener(\"click\", function(){\n if (colorpicker.style.display == \"inline-block\"){\n colorpicker.style.display = \"none\";\n }\n else{\n colorpicker.style.display = \"inline-block\";\n }\n });\n colorpicker.style.display = \"none\";\n\n button.type = \"textbox\";\n button.readOnly = true;\n button.value = className;\n button.id = className + \"_via_btn\";\n button.className = \"bx--link _via_btn\";\n\n //eventually have it so class names can't include underscores so this can be unique and there are on conflicts\n count.id = className + \"_num\";\n count.value=0;\n count.innerHTML = \"(0)\";\n count.className = \"bx--link count_button\";\n\n trash.setAttribute('width','12');\n trash.setAttribute('height','16');\n trash.id = className + \"_del\";\n\n edit.setAttribute('width','40');\n edit.setAttribute('height','16');\n edit.id = className + \"_edit\";\n\n\n name_input.type = \"text\";\n name_input.id = className + \"_text\";\n name_input.className = \"name_changer\";\n\n name_submit.type = \"button\";\n name_submit.value = \"confirm change\";\n name_submit.id = className + \"_submit\";\n name_submit.className = \"name_changer\";\n\n var leftDiv = document.createElement(\"div\");\n\n\n var rightDiv = document.createElement(\"div\");\n leftDiv.className = \"left_labels\";\n rightDiv.className = \"right_labels\";\n var mainDiv = document.createElement(\"div\");\n mainDiv.className = \"mainDivs\";\n document.getElementById(\"classes_info\").appendChild(mainDiv);\n mainDiv.appendChild(leftDiv);\n mainDiv.appendChild(rightDiv);\n\n\n colorwrapper.appendChild(colorswitch);\n colorwrapper.appendChild(colorpicker);\n leftDiv.appendChild(colorwrapper);\n leftDiv.appendChild(button);\n rightDiv.appendChild(count);\n\n rightDiv.appendChild(edit);\n var path1 = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n\n path1.setAttribute('d','M2.032 10.924l7.99-7.99 2.97 2.97-7.99 7.99zm9.014-8.91l1.98-1.98 2.97 2.97-1.98 1.98zM0 16l3-1-2-2z');\n path1.setAttribute('fill','#3D6FB1');\n edit.appendChild(path1);\n\n rightDiv.appendChild(trash);\n path1 = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n var path2 = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n\n path1.setAttribute('d','M11 4v11c0 .6-.4 1-1 1H2c-.6 0-1-.4-1-1V4H0V3h12v1h-1zM2 4v11h8V4H2z');\n path1.setAttribute('fill','#3D6FB1');\n trash.appendChild(path1);\n\n path2.setAttribute('d','M4 6h1v7H4zm3 0h1v7H7zM3 1V0h6v1z');\n path2.setAttribute('fill','#3D6FB1');\n trash.appendChild(path2);\n\n\n rightDiv.appendChild(name_input);\n rightDiv.appendChild(name_submit);\n rightDiv.appendChild(dummy);\n mainDiv.style.zIndex = 1;\n colorpicker.style.zIndex = 1000;\n\n document.getElementById(\"draw_path_1\").style.fill = \"#3D70B2\";\n document.getElementById(\"draw_path_2\").style.stroke = \"#3D70B2\";\n document.getElementById(\"toolbar_draw\").style.backgroundColor = \"#e5e5e5\";\n\n\n attr_input_focus(className);\n if (_via_class_names.has(className)){\n _via_current_update_attribute_name = className;\n _via_current_shape = VIA_REGION_SHAPE.RECT;\n }\n else{\n _via_current_update_attribute_name = '';\n }\n var active_div = document.querySelector('.mainDivs.active');\n var active_btn = document.querySelector('._via_btn.active');\n //if any active btn\n if(active_div){\n //remove active class from it \n\n active_div.classList.remove('active');\n active_btn.classList.remove('active');\n active_div.style.backgroundColor = \"transparent\";\n active_btn.style.backgroundColor = \"transparent\";\n\n }\n\n mainDiv.classList.add('active');\n button.classList.add('active');\n mainDiv.style.backgroundColor = \"#dbe4f0\";\n button.style.backgroundColor = \"#dbe4f0\";\n turnOnShortcuts();\n\n mainDiv.addEventListener(\"mouseover\", function(){\n if (mainDiv.classList.contains('active')){\n return; \n }\n mainDiv.style.backgroundColor = \"#ECF1F7\";\n button.style.backgroundColor = \"#ECF1F7\";\n\n });\n\n mainDiv.addEventListener(\"mouseout\", function(){\n if (mainDiv.classList.contains('active')){\n return; \n }\n mainDiv.style.backgroundColor = \"transparent\";\n button.style.backgroundColor = \"transparent\";\n });\n \n mainDiv.addEventListener(\"click\", function(){\n attr_input_focus(className);\n if (_via_class_names.has(className)){\n _via_current_update_attribute_name = className;\n _via_current_shape = VIA_REGION_SHAPE.RECT;\n }\n else{\n _via_current_update_attribute_name = '';\n }\n var active_div = document.querySelector('.mainDivs.active');\n var active_btn = document.querySelector('._via_btn.active');\n if(active_div){\n //remove active class from it \n active_div.classList.remove('active');\n active_btn.classList.remove('active');\n active_div.style.backgroundColor = \"transparent\";\n active_btn.style.backgroundColor = \"transparent\";\n }\n\n mainDiv.classList.add('active');\n button.classList.add('active');\n mainDiv.style.backgroundColor = \"#dbe4f0\";\n button.style.backgroundColor = \"#dbe4f0\";\n document.getElementById(\"draw_path_1\").style.fill = \"#3D70B2\";\n document.getElementById(\"draw_path_2\").style.stroke = \"#3D70B2\";\n turnOnShortcuts();\n });\n\n //removal of class\n trash.addEventListener(\"click\", function(){\n var isActive = false;\n if (mainDiv.classList.contains('active')){\n mainDiv.classList.remove('active');\n isActive = true;\n _via_current_update_attribute_name = '';\n document.getElementById(\"draw_path_1\").style.fill = \"#9EB7D8\";\n document.getElementById(\"draw_path_2\").style.stroke = \"#9EB7D8\";\n\n }\n //go through the metadata and delete all of that as well as w the classes\n select_regions(className);\n del_sel_regions();\n //we have to make sure we account for the metadata too and the images in other pictures\n for (var x in _via_img_metadata){\n for (var i = 0; i < _via_img_metadata[x].regions.length; i++){\n if(_via_img_metadata[x].regions[i].region_attributes[\"name\"] == className){\n _via_img_metadata[x].regions.splice(i,1);\n i--;\n }\n\n }\n }\n\n trash.remove();\n button.remove();\n count.remove();\n edit.remove();\n name_input.remove();\n name_submit.remove();\n leftDiv.remove();\n rightDiv.remove();\n mainDiv.remove();\n\n _via_class_names.delete(className);\n document.getElementById(\"classes_label\").innerHTML = \"Classes \" + \" (\" + _via_class_names.size + \")\";\n\n if (isActive){\n _via_current_update_attribute_name = '';\n document.getElementById(\"draw_path_1\").style.fill = \"#9EB7D8\";\n document.getElementById(\"draw_path_2\").style.stroke = \"#9EB7D8\";\n }\n\n });\n\n edit.addEventListener(\"click\", function(){\n button.readOnly = false;\n button.focus();\n _via_changing_class = true;\n });\n\n button.addEventListener(\"focus\", function(){\n _via_is_user_adding_attribute_name = true;\n _via_is_user_updating_attribute_value = true;\n _via_is_user_updating_attribute_name = true;\n });\n\n button.addEventListener(\"blur\", function(){\n turnOnShortcuts();\n });\n button.addEventListener(\"change\", function(){\n\n\n if (_via_class_names.has(button.value)){\n show_message(\"name already exists\");\n button.value = className;\n return;\n }\n var classCount = _via_class_names.get(className)[0];\n var oldClassName = className;\n _via_class_names.set(button.value, [classCount, _via_class_names.get(className)[1]]);\n _via_class_names.delete(className);\n\n className = button.value;\n //next lets change up the metadata and the canvas region data and update the canvas\n //canvas region\n for (var i = 0; i < _via_canvas_regions.length; i++){\n \n if (_via_canvas_regions[i].region_attributes[\"name\"] == oldClassName){\n _via_canvas_regions[i].region_attributes[\"name\"] = className;\n }\n }\n for (var i = 0; i < _via_img_metadata[\"cars.png62201\"].regions.length; i++){\n \n if (_via_img_metadata[\"cars.png62201\"].regions[i].region_attributes[\"name\"] == oldClassName){\n _via_img_metadata[\"cars.png62201\"].regions[i].region_attributes[\"name\"] = className;\n }\n }\n\n for (var i = 0; i < _via_img_metadata[\"lot.jpeg71862\"].regions.length; i++){\n \n if (_via_img_metadata[\"lot.jpeg71862\"].regions[i].region_attributes[\"name\"] == oldClassName){\n _via_img_metadata[\"lot.jpeg71862\"].regions[i].region_attributes[\"name\"] = className;\n }\n }\n\n for (var i = 0; i < _via_img_metadata[\"outside.jpeg21513\"].regions.length; i++){\n \n if (_via_img_metadata[\"outside.jpeg21513\"].regions[i].region_attributes[\"name\"] == oldClassName){\n _via_img_metadata[\"outside.jpeg21513\"].regions[i].region_attributes[\"name\"] = className;\n }\n }\n //we have to update labels as well as the canvas\n button.value = className;\n button.id = className + \"_via_btn\";\n count.id = className + \"_num\";\n trash.id = className + \"_del\";\n edit.id = className + \"_edit\";\n name_input.id = className + \"_text\";\n name_submit.id = className + \"_submit\";\n button.readOnly = true;\n var active_btn = document.querySelector('.class_button.active');\n \n //if any active btn\n if(active_btn){\n //remove active class from it \n active_btn.classList.remove('active');\n }\n\n button.classList.add('active');\n attr_input_focus(className);\n _via_changing_class = false;\n\n\n turnOnShortcuts();\n\n });\n\n}", "function click (card){\n card.addEventListener(\"click\",function(){\n const presentCard = this;\n const previousCard = openCard[0];\n if(openCard.length === 1){\n\n card.classList.add(\"open\",\"show\",\"disabled\");\n openCard.push(this);\n compare(presentCard,previousCard);\n }else{\n presentCard.classList.add('open','show','disabled');\n openCard.push(this);\n }\n }\n )\n\n }", "function addListener() {\r\n var cards = document.querySelectorAll(\".card.effect_click\");\r\n\r\n for (var i = 0; i < cards.length; i++) {\r\n clickListener(cards[i]);\r\n }\r\n\r\n function clickListener(card) {\r\n card.addEventListener(\"click\", function() {\r\n this.classList.toggle(\"flipped\");\r\n });\r\n }\r\n }", "function initCards(cardsnum){\n for (i = 0; i < cardsnum; i++) { \n let div = document.createElement(\"div\");\n div.className ='card'+i;\n cards.appendChild(div);\n };\n }", "function clickCards(){\r\n let allCards = document.querySelectorAll('.card');\r\n let i, cardName;\r\n for (i = 0; i < allCards.length; i++) {\r\n allCards[i].setAttribute(cardName, deckOfCards[i]);\r\n }\r\n // To Read the card name use\r\n // allCards[i].getAttribute(cardName);\r\n let openCards = [];\r\n let initialClick = 0;\r\n\r\n // Add an event listener to each element of allCards\r\n // The function in forEach takes two parameters: the refernce to the value\r\n // stored in allCards[i] and the index i\r\n allCards.forEach(function(htmlText, arrayIndex){\r\n // The value sent from allCards[i] has an event listener to it that is\r\n // activated by clikcing. Clicking the card represented by htmlText will\r\n // write the index value to openCards, which will later be used to compare\r\n // if two selected cards are a match.\r\n console.log(\"forEach method called.\")\r\n\r\n allCards[arrayIndex].addEventListener(\"click\", function() {\r\n // If its the first card click, activate timer functionality\r\n\r\n if (initialClick == 0) {\r\n initialClick = 1;\r\n setTimer();\r\n }\r\n\r\n // Make sure the same card isn't being clicked twice\r\n if(arrayIndex == openCards[0]) return;\r\n console.log(\"arrayIndex = \", arrayIndex);\r\n\r\n // Add array number for card that has been clicked in openCards\r\n openCards.push(arrayIndex);\r\n\r\n // Check if there are too many cards open (timeout isn't over)\r\n if(openCards.length > 2) return;\r\n\r\n allCards[arrayIndex].classList.add('open', 'show');\r\n\r\n // clicked to compare cards.\r\n if(openCards.length >= 2) {\r\n moveCounter++;\r\n setMoves();\r\n setStars();\r\n\r\n // If two cards are open, compare their values. If they're a match,\r\n // update the CSS coresponding to their class 'match' and 'show'\r\n if(allCards[openCards[0]].firstChild.className == allCards[openCards[1]].firstChild.className) {\r\n\r\n // Match found\r\n\r\n allCards[openCards[0]].classList.remove('open');\r\n allCards[openCards[1]].classList.remove('open');\r\n allCards[openCards[0]].classList.add('match');\r\n allCards[openCards[1]].classList.add('match');\r\n // add to matimetchedCards for winning the game\r\n matchedCards++;\r\n\r\n // Clear the openCards array\r\n openCards = [];\r\n } else {\r\n // No match found. Reset the cards\r\n setTimeout(function() {\r\n allCards[openCards[0]].classList.remove('open','show');\r\n allCards[openCards[1]].classList.remove('open','show');\r\n\r\n // Clear the openCards array\r\n openCards = [];\r\n //seconds allowed for open cards\r\n },475);\r\n }\r\n }\r\n })\r\n });\r\n}", "function newRound(numToAppend) {\n $('#tiles').empty();\n let colorArr = [];\n for (let i = 0; i < numToAppend; i++) {\n colorArr.push(randomRGB());\n let colorTile = $(\n `<div class = 'colorTile' data-color='${colorArr[i]}' style='background: ${colorArr[i]}'</div>`\n );\n $('#tiles').append(colorTile);\n }\n winner = getWinningColor(colorArr);\n $('#clue').text(winner);\n console.log(colorArr);\n}", "function createBoard(){\n for(let i=0; i<carPic.length;i++){\n let card = document.createElement('img')\n // creating an image tage for each item of carpic array\n card.setAttribute('src','img/bbs.png')\n // adding the src of the image associated with each image\n card.setAttribute('data-id',i)\n // giving an ID to each item of the array\n card.addEventListener('click',cardFlip)\n // each card will flip on click\n table.appendChild(card)\n // adding an image associated with the attributes added to each item of the array\n card.classList.add(\"wheel\")\n // adding a css class of wheel to make it spin\n }\n }", "function createBoard(){\n for(let i=0; i<cardArray.length; i++){\n const card = document.createElement('img')\n card.setAttribute('src', 'images/blank.jpg')\n card.setAttribute('data-id', i)\n card.addEventListener('click', flipCard)\n grid.appendChild(card)\n }\n}", "function cardListener() {\n const cards = document.getElementsByClassName('card');\n for (let i = 0; i < 12; i = i + 1) {\n cards[i].addEventListener('click', function () { generateModal(i) });\n }\n}", "function startGame() {\n addCards();\n timer();\n\n var colors = randomizeColors();\n var cards = document.getElementsByClassName(\"card\");\n\n for (let i = 0; i < cards.length; i++) {\n cards[i].addEventListener(\"click\", function(){\n if(allowClick && this.style.backgroundColor === 'black') {\n playMoove(this, colors[i]);\n }\n });\n }\n\n}", "function setupSquares(){\n for(var i = 0 ; i < squares.length; i++){\n // adding click events to squares\n squares[i].addEventListener(\"click\", function(){\n // grab color of clicked square\n var clickedColor = this.style.backgroundColor;\n //compare color to pickedColor\n if(clickedColor === pickedColor){\n messageDisplay.textContent = \"Corect!\";\n changeColors(clickedColor);\n h1.style.backgroundColor = clickedColor;\n resetButton.textContent = \"Play Again?\";\n } else{\n messageDisplay.textContent = \"Try Again\";\n this.style.backgroundColor = \"#232323\";\n }\n });\n }\n}", "addButtonListener() {\n for (const color in this.colors) {\n this.colors[color].addEventListener(`click`, this.chooseColor);\n }\n }", "function createDeck()\n{\n cardsArr.sort(() => 0.5 - Math.random());\n for(let i =0; i < cardsArr.length; i++)\n {\n let cards = document.createElement(\"img\");\n cards.setAttribute(\"src\", \"/images/default.png\");\n cards.classList.add(\"back\");\n cards.setAttribute(\"data-id\",i);\n cards.addEventListener(\"click\",flipped);\n display.appendChild(cards);\n \n \n }\n currentPlayer.push(playerName.value);\n \n \n}", "function createBoard () {\n\tfor (var i=0; i<cards.length; i++) {\n\t\tvar newCard = document.createElement('div');\n\t\tnewCard.className = 'card';\n\t\tnewCard.setAttribute('data-card', cards[i]);\n\t\tnewCard.addEventListener('click', isTwoCards);\n\t\tgameBoard.appendChild(newCard);\n\t}\n}" ]
[ "0.834697", "0.82764417", "0.8223376", "0.8177341", "0.8173253", "0.8118955", "0.8051726", "0.80365855", "0.8033395", "0.8033306", "0.8025407", "0.8008537", "0.80012107", "0.80012107", "0.80012107", "0.80012107", "0.80012107", "0.7987586", "0.7986394", "0.7934706", "0.7930237", "0.7921549", "0.79112273", "0.78442025", "0.77568334", "0.762523", "0.7607552", "0.7533216", "0.7322495", "0.7250946", "0.703387", "0.68602556", "0.6815999", "0.67887485", "0.6788079", "0.6761973", "0.67489946", "0.6745273", "0.6724771", "0.6723115", "0.67127687", "0.67053246", "0.66898644", "0.66895276", "0.66781217", "0.6634971", "0.6632391", "0.6592151", "0.6566245", "0.65608066", "0.6548312", "0.65434796", "0.6508319", "0.6499642", "0.6495815", "0.64533734", "0.6449878", "0.6448365", "0.6431459", "0.6428522", "0.64249825", "0.64194554", "0.6399083", "0.63937443", "0.6392534", "0.6384813", "0.6380286", "0.6376243", "0.63753605", "0.6373703", "0.6361879", "0.6361858", "0.63591236", "0.6346237", "0.63366145", "0.6329099", "0.6326525", "0.6320628", "0.6314722", "0.63017786", "0.6300494", "0.6299194", "0.6290959", "0.62817556", "0.6274409", "0.62736475", "0.626788", "0.6263383", "0.62629795", "0.62569356", "0.62398195", "0.62386453", "0.623393", "0.623076", "0.6230029", "0.6223366", "0.62192744", "0.6216749", "0.62075645", "0.62042886" ]
0.78776777
23
generic function for sending requests through a $httplike http service obj is the api object that makes the request action and error are promises to be run on success and error respectively and after the corresponding default promises have been run
function sendRequest(obj, request, httpService, action, error) { obj.running = true; obj.valid = null; obj.raw = null; // action and error are functions for the promise. if defined they'll be run after the default action and error functions let _action = function (result) { obj.raw = result; obj.valid = true; if (action) { action(result); } obj.running = false; }; let _error = function (result) { obj.raw = result; obj.valid = false; if (error) { error(result); } obj.running = false; }; httpService(request).then(_action).catch(_error); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send_http(url,method,data)\r\n {\r\n var defer = $q.defer();\r\n\r\n url = HOST+url;\r\n $http({\r\n 'method':method,\r\n 'url':url,\r\n 'data':data\r\n }).then(\r\n function(res)\r\n {\r\n defer.resolve(res.data);\r\n },\r\n function(err)\r\n {\r\n //HANDLE ERRORS from server\r\n console.log(err.data);\r\n defer.resolve('Error'); //simply answer error to run logic for error\r\n });\r\n\r\n return defer.promise;\r\n }", "function request($http, url, method, data, successCallback, errorCallback){\n $http({\n url: url,\n method: method, \n data: data\n }).then(function(response){\n successCallback(response);\n }, function(response){\n errorCallback(response);\n });\n}", "function http($http, $q, Upload, toastr, back4app) {\n console.log('create request service');\n\n return {\n get: function (url, data) {\n return request('GET', url, data);\n },\n post: function (url, data) {\n return request('POST', url, data);\n },\n put: function (url, data) {\n return request('PUT', url, data);\n },\n delete: function (url, data) {\n return request('DELETE', url, data);\n },\n file: function (url, data) {\n return requestFile(url, data);\n }\n };\n\n\n /**\n * Main request function\n * @param {string} method - Method name\n * @param {string} url - Request url\n * @param {object} data - Data to request\n * @returns {promise}\n */\n\n function request(method, url, data) {\n\n\n let config = {\n dataType: 'json',\n method: method,\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json; charset=UTF-8',\n 'X-Parse-Application-Id': back4app.appId,\n 'X-Parse-REST-API-Key': back4app.token\n }\n };\n\n if (method === 'GET') {\n config.params = data;\n config.timeout = 20000;\n }\n else {\n config.data = data;\n }\n\n // if ($sessionStorage.auth_key) {\n // config.url = url + '?auth_key=' + $sessionStorage.auth_key;\n // }\n // else {\n config.url = url;\n // }\n\n return $http(config)\n .then(requestComplete)\n .catch(requestFailed);\n }\n\n /**\n * Callback function for failed request\n * @param err\n * @returns {promise}\n */\n function requestFailed(err) {\n console.info('error', err.config.url, err);\n\n if (err.data == null || !err.data.error) {\n if (err.status === 200) {\n toastr.error('Server error: ' + err.data);\n }\n else if (err.status === -1) {\n toastr.error('Server is not available');\n }\n else if (err.status === 0) {\n toastr.error('There is no Internet connection');\n }\n else if (err.status === 500) {\n toastr.error('Server error: ' + err.status + ' ' + err.data.message);\n }\n else {\n toastr.error('Server error: ' + err.status + ' ' + err.statusText);\n }\n // console.log('XHR Failed: ' + err.status);\n } else {\n toastr.error(err.data.error);\n }\n\n\n return $q.reject(err.data.error);\n }\n\n /**\n * Callback function for success request\n * @param response\n * @returns {promise}\n */\n\n function requestComplete(response) {\n let promise = $q.defer();\n\n console.info('response complete', response.config.url, response);\n\n if (!response.data.error) {\n promise.resolve(response.data);\n }\n else {\n promise.reject(response);\n }\n\n\n return promise.promise;\n }\n\n /**\n * Function for sending files\n * @param {string} url - Request url\n * @param {object} data - Data to request\n * @returns {promise}\n */\n function requestFile(url, file) {\n return Upload.http({\n url: url,\n headers: {\n 'Content-Type': file.type,\n 'X-Parse-Application-Id': back4app.appId,\n 'X-Parse-REST-API-Key': back4app.token\n },\n data: file\n });\n }\n }", "function http($http, $q, $localStorage , toastr) {\n console.log('create request service');\n\n return {\n get: function (url, data) {\n return request('GET', url, data);\n },\n post: function (url, data) {\n return request('POST', url, data);\n },\n put: function (url, data) {\n return request('PUT', url, data);\n },\n delete: function (url, data) {\n return request('DELETE', url, data);\n },\n file: function (url, data) {\n return requestFile(url, data);\n }\n };\n\n\n /**\n * Main request function\n * @param {string} method - Method name\n * @param {string} url - Request url\n * @param {object} data - Data to request\n * @returns {promise}\n */\n\n function request(method, url, data) {\n\n let token = $localStorage.token;\n\n\n let config = {\n dataType: 'json',\n method: method,\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n if(typeof token != 'undefined') {\n config.headers.Authorization = 'Bearer ' + token;\n }\n\n if (method === 'GET') {\n config.params = data;\n config.timeout = 20000;\n }\n else {\n config.data = data;\n }\n\n config.url = url;\n\n // console.log(config, 'data for sand');\n\n return $http(config)\n .then(requestComplete)\n .catch(requestFailed);\n }\n\n /**\n * Function for sending files\n * @param {string} url - Request url\n * @param {object} data - Data to request\n * @returns {promise}\n */\n\n function requestFile (url, data) {\n let token = $localStorage.token;\n console.log(data);\n let config = {\n transformRequest: angular.identity,\n headers: {\n 'Content-Type': undefined\n }\n };\n\n if(typeof token != 'undefined') {\n config.headers.Authorization = 'Bearer ' + token;\n }\n\n return $http.post(url, data, config).then(\n function (response) {\n let defer = $q.defer();\n\n // console.info('response', url, response);\n if (response.data.error) {\n toastr.error(response.data.error);\n defer.reject(response.data.error);\n }\n defer.resolve(response.data);\n return defer.promise;\n },\n function (response) {\n let defer = $q.defer();\n // console.info('error', url, response);\n\n if (response.status === 200) {\n toastr.error('Server Error: ' + response.data);\n defer.reject(response.data);\n }\n else if (response.status === -1) {\n toastr.error('Server unavailable');\n defer.reject(response.data);\n }\n else if (response.status === 500) {\n toastr.error(response.data.message);\n // toastr.error('Server Error: ' + response.status + ' ' + response.data.message);\n defer.reject(response.data);\n }\n else if (response.status === 403) {\n toastr.error('Access denied.');\n defer.reject(response.data);\n }\n else {\n toastr.error('Server Error: ' + response.status + ' ' + response.data.message);\n defer.reject(response.data);\n }\n defer.reject(response.data);\n return defer.promise;\n }\n );\n };\n\n /**\n * Callback function for failed request\n * @param err\n * @returns {promise}\n */\n function requestFailed(err) {\n console.info('error', err);\n\n if (err.data == null || !err.data.error) {\n if (err.status === 200) {\n toastr.error('Server error: ' + err.data);\n }\n else if (err.status === -1) {\n toastr.error('Server is not available');\n }\n else if (err.status === 0) {\n toastr.error('There is no Internet connection');\n }\n else if (err.status === 500) {\n toastr.error('Server error: ' + err.status + ' ' + err.data.message);\n }\n else {\n toastr.error('Server error: ' + err.status + ' ' + err.statusText);\n }\n }\n else {\n toastr.error(err.data.error);\n\n }\n\n return {status: false};\n }\n\n /**\n * Callback function for success request\n * @param response\n * @returns {promise}\n */\n\n function requestComplete(response) {\n // let promise = $q.defer();\n // console.info('response complete', response.config.url);\n // // console.log(!response.data.status, '123')\n // if (response.data.status) {\n // promise.resolve(response.data);\n // }\n // else {\n // promise.reject(response.data);\n // }\n console.log(response, 'request response');\n\n return response.data;\n\n\n }\n }", "function HttpService ( $http ) {\r\n\r\n\tvar service = {\r\n\t\tsend: send\r\n\t}\r\n\r\n\treturn service\r\n\r\n function send ( request ) {\r\n\r\n \tvar promise = $http ({\r\n \t\tmethod: \"post\",\r\n \t\turl: \"../API.php\",\r\n \t\theaders: {'Content-Type': 'application/x-www-form-urlencoded'},\r\n \t\tdata: request\r\n \t})\r\n .then ( function ( response ) {\r\n\r\n \t\treturn response.data\r\n \t})\r\n\r\n \treturn promise\r\n }\r\n}", "sendHttpRequest(apiEndpoint, opts, body = null, httpType) {\n let headers;\n if (this.keyValueExistsAndNonNull(opts, 'accessToken')) {\n if (this.keyValueExistsAndNonNull(opts, 'accessTokenUsesParam') && opts['accessTokenUsesParam']) {\n // Using parameter\n opts['access_token'] = opts['accessToken'];\n delete opts['accessToken'];\n // We don't want to pass this to the actual API endpoint\n delete opts['accessTokenUsesParam'];\n }\n else {\n // Using HTTP headers\n headers = new HttpHeaders()\n .set('Authorization', `Bearer ${opts['accessToken']}`);\n }\n }\n switch (httpType) {\n case 'delete':\n if (headers) {\n return this.http.createHttpDelete(apiEndpoint, opts, headers);\n }\n else {\n return this.http.createHttpDelete(apiEndpoint, opts);\n }\n case 'get':\n if (headers) {\n return this.http.createHttpGet(apiEndpoint, opts, headers);\n }\n else {\n return this.http.createHttpGet(apiEndpoint, opts);\n }\n case 'post':\n if (headers) {\n if (body) {\n return this.http.createHttpPost(apiEndpoint, opts, body, headers);\n }\n else {\n return this.http.createHttpPost(apiEndpoint, opts, null, headers);\n }\n }\n else {\n if (body) {\n return this.http.createHttpPost(apiEndpoint, opts, body);\n }\n else {\n return this.http.createHttpPost(apiEndpoint, opts, null);\n }\n }\n case 'put':\n if (headers) {\n if (body) {\n return this.http.createHttpPut(apiEndpoint, opts, body, headers);\n }\n else {\n return this.http.createHttpPut(apiEndpoint, opts, null, headers);\n }\n }\n else {\n if (body) {\n return this.http.createHttpPut(apiEndpoint, opts, body);\n }\n else {\n return this.http.createHttpPut(apiEndpoint, opts, null);\n }\n }\n }\n }", "function http(_x) {\n return _http.apply(this, arguments);\n} // exported for testing", "function http(_x) {\n return _http.apply(this, arguments);\n} // exported for testing", "function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,url=buildUrl(config.url,config.paramSerializer(config.params));$http.pendingRequests.push(config);promise.then(removePendingReq,removePendingReq);if((config.cache||defaults.cache)&&config.cache!==false&&(config.method==='GET'||config.method==='JSONP')){cache=isObject(config.cache)?config.cache:isObject(defaults.cache)?defaults.cache:defaultCache;}if(cache){cachedResp=cache.get(url);if(isDefined(cachedResp)){if(isPromiseLike(cachedResp)){// cached request has already been sent, but there is no response yet\n\tcachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else{// serving from cache\n\tif(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else{resolvePromise(cachedResp,200,{},'OK');}}}else{// put the promise for the non-transformed response into cache as a placeholder\n\tcache.put(url,promise);}}// if we won't have the response in cache, set the xsrf headers and\n\t// send the request to the backend\n\tif(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$$cookieReader()[config.xsrfCookieName||defaults.xsrfCookieName]:undefined;if(xsrfValue){reqHeaders[config.xsrfHeaderName||defaults.xsrfHeaderName]=xsrfValue;}$httpBackend(config.method,url,reqData,done,reqHeaders,config.timeout,config.withCredentials,config.responseType,createApplyHandlers(config.eventHandlers),createApplyHandlers(config.uploadEventHandlers));}return promise;function createApplyHandlers(eventHandlers){if(eventHandlers){var applyHandlers={};forEach(eventHandlers,function(eventHandler,key){applyHandlers[key]=function(event){if(useApplyAsync){$rootScope.$applyAsync(callEventHandler);}else if($rootScope.$$phase){callEventHandler();}else{$rootScope.$apply(callEventHandler);}function callEventHandler(){eventHandler(event);}};});return applyHandlers;}}/**\n\t * Callback registered to $httpBackend():\n\t * - caches the response if desired\n\t * - resolves the raw $http promise\n\t * - calls $apply\n\t */function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\n\tcache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}/**\n\t * Resolves the raw $http promise.\n\t */function resolvePromise(response,status,headers,statusText){//status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\tstatus=status>=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText});}function resolvePromiseWithResult(result){resolvePromise(result.data,result.status,shallowCopy(result.headers()),result.statusText);}function removePendingReq(){var idx=$http.pendingRequests.indexOf(config);if(idx!==-1)$http.pendingRequests.splice(idx,1);}}", "function API(s=\"untitled\",t=!1){return new class{constructor(s,t){this.name=s,this.debug=t,this.isRequest=\"undefined\"!=typeof $request,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>{if(this.isNode){const s=\"undefined\"!=typeof $request?void 0:require(\"request\"),t=require(\"fs\");return{request:s,fs:t}}return null})(),this.initCache();const e=(s,t)=>new Promise(function(e){setTimeout(e.bind(null,t),s)});Promise.prototype.delay=function(s){return this.then(function(t){return e(s,t)})}}get(s){return this.isQX?(\"string\"==typeof s&&(s={url:s,method:\"GET\"}),$task.fetch(s)):new Promise((t,e)=>{this.isLoon||this.isSurge?$httpClient.get(s,(s,i,o)=>{s?e(s):t({statusCode:i.status,headers:i.headers,body:o})}):this.node.request(s,(s,i,o)=>{s?e(s):t({...i,statusCode:i.statusCode,body:o})})})}post(s){return this.isQX?(\"string\"==typeof s&&(s={url:s}),s.method=\"POST\",$task.fetch(s)):new Promise((t,e)=>{this.isLoon||this.isSurge?$httpClient.post(s,(s,i,o)=>{s?e(s):t({statusCode:i.status,headers:i.headers,body:o})}):this.node.request.post(s,(s,i,o)=>{s?e(s):t({...i,statusCode:i.statusCode,body:o})})})}initCache(){if(this.isQX&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||\"{}\")),(this.isLoon||this.isSurge)&&(this.cache=JSON.parse($persistentStore.read(this.name)||\"{}\")),this.isNode){let s=\"root.json\";this.node.fs.existsSync(s)||this.node.fs.writeFileSync(s,JSON.stringify({}),{flag:\"wx\"},s=>console.log(s)),this.root={},s=`${this.name}.json`,this.node.fs.existsSync(s)?this.cache=JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(s,JSON.stringify({}),{flag:\"wx\"},s=>console.log(s)),this.cache={})}}persistCache(){const s=JSON.stringify(this.cache);this.isQX&&$prefs.setValueForKey(s,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(s,this.name),this.isNode&&(this.node.fs.writeFileSync(`${this.name}.json`,s,{flag:\"w\"},s=>console.log(s)),this.node.fs.writeFileSync(\"root.json\",JSON.stringify(this.root),{flag:\"w\"},s=>console.log(s)))}write(s,t){this.log(`SET ${t}`),-1!==t.indexOf(\"#\")?(t=t.substr(1),this.isSurge||this.isLoon&&$persistentStore.write(s,t),this.isQX&&$prefs.setValueForKey(s,t),this.isNode&&(this.root[t]=s)):this.cache[t]=s,this.persistCache()}read(s){return this.log(`READ ${s}`),-1===s.indexOf(\"#\")?this.cache[s]:(s=s.substr(1),this.isSurge||this.isLoon?$persistentStore.read(s):this.isQX?$prefs.valueForKey(s):this.isNode?this.root[s]:void 0)}delete(s){this.log(`DELETE ${s}`),-1!==s.indexOf(\"#\")?(s=s.substr(1),this.isSurge||this.isLoon&&$persistentStore.write(null,s),this.isQX&&$prefs.removeValueForKey(s),this.isNode&&delete this.root[s]):delete this.cache[s],this.persistCache()}notify(t=s,e=\"\",i=\"\",o,n){if(this.isSurge){let s=i+(null==n?\"\":`\\n\\n多媒体链接:${n}`),r={};o&&(r.url=o),\"{}\"==JSON.stringify(r)?$notification.post(t,e,s):$notification.post(t,e,s,r)}if(this.isQX){let s={};o&&(s[\"open-url\"]=o),n&&(s[\"media-url\"]=n),\"{}\"==JSON.stringify(s)?$notify(t,e,i):$notify(t,e,i,s)}if(this.isLoon){let s={};o&&(s.openUrl=o),n&&(s.mediaUrl=n),\"{}\"==JSON.stringify(s)?$notification.post(t,e,i):$notification.post(t,e,i,s)}if(this.isNode){let s=i+(null==o?\"\":`\\n\\n跳转链接:${o}`)+(null==n?\"\":`\\n\\n多媒体链接:${n}`);if(this.isJSBox){const i=require(\"push\");i.schedule({title:t,body:e?e+\"\\n\"+s:s})}else console.log(`${t}\\n${e}\\n${s}\\n\\n`)}}log(s){this.debug&&console.log(s)}info(s){console.log(s)}error(s){console.log(\"ERROR: \"+s)}wait(s){return new Promise(t=>setTimeout(t,s))}done(s={}){this.isQX||this.isLoon||this.isSurge?this.isRequest?$done(s):$done():this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=s.headers,$context.statusCode=s.statusCode,$context.body=s.body)}}(s,t)}", "function http(options, parameters, body){\n\tvar acceptJson = false, jQuery = false, nodeJs = false, http, http_txt = '', goodJSON = false;\n\tvar ids = 'abcdefghijkmnopqrstuvwxyz';\n\tvar id = ids[Math.floor(Math.random() * ids.length)];\t\t\t\t\t\t\t\t\t\t//random letter to help id calls when there are multiple rest calls\n\toptions = mergeBtoA(default_options, options);\n\t\n\t//// Handle Call Back ////\n\tfunction success(statusCode, headers, resp){\t\t\t\t\t\t\t\t\t\t\t\t//go to success callback\n\t\tif(options.include_headers) resp = {response:resp, headers: headers};\n\t\tif(jQuery) options.success(statusCode, resp);\n\t\telse if(nodeJs) options.cb(null, resp);\t\t\t\t\t\t\t\t\t\t\t\t\t//if neither callback set, don't do either\n\t}\n\t\n\tfunction failure(statusCode, headers, msg){\t\t\t\t\t\t\t\t\t\t\t\t\t//go to failure callback\n\t\tif(options.include_headers) msg = {response:msg, headers: headers};\n\t\tif(jQuery) options.failure(statusCode, msg);\n\t\telse if(nodeJs) options.cb(statusCode, msg);\t\t\t\t\t\t\t\t\t\t\t//if neither callback set, don't do either\n\t}\n\t\n\tif(typeof(options.ssl) === 'undefined' || options.ssl) {\t\t\t\t\t\t\t\t\t//if options.ssl not found or true use https\n\t\thttp = https_mod;\n\t\thttp_txt = '[https ' + options.method + ' - ' + id + ']';\n\t}\n\telse {\n\t\thttp = http_mod;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if options.ssl == false use http\n\t\thttp_txt = '[http ' + options.method + ' - ' + id + ']';\n\t}\n\tif(!options.quiet) console.log(http_txt + ' ' + options.path);\n\t\n\t//// Sanitize Inputs ////\n\tvar querystring = require('querystring');\t\t\t\t\t\t\t\t\t\t\t\t\t//convert all header keys to lower-case for easier parsing\n\tfor(var i in options.headers) {\n\t\tvar temp = options.headers[i];\n\t\tdelete options.headers[i];\n\t\tif(temp != null){\n\t\t\toptions.headers[i.toLowerCase()] = temp;\n\t\t}\n\t}\n\t\n\tif(typeof body == 'object'){\n\t\tif(options.headers) options.headers['content-type'] = 'application/json';\n\t\telse options.headers = {'content-type': 'application/json'};\n\t\tbody = JSON.stringify(body);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//stringify body\n\t}\n\t\n\tif(options.headers && options.headers['accept'] && options.headers['accept'].toLowerCase().indexOf('json') >= 0) acceptJson = true;\n\tif(options.success && options.failure) jQuery = true;\n\telse if(options.cb) nodeJs = true;\n\n\tif(body){\n\t\tif(options.headers) options.headers['content-length'] = Buffer.byteLength(body);\n\t\telse options.headers = {'content-lenght': Buffer.byteLength(body)};\n\t}\n\t//else if(options.headers['content-length']) delete options.headers['content-length'];\t\t\t//we don't need you\n\t\n\tif(!options.quiet && options.method.toLowerCase() !== 'get') {\n\t\tconsole.log(' body:', body);\n\t}\n\t\t\n\t//// Handle Request ////\n\tif(typeof parameters == 'object') options.path += '?' + querystring.stringify(parameters);\t\t//should be a json object\n\tvar request = http.request(options, function(resp) {\n\t\tvar str = '', temp, chunks = 0;\n\t\tif(!options.quiet) console.log(http_txt + ' Status code: ' + resp.statusCode);\n\t\t\n\t\tresp.setEncoding('utf8');\n\t\tresp.on('data', function(chunk) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//merge chunks of request\n\t\t\tstr += chunk;\n\t\t\tchunks++;\n\t\t});\n\t\tresp.on('end', function() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//wait for end before decision\n\t\t\tif(resp.statusCode == 204){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//empty response, don't parse body\n\t\t\t\tif(!options.quiet) console.log(http_txt + ' Data: No Content');\n\t\t\t\tsuccess(resp.statusCode, resp.headers, str);\n\t\t\t}\n\t\t\telse if(resp.statusCode >= 200 && resp.statusCode <= 399){\t\t\t\t\t\t\t\t//check status codes\n\t\t\t\tif(acceptJson){\n\t\t\t\t\ttry{\n\t\t\t\t\t\ttemp = JSON.parse(str);\n\t\t\t\t\t\tgoodJSON = true;\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e){\n\t\t\t\t\t\tgoodJSON = false;\n\t\t\t\t\t\tif(!options.quiet) console.log(http_txt + ' Error - response is not JSON: ', str);\n\t\t\t\t\t\tfailure(500, resp.headers, 'Invalid JSON response: ' + str);\n\t\t\t\t\t}\n\t\t\t\t\tif(goodJSON){\n\t\t\t\t\t\t//if(!options.quiet) console.log(http_txt + ' Data:', str);\t\t\t\t\t//all good [json resp]\n\t\t\t\t\t\tsuccess(resp.statusCode, resp.headers, temp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//all good [not json resp]\n\t\t\t\t\tif(!options.quiet) console.log(http_txt + ' Data:', str);\n\t\t\t\t\tsuccess(resp.statusCode, resp.headers, str);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(!options.quiet) console.log(http_txt + ' Error - status code: ' + resp.statusCode, str);\n\t\t\t\tif(acceptJson){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tstr = JSON.parse(str);\t\t\t\t\t\t\t\t\t\t\t\t\t\t//attempt to parse error for JSON\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e){}\n\t\t\t\t}\n\t\t\t\tfailure(resp.statusCode, resp.headers, str);\n\t\t\t}\n\t\t});\n\t});\n\t\n\trequest.on('error', function(e) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//handle error event\n\t\tif(!options.quiet) console.log(http_txt + ' Error - unknown issue with request: ', e);\t\t//catch failed request (failed DNS lookup and such)\n\t\tfailure(500, null, e);\n\t});\n\t\n\trequest.setTimeout(Number(options.timeout) || default_options.timeout);\n\trequest.on('timeout', function(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//handle time out event\n\t\tif(!options.quiet) console.log(http_txt + ' Error - request timed out');\n\t\tfailure(408, null, 'Request timed out');\n\t\trequest.destroy();\n\t});\n\t\n\tif(body && body !== '' && !isEmpty(body)){\n\t\trequest.write(body);\n\t}\n\trequest.end();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//send the request\n}", "function API(e=\"untitled\",s=!1){return new class{constructor(e,s){this.name=e,this.debug=s,this.isRequest=\"undefined\"!=typeof $request,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>{if(this.isNode){const e=\"undefined\"!=typeof $request?void 0:require(\"request\"),s=require(\"fs\");return{request:e,fs:s}}return null})(),this.initCache();const t=(e,s)=>new Promise(function(t){setTimeout(t.bind(null,s),e)});Promise.prototype.delay=function(e){return this.then(function(s){return t(e,s)})}}get(e){return this.isQX?(\"string\"==typeof e&&(e={url:e,method:\"GET\"}),$task.fetch(e)):new Promise((s,t)=>{this.isLoon||this.isSurge?$httpClient.get(e,(e,i,o)=>{e?t(e):s({statusCode:i.status,headers:i.headers,body:o})}):this.node.request(e,(e,i,o)=>{e?t(e):s({...i,statusCode:i.statusCode,body:o})})})}post(e){return e.body&&e.headers&&!e.headers[\"Content-Type\"]&&(e.headers[\"Content-Type\"]=\"application/x-www-form-urlencoded\"),this.isQX?(\"string\"==typeof e&&(e={url:e}),e.method=\"POST\",$task.fetch(e)):new Promise((s,t)=>{this.isLoon||this.isSurge?$httpClient.post(e,(e,i,o)=>{e?t(e):s({statusCode:i.status,headers:i.headers,body:o})}):this.node.request.post(e,(e,i,o)=>{e?t(e):s({...i,statusCode:i.statusCode,body:o})})})}initCache(){if(this.isQX&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||\"{}\")),(this.isLoon||this.isSurge)&&(this.cache=JSON.parse($persistentStore.read(this.name)||\"{}\")),this.isNode){let e=\"root.json\";this.node.fs.existsSync(e)||this.node.fs.writeFileSync(e,JSON.stringify({}),{flag:\"wx\"},e=>console.log(e)),this.root={},e=`${this.name}.json`,this.node.fs.existsSync(e)?this.cache=JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(e,JSON.stringify({}),{flag:\"wx\"},e=>console.log(e)),this.cache={})}}persistCache(){const e=JSON.stringify(this.cache);this.isQX&&$prefs.setValueForKey(e,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(e,this.name),this.isNode&&(this.node.fs.writeFileSync(`${this.name}.json`,e,{flag:\"w\"},e=>console.log(e)),this.node.fs.writeFileSync(\"root.json\",JSON.stringify(this.root),{flag:\"w\"},e=>console.log(e)))}write(e,s){this.log(`SET ${s}`),-1!==s.indexOf(\"#\")?(s=s.substr(1),(this.isSurge||this.isLoon)&&$persistentStore.write(e,s),this.isQX&&$prefs.setValueForKey(e,s),this.isNode&&(this.root[s]=e)):this.cache[s]=e,this.persistCache()}read(e){return this.log(`READ ${e}`),-1===e.indexOf(\"#\")?this.cache[e]:(e=e.substr(1),this.isSurge||this.isLoon?$persistentStore.read(e):this.isQX?$prefs.valueForKey(e):this.isNode?this.root[e]:void 0)}delete(e){this.log(`DELETE ${e}`),-1!==e.indexOf(\"#\")?(e=e.substr(1),(this.isSurge||this.isLoon)&&$persistentStore.write(null,e),this.isQX&&$prefs.removeValueForKey(e),this.isNode&&delete this.root[e]):delete this.cache[e],this.persistCache()}notify(s=e,t=\"\",i=\"\",o,n){if(this.isSurge){let e=i+(null==n?\"\":`\\n\\n多媒体链接:${n}`),r={};o&&(r.url=o),\"{}\"==JSON.stringify(r)?$notification.post(s,t,e):$notification.post(s,t,e,r)}if(this.isQX){let e={};o&&(e[\"open-url\"]=o),n&&(e[\"media-url\"]=n),\"{}\"==JSON.stringify(e)?$notify(s,t,i):$notify(s,t,i,e)}if(this.isLoon){let e={};o&&(e.openUrl=o),n&&(e.mediaUrl=n),\"{}\"==JSON.stringify(e)?$notification.post(s,t,i):$notification.post(s,t,i,e)}if(this.isNode){let e=i+(null==o?\"\":`\\n\\n跳转链接:${o}`)+(null==n?\"\":`\\n\\n多媒体链接:${n}`);if(this.isJSBox){const i=require(\"push\");i.schedule({title:s,body:t?t+\"\\n\"+e:e})}else console.log(`${s}\\n${t}\\n${e}\\n\\n`)}}log(e){this.debug&&console.log(e)}info(e){console.log(e)}error(e){console.log(\"ERROR: \"+e)}wait(e){return new Promise(s=>setTimeout(s,e))}done(e={}){this.isQX||this.isLoon||this.isSurge?this.isRequest?$done(e):$done():this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=e.headers,$context.statusCode=e.statusCode,$context.body=e.body)}}(e,s)}", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])(req).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"concatMap\"])((req) => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])((event) => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"map\"])((res) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "request(first, url, options = {}) {\n let req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n } else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n let headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n } else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n let params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n } else {\n params = new HttpParams({\n fromObject: options.params\n });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, options.body !== undefined ? options.body : null, {\n headers,\n context: options.context,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.of)(req).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.concatMap)(req => this.handler.handle(req)));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$ = events$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.filter)(event => event instanceof HttpResponse));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(res => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(res => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(res => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(res => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }", "m_submit_http_request(ph_args) {\n const lo_this = this;\n\n try {\n\n // call limit already reached ? - silently exit\n if (lo_this._ab_call_limit_reached) {\n return;\n }\n\n const pi_max_calls = lo_this.m_pick_option(ph_args, \"pi_max_calls\", true);\n const li_call_count = lo_this.m_get_call_count_pushed();\n\n // when we reached the max number of calls to this server, just stop now\n if (f_is_defined(pi_max_calls) && (li_call_count >= pi_max_calls)) {\n lo_this._ab_call_limit_reached = true;\n throw f_console_alert(`${lo_this.m_get_context()} - total of [${li_call_count}] calls, reached the limit pi_max_calls=[${pi_max_calls}] - stopping`);\n }\n\n\n // on-the-fly create a new async queue object, when required\n if (! lo_this._ao_query_queue) {\n const pi_concurrency = lo_this.m_pick_option(ph_args, \"pi_concurrency\");\n const pi_max_rate_cps = lo_this.m_pick_option(ph_args, \"pi_max_rate_cps\");\n\n f_console_verbose(1, `${lo_this.m_get_context()} - initializing async WBS queue with concurrency=[${pi_concurrency}] and rate-limit=[${pi_max_rate_cps} cps]`);\n\n // https://caolan.github.io/async/docs.html#QueueObject\n const lo_new_queue = cm_async.queue(function (ph_args, pf_process_next_in_queue) {\n lo_this._m_queue_worker(ph_args, pf_process_next_in_queue);\n }, pi_concurrency);\n\n\n // branch events\n lo_new_queue.drain = function () {\n lo_this._m_queue_drain();\n };\n\n lo_new_queue.empty = function () {\n lo_this._m_queue_empty();\n };\n\n lo_this._ao_query_queue = lo_new_queue;\n }\n\n const ps_call_context = lo_this.m_pick_option(ph_args, \"ps_call_context\");\n if (f_string_is_blank(ps_call_context)) {\n throw f_console_fatal(`${lo_this.m_get_context()} - missing option [ps_call_context]`);\n }\n\n f_console_verbose(2, `${lo_this.m_get_context(ps_call_context)} - pushing arguments:`, ph_args);\n\n const pb_high_priority = f_is_true(lo_this.m_pick_option(ph_args, \"pb_high_priority\", true));\n if (pb_high_priority) {\n f_console_verbose(1, `${lo_this.m_get_context(ps_call_context)} - scheduling query in high priority`);\n lo_this._ao_query_queue.unshift(ph_args);\n }\n\n else {\n lo_this._ao_query_queue.push(ph_args);\n }\n\n lo_this._ai_call_count_pushed_total ++;\n lo_this._ai_queue_len_max = f_number_max(lo_this._ai_queue_len_max, lo_this._ao_query_queue.length());\n }\n\n catch (po_err) {\n f_console_catch(po_err);\n }\n }", "static async makeRequest(action, params, url) {\n const {reqMethods} = await import('./request.js');\n let reqMethodFunc=reqMethods.get(action);\n if (!reqMethodFunc) reqMethodFunc=reqMethods.get(\"default\");\n const method=reqMethodFunc(params);\n const contentType='application/json';\n if (!url) url=config.requestUrlPath;\n const fetchParams={\n method: method,\n headers: {\n 'Content-Type': contentType\n },\n body: JSON.stringify({action: action, parameters: params}),\n };\n if (authorizationToken) fetchParams.headers={...fetchParams.headers, ...authorizationToken};\n return fetch(url, fetchParams)\n .then(res => res.text())\n .then(resultTxt => {\n // This is allowing a null result, it doesnt throw errur if resultTxt==null\n let result=null;\n if (resultTxt) {\n try {\n result=JSON.parse(resultTxt);\n }\n catch(e){//To send errors from server in case the error catching methods at backend fail\n throw new Error(e.message + \"Action: \" + action + \". Error: Response error: \"+ resultTxt);\n }\n }\n return result;\n })\n .then(resultJSON => {\n if (resultJSON?.error==true) {\n throw new Error(action + '. SERVER Message: ' + result.message);\n }\n return resultJSON;\n });\n /*\n .then(res => res.text())\n .then(resultTxt => {\n let result=null;\n if (resultTxt) {\n try {\n result=JSON.parse(resultTxt);\n }\n catch(e){//To send errors from server in case the error catching methods at backend fail\n throw new Error(e.message + \"Action: \" + action + \". Error: Response error: \"+ resultTxt);\n }\n }\n if (result?.error==true) {\n throw new Error(action + '. SERVER Message: ' + result.message);\n }\n return result;\n });\n */\n\n }", "function constructor(){\n\n \t \t \n \t \n /**\n * Handles the POST request.\n * @param urlRequest {String} Url to request.\n * @param dataToSend {Object} Data, if it exists, which will be sent with the request.\n * @returns {Object} A promise\n */\n this.post= function(urlRequest,dataToSend){\n\n urlRequest=urlRequest || null;\n dataToSend=dataToSend || null;\n var uniqueIdRequest=__registerInfoRequest(urlRequest,dataToSend);\n return __requestMethod(urlRequest,dataToSend,uniqueIdRequest,\"POST\");\n\n };\n\n /**\n * Handles the GET request.\n * @param urlRequest {String} Url to request.\n * @param dataToSend {Object} Data, if it exists, which will be sent with the request.\n * @returns {Object} A promise\n */\n this.get= function(urlRequest,dataToSend){\n\n urlRequest=urlRequest || null;\n dataToSend=dataToSend || null;\n var uniqueIdRequest=__registerInfoRequest(urlRequest,dataToSend);\n return __requestMethod(urlRequest,dataToSend,uniqueIdRequest,\"GET\");\n\n };\n\n /**\n * Handles the PUT request.\n * @param urlRequest {String} Url to request.\n * @param dataToSend {Object} Data, if it exists, which will be sent with the request.\n * @returns {Object} A promise\n */\n this.put= function(urlRequest,dataToSend){\n\n urlRequest=urlRequest || null;\n dataToSend=dataToSend || null;\n var uniqueIdRequest=__registerInfoRequest(urlRequest,dataToSend);\n return __requestMethod(urlRequest,dataToSend,uniqueIdRequest,\"PUT\");\n\n };\n\n /**\n * Handles the DELETE request.\n * @param urlRequest {String} Url to request.\n * @param dataToSend {Object} Data, if it exists, which will be sent with the request.\n * @returns {Object} A promise\n */\n this.delete= function(urlRequest,dataToSend){\n\n urlRequest=urlRequest || null;\n dataToSend=dataToSend || null;\n var uniqueIdRequest=__registerInfoRequest(urlRequest,dataToSend);\n return __requestMethod(urlRequest,dataToSend,uniqueIdRequest,\"DELETE\");\n\n };\n \n (function InitModules(){\n \t\n \tif(__dataConnectionModule.getStateValueClient()!=false){\n \t\t__dataConnectionModule.setInfo();\n \t}else{\n \t\tvar uniqueIdRequest=__registerInfoRequest(dataConnectionModule.getUrl(),null);\n var response= __requestMethod(__dataConnectionModule.getUrl(),null,uniqueIdRequest,\"POST\");\n response.then(function(data){ \t\n \t__dataConnectionModule.getInfoServer(data.data);\n \t\n })\n \t}\n \t\n })();\n\n\n }", "static callApi(obj) {\n return new Promise (\n (resolve, reject) => {\n\n switch (obj.method) {\n case \"POST\":\n\n Vue.http.post(obj.path, obj.params).then(\n (result) => {\n\n resolve(result);\n }, (err) => {\n\n reject(err);\n });\n\n break;\n case \"GET\":\n Vue.http.get(obj.path).then((result) => {\n resolve(result);\n }, (err) => {\n \n reject(err);\n });\n break;\n case \"PUT\":\n Vue.http.put(obj.path, obj.params).then((result) => {\n \n resolve(result);\n }, (err) => {\n \n reject(err);\n });\n break;\n case \"DELETE\":\n Vue.http.delete(obj.path, obj.params).then((result) => {\n \n resolve(result);\n }, (err) => {\n \n reject(err);\n });\n break;\n case \"POST-MULTI\":\n const data = new FormData();\n data.append('file', obj.params.file);\n delete obj.params.file;\n data.append('data', JSON.stringify(obj.params));\n Vue.http.post(obj.path,data,{headers: {'Content-Type': 'multipart/form-data'}}).then((result) => {\n \n resolve(result);\n }, (err) => {\n \n reject(err);\n });\n break;\n }\n }\n )\n }", "function _makeAPIcall(method, url, params,withResults) {\r\n var _method = method;\r\n var _url = url;\r\n var _params = params;\r\n var _withResults = withResults; \r\n return _authToken().then(function (response) {\r\n if (response.error === undefined) {\r\n var _token = response;\r\n $http.defaults.headers.common.Authorization = 'Bearer token: ' + _token;\r\n if (_method == 'get') { \r\n return $http.get(_url, { params: _params })\r\n .then(function (response) { \r\n \r\n return _apiCallSuccess(response, _url,_withResults);\r\n })\r\n .catch(function (response) { \r\n \r\n return _apiCallFail(response, _url)\r\n });\r\n } else {\r\n return $http.post(_url, _params)\r\n .then(function (response) {\r\n return _apiCallSuccess(response, _url,_withResults);\r\n })\r\n .catch(function (response) { \r\n return _apiCallFail(response, _url)\r\n });\r\n }\r\n } else {\r\n return response;\r\n }\r\n\r\n });\r\n\r\n }", "httpRequest({\n\t\tmethod = 'get',\n\t\turl = '',\n\t\tbody = {},\n\t\tcross = false , \n\t\tgetBody = true , \n\t\tjson = true,\n\t\tform = {},\n timeout = 10000\n\t}){\n\t\tconst { buildUrl , consoleUrl , promise , getContent } = this;\n\t\tconst requestUrl = buildUrl(url,cross);\n\t\tconsoleUrl(requestUrl,method);\n\t\tconst options = {\n\t\t\tmethod : method ,\n\t\t\turi : requestUrl ,\n\t\t\tjson : json,\n\t\t\ttimeout: timeout\n\t\t};\n\t\tif(json){\n\t\t\toptions.body = body;\n\t\t}else{\n\t\t\toptions.form = form;\n\t\t}\n\t\treturn promise((resolve,reject)=>{\n\t\t\trequest(options,(error, response, body)=>{\n\t\t\t\tconsole.log(body);\n\t\t\t\tconsole.log(error);\n\t\t\t\tif (!error && response.statusCode == 200) {\n\t\t\t \tresolve(getContent(response,getBody));\n\t\t\t }else{\n\t\t\t \treject(error);\n\t\t\t }\n\t\t\t})\n\t\t});\n\t}", "function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,isJsonp=lowercase(config.method)==='jsonp',url=config.url;if(isJsonp){// JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n// our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\nurl=$sce.getTrustedResourceUrl(url);}else if(!isString(url)){// If it is not a string then the URL must be a $sce trusted object\nurl=$sce.valueOf(url);}url=buildUrl(url,config.paramSerializer(config.params));if(isJsonp){// Check the url and add the JSONP callback placeholder\nurl=sanitizeJsonpCallbackParam(url,config.jsonpCallbackParam);}$http.pendingRequests.push(config);promise.then(removePendingReq,removePendingReq);if((config.cache||defaults.cache)&&config.cache!==false&&(config.method==='GET'||config.method==='JSONP')){cache=isObject(config.cache)?config.cache:isObject(/** @type {?} */defaults.cache)?/** @type {?} */defaults.cache:defaultCache;}if(cache){cachedResp=cache.get(url);if(isDefined(cachedResp)){if(isPromiseLike(cachedResp)){// cached request has already been sent, but there is no response yet\ncachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else{// serving from cache\nif(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else{resolvePromise(cachedResp,200,{},'OK');}}}else{// put the promise for the non-transformed response into cache as a placeholder\ncache.put(url,promise);}}// if we won't have the response in cache, set the xsrf headers and\n// send the request to the backend\nif(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$$cookieReader()[config.xsrfCookieName||defaults.xsrfCookieName]:undefined;if(xsrfValue){reqHeaders[config.xsrfHeaderName||defaults.xsrfHeaderName]=xsrfValue;}$httpBackend(config.method,url,reqData,done,reqHeaders,config.timeout,config.withCredentials,config.responseType,createApplyHandlers(config.eventHandlers),createApplyHandlers(config.uploadEventHandlers));}return promise;function createApplyHandlers(eventHandlers){if(eventHandlers){var applyHandlers={};forEach(eventHandlers,function(eventHandler,key){applyHandlers[key]=function(event){if(useApplyAsync){$rootScope.$applyAsync(callEventHandler);}else if($rootScope.$$phase){callEventHandler();}else{$rootScope.$apply(callEventHandler);}function callEventHandler(){eventHandler(event);}};});return applyHandlers;}}/**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\ncache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}/**\n * Resolves the raw $http promise.\n */function resolvePromise(response,status,headers,statusText){//status: HTTP response status code, 0, -1 (aborted by timeout / promise)\nstatus=status>=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText});}function resolvePromiseWithResult(result){resolvePromise(result.data,result.status,shallowCopy(result.headers()),result.statusText);}function removePendingReq(){var idx=$http.pendingRequests.indexOf(config);if(idx!==-1)$http.pendingRequests.splice(idx,1);}}", "static sendXhr(method, uri, props, responseType) {\r\n return new Promise((resolve, reject) => {\r\n if (this.stop) { return C.CAN_FN.PR_RJ_STOP(); };\r\n\r\n // Get an unused key for this xhr. The do-while will usually only run one iteration.\r\n // Then create the object, setting it on the in-flight map and in the xhr local var.\r\n var xhrId = '0';\r\n do {\r\n xhrId = `${(Utils.xhrIdSeed++)}`;\r\n } while (Utils.xhrsInFlight.hasOwnProperty(xhrId));\r\n\r\n // Create the XHR in the tracking map and get a var handle to it.\r\n var xhr = Utils.xhrsInFlight[xhrId] = new XMLHttpRequest();\r\n\r\n\r\n // Error handler function. Logs the error status,\r\n // then deletes the xhr from the array and sets the var reference\r\n // to nul, then rejects with theStatus.\r\n var errorHandler = (errorStatus) => {\r\n // Log the error.\r\n Utils.lm(`XHR Error in sendXhr():\\n ${JSON.stringify(errorStatus)}`);\r\n\r\n // delete the xhr as best we can.\r\n delete Utils.xhrsInFlight[xhrId];\r\n xhr = null;\r\n\r\n // reject with the error status we were called with.\r\n reject(errorStatus);\r\n };\r\n\r\n\r\n // Left as a old-school function def so \"this\" will point at the xhr and not\r\n // accidentally cause bad closures.\r\n xhr.onreadystatechange = function onXhrRSC() {\r\n if (Utils.isSTOP()) {\r\n errorHandler(this.status);\r\n return;\r\n }\r\n\r\n if (this.readyState == XMLHttpRequest.DONE)\r\n {\r\n if (this.status == 200) {\r\n if (props && props.length > 1) {\r\n var propMap = {};\r\n var thisXhr = this;\r\n\r\n props.forEach((prop) => {\r\n propMap[prop] = thisXhr[prop];\r\n });\r\n\r\n resolve(propMap);\r\n }\r\n else if (props && props.length === 1) {\r\n resolve(this[props[0]]);\r\n }\r\n else {\r\n resolve(this);\r\n }\r\n }\r\n else {\r\n errorHandler(this.status);\r\n }\r\n\r\n // delete the xhr as best we can.\r\n delete Utils.xhrsInFlight[xhrId];\r\n xhr = null;\r\n }\r\n };\r\n\r\n\r\n // Again, using the old-school \"function\" so that \"this\"\r\n // points o the XHR.\r\n xhr.onerror = function onXhrError() {\r\n errorHandler(this.status);\r\n };\r\n\r\n\r\n // When STOP event is dispatched, abort gets called.\r\n xhr.onabort = function onXhrAbort() {\r\n Utils.lm(`aborted XHR for uri: ${uri}.`);\r\n errorHandler(C.ACTION.STOP);\r\n };\r\n\r\n\r\n // Event listener for stop event.\r\n var stopHandler = (evt) => {\r\n window.document.removeEventListener(C.ACTION.STOP, stopHandler, false);\r\n\r\n if (Utils.exists(Utils.xhrsInFlight[xhrId])) {\r\n Utils.xhrsInFlight[xhrId].abort();\r\n }\r\n };\r\n window.document.addEventListener(C.ACTION.STOP, stopHandler, false);\r\n\r\n\r\n // Perform the fetch.\r\n xhr.open(method, uri, true);\r\n if (responseType) {\r\n xhr.responseType = responseType;\r\n }\r\n xhr.send();\r\n });\r\n }", "function authservice_ajax_call(method, urlpath, params, withAuthorizedHeader, successCallback/*(response)*/, errorCallback/*(statusCode, statusText, responseJSON)*/) {\n\n // var url = ENDPOINT + urlpath;\n var url = ENDPOINT + urlpath;\n console.log('authservice_ajax_call(method, ' + urlpath + ')')\n console.log(url)\n console.log(params);\n console.log(\"vvvvvv calling vvvvvv\");\n // if (errorCallback) {\n // console.log('------- have an errorCallback')\n // } else {\n // console.log('------- no errorCallback - will use default')\n // }\n\n // See if this is an Angular AJAX call\n if (_$http) {\n // Call the API to get the product details\n // ZZZZ This should use JSONP, as some browsers do not support CORS.\n // ZZZZ Unfortunately JSONP does not support headers, so we need\n // ZZZZ to pass details either in the url or the data. i.e. the\n // ZZZZ server requires changes.\n\n\n /*\n * We'll use Angular's $http to call the authservice API.\n *\n * See https://docs.angularjs.org/api/ng/service/$http\n */\nconsole.log('*** Using Angular AJAX call');\n var req = {\n method: method,\n url: url,\n data: params\n };\n\n if (withAuthorizedHeader) {\n req.headers = {\n 'Authorization' : 'Bearer XYZ'\n };\n }\n\n _$http(req).then(function(response) { // success handler\n\n // Successful AJAX call.\n var data = response.data; // {string|Object} – The response body transformed with the transform functions.\n console.log('success:', data)\n return successCallback(data);\n\n }, function(response) { // error handler\n\n // Error during API call.\n var statusCode = response.status; // {number} – HTTP status code of the response.\n var statusText = response.statusText; // {string} – HTTP status text of the response.\n // var error = response.data; // Maybe an error object was returned.\n var responseJSON = response.data; // Maybe an error object was returned.\n if (errorCallback) {\n return errorCallback(statusCode, statusText, responseJSON);\n }\n\n // We have no error callback, so we'll report the error here and return null data.\n alert('An error occurred contacting Authservice.\\nSee the Javascript console for details.')\n console.log('statusCode:', response)\n console.log('statusText:', statusText)\n console.log('error:', error)\n return successCallback(null);\n });\n\n\n } else { // Use jQuery AJAX.\n\n // We don't have Angular's $http, so use jQuery AJAX.\n // See http://api.jquery.com/jquery.ajax/\nconsole.log('*** jQuery AJAX call (before)');\n var headers = { };\n if (withAuthorizedHeader) {\n headers.Authorization = 'Bearer XYZ';\n }\n\n var json = JSON.stringify(params)\n _jQuery.ajax({\n url: url,\n type: method, // Using CORS\n crossDomain: true,\n async: true,\n data: json,\n dataType: \"json\",\n headers: headers,\n contentType: 'application/json',\n success: function(response) {\n console.log('*** jQuery AJAX call (success)', response);\n\n // Successful AJAX call.\n return successCallback(response);\n },\n error: function(jqxhr, textStatus, errorThrown) {\n console.log('*** jQuery AJAX call (error)', jqxhr, textStatus, errorThrown);\n\n // Error during AJAX call.\n var statusCode = jqxhr.status; // {number} – HTTP status code of the response.\n var statusText = jqxhr.statusText; // {string} null, \"timeout\", \"error\", \"abort\", or \"parsererror\"\n var responseJSON = jqxhr.responseJSON;\n // var error = errorThrown; // {string} \"When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status.\"\n if (errorCallback) {\n return errorCallback(statusCode, statusText, responseJSON);\n }\n\n // We have no error callback, so we'll report the error here and return null data.\n alert('An error occurred contacting Authservice.\\nSee the Javascript console for details.')\n console.log('statusCode:', statusCode)\n console.log('statusText:', statusText)\n console.log('responseJSON:', responseJSON)\n // return successCallback(null);\n }\n });\n }\n }", "doRequest(method, data, additionalPath, additionalHeaders) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\r\n return new Promise((resolve, reject) => {\r\n const headers = additionalHeaders || {};\r\n let uri = this._networkEndPoint.getUri();\r\n let path = this._networkEndPoint.getRootPath();\r\n if (!stringHelper_1.StringHelper.isEmpty(additionalPath)) {\r\n const stripped = `/${additionalPath.replace(/^\\/*/, \"\")}`;\r\n path += stripped;\r\n uri += stripped;\r\n }\r\n const options = {\r\n protocol: `${this._networkEndPoint.getProtocol()}:`,\r\n hostname: this._networkEndPoint.getHost(),\r\n port: this._networkEndPoint.getPort(),\r\n path: path,\r\n method: method,\r\n headers,\r\n timeout: this._timeoutMs > 0 ? this._timeoutMs : undefined\r\n };\r\n if ((method === \"GET\" || method === \"DELETE\") && !objectHelper_1.ObjectHelper.isEmpty(data)) {\r\n options.path += data;\r\n }\r\n const req = this._httpClientRequest(options, (res) => {\r\n let responseData = \"\";\r\n res.setEncoding(\"utf8\");\r\n res.on(\"data\", (responseBody) => {\r\n responseData += responseBody;\r\n });\r\n res.on(\"end\", () => {\r\n if (res.statusCode === 200) {\r\n resolve(responseData);\r\n }\r\n else {\r\n this._logger.info(\"<=== NetworkClient::Received Fail\", { code: res.statusCode, data: responseData });\r\n reject(new networkError_1.NetworkError(`Failed ${method} request`, {\r\n endPoint: uri,\r\n errorResponseCode: res.statusCode,\r\n errorResponse: responseData || res.statusMessage\r\n }));\r\n }\r\n });\r\n });\r\n req.on(\"error\", (err) => {\r\n this._logger.error(\"<=== NetworkClient::Errored\");\r\n reject(new networkError_1.NetworkError(`Failed ${method} request`, {\r\n endPoint: uri,\r\n errorResponse: err\r\n }));\r\n });\r\n req.on(\"timeout\", (err) => {\r\n this._logger.error(\"<=== NetworkClient::Timed Out\");\r\n reject(new networkError_1.NetworkError(`Failed ${method} request, timed out`, {\r\n endPoint: uri\r\n }));\r\n });\r\n if (method !== \"GET\" && method !== \"DELETE\" && !objectHelper_1.ObjectHelper.isEmpty(data)) {\r\n req.write(data);\r\n }\r\n req.end();\r\n });\r\n });\r\n }", "function api_proc(q) {\n if (q.setimmediate) {\n clearTimeout(q.setimmediate);\n q.setimmediate = false;\n }\n if (q.ctxs[q.i].length || !q.ctxs[q.i ^ 1].length) return;\n q.i ^= 1;\n if (!q.xhr) q.xhr = getxhr();\n q.xhr.q = q;\n q.xhr.onerror = function() {\n if (!this.q.cancelled) {\n if (d) console.log('API request error - retrying');\n api_reqerror(q, -3);\n }\n }\n q.xhr.onload = function() {\n if (!this.q.cancelled) {\n var t;\n if (this.status == 200) {\n var response = this.responseText || this.response;\n if (d) console.log('API response: ', response);\n try {\n t = JSON.parse(response);\n if (response[0] == '{') t = [\n t\n ];\n } catch (e) {\n // bogus response, try again\n console.log('Bad JSON data in response: ' + response);\n t = EAGAIN;\n }\n } else {\n if (d) console.log('API server connection failed (error ' + this.status + ')');\n t = ERATELIMIT;\n }\n if (typeof t == 'object') {\n for (var i = 0; i < this.q.ctxs[this.q.i].length; i++)\n if (this.q.ctxs[this.q.i][i].callback) this.q.ctxs[this.q.i][i].callback(t[i], this.q.ctxs[this.q.i][i], this);\n this.q.rawreq = false;\n this.q.backoff = 0; // request succeeded - reset backoff timer\n this.q.cmds[this.q.i] = [];\n this.q.ctxs[this.q.i] = [];\n api_proc(q);\n } else api_reqerror(this.q, t);\n }\n }\n if (q.rawreq === false) {\n q.url = apipath + q.service + '?id=' + (q.seqno++) + '&' + q.sid;\n if (typeof q.cmds[q.i][0] == 'string') {\n q.url += '&' + q.cmds[q.i][0];\n q.rawreq = '';\n } else q.rawreq = JSON.stringify(q.cmds[q.i]);\n }\n api_send(q);\n}", "sendRequest(options) {\n if (options === null || options === undefined || typeof options !== \"object\") {\n throw new Error(\"options cannot be null or undefined and it must be of type object.\");\n }\n let httpRequest;\n try {\n if (isWebResourceLike(options)) {\n options.validateRequestProperties();\n httpRequest = options;\n }\n else {\n httpRequest = new WebResource();\n httpRequest = httpRequest.prepare(options);\n }\n }\n catch (error) {\n return Promise.reject(error);\n }\n let httpPipeline = this._httpClient;\n if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) {\n for (let i = this._requestPolicyFactories.length - 1; i >= 0; --i) {\n httpPipeline = this._requestPolicyFactories[i].create(httpPipeline, this._requestPolicyOptions);\n }\n }\n return httpPipeline.sendRequest(httpRequest);\n }", "sendRequest(options) {\n if (options === null || options === undefined || typeof options !== \"object\") {\n throw new Error(\"options cannot be null or undefined and it must be of type object.\");\n }\n let httpRequest;\n try {\n if (isWebResourceLike(options)) {\n options.validateRequestProperties();\n httpRequest = options;\n }\n else {\n httpRequest = new WebResource();\n httpRequest = httpRequest.prepare(options);\n }\n }\n catch (error) {\n return Promise.reject(error);\n }\n let httpPipeline = this._httpClient;\n if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) {\n for (let i = this._requestPolicyFactories.length - 1; i >= 0; --i) {\n httpPipeline = this._requestPolicyFactories[i].create(httpPipeline, this._requestPolicyOptions);\n }\n }\n return httpPipeline.sendRequest(httpRequest);\n }", "function MyHttp() {\n\n var debug = false;\n var log = function() {\n if (debug) console.log.apply(console, [].slice.call(arguments));\n }\n\n var self = this;\n\n this.methodsAllowed = ['GET', 'POST', 'DELETE', 'PUT', 'UPDATE'];\n this.callback = {};\n this.option = {\n 'method': 'GET'\n };\n\n /* set request options */\n this.set = function(name, value) {\n if (this.set[name]) return this.set[name](value);\n this.option[name] = value;\n return this;\n }\n\n /* parse url setting */\n this.set.url = function(url) {\n var parse = URL.parse(url);\n self.set('protocol', parse.protocol);\n self.set('host', parse.host);\n self.set('hostname', parse.hostname);\n self.set('port', parse.port);\n self.set('path', parse.path);\n self.set('pathname', parse.pathname);\n self.set('query', parse.query);\n return self;\n }\n\n /* filter method setting */\n this.set.method = function(method) {\n if (self.methodsAllowed.indexOf(method) === -1) {\n throw new Error('method ' + method + ' is not allowed');\n }\n self.option.method = method;\n return self;\n }\n\n /* transform object data to chunk string */\n this.set.data = function(data) {\n // if (typeof data === 'object') {\n // data = JSON.stringify(data);\n // }\n self.option.data = data;\n return self;\n }\n\n /* set request header */\n this.setHeader = function(name, value) {\n if (! this.option.headers) this.option.headers = {};\n this.option.headers[name] = value;\n }\n\n /* \n * register event listener\n * available events, 'error', 'response', 'complete'\n */\n this.on = function(event, callback) {\n this.callback[event] = callback;\n }\n\n this.initProtocol = function(protocol) {\n if (protocol === 'https:') {\n return HTTPS;\n }\n return HTTP;\n }\n\n this.request = function(onComplete) {\n log('this.option', this.option);\n if (onComplete === undefined) {\n this.callback.complete = this.callback.complete || function() {};\n } else {\n this.callback.complete = onComplete;\n }\n var protocol = this.initProtocol(this.option.protocol);\n var req = protocol.request(this.option, this.onResponse.bind(this));\n req.on('error', this.onError.bind(this));\n if (this.option.data) req.write(this.option.data);\n req.end();\n }\n\n /* request response callback */\n this.onResponse = function(res) {\n this.trigger('response', [res.statusCode, res]);\n res.on('data', function(chunk) {\n Bupper.add(chunk);\n })\n res.on('end', function() {\n res.buffer = Bupper.combine();\n self.trigger('complete', [res.buffer.toString(), res]);\n })\n }\n\n /* request error callback */\n this.onError = function() {\n this.trigger('error', [].slice.call(arguments));\n }\n\n /* trigger an event from callback stack */\n this.trigger = function(ev, args) {\n var callback;\n if (callback = this.callback[ev]) {\n return callback.apply(this, args);\n }\n }\n\n /* enable verbose mode */\n this.debug = function(set) {\n if (set) debug = true;\n }\n}", "function sendReq(config, reqData) { // 10508\n var deferred = $q.defer(), // 10509\n promise = deferred.promise, // 10510\n cache, // 10511\n cachedResp, // 10512\n reqHeaders = config.headers, // 10513\n url = buildUrl(config.url, config.paramSerializer(config.params)); // 10514\n // 10515\n $http.pendingRequests.push(config); // 10516\n promise.then(removePendingReq, removePendingReq); // 10517\n // 10518\n // 10519\n if ((config.cache || defaults.cache) && config.cache !== false && // 10520\n (config.method === 'GET' || config.method === 'JSONP')) { // 10521\n cache = isObject(config.cache) ? config.cache // 10522\n : isObject(defaults.cache) ? defaults.cache // 10523\n : defaultCache; // 10524\n } // 10525\n // 10526\n if (cache) { // 10527\n cachedResp = cache.get(url); // 10528\n if (isDefined(cachedResp)) { // 10529\n if (isPromiseLike(cachedResp)) { // 10530\n // cached request has already been sent, but there is no response yet // 10531\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult); // 10532\n } else { // 10533\n // serving from cache // 10534\n if (isArray(cachedResp)) { // 10535\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]); // 10536\n } else { // 10537\n resolvePromise(cachedResp, 200, {}, 'OK'); // 10538\n } // 10539\n } // 10540\n } else { // 10541\n // put the promise for the non-transformed response into cache as a placeholder // 10542\n cache.put(url, promise); // 10543\n } // 10544\n } // 10545\n // 10546\n // 10547\n // if we won't have the response in cache, set the xsrf headers and // 10548\n // send the request to the backend // 10549\n if (isUndefined(cachedResp)) { // 10550\n var xsrfValue = urlIsSameOrigin(config.url) // 10551\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] // 10552\n : undefined; // 10553\n if (xsrfValue) { // 10554\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; // 10555\n } // 10556\n // 10557\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, // 10558\n config.withCredentials, config.responseType); // 10559\n } // 10560\n // 10561\n return promise; // 10562\n // 10563\n // 10564\n /** // 10565\n * Callback registered to $httpBackend(): // 10566\n * - caches the response if desired // 10567\n * - resolves the raw $http promise // 10568\n * - calls $apply // 10569\n */ // 10570\n function done(status, response, headersString, statusText) { // 10571\n if (cache) { // 10572\n if (isSuccess(status)) { // 10573\n cache.put(url, [status, response, parseHeaders(headersString), statusText]); // 10574\n } else { // 10575\n // remove promise from the cache // 10576\n cache.remove(url); // 10577\n } // 10578\n } // 10579\n // 10580\n function resolveHttpPromise() { // 10581\n resolvePromise(response, status, headersString, statusText); // 10582\n } // 10583\n // 10584\n if (useApplyAsync) { // 10585\n $rootScope.$applyAsync(resolveHttpPromise); // 10586\n } else { // 10587\n resolveHttpPromise(); // 10588\n if (!$rootScope.$$phase) $rootScope.$apply(); // 10589\n } // 10590\n } // 10591\n // 10592\n // 10593\n /** // 10594\n * Resolves the raw $http promise. // 10595\n */ // 10596\n function resolvePromise(response, status, headers, statusText) { // 10597\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise) // 10598\n status = status >= -1 ? status : 0; // 10599\n // 10600\n (isSuccess(status) ? deferred.resolve : deferred.reject)({ // 10601\n data: response, // 10602\n status: status, // 10603\n headers: headersGetter(headers), // 10604\n config: config, // 10605\n statusText: statusText // 10606\n }); // 10607\n } // 10608\n // 10609\n function resolvePromiseWithResult(result) { // 10610\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText); // 10611\n } // 10612\n // 10613\n function removePendingReq() { // 10614\n var idx = $http.pendingRequests.indexOf(config); // 10615\n if (idx !== -1) $http.pendingRequests.splice(idx, 1); // 10616\n } // 10617\n } // 10618", "function cmdUpdateReceived_ClickCase80() {\n console.log(\"cmdUpdateReceived_ClickCase80\");\n var promiseArray1 = [];\n var promiseArray2 = [];\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase80_1', {\n 'WOID': $scope.selectedWOIDData['woid'],//\n 'EndDate': getCurrentDatetime()\n })\n );\n promiseArray2.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase80_2', {\n 'WOID': $scope.selectedWOIDData['woid'],//\n 'WOStatus': $scope.WOStatus\n })\n );\n $q.all(promiseArray1).then(function (response) {\n console.log(\"cmdUpdateReceived_ClickCase80_1\", response);\n $q.all(promiseArray2).then(function (response) {\n console.log(\"cmdUpdateReceived_ClickCase80_2\", response);\n cmdUpdateReceived_ClickCase90();\n });\n });\n\n\n }", "async doRequest(method, data, additionalPath, additionalHeaders) {\r\n return new Promise((resolve, reject) => {\r\n const headers = additionalHeaders || {};\r\n let uri = this._networkEndPoint.getUri();\r\n let path = this._networkEndPoint.getRootPath();\r\n if (!stringHelper_1.StringHelper.isEmpty(additionalPath)) {\r\n const stripped = `/${additionalPath.replace(/^\\/*/, \"\")}`;\r\n path += stripped;\r\n uri += stripped;\r\n }\r\n const options = {\r\n protocol: `${this._networkEndPoint.getProtocol()}:`,\r\n hostname: this._networkEndPoint.getHost(),\r\n port: this._networkEndPoint.getPort(),\r\n path: path,\r\n method: method,\r\n headers,\r\n timeout: this._timeoutMs > 0 ? this._timeoutMs : undefined\r\n };\r\n if ((method === \"GET\" || method === \"DELETE\") && !objectHelper_1.ObjectHelper.isEmpty(data)) {\r\n options.path += data;\r\n }\r\n const req = this._httpClientRequest(options, (res) => {\r\n let responseData = \"\";\r\n res.setEncoding(\"utf8\");\r\n res.on(\"data\", (responseBody) => {\r\n responseData += responseBody;\r\n });\r\n res.on(\"end\", () => {\r\n if (res.statusCode === 200) {\r\n resolve(responseData);\r\n }\r\n else {\r\n this._logger.info(\"<=== NetworkClient::Received Fail\", { code: res.statusCode, data: responseData });\r\n reject(new networkError_1.NetworkError(`Failed ${method} request`, {\r\n endPoint: uri,\r\n errorResponseCode: res.statusCode,\r\n errorResponse: responseData || res.statusMessage\r\n }));\r\n }\r\n });\r\n });\r\n req.on(\"error\", (err) => {\r\n this._logger.error(\"<=== NetworkClient::Errored\");\r\n reject(new networkError_1.NetworkError(`Failed ${method} request`, {\r\n endPoint: uri,\r\n errorResponse: err\r\n }));\r\n });\r\n req.on(\"timeout\", (err) => {\r\n this._logger.error(\"<=== NetworkClient::Timed Out\");\r\n reject(new networkError_1.NetworkError(`Failed ${method} request, timed out`, {\r\n endPoint: uri\r\n }));\r\n });\r\n if (method !== \"GET\" && method !== \"DELETE\" && !objectHelper_1.ObjectHelper.isEmpty(data)) {\r\n req.write(data);\r\n }\r\n req.end();\r\n });\r\n }", "function sendReq(config, reqData) {\n\t var deferred = $q.defer(),\n\t promise = deferred.promise,\n\t cache,\n\t cachedResp,\n\t reqHeaders = config.headers,\n\t url = buildUrl(config.url, config.paramSerializer(config.params));\n\n\t $http.pendingRequests.push(config);\n\t promise.then(removePendingReq, removePendingReq);\n\n\n\t if ((config.cache || defaults.cache) && config.cache !== false &&\n\t (config.method === 'GET' || config.method === 'JSONP')) {\n\t cache = isObject(config.cache) ? config.cache\n\t : isObject(defaults.cache) ? defaults.cache\n\t : defaultCache;\n\t }\n\n\t if (cache) {\n\t cachedResp = cache.get(url);\n\t if (isDefined(cachedResp)) {\n\t if (isPromiseLike(cachedResp)) {\n\t // cached request has already been sent, but there is no response yet\n\t cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n\t } else {\n\t // serving from cache\n\t if (isArray(cachedResp)) {\n\t resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n\t } else {\n\t resolvePromise(cachedResp, 200, {}, 'OK');\n\t }\n\t }\n\t } else {\n\t // put the promise for the non-transformed response into cache as a placeholder\n\t cache.put(url, promise);\n\t }\n\t }\n\n\n\t // if we won't have the response in cache, set the xsrf headers and\n\t // send the request to the backend\n\t if (isUndefined(cachedResp)) {\n\t var xsrfValue = urlIsSameOrigin(config.url)\n\t ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n\t : undefined;\n\t if (xsrfValue) {\n\t reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n\t }\n\n\t $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n\t config.withCredentials, config.responseType,\n\t createApplyHandlers(config.eventHandlers),\n\t createApplyHandlers(config.uploadEventHandlers));\n\t }\n\n\t return promise;\n\n\t function createApplyHandlers(eventHandlers) {\n\t if (eventHandlers) {\n\t var applyHandlers = {};\n\t forEach(eventHandlers, function(eventHandler, key) {\n\t applyHandlers[key] = function(event) {\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(callEventHandler);\n\t } else if ($rootScope.$$phase) {\n\t callEventHandler();\n\t } else {\n\t $rootScope.$apply(callEventHandler);\n\t }\n\n\t function callEventHandler() {\n\t eventHandler(event);\n\t }\n\t };\n\t });\n\t return applyHandlers;\n\t }\n\t }\n\n\n\t /**\n\t * Callback registered to $httpBackend():\n\t * - caches the response if desired\n\t * - resolves the raw $http promise\n\t * - calls $apply\n\t */\n\t function done(status, response, headersString, statusText) {\n\t if (cache) {\n\t if (isSuccess(status)) {\n\t cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n\t } else {\n\t // remove promise from the cache\n\t cache.remove(url);\n\t }\n\t }\n\n\t function resolveHttpPromise() {\n\t resolvePromise(response, status, headersString, statusText);\n\t }\n\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(resolveHttpPromise);\n\t } else {\n\t resolveHttpPromise();\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t }\n\t }\n\n\n\t /**\n\t * Resolves the raw $http promise.\n\t */\n\t function resolvePromise(response, status, headers, statusText) {\n\t //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\t status = status >= -1 ? status : 0;\n\n\t (isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t data: response,\n\t status: status,\n\t headers: headersGetter(headers),\n\t config: config,\n\t statusText: statusText\n\t });\n\t }\n\n\t function resolvePromiseWithResult(result) {\n\t resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n\t }\n\n\t function removePendingReq() {\n\t var idx = $http.pendingRequests.indexOf(config);\n\t if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n\t }\n\t }", "request(opts) {\n opts.params = opts.params || {};\n \n\t\t// build request options\n\t\tconst _options = {\n\t\t\tmethod: opts.method ? opts.method.toLowerCase() : \"get\",\n\t\t\turi: this.endpoint(opts.path)\n\t\t}\n \n switch (_options.method) {\n case \"get\":\n _options.qs = opts.params;\n break;\n case \"post\":\n _options.form = opts.params;\n break;\n }\n \n // return new promise based on back off api status\n return new Promise((resolve,reject) => {\n // make the request\n if (this._shouldBackoff(opts.path)) {\n reject({type: 'twitter:backoff', err: {path: opts.path, backoff: this._backoff[opts.path]}});\n }\n \n // make request to twitter\n this._request(_options, (err, res, data) => {\n if (err) reject({type:'twitter:request', err});\n data = JSON.parse(data);\n\n // check backoff status of path and resolve or reject based on the end point api status\n this._checkBackoff(opts.path, res.headers)\n .then(msg => {\n resolve({ api:msg.api, data });\n })\n .catch(err => {\n reject({type: 'twitter:checkapi', error: {err,res,data}});\n });\n });\n\n });\n\t}", "function getTodo(object) {\n return $http({\n//Using the POST method to create the \"to-do\" object input for our SQL database\n method: 'POST',\n url: 'http://localhost:51202/api/Todo',\n data: object,\n headers: {\n 'Content-Type': 'application/json; charset=utf-8'\n }\n//To show if the submission of the to-do item was successfully passed into our database\n }) .then(function successfulSubmit(response)\n {\n return response;\n }, \n//To show if we were unsuccessful in passing our to-do item to our database\n function errorReturn(error)\n {\n return error;\n }); \n \n }", "function sendApiReq (path, method, data, appendToken, retryLimit) {\n\t// handles requests processing\n\t// the receiver doesn't even know about auth error\n\n\tmethod = method || 'GET'\n\tdata = data || null\n\tappendToken = typeof appendToken === 'undefined' ? true : appendToken\n\tretryLimit = typeof retryLimit === 'undefined' ? 1 : retryLimit\n\n\tif (!path.startsWith('\\g')) {\n\t\tpath = CONFIG_API_ENDPOINT + path\n\t} else {\n\t\tpath = path.substr(1)\n\t}\n\n\tvar gToken = null\n\tif (appendToken) {\n\t\tgToken = getCookie('gToken')\n\t}\n\n\tif (!appendToken || gToken) {\n\t\treturn _sendRequestCore(path, method, appendToken ? gToken : null, data, retryLimit)\n\t} else if (!gToken) {\n\t\treturn guestTokenRequest().then(\n\t\t\tfunction (res) {\n\t\t\t\tgToken = res.access_token\n\t\t\t\treturn _sendRequestCore(path, method, gToken, data, retryLimit)\n\t\t\t},\n\t\t\tfunction (jqXHR, err) {\n\t\t\t\treturn jqXHR\n\t\t\t}\n\t\t)\n\t}\n}", "function APIClass() {\n\t// Config\n\tthis.api_url_base = \"http://\" + window.location.hostname + \":\";\n\tthis.default_config = new Config(PORT.ORCHESTRATOR, CONTENT_TYPE.NONE, METHOD.GET);\n\n\n\t/**\n\t * Open HTTP Request\n\t * @param api_config\n\t * @param uri\n\t * @returns {XMLHttpRequest}\n\t */\n\tthis.open_request = function(api_config, uri) {\n\t\tlet url = this.api_url_base + api_config.port + uri;\n\t\tconsole.log(\"[API] [\" + api_config.method + \"] \" + url);\n\n\t\tlet http = new XMLHttpRequest();\n\t\thttp.open(api_config.method, url, true);\n\t\tif(api_config.contentType !== CONTENT_TYPE.NONE) {\n\t\t\thttp.setRequestHeader(\"Content-Type\", api_config.contentType);\n\t\t}\n\t\thttp.setRequestHeader(\"Authorization\", \"Basic \" + window.localStorage.getItem(\"defpi_token\"));\n\t\treturn http;\n\t};\n\n\t/**\n\t * Send method for API request\n\t * @param {object}\t\t\t\tapi_config\n\t * @param {string} \t\turi\n\t * @param {object} \t\tdata\n\t * @param {function} \t\tcallback\n\t * @param {function(number)} error\n\t */\n\tthis.send = function(api_config, uri, data, callback, error) {\n\t\tif(api_config === null) api_config = this.default_config;\n\n\t\tlet http = this.open_request(api_config, uri);\n\t\thttp.onreadystatechange = function() {\n\t\t\tif(http.readyState === http.DONE ) {\n\t\t\t\tif (http.status >= 200 && http.status <= 207) {\n\t\t\t\t\tif (this.getResponseHeader(\"Content-Type\") === \"application/javascript\" || this.getResponseHeader(\"Content-Type\") === \"application/json\") {\n\t\t\t\t\t\tlet response = JSON.parse(http.response);\n\t\t\t\t\t\tcallback(response);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback(http.response);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(\"[Api] HTTP CODE: \" + http.status);\n\t\t\t\t\tif(error != null) { error(http.status); return; }\n\n\t\t\t\t\tconsole.log(\"Server down?\");\n\t\t\t\t\t//document.location = \"/\";\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\thttp.send(data);\n\t};\n\n}", "protocolSendHTTP (request, method, data) {\n var self = this\n var from\n var to\n var responseBody\n var status = 200\n\n // If it's sending and error, `data` is the actual error. It will be\n // formatted using the object's formatErrorResponse method\n if (method === 'error') responseBody = self.formatErrorResponse(data)\n else responseBody = data\n\n // Sets location and range headers\n switch (method) {\n case 'post':\n status = 201\n if (self.handleGet) { request._res.setHeader('Location', request._req.originalUrl + data[ self.idProperty ]) }\n break\n\n case 'put':\n status = 201\n if (self.handleGet) {\n request._res.setHeader('Location', request._req.originalUrl)\n }\n break\n\n case 'delete':\n status = 200\n break\n\n case 'error':\n status = data.status || 500\n break\n\n case 'getQuery':\n if (request.options.ranges) {\n // Working out from-to/of\n // Note that if no records were returned, the format should be 0-0/X\n\n // Nice shorter variables\n var skip = request.options.ranges.skip || 0\n var total = request.total\n\n // Work out 'of': it will depend on the grandTotal, and that's it. It's an easy one.\n var of = request.grandTotal\n\n if (typeof request.grandTotal !== 'undefined') {\n // If nothing was returned, then the format 0-0/grandTotal is honoured\n if (!total) {\n from = 0\n to = 0\n // If something was returned, then `from` is the same as `skip`, and `to`\n // will depends on how many records were returned\n } else {\n from = skip\n to = from + total - 1\n }\n\n request._res.setHeader('Content-Range', 'items ' + from + '-' + to + '/' + of)\n }\n }\n break\n }\n\n // Send the response using HTTP\n request._res.status(status).json(responseBody)\n }", "function httpPost(url, data){\n \tvar deferred = $q.defer();\n \tvar promise = deferred.promise;\n\n \t$http.post(serviceBase + url , data).then(\n \t\tfunction (response){\n \t\t\treturn deferred.resolve(response.data);\n \t\t}, function(error){\n \t\t\treturn deferred.reject(error);\n \t\t});\n \treturn promise;\n }", "function httpPost(url, data){\n \tvar deferred = $q.defer();\n \tvar promise = deferred.promise;\n\n \t$http.post(serviceBase + url , data).then(\n \t\tfunction (response){\n \t\t\treturn deferred.resolve(response.data);\n \t\t}, function(error){\n \t\t\treturn deferred.reject(error);\n \t\t});\n \treturn promise;\n }", "function cancelAllHttpRequest($http) {\n var pendingRequests = $http.pendingRequests || [];\n\n pendingRequests.forEach(function(item) {\n if(isApiRequest(item.url) && item._ta && item._ta.canceller) {\n item._ta.selfCancelled = true;\n item._ta.canceller.resolve();\n }\n });\n }", "function http() {\n\tthis.hint = 'url,queryType,dataType,async,data,timeout\\n\\nПри передаче данных в виде аргументов следует соблюдать их порядок, как в примере выше\\n\\nИмя свойств в передаваемом объекте должны быть одноименны с названиями аргументов в примере выше';\n\tthis.control = false;\n\tthis.lastQuery = false;\n\tthis.config = new Object();\n\tthis.defined = {\n\t\turl : '',\n\t\tqueryType : 'POST',\n\t\tdataType : 'json',\n\t\tasync : true,\n\t\tdata : false,\n\t\ttimeout : 500\n\t}\n\tthis.log = new Array();\n\tthis.log.console = true;\n\tthis.log.show = function(){\n\t\tfor (var i=0; i<this.length; i++) {\n\t\t\tconsole.log(this[i]);\n\t\t}\n\t}\n\tthis.log.clean = function(){\n\t\tthis.splice( 0,this.length );\n\t}\n\tthis.fromObject = function(arg) {\n\t\tif( arg != null && typeof(arg) == 'object' && arg.url != undefined ) {\n\t\t\tthis.control = true;\n\t\t\tthis.config.url = arg.url;\n\t\t\targ.queryType ? this.config.queryType = arg.queryType : this.config.queryType = this.defined.queryType;\n\t\t\targ.dataType ? this.config.dataType = arg.dataType : this.config.dataType = this.defined.dataType;\n\t\t\targ.async ? this.config.async = arg.async : this.config.async = this.defined.async;\n\t\t\targ.data ? this.config.data = arg.data : this.config.data = this.defined.data;\n\t\t\targ.timeout ? this.config.timeout = arg.timeout : this.config.timeout = this.defined.timeout;\n\t\t} else {\n\t\t\tif( typeof(arg) == 'string' ) { this.fromArguments(new Array(arg)) }\n\t\t}\n\t}\n\tthis.fromArguments = function(args) {\n\t\tif ( !args[0] ) { console.error('No URL'); return false }\n\t\t\telse { this.config.url = args[0]; this.control = true; }\n\t\tif ( args[1] === undefined ) this.config.queryType = this.defined.queryType;\n\t\t\telse this.config.queryType = args[1];\n\t\tif ( args[2] === undefined ) this.config.dataType = this.defined.dataType;\n\t\t\telse this.config.dataType = args[2];\n\t\tif ( args[3] === undefined ) this.config.async = this.defined.async;\n\t\t\telse this.config.async = args[3];\n\t\tif ( args[4] === undefined ) this.config.data = this.defined.data;\n\t\t\telse this.config.data = args[4];\n\t\tif ( args[5] === undefined ) this.config.timeout = this.defined.timeout;\n\t\t\telse this.config.timeout = args[5];\n\t}\n\tthis.router = function(ARGS){\n\t\tswitch( ARGS.length ) {\n\t\t\tcase 0 : this.lastQuery ? this.control = true : 0; break;\n\t\t\tcase 1 : this.fromObject(ARGS[0]); break;\n\t\t\tdefault : this.fromArguments(ARGS);\n\t\t}\n\t}\n\tthis.request = function() {\n\t\tthis.router(arguments);\n\t\tif( this.control ) {\n\t\t\treturn new Promise( function(resolve,reject) {\n\t\t\t\t$.ajax({\n\t\t\t\t\ttimeout : document.http.config.url,\n\t\t\t\t\turl : document.http.config.url,\n\t\t\t\t\ttype : document.http.config.queryType,\n\t\t\t\t\tdataType : document.http.config.dataType,\n\t\t\t\t\tasync : document.http.config.async,\n\t\t\t\t\tdata : document.http.config.data,\n\t\t\t\t\tsuccess : function( data, control ) { document.http.lastQuery = true; resolve(data) },\n\t\t\t\t\terror : function (xhr, errorType, exception) { var errorMessage = exception || xhr.controlText; reject(errorMessage); },\n\t\t\t\t\tcomplete : function() {\n\t\t\t\t\t\tdocument.http.control = false;\n\t\t\t\t\t\tvar msg = 'Request to ' + document.http.config.url+ ' completed'\n\t\t\t\t\t\tif ( document.http.log.console ) console.log(msg);\n\t\t\t\t\t\tdocument.http.log.push(msg);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} )\n\t\t} else {\n\t\t\tconsole.error('Cannot to request'); return false;\n\t\t}\n\t}\n}", "function http_request(method, url, payload, headers, callback) {\n var client = Ti.Network.createHTTPClient({\n onload: function(e) {\n // if its a binary download... save to file from responseData not responseText\n if (callback) {\n callback(true, this.responseText, null, this);\n }\n },\n onerror: function(e) {\n //if (callback) callback(false, {code: this.status, data: {error: _.isString(e.error) ? e.error + ' ' + this.responseText : this.responseText}}, e);\n if (callback) callback(false, this.responseText, e, this);\n },\n timeout : options.timeout || ($.lib.platform.isSimulator ? 30000 : 15000)\n });\n\n if (client && client.connected) {\n $.lib.logError('*** xhr client exists and is connected! Change APIcall to required lib/instance.');\n }\n\n Alloy.CFG.logging && $.lib.logInfo('[apicall] open url=' + method + ':' + url + ' payload=' + $.lib.stringify(payload, 2000));\n client.validatesSecureCertificate = false;\n client.open(method, url);\n client.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\n //client.setRequestHeader('Accept', 'application/json');\n isHTTPGet ? client.send() : client.send(JSON.stringify(payload));\n }", "function cmdUpdate_ClickCase95() {\n console.log(\"cmdUpdate_ClickCase95\");\n\n var promiseArray1 = [];\n var promiseArray2 = [];\n\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase95_1', {\n 'WOID': $scope.selectedWOIDData['woid']\n\n })\n );\n\n promiseArray2.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase95_2', {\n 'id': $scope.PPID,\n 'Status': $scope.WOStatus\n\n })\n );\n\n $q.all(promiseArray1).then(function (response) {\n console.log(\"cmdUpdate_ClickCase95_1\", response);\n\n });\n\n $q.all(promiseArray2).then(function (response) {\n console.log(\"cmdUpdate_ClickCase95_2\", response);\n\n });\n }", "_makeRequest(hash) {\n const method = hash.method || hash.type || 'GET';\n const requestData = { method, type: method, url: hash.url };\n if (isJSONStringifyable(method, hash)) {\n hash.data = JSON.stringify(hash.data);\n }\n pendingRequestCount = pendingRequestCount + 1;\n const jqXHR = (0, _ajax.default)(hash.url, hash);\n const promise = new _promise.default((resolve, reject) => {\n jqXHR.done((payload, textStatus, jqXHR) => {\n const response = this.handleResponse(jqXHR.status, (0, _parseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);\n if ((0, _errors.isAjaxError)(response)) {\n const rejectionParam = {\n payload,\n textStatus,\n jqXHR,\n response\n };\n Ember.run.join(null, reject, rejectionParam);\n } else {\n const resolutionParam = {\n payload,\n textStatus,\n jqXHR,\n response\n };\n Ember.run.join(null, resolve, resolutionParam);\n }\n }).fail((jqXHR, textStatus, errorThrown) => {\n Ember.runInDebug(function () {\n const message = `The server returned an empty string for ${requestData.type} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n const validJSONString = !(textStatus === 'parsererror' && jqXHR.responseText === '');\n (true && Ember.warn(message, validJSONString, {\n id: 'ds.adapter.returned-empty-string-as-JSON'\n }));\n });\n const payload = this.parseErrorResponse(jqXHR.responseText) || errorThrown;\n let response;\n if (textStatus === 'timeout') {\n response = new _errors.TimeoutError();\n } else if (textStatus === 'abort') {\n response = new _errors.AbortError();\n } else {\n response = this.handleResponse(jqXHR.status, (0, _parseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);\n }\n const rejectionParam = {\n payload,\n textStatus,\n jqXHR,\n errorThrown,\n response\n };\n Ember.run.join(null, reject, rejectionParam);\n }).always(() => {\n pendingRequestCount = pendingRequestCount - 1;\n });\n }, `ember-ajax: ${hash.type} ${hash.url}`);\n promise.xhr = jqXHR;\n return promise;\n }", "function cmdUpdateReceived_ClickCase95() {\n console.log(\"cmdUpdateReceived_ClickCase95\");\n\n var promiseArray1 = [];\n var promiseArray2 = [];\n\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase95_1', {\n 'WOID': $scope.selectedWOIDData['woid']\n \n })\n );\n\n promiseArray2.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase95_2', {\n 'id': $scope.PPID,\n 'Status':$scope.WOStatus\n \n })\n );\n\n $q.all(promiseArray1).then(function (response) {\n console.log(\"cmdUpdateReceived_ClickCase95_1\", response);\n\n });\n\n $q.all(promiseArray2).then(function (response) {\n console.log(\"cmdUpdateReceived_ClickCase80_2\", response);\n\n });\n }", "fetchFromApi(requestCustomOptions) {\n return new Promise((resolve, reject) => {\n storageService.get(STORAGE_KEYS.AUTH_INFO)\n .then((authInfo) => {\n let doRequest = true;\n let logResponse = true;\n let logRequest = true;\n let informEventBus = true;\n\n // if we do not want to log request or response we need to\n // set sub-keys of loggingOption map\n if (typeof requestCustomOptions.loggingOption !== \"undefined\") {\n logResponse = requestCustomOptions.loggingOption.logResponse;\n logRequest = requestCustomOptions.loggingOption.logRequest;\n }\n\n // informEventBus is a value to prevent infinite-loop\n // that customHttpService is also used by logService itself\n // so that logging its own request creates an infinite-loop..\n if (typeof requestCustomOptions.informEventBus !== \"undefined\") {\n informEventBus = requestCustomOptions.informEventBus;\n }\n\n if (!authInfo && requestCustomOptions.requiresAuth) {\n doRequest = false;\n }\n\n if (doRequest) {\n\n let requestOptions = {\n method: requestCustomOptions.method,\n headers: {}\n };\n\n requestOptions.headers[\"Accept\"] = \"application/json\";\n if (requestOptions.body && requestCustomOptions.body.imagePost) {\n requestOptions.headers[\"Content-Type\"] = requestCustomOptions.headers[\"Content-type\"];\n } else {\n requestOptions.headers[\"Content-Type\"] = \"application/json\";\n }\n\n let url = EnvironmentConfiguration.API_URL;\n // set url value by using resolvePath method if it is passed\n // from options..\n if (requestCustomOptions.resolvePath) {\n url += requestCustomOptions.resolvePath(authInfo);\n } else {\n url += requestCustomOptions.path;\n }\n\n if (requestCustomOptions.body) {\n requestOptions.body = JSON.stringify(requestCustomOptions.body);\n }\n\n if (requestCustomOptions.requiresAuth) {\n requestOptions.headers[\"Authorization\"] = authInfo.token;\n }\n\n if (informEventBus) {\n eventBusService.sendMessageToBus(EVENT_TYPES.HTTP_REQUEST_STARTED, {\n url,\n body: requestOptions.body,\n logRequest\n });\n }\n\n fetch(url, {...requestOptions, timeout: EnvironmentConfiguration.TIMEOUT_MS})\n .then(res => {\n eventBusService.sendMessageToBus(EVENT_TYPES.HTTP_RESPONSE_HEADER_RECEIVED, {res});\n\n // this check is required for API's DELETE operations that returns HTTP 204 with\n // \"text/plain;charset=UTF-8\" content-type\n let headerContentType = res.headers.get(\"content-type\");\n if (headerContentType) {\n if (headerContentType.match(/application\\/json/)) {\n return res.json();\n }\n }\n\n return res;\n })\n .then((res) => {\n if (informEventBus) {\n eventBusService.sendMessageToBus(EVENT_TYPES.HTTP_REQUEST_COMPLETED, {\n res,\n url,\n logResponse\n });\n }\n if (res.errorCode || res.status == ErrorStatusCode.NOT_FOUND) {\n if (tokenService.isTokenError(res)) {\n if (authInfo.rememberMe) {\n tokenService.refreshToken(authInfo.uuid, authInfo.refreshToken);\n reject(res);\n } else {\n reject(res);\n tokenService.redirectToLogin();\n }\n } else {\n eventBusService.sendMessageToBus(EVENT_TYPES.HTTP_REQUEST_RETURNED_ERROR, {res});\n reject(res);\n }\n } else {\n resolve(res);\n }\n if (__DEV__) {\n console.log(res);\n }\n })\n .catch((err) => {\n reject(err);\n if (__DEV__) {\n console.log(err);\n }\n });\n\n } else {\n reject();\n }\n }).catch((err) => {\n reject(err);\n });\n });\n }", "function dHttp(opts) {\n let called = false;\n const errmsg = '[JSON-RPC ERROR] ';\n const options = {};\n let auth = opts.auth;\n if (undefined === auth)\n auth = '';\n opts.timeout = 15000;\n // options setting\n Object.assign(options, opts);\n Object.assign(options, url.parse(opts.url));\n return new Promise((resolve, reject) => {\n try {\n const req = https.request(options, function (res) {\n let buf = '';\n res.on('data', function (data) {\n buf += data;\n });\n res.on('end', function () {\n if (called)\n return;\n try {\n called = true;\n // console.log('status code: ' + res.statusCode)\n if (res.statusCode === 401) {\n const rpcRes = new Models_1.RpcResponse();\n rpcRes.error = { code: res.statusCode, message: errmsg + res.statusCode };\n // rpcRes.context = {};\n resolve(rpcRes);\n return;\n }\n if (res.statusCode === 403) {\n const rpcRes = new Models_1.RpcResponse();\n rpcRes.error = { code: res.statusCode, message: errmsg + res.statusCode };\n // rpcRes.context = {};\n resolve(rpcRes);\n return;\n }\n }\n catch (ex) {\n console.log(ex);\n }\n // if (res.statusCode === 500) {\n // const rpcRes = new RpcResponse();\n // rpcRes.error = { code: res.statusCode, message: errmsg + res.statusCode };\n // rpcRes.context = JSON.parse(buf);\n // resolve(rpcRes);\n // return;\n // }\n // todoW Work que depth exceeded\n // if (buf.toString('utf8') === 'Work queue depth exceeded') {\n // let exceededError = new Error('Bitcoin JSON-RPC: ' + buf.toString('utf8'))\n // // exceededError.code = 429 // Too many requests\n // reject(exceededError)\n // return\n // }\n let parsedBuf;\n try {\n parsedBuf = JSON.parse(buf);\n // console.log('parsedBuf: ' + JSON.parse(buf))\n }\n catch (e) {\n // todo log\n const rpcRes = new Models_1.RpcResponse();\n rpcRes.error = { code: -999, message: errmsg + 'Error Parsing JSON' };\n if (e instanceof Error) {\n console.log(e.message);\n console.log(e.stack);\n }\n else {\n console.log(e);\n }\n // rpcRes.context = {};\n reject(rpcRes);\n return;\n }\n const rpcRes = new Models_1.RpcResponse();\n rpcRes.error = parsedBuf.error;\n rpcRes.context = parsedBuf;\n resolve(rpcRes);\n });\n });\n req.on('error', function (e) {\n const rpcRes = new Models_1.RpcResponse();\n try {\n rpcRes.error = { code: -99, message: errmsg + 'Request Error: ' + e.message };\n }\n catch (ex) {\n console.log(ex);\n }\n reject(rpcRes);\n });\n // req.on('timeout', () => {\n // try {\n // req.abort();\n // const rpcRes = new RpcResponse();\n // rpcRes.error = { code: -1, message: errmsg + 'Timeout Error' };\n // reject(rpcRes);\n // } catch (ex) {\n // console.log(ex);\n // }\n // });\n req.setHeader('Content-Length', opts.body.length);\n req.setHeader('Content-Type', 'application/json');\n req.setHeader('Connection', 'keep-alive');\n req.setHeader('Authorization', auth);\n req.write(opts.body);\n req.end();\n }\n catch (e) {\n if (e instanceof Error) {\n console.log(e.message);\n console.log(e.stack);\n }\n else {\n console.log(e);\n }\n const rpcRes = new Models_1.RpcResponse();\n rpcRes.error = { code: -1, message: errmsg + 'http Error' };\n reject(rpcRes);\n }\n });\n}", "function UploadService($http, toastService) {\n //api endpoints\n var buildingUploadUrl = 'building/addNewBuilding';\n var logFileUploadUrl = 'position/processRadioMapFiles';\n var evalFileUploadUrl = 'position/processEvalFiles';\n var floorUploadUrl = 'building/addFloorToBuilding';\n\n\n // service functions\n return {\n uploadBuilding: function (newBuilding) {\n var postData = newBuilding;\n\n var promise = $http({\n method: 'POST',\n url: buildingUploadUrl,\n data: postData,\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(function (response) {\n logMessage = response.data.message;\n toastService.showToast(logMessage, \"success-toast\");\n return response.data;\n }, function errorCallback(response) {\n logMessage = response.data.message;\n toastService.showToast(logMessage, \"error-toast\");\n });\n return promise;\n },\n uploadRadioMap: function (radioMapSet) {\n if (!radioMapSet.radioMapFiles) {\n if (radioMapSet.buildingIdentifier !== 0) {\n logMessage = \"Please choose a file to upload\";\n toastService.showToast(logMessage, \"error-toast\");\n }\n } else if (radioMapSet.tpFiles.length && radioMapSet.tpFiles.length !== radioMapSet.radioMapFiles.length) {\n logMessage = \"Number of tp files and radiomap files should match\";\n toastService.showToast(logMessage, \"error-toast\");\n } else {\n // body content (log files and buildingId)\n var formData = new FormData();\n formData.append('buildingIdentifier', radioMapSet.buildingIdentifier);\n for (var i = 0; i < radioMapSet.radioMapFiles.length; i++) {\n formData.append('radioMapFiles', radioMapSet.radioMapFiles[i], radioMapSet.radioMapFiles[i].name);\n }\n for (var j = 0; j < radioMapSet.tpFiles.length; j++) {\n formData.append('transformedPointsFiles', radioMapSet.tpFiles[j], radioMapSet.tpFiles[j].name);\n }\n\n\n $http({\n method: 'POST',\n url: logFileUploadUrl,\n data: formData,\n transformRequest: function (data, headersGetterFunction) {\n return data;\n },\n headers: {\n 'Content-Type': undefined\n }\n }).then(function successCallback(response) {\n // success\n logMessage = response.data.message;\n toastService.showToast(logMessage, \"success-toast\");\n }, function errorCallback(response) {\n // failure\n logMessage = response.data.message;\n toastService.showToast(logMessage, \"error-toast\");\n });\n }\n },\n uploadEvaluationFile: function (evaluationSet) {\n if (evaluationSet.evalFiles[0] === null) {\n if (evaluationSet.buildingIdentifier !== 0) {\n logMessage = \"Please choose a file to upload\";\n toastService.showToast(logMessage, \"error-toast\");\n }\n } else if (evaluationSet.tpFiles.length && evaluationSet.tpFiles.length !== evaluationSet.evalFiles.length) {\n logMessage = \"Number of tp files and eval files should match\";\n toastService.showToast(logMessage, \"error-toast\");\n } else {\n // body content (eval files and buildingId)\n var formData = new FormData();\n formData.append('buildingIdentifier', evaluationSet.buildingIdentifier);\n formData.append('evalFiles', evaluationSet.evalFiles[0], evaluationSet.evalFiles[0].name);\n for (var j = 0; j < evaluationSet.tpFiles.length; j++) {\n formData.append('transformedPointsFiles', evaluationSet.tpFiles[j], evaluationSet.tpFiles[j].name);\n }\n\n $http({\n method: 'POST',\n url: evalFileUploadUrl,\n data: formData,\n transformRequest: function (data, headersGetterFunction) {\n return data;\n },\n headers: {\n 'Content-Type': undefined\n }\n }).then(function successCallback(response) {\n // success\n logMessage = response.data.message;\n toastService.showToast(logMessage, \"success-toast\");\n }, function errorCallback(response) {\n // failure\n logMessage = response.data.message;\n toastService.showToast(logMessage, \"error-toast\");\n });\n }\n },\n uploadFloorMap: function (floorSet) {\n if (floorSet.floorFiles[0] === null) {\n logMessage = \"Please choose an image file to upload\";\n toastService.showToast(logMessage, \"error-toast\");\n } else {\n // body content (floor file, floorId and buildingId)\n var formData = new FormData();\n formData.append('buildingIdentifier', floorSet.building.buildingId);\n formData.append('floorIdentifier', floorSet.floorIdentifier);\n formData.append('floorName', floorSet.floorName);\n formData.append('floorMapFile', floorSet.floorFiles[0], floorSet.floorFiles[0].name);\n\n $http({\n method: 'POST',\n url: floorUploadUrl,\n data: formData,\n transformRequest: function (data, headersGetterFunction) {\n return data;\n },\n headers: {\n 'Content-Type': undefined\n }\n }).then(function successCallback(response) {\n // success\n logMessage = response.data.message;\n toastService.showToast(logMessage, \"success-toast\");\n }, function errorCallback(response) {\n // failure\n logMessage = response.data.message;\n toastService.showToast(logMessage, \"error-toast\");\n });\n }\n }\n };\n}", "function RatingReviewServices($http, $q){\n try{\n var ratingReviewDetails = {};\n \n ratingReviewDetails.addRatingReviewAboutProduct = function(preparedParamJsonObj){\n var promiseObject = communicationWithAjax(\"dessertskhazana-services/dessertskhazanainnerservices/?r=api/v1/RatingReview/UserRatingReviewProduct\", 'apiFile', 'POST', '', preparedParamJsonObj).done(function(retResponseJson){});\n return promiseObject;\n };\n ratingReviewDetails.getShopStoreRatingReviewQuestionsAboutProduct = function(preparedParamJsonObj){\n var promiseObject = communicationWithAjax(\"dessertskhazana-services/dessertskhazanainnerservices/?r=api/v1/RatingReview/ManageShopStoreRatingReviewQuestionsAboutProduct\", 'apiFile', 'GET', '', preparedParamJsonObj).done(function(retResponseJson){});\n return promiseObject;\n };\n ratingReviewDetails.getShopStoreAllUserRatingReviewed = function(preparedParamJsonObj){\n var promiseObject = communicationWithAjax(\"dessertskhazana-services/dessertskhazanainnerservices/?r=api/v1/RatingReview/ShopStoreAllUserRating\", 'apiFile', 'GET', '', preparedParamJsonObj).done(function(retResponseJson){});\n return promiseObject;\n };\n ratingReviewDetails.getAllUserRatingReviewAboutProduct = function(preparedParamJsonObj){\n var promiseObject = communicationWithAjax(\"dessertskhazana-services/dessertskhazanainnerservices/?r=api/v1/RatingReview/AllUserRatingReviewAboutProduct\", 'apiFile', 'GET', '', preparedParamJsonObj).done(function(retResponseJson){});\n return promiseObject;\n };\n ratingReviewDetails.getMaxRatingReviewAboutProduct = function(preparedParamJsonObj){\n var promiseObject = communicationWithAjax(\"dessertskhazana-services/dessertskhazanainnerservices/?r=api/v1/RatingReview/MaxRatingReviewAboutProduct\", 'apiFile', 'GET', '', preparedParamJsonObj).done(function(retResponseJson){});\n return promiseObject;\n };\n ratingReviewDetails.getAverageRatingReviewAboutProduct = function(preparedParamJsonObj){\n var promiseObject = communicationWithAjax(\"dessertskhazana-services/dessertskhazanainnerservices/?r=api/v1/RatingReview/AverageRatingReviewAboutProduct\", 'apiFile', 'GET', '', preparedParamJsonObj).done(function(retResponseJson){});\n return promiseObject;\n };\n return ratingReviewDetails;\n }catch(ex){\n console.log(\"problem in Rating/Review services ex=>\"+ex);\n return false;\n }\n}", "_sendRequest(api, path, options) {\n options.headers = options.headers || {};\n if (this.token) {\n options.headers[\"Authoriztion\"] = `Bearer ${ this.token }`;\n }\n\n return api.request(path, options);\n }", "function generalPOST ( genHost, genPath, post_data,portNum, err, res )\n{\n if( typeof(portNum) == 'undefined' )\n {\n portNum = '3000';\n if (debug) console.log(\"Using default port\");\n }\n // check if arg param err does not exist\n if (typeof(err) != \"function\")\n {\n err = function(e) \n {\n if(debug) console.log(\"Lost connection to \" + genHost + \"removing from ring\");\n\n removeRingMember(genHost);\n\n// processApproval(genHost);\n\n if(debug) console.log(\"generalPOST err called \"+ e);\n };\n }\n\n // check if arg param res does not exist\n if (typeof(res) != \"function\")\n {\n res = function(r) {} ;\n }\n\n var dataString = JSON.stringify( post_data );\n\n var headers = {\n 'Content-Type': 'application/json',\n 'Content-Length': dataString.length\n };\n\n var post_options = {\n host: genHost,\n port: portNum,\n path: genPath,\n method: 'POST',\n headers: headers\n };\n\n var post_request = http.request(post_options, function(res){\n res.setEncoding('utf-8');\n \n var responseString = '';\n\n res.on('data', function(data){\n responseString += data;\n });\n\n res.on('end', function(){\n //var resultObject = JSON.parse(responseString);\n });\n });\n \n post_request.on('error', err );\n post_request.write(dataString);\n post_request.end();\n}", "multiCheckHttpCommunication(expected, responses, headers, extras) {\n\t\t// Setup environment and handling request\n\t\tthis.multiCheckHttpRequest(expected, responses, headers, extras);\n \t\t// Setup handling get\n\t\tthis.get = (url, success, error) => this._handleCommunication({ path: url }, success, error);\n }", "function doRequest(request, urlparams, requestObject){\n\n var json;\n apiurl = \"\";\n\n try{\n apiurl = constructURL(urlparams);\n }\n catch(e){\n throw e;\n }\n\n $.ajax({\n\n async: ajaxasync,\n cache: jsonpcaching,\n contentType: ajaxcontenttype,\n data: requestObject,\n dataType: ajaxreturn,\n type: request,\n //username: user, // \n //password: pass, // UNCOOMENT FOR HTTP AUTHENTICATION === NUCLEAR WAR\n url: apiurl,\n success: function( data ) { json = data; },\n statusCode: {\n 400: function(){ throw { code: \"400\", message: \"Неверный запрос\" }; },\n 401: function(){ throw { code: \"401\", message: \"Авторизируйтесь, пожалуйста\" }; },\n 402: function(){ throw { code: \"402\", message: \"Это - платная услуга\" }; },\n 403: function(){ throw { code: \"403\", message: \"Запрещено\" }; },\n 404: function(){ throw { code: \"404\", message: \"Ничего не найдено\" }; },\n 409: function(){ throw { code: \"409\", message: \"Такой объект уже существует\" }; },\n 410: function(){ throw { code: \"410\", message: \"Объект удален\" }; },\n 425: function(){ throw { code: \"425\", message: \"Объект заблокирован\" }; }\n }\n\n });\n\n return json;\n\n}", "function productionResumeCase10() {\n console.log(\"productionResumeCase10\");\n var promiseArray1 = [];\n var promiseArray2 = [];\n var promiseArray3 = [];\n var promiseArray4 = [];\n var currentdate = getCurrentDatetime();\n\n //Multiple Operator\n if(config.AllowMultipleWO){\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_1_1', {\n 'StopDateTime': currentdate,\n 'endType': 'JobContinue',\n 'WOID': $scope.selectedWOIDData['woid'],\n 'McID': $scope.McID,\n 'WorkCenter': $scope.WorkCenter,\n 'ProcOpSeq': $scope.ProcOpSeq,\n 'OperatorName': String($scope.OperatorName).trim()\n\n })\n );\n } else {\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_1', {\n 'StopDateTime': currentdate,\n 'endType': 'JobContinue',\n 'WOID': $scope.selectedWOIDData['woid'],\n 'McID': $scope.McID,\n 'WorkCenter': $scope.WorkCenter,\n 'ProcOpSeq': $scope.ProcOpSeq\n\n })\n );\n }\n\n\n $q.all(promiseArray1).then(function (response) {\n console.log(\"productionResumeCase10_1/productionResumeCase10_1_1\", response);\n\n promiseArray2.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_2', {\n 'WOID': $scope.selectedWOIDData['woid'],\n 'WorkCenter': $scope.WorkCenter,\n 'RouteID': $scope.RouteID,\n 'OpSeq': $scope.OpSeq,\n 'ProcOpSeq': $scope.ProcOpSeq,\n 'StartDateTime': currentdate,\n 'StartType': 'JobContinue',\n 'McID': $scope.McID,\n 'McType': $scope.McType,\n 'reason': 'JobContinue',\n 'OperatorID': String(authService.currentUser.userName).trim(),//\n 'OperatorName': String($scope.OperatorName).trim()\n })\n );\n\n\n $q.all(promiseArray2).then(function (response) {\n console.log(\"productionResumeCase10_2\", response);\n\n var TotalSetupDuration = 0;\n var subcontime = 0;\n if (String($scope.McType).trim() == \"Subcon\") {\n\n if (String($(\"#wotracking-table3-total\").val()).trim() == '') {\n subcontime = 0;\n } else {\n subcontime = parseFloat(String($(\"#wotracking-table3-total\").val()).trim());\n\n }\n TotalSetupDuration = 0;\n // $(\"#wotracking-table3-productiontotalduration\").val(String($(\"#wotracking-table3-total\").val()).trim());\n $(\"#wotracking-table3-total\").val(subcontime);\n } else {\n if (String($(\"#wotracking-table3-setuptotalduration\").val()).trim() == \"\") {\n $(\"#wotracking-table3-setuptotalduration\").val(\"0.00\") //todo display in hour\n }\n if (String($(\"#wotracking-table3-productiontotalduration\").val()).trim() == \"\") {\n $(\"#wotracking-table3-productiontotalduration\").val(\"0.00\")// todo display in hour\n }\n subcontime = $(\"#wotracking-table3-productiontotalduration\").val();\n TotalSetupDuration = $(\"#wotracking-table3-setuptotalduration\").val();\n }\n\n $scope.WOExecutionStatus = \"ProcessingStart\";\n promiseArray3.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_3', {\n 'WOStatus': $scope.WOExecutionStatus,//\n // 'SetupStartDate': TotalSetupDuration,\n 'OperatorID': String(authService.currentUser.userName).trim(),//\n 'OperatorName': String($scope.OperatorName).trim(),//\n 'ShiftID': 0,//\n 'McID': $scope.McID,//\n 'TotalSetupDuration': parseFloat(TotalSetupDuration),//\n 'ProdTotalDuration': convertDatetimeToSecond(subcontime),//\n //'Remark': String($('#select_wotrackingremark option:selected').text()).trim(),//\n 'Remark': String($('#select_wotrackingremark-input').val()).trim(),//\n 'WOID': $scope.selectedWOIDData['woid'],//\n 'ProcOpSeq': $scope.ProcOpSeq,//\n 'WorkCenter': $scope.WorkCenter//\n\n })\n );\n\n $q.all(promiseArray3).then(function (response) {\n console.log(\"productionResumeCase10_3\", response);\n fnUpdateOperator(\"ProcessingStart\",3);//multiple operator\n promiseArray4.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_4', {\n 'WOID': $scope.selectedWOIDData['woid'],//\n 'ProcOpSeq': $scope.ProcOpSeq,//\n 'ExStatus': 7,\n 'UpdatedDate': currentdate,\n 'OperatorID': String(authService.currentUser.userName).trim(),//\n 'OperatorName': String($scope.OperatorName).trim(),//\n 'reason': ''\n })\n );\n $q.all(promiseArray4).then(function (response) {\n console.log(\"productionResumeCase10_4\", response);\n CheckWOOpnStatus();\n });\n\n\n });\n\n });\n });\n\n\n\n\n\n //$q.all(promiseArray1).then(function (response) {\n // console.log(\"productionResumeCase10_1\", response);\n // $q.all(promiseArray2).then(function (response) {\n // console.log(\"productionResumeCase10_2\", response);\n // $q.all(promiseArray3).then(function (response) {\n // console.log(\"productionResumeCase10_3\", response);\n // $q.all(promiseArray4).then(function (response) {\n // console.log(\"productionResumeCase10_4\", response);\n // reload();\n // });\n // });\n // });\n //});\n\n\n\n }", "function HttpApiService(http) {\n this.http = http;\n }", "_m_exec_http_request(ph_args, pf_process_next_in_queue) {\n const lo_this = this;\n\n const ph_query_opts = ph_args.ph_query_opts;\n\n const pf_json_callback = lo_this.m_pick_option(ph_args, \"pf_json_callback\");\n const pi_timeout_ms = lo_this.m_pick_option(ph_args, \"pi_timeout_ms\");\n const ps_call_context = lo_this.m_pick_option(ph_args, \"ps_call_context\");\n const ps_method = lo_this.m_pick_option(ph_args, \"ps_method\");\n const ps_url_end_point = lo_this.m_pick_option(ph_args, \"ps_url_end_point\");\n const ps_url_path = lo_this.m_pick_option(ph_args, \"ps_url_path\");\n\n const ls_url_full = f_join_non_blank_vals('', f_string_remove_trailing_slash(ps_url_end_point), ps_url_path);\n\n\n // credentials to call our own services\n const ps_http_pass = lo_this.m_pick_option(ph_args, \"ps_http_pass\", true);\n const ps_http_user = lo_this.m_pick_option(ph_args, \"ps_http_user\", true);\n\n /* eslint multiline-ternary:0, no-ternary:0 */\n const lh_auth = (f_string_is_blank(ps_http_pass) ? null : {\n user: ps_http_user,\n pass: ps_http_pass,\n sendImmediately: true\n });\n\n\n // one more call\n lo_this._ai_call_count_exec_total ++;\n f_chrono_start(lo_this._as_queue_chrono_name);\n\n // at first call\n if (lo_this._ab_first_call) {\n lo_this._ab_first_call = false;\n f_console_OUTGOING_CNX(`target=[${ls_url_full}] login=[${ps_http_user}] way=[push] comment=[connection ${lo_this.m_get_context(ps_call_context)}]`);\n }\n\n const ls_full_call_context = lo_this.m_get_context(`[#${lo_this._ai_call_count_exec_total}]`, ps_call_context);\n\n f_console_verbose(1, `${ls_full_call_context} - init`);\n\n // https://github.com/request/request#requestoptions-callback\n const lh_query_opts = f_object_extend({\n method: ps_method,\n url: ls_url_full,\n\n agent: false,\n auth: lh_auth,\n encoding: \"utf8\",\n json: true,\n rejectUnauthorized: false,\n requestCert: false,\n timeout: pi_timeout_ms,\n }, ph_query_opts);\n\n const ls_call_chrono_name = f_digest_md5_hex(f_join_non_blank_vals('~', lo_this._as_queue_chrono_name, lo_this._ai_call_count_exec_total, f_date_format_iso()));\n f_chrono_start(ls_call_chrono_name);\n\n\n // one more pending request in parallel...\n lo_this._ai_parallel_current ++;\n lo_this._ai_parallel_max = f_number_max(lo_this._ai_parallel_max, lo_this._ai_parallel_current);\n\n cm_request(lh_query_opts, function(ps_error, po_response, po_json_response) {\n\n // one less pending request in parallel...\n lo_this._ai_parallel_current --;\n\n const li_call_duration_ms = f_chrono_elapsed_ms(ls_call_chrono_name);\n f_console_verbose(2, `${ls_full_call_context} - call took [${f_human_duration(li_call_duration_ms, true)}]`);\n\n // collect stats\n lo_this._ai_call_duration_total_ms += li_call_duration_ms;\n lo_this._ai_call_duration_max_ms = f_number_max(lo_this._ai_call_duration_max_ms, li_call_duration_ms);\n lo_this._ai_call_duration_min_ms = f_number_min(lo_this._ai_call_duration_min_ms, li_call_duration_ms);\n\n try {\n\n // error ?\n if (f_string_is_not_blank(ps_error)) {\n throw f_console_error(`${ls_full_call_context} - ${ps_error}`);\n }\n\n const li_statusCode = po_response.statusCode;\n if (li_statusCode !== 200) {\n throw f_console_error(`${ls_full_call_context} - call returned statusCode=[${li_statusCode} / ${po_response.statusMessage}] on URL=[${ls_url_full}] - reponse=[${f_console_stringify(po_json_response)}]`);\n }\n\n if (f_is_not_defined(po_json_response)) {\n throw f_console_error(`${ls_full_call_context} - returned an empty body`);\n }\n\n f_console_verbose(3, `${ls_full_call_context} - returned statusCode=[${li_statusCode}] with raw response:`, {\n po_json_response: po_json_response\n });\n\n if (f_is_defined(po_json_response.errors)) {\n throw f_console_error(`${ls_full_call_context} - errors=[${f_console_stringify(po_json_response.errors)}]`);\n }\n\n if (f_is_defined(po_json_response.error)) {\n throw f_console_error(`${ls_full_call_context} - error=[${f_console_stringify(po_json_response.error)}]`);\n }\n\n // give a context to the reply\n po_json_response.as_call_context = ls_full_call_context;\n\n // positive feed-back through the call-back\n pf_json_callback(null, po_json_response);\n }\n\n catch (po_err) {\n f_console_catch(po_err);\n }\n\n // handle the next pending element in the queue\n f_console_verbose(2, `${lo_this.m_get_context()} - next in queue...`);\n pf_process_next_in_queue();\n });\n }", "constructor(http, sharedService) {\n this.http = http;\n this.sharedService = sharedService;\n this.MSG_CREATE_SUCCESS = \"Enregistrement effectué\";\n this.MSG_UPDATE_SUCCESS = \"Enregistrement effectué\";\n this.MSG_DELETE_SUCCESS = \"Suppression effectuée\";\n // Base URL for Petfinder API\n this.apiUrl = \"http://\" + window.location.host + \"/api/\";\n this.controllerName = \"\";\n }", "async makeRequest(url, body, headers = {}) {\n // TODO: better input types - remove any\n const task = () => this.requestQueue.add(async () => {\n this.logger.debug('will perform http request');\n try {\n const response = await this.axios.post(url, body, Object.assign({\n headers,\n }, this.tlsConfig));\n this.logger.debug('http response received');\n if (response.status === 429) {\n const retrySec = parseRetryHeaders(response);\n if (retrySec !== undefined) {\n this.emit(WebClientEvent.RATE_LIMITED, retrySec);\n if (this.rejectRateLimitedCalls) {\n throw new p_retry_1.AbortError(errors_1.rateLimitedErrorWithDelay(retrySec));\n }\n this.logger.info(`API Call failed due to rate limiting. Will retry in ${retrySec} seconds.`);\n // pause the request queue and then delay the rejection by the amount of time in the retry header\n this.requestQueue.pause();\n // NOTE: if there was a way to introspect the current RetryOperation and know what the next timeout\n // would be, then we could subtract that time from the following delay, knowing that it the next\n // attempt still wouldn't occur until after the rate-limit header has specified. an even better\n // solution would be to subtract the time from only the timeout of this next attempt of the\n // RetryOperation. this would result in the staying paused for the entire duration specified in the\n // header, yet this operation not having to pay the timeout cost in addition to that.\n await helpers_1.delay(retrySec * 1000);\n // resume the request queue and throw a non-abort error to signal a retry\n this.requestQueue.start();\n throw Error('A rate limit was exceeded.');\n }\n else {\n // TODO: turn this into some CodedError\n throw new p_retry_1.AbortError(new Error('Retry header did not contain a valid timeout.'));\n }\n }\n // Slack's Web API doesn't use meaningful status codes besides 429 and 200\n if (response.status !== 200) {\n throw errors_1.httpErrorFromResponse(response);\n }\n return response;\n }\n catch (error) {\n this.logger.warn('http request failed', error.message);\n if (error.request) {\n throw errors_1.requestErrorWithOriginal(error);\n }\n throw error;\n }\n });\n return p_retry_1.default(task, this.retryConfig);\n }", "function makeRequest(options, responseEndCallback, requestId){\n //console.log('making request to url: ' + options.url);\n var url = options.url,\n path = '';\n\n if(!options.url){\n var randomIndex=Math.floor(Math.random()*options.urls.length);//randomly select an index in the urls array\n url = options.urls[randomIndex];\n //console.log('url: %s randomIndex: %s', url, randomIndex);\n }\n\n //seperate the base url from the path.\n var firstSlashIndex = url.indexOf('/');\n if(firstSlashIndex >= 0){\n path = url.substr(firstSlashIndex);\n url = url.substr(0, firstSlashIndex);\n }\n\n //try using agent to get around ECONNRESET. seems to work!\n //var agent = new http.Agent();\n //agent.maxSockets = 20; //1 socket = 1936/2000 success. 10 socket = 1995/2000 success. 20 socket = 2000/2000 success!\n var agent = options.useAgents ? agentProvider.getAgent() : false; //false;//\n\n //create the request options for the http.request api.\n var requestOptions = {\n hostname: url,\n port: options.port,\n path: path,\n method: options.requestMethod,\n agent:agent, //try to fix ECONNRESET, socket closed issue.\n headers:{\n 'connection': options.connectionHeader, //'close' or 'keep-alive'\n 'requestid': requestId\n }\n };\n\n //initiate the request\n var req = http.request(requestOptions, function(res) {\n //console.log('creating request');\n pound.openConnections++;//increment count to keep track\n pound.requestsGenerated++;\n pound.requestsPerSecond = pound.requestsGenerated / ((new Date().getTime() - pound.startMilliseconds) / 1000);\n //console.log('open connections %s - open', pound.openConnections);\n pound.highestOpenConnectionsAtOneTime = pound.openConnections > pound.highestOpenConnectionsAtOneTime ? pound.openConnections : pound.highestOpenConnectionsAtOneTime;\n\n //console.log('STATUS: ' + res.statusCode);\n //console.log('HEADERS: ' + JSON.stringify(res.headers));\n //res.setEncoding('utf8');\n\n //Indicates that the underlaying connection was terminated before response.end() was called or able to flush.\n res.on('close', function(){ // this isn't getting called.\n console.log('response close called');\n });\n\n res.on('end', function(){\n pound.openConnections--;\n });\n //then you must consume the data from the response object, either by calling response.read() whenever there is a 'readable' event\n res.on('readable', function(message){\n //console.log('readable event fired');\n res.read();\n });\n\n }.bind({requestId:requestId}));\n\n //wait for the response\n /**\n * http://nodejs.org/docs/latest/api/http.html#http_class_http_agent\n * If no 'response' handler is added, then the response will be entirely discarded. However, if you add a 'response' event handler, then you must consume the data from the response object,\n * either by calling response.read() whenever there is a 'readable' event, or by adding a 'data' handler, or by calling the .resume() method.\n * Until the data is consumed, the 'end' event will not fire.\n */\n req.on('response', function(resp){\n //console.log('response received');\n //pound.openConnections--;\n \n pound.responsesReceived++;\n pound.responsesPerSecond = pound.responsesReceived / ((new Date().getTime() - pound.startMilliseconds) / 1000);\n //console.log('open connections %s - close', pound.openConnections);\n if(responseEndCallback){\n responseEndCallback(this.requestId);\n }\n });\n\n //log request errors.\n req.on('error', function(e) {\n pound.requestErrorCount++;\n console.warn('problem with requestId: %s to url: %s message: %s \\n complete: %s', this.requestId, this.url, e.message, JSON.stringify(e));\n }.bind({url:url, requestId:requestId}));\n\n //TODO: allow for request timeouts?\n // req.setTimeout(options.requestTimeout, function(e){\n // console.log('timeout for url %s', this.url);\n // this.req.end();\n // this.req.destroy();\n // }.bind({url:url, req:req}));\n\n // write data to request body\n //req.write('data\\n');\n //req.write('data\\n');\n req.end();\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false && (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache : isObject(defaults.cache) ? defaults.cache : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url) ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] : undefined;\n if (xsrfValue) {\n reqHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, config.withCredentials, config.responseType, createApplyHandlers(config.eventHandlers), createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function (eventHandler, key) {\n applyHandlers[key] = function (event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function cmdUpdate_ClickCase80() {\n console.log(\"cmdUpdate_ClickCase80\");\n var promiseArray1 = [];\n var promiseArray2 = [];\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase80_1', {\n 'WOID': $scope.selectedWOIDData['woid'],//\n 'EndDate': getCurrentDatetime()\n })\n );\n promiseArray2.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase80_2', {\n 'WOID': $scope.selectedWOIDData['woid'],//\n 'WOStatus': $scope.WOStatus\n })\n );\n $q.all(promiseArray1).then(function (response) {\n console.log(\"cmdUpdate_ClickCase80_1\", response);\n $q.all(promiseArray2).then(function (response) {\n console.log(\"cmdUpdate_ClickCase80_2\", response);\n\n fnAddFGInventory();\n cmdUpdate_ClickCase90();\n });\n });\n\n\n }", "request(config) {\n config.url = this.makeUrl();\n return this.$http.request(config)\n }", "function RequestFactory($http, $q){\n var factory = {\n request: request\n };\n\n return factory;\n\n //returns a promise that will be resolved or rejected (asynchronously) based on the return of $http.get request\n //resource: to be added to the BASE_URL\n function request(resource, page, extraParams){\n //default value of 1 if page is undefined\n page = page ? page : 1;\n\n var deferred = $q.defer();\n var FINAL_URL = BASE_URL+ resource + '?api_key=' + API_KEY + '&page=' + page;\n //add any extra params added\n if ( extraParams ) {\n extraParams.forEach(function(param){\n //make sure the param has key and value properties\n if(param.key && param.value){\n FINAL_URL += '&'+param.key+'='+param.value ;\n }\n });\n }\n $http.get(FINAL_URL)\n .then(\n //success function\n function(response){\n //return the actually resource (e.g. movies), so that the caller can use it right away\n //if has results (array of something), return it, otherwise return data (single data)\n deferred.resolve(response.data.results ? response.data.results : response.data);\n },\n\n //error function\n function(error){\n //propagate the error to the caller\n deferred.reject(error);\n });\n return deferred.promise;\n }\n}", "function dataService($q, $http) {\n return {\n getAllStockItems: getAllStockItems,\n getStockItemById: getStockItemById,\n addStockItem: addStockItem,\n updateStockItem: updateStockItem,\n deleteStockItem: deleteStockItem,\n insertItemEntry: insertItemEntry,\n useStockItem: useStockItem,\n getCategories: getCategories\n };\n\n //get stock items and callbacks\n function getAllStockItems() {\n return $http.get('api/stockitems/')\n .then(sendResponseData)\n .catch(sendGetErrors);\n }\n\n //get stock item by id\n function getStockItemById(stockItemId) {\n return $http.get('api/stockitems/' + stockItemId)\n .then(sendResponseData)\n .catch(sendGetErrors);\n }\n\n function sendResponseData(response) {\n return response.data;\n }\n\n function sendGetErrors(response) {\n $q.reject('Error retrieving item(s). (HTTP status: ' + response.status + ')');\n }\n\n //Add stock item and callbacks\n function addStockItem(stockItem) {\n return $http({\n method: 'POST',\n url: 'api/stockitems',\n data: stockItem\n })\n .then(addStockItemSuccess)\n .catch(addStockItemError)\n }\n\n function addStockItemSuccess(response) {\n return 'Stock item added: ' + response.config.data.StockItemId;\n }\n\n function addStockItemError(response) {\n $q.reject('Error adding item. (HTTP status: ' + response.status + ')');\n }\n\n //Update stock item and callbacks\n function updateStockItem(stockItem) {\n return $http.put('api/stockitems/' + stockItem.StockItemId, stockItem)\n .then(updateStockItemSuccess)\n .catch(updateStockItemError);\n }\n\n function updateStockItemSuccess(response) {\n return 'Stock item updated: ' + response.config.data.StockItemId;\n }\n\n function updateStockItemError(response) {\n $q.reject('Error updating item. (HTTP status: ' + response.status + ')');\n }\n\n //Delete stock item and callbacks\n function deleteStockItem(stockItemId) {\n return $http.delete('api/stockitems/' + stockItemId)\n .then(deleteStockItemSuccess)\n .catch(deleteStockItemError);\n }\n\n function deleteStockItemSuccess(response) {\n return 'Stock item deleted.'\n }\n\n function deleteStockItemError(response) {\n $q.reject('Error deleting item. (HTTP status: ' + response.status + ')');\n }\n\n\n function useStockItem(stockItemId) {\n return $http.post('api/stockitems/useStockItem/' + stockItemId)\n .then(useStockItemSuccess)\n .catch(useStockItemError);\n }\n\n function useStockItemSuccess(response) {\n return response.data;\n }\n\n function useStockItemError(response) {\n $q.reject('Error using item. (HTTP status: ' + response.status + ')');\n }\n\n\n function insertItemEntry(item) {\n return $http.post('api/stockitems/addItemEntry/' + item.StockItemId , item)\n .then(updateStockItemSuccess)\n .catch(updateStockItemError);\n }\n\n function getCategories() {\n return $http.get('api/categories/')\n .then(sendResponseData)\n .catch(sendGetErrors);\n }\n }", "httpPost(reqObj) {\n reqObj.jar = this.jar\n return new Promise((resolve, reject) => {\n this.request.post(reqObj)\n .then(function(body) {\n resolve(body)\n })\n .catch(function(e) {\n console.log('http post failed : ' + e.message)\n console.log(reqObj)\n process.exit(1)\n })\n })\n }", "function FetchService($http, dbURL){\n return {\n // getFetch isn't used\n getFetch:function(user){\n console.log(user);\n return $http.post(dbURL.url + '/fetches/', user)\n .then(function(response){\n console.log(response);\n }, function(error){\n console.log(error);\n });\n },\n\n claimFetch: function(fetch){\n return $http.put(dbURL.url + '/fetches/claim/', fetch)\n .then(function(response){\n console.log(response);\n }, function(error){\n console.log(error);\n });\n },\n\n closeFetch: function(fetch){\n return $http.put(dbURL.url + '/fetches/close/', fetch)\n .then(function(response){\n console.log(response);\n }, function(error){\n console.log(error);\n });\n },\n\n postNewFetch: function(fetchObj) {\n // console.log(fetchObj);\n return $http.post(dbURL.url + '/fetches', fetchObj)\n .then(function(response){\n console.log(response);\n }, function(error){\n console.log(error);\n });\n },\n\n updateFetch: function(fetchObj) {\n return $http.put(dbURL.url + '/fetches/update/', fetchObj)\n .then(function(response){\n console.log(response);\n }, function(error){\n console.log(error);\n });\n },\n\n deleteFetch: function(fetchObj) {\n console.log(fetchObj)\n return $http.post(dbURL.url + '/fetches/delete/', fetchObj)\n .then(function(response){\n console.log(response);\n }, function(error){\n console.log(error);\n });\n }\n };\n}", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }", "function http(){\n\t//Initialize XMLHttp request function.\n\tthis.request = new XMLHttpRequest();\n\n\t//Ready for result on onload event listener.\n\tthis.result = function(callback){\n\t\t//Success\n\t\tthis.request.onload = function() {\n\t\t\tif (this.status >= 200 && this.status < 400) {\n\t\t\t\tvar data = JSON.parse(this.responseText);\n\t\t\t\tcallback(data);\n\t\t\t}\n\t\t};\n\n\t\t//Error\n\t\tthis.request.onerror = function() {\n\t\t\tcallback(null);\n\t\t};\n\t}\n\n\t//Get function of http.\n\tthis.get = function(url, callback){\n\t\tthis.request.open('GET', url, true);\n\t\tthis.request.send();\n\t\tthis.result(callback);\n\t}\n\n\t//Post function of http.\n\tthis.post = function(url, data, callback){\n\t\tthis.request.open('POST', url, true);\n\t\tthis.request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n\t\tthis.request.send(JSON.stringify(data));\n\t\tthis.result(callback);\n\t}\n}", "http (url, options) {\n return this.robot.http(url, options)\n }", "function sendAjaxCall( apiMethod, data ) {\n var requestUrl = [API_ROOT,API_NAME,apiMethod].join('/');\n data = data || [];\n var dataObj = {};\n\n dataObj.args = data;\n dataObj.hasCb = true;\n\n return $http({\n url: requestUrl,\n data: JSON.stringify(dataObj),\n timeout: API_TIMEOUT,\n method: 'POST',\n headers : {\n \"Content-Type\": \"application/json\" \n }\n });\n }", "request_POST(self, url, params, fnSuccessResponse = null, headers = null, fnFailureResponse = null, finallyHandler = null) {\n console.log(\"post\")\n if (headers == null) {\n let token = \"\"\n if (sessionStorage.getItem(\"token\"))\n token = sessionStorage.getItem(\"token\")\n\n headers = {\n 'token': token,\n }\n }\n axios_instance.post(url, params, {\n headers: headers,\n })\n .then(function (response) {\n console.log(\"response.data.success=\" + response.data.success)\n if (fnSuccessResponse != null) {\n if (response.data.success == false)\n self.showSnakeBar(\"error\", response.data.message)\n console.log(\"log1.1\")\n fnSuccessResponse(response);\n }\n })\n .catch(function (error) {\n console.log(error);\n if (!error.response) {\n console.log(error)\n } else {\n console.log(error.response.data.status_code)\n self.handle400(error.response);\n self.handle401(error.response.status);\n self.handle440(error.response.status);\n self.handle403(error.response.status);\n self.handle500(error.response.status);\n if (fnFailureResponse != null) {\n fnFailureResponse();\n } else {\n self.handleNoInternetConnection()\n }\n }\n }).finally(function (res) {\n if (finallyHandler !== null) {\n finallyHandler()\n }\n });\n }", "request(url, form, data) {\n\n const options = {\n url: this.api + url,\n json: true\n };\n\n if (this.proxy) options.proxy = this.proxy;\n\n if (form) {\n options.form = form;\n } else {\n for (let item in data) {\n const type = typeof data[item];\n if (type == 'string' || type == 'object') continue;\n data[item] = JSON.stringify(data[item]);\n }\n options.formData = data;\n }\n\n return new Promise((resolve, reject) => {\n request.post(options, (error, response, body) => {\n if (error || !body || !body.ok || response.statusCode == 404) {\n return reject(error || body || 404);\n }\n return resolve(body);\n });\n });\n\n }", "function productionPauseCase20() {\n console.log(\"productionPauseCase20\");\n var promiseArray1 = [];\n var promiseArray2 = [];\n var promiseArray3 = [];\n\n var currentdate = getCurrentDatetime();\n //currentdate = Date();\n // currentData = \"\";\n\n if(config.AllowMultipleOperator){ //Multiple Operator\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionPauseCase20_1_1', {\n 'StopDateTime': currentdate,\n 'endType': 'JobPause',\n 'WOID': $scope.selectedWOIDData['woid'],\n 'ProcOpSeq': $scope.ProcOpSeq,\n 'WorkCenter': $scope.WorkCenter,\n 'OperatorName': String($scope.OperatorName).trim()\n })\n );\n } else {\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionPauseCase20_1', {\n 'StopDateTime': currentdate,\n 'endType': 'JobPause',\n 'WOID': $scope.selectedWOIDData['woid'],\n 'ProcOpSeq': $scope.ProcOpSeq,\n 'WorkCenter': $scope.WorkCenter,\n })\n );\n }\n\n\n\n\n\n\n $q.all(promiseArray1).then(function (response) {\n console.log(\"productionPauseCase20_1\", response);\n fnUpdateOperator(\"ProcessingPause\",3);//multiple operator\n //var reason = \"JobPause - \" + String($('#select_wotracking-pausereason option:selected').text()).trim()\n var reason = \"JobPause - \" + String($(\"#select_wotracking-pausereason-input\").val()).trim();\n promiseArray2.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionPauseCase20_2', {\n 'WOID': $scope.selectedWOIDData['woid'],\n 'WorkCenter': $scope.WorkCenter,\n 'RouteID': $scope.RouteID,\n 'OpSeq': $scope.OpSeq,\n 'ProcOpSeq': $scope.ProcOpSeq,\n 'StartDateTime': currentdate,\n 'StopDateTime': '',\n 'endType': '',\n 'StartType': \"JobPause\",\n 'McID': $scope.McID,\n 'McType': $scope.McType,\n 'reason': reason,\n 'OperatorID': String(authService.currentUser.userName).trim(),//\n 'OperatorName': String($scope.OperatorName).trim(),//\n 'ShiftID': '0'\n })\n );\n\n\n $q.all(promiseArray2).then(function (response) {\n console.log(\"productionPauseCase20_2\", response);\n $q.all(promiseArray3).then(function (response) {\n\n promiseArray3.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionPauseCase20_3', {\n 'WOID': $scope.selectedWOIDData['woid'],\n 'ProcOpSeq': $scope.ProcOpSeq,\n 'ExStatus': 6,\n 'UpdatedDate': currentdate,\n 'OperatorID': String(authService.currentUser.userName).trim(),//\n 'OperatorName': String($scope.OperatorName).trim(),//\n 'reason': reason\n\n\n })\n );\n console.log(\"productionPauseCase20_3\", response);\n CheckWOOpnStatus();\n //reload();\n });\n });\n });\n\n\n\n\n\n }", "function sendReq(config, reqData) {\n\t var deferred = $q.defer(),\n\t promise = deferred.promise,\n\t cache,\n\t cachedResp,\n\t reqHeaders = config.headers,\n\t isJsonp = lowercase(config.method) === 'jsonp',\n\t url = config.url;\n\n\t if (isJsonp) {\n\t // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n\t // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n\t url = $sce.getTrustedResourceUrl(url);\n\t } else if (!isString(url)) {\n\t // If it is not a string then the URL must be a $sce trusted object\n\t url = $sce.valueOf(url);\n\t }\n\n\t url = buildUrl(url, config.paramSerializer(config.params));\n\n\t if (isJsonp) {\n\t // Check the url and add the JSONP callback placeholder\n\t url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n\t }\n\n\t $http.pendingRequests.push(config);\n\t promise.then(removePendingReq, removePendingReq);\n\n\t if ((config.cache || defaults.cache) && config.cache !== false &&\n\t (config.method === 'GET' || config.method === 'JSONP')) {\n\t cache = isObject(config.cache) ? config.cache\n\t : isObject(/** @type {?} */ (defaults).cache)\n\t ? /** @type {?} */ (defaults).cache\n\t : defaultCache;\n\t }\n\n\t if (cache) {\n\t cachedResp = cache.get(url);\n\t if (isDefined(cachedResp)) {\n\t if (isPromiseLike(cachedResp)) {\n\t // cached request has already been sent, but there is no response yet\n\t cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n\t } else {\n\t // serving from cache\n\t if (isArray(cachedResp)) {\n\t resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n\t } else {\n\t resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n\t }\n\t }\n\t } else {\n\t // put the promise for the non-transformed response into cache as a placeholder\n\t cache.put(url, promise);\n\t }\n\t }\n\n\n\t // if we won't have the response in cache, set the xsrf headers and\n\t // send the request to the backend\n\t if (isUndefined(cachedResp)) {\n\t var xsrfValue = urlIsAllowedOrigin(config.url)\n\t ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n\t : undefined;\n\t if (xsrfValue) {\n\t reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n\t }\n\n\t $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n\t config.withCredentials, config.responseType,\n\t createApplyHandlers(config.eventHandlers),\n\t createApplyHandlers(config.uploadEventHandlers));\n\t }\n\n\t return promise;\n\n\t function createApplyHandlers(eventHandlers) {\n\t if (eventHandlers) {\n\t var applyHandlers = {};\n\t forEach(eventHandlers, function(eventHandler, key) {\n\t applyHandlers[key] = function(event) {\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(callEventHandler);\n\t } else if ($rootScope.$$phase) {\n\t callEventHandler();\n\t } else {\n\t $rootScope.$apply(callEventHandler);\n\t }\n\n\t function callEventHandler() {\n\t eventHandler(event);\n\t }\n\t };\n\t });\n\t return applyHandlers;\n\t }\n\t }\n\n\n\t /**\n\t * Callback registered to $httpBackend():\n\t * - caches the response if desired\n\t * - resolves the raw $http promise\n\t * - calls $apply\n\t */\n\t function done(status, response, headersString, statusText, xhrStatus) {\n\t if (cache) {\n\t if (isSuccess(status)) {\n\t cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n\t } else {\n\t // remove promise from the cache\n\t cache.remove(url);\n\t }\n\t }\n\n\t function resolveHttpPromise() {\n\t resolvePromise(response, status, headersString, statusText, xhrStatus);\n\t }\n\n\t if (useApplyAsync) {\n\t $rootScope.$applyAsync(resolveHttpPromise);\n\t } else {\n\t resolveHttpPromise();\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t }\n\t }\n\n\n\t /**\n\t * Resolves the raw $http promise.\n\t */\n\t function resolvePromise(response, status, headers, statusText, xhrStatus) {\n\t //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n\t status = status >= -1 ? status : 0;\n\n\t (isSuccess(status) ? deferred.resolve : deferred.reject)({\n\t data: response,\n\t status: status,\n\t headers: headersGetter(headers),\n\t config: config,\n\t statusText: statusText,\n\t xhrStatus: xhrStatus\n\t });\n\t }\n\n\t function resolvePromiseWithResult(result) {\n\t resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n\t }\n\n\t function removePendingReq() {\n\t var idx = $http.pendingRequests.indexOf(config);\n\t if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n\t }\n\t }", "httpCall(requestParams, variable, params) {\n return new Promise((resolve, reject) => {\n variable._observable = httpService.sendCallAsObservable(requestParams, params).subscribe((response) => {\n if (response && response.type) {\n resolve(response);\n }\n }, (err) => {\n if (httpService.isPlatformSessionTimeout(err)) {\n // send the notification manually to hide any context spinners on page.\n // [TODO]: any spinners on widget listening on this variable will also go off. Need to see an approach to sovle that.\n this.notifyInflight(variable, false, err);\n err._401Subscriber.asObservable().subscribe(response => resolve(response), e => reject(e));\n }\n else {\n reject(err);\n }\n });\n });\n }", "function btnScrap_ClickCase95() {\n console.log(\"btnScrap_ClickCase95\");\n var promiseArray1 = [];\n var promiseArray2 = [];\n\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase95_1', {\n 'WOID': $scope.selectedWOIDData['woid']\n\n })\n );\n\n promiseArray2.push(\n $http.post(config.baseUrlApi + 'HMLVTS/cmdUpdateReceived_ClickCase95_2', {\n 'id': $scope.PPID,\n 'Status': $scope.WOStatus\n\n })\n );\n\n $q.all(promiseArray1).then(function (response) {\n console.log(\"btnScrap_ClickCase95 cmdUpdate_ClickCase95_1\", response);\n\n });\n\n $q.all(promiseArray2).then(function (response) {\n console.log(\"btnScrap_ClickCase95 cmdUpdate_ClickCase95_2\", response);\n\n });\n\n }", "_request(path, options = {}) {\n return _sendRequest(this.api, path, options);\n }", "send(options) {\n const args = this.getHttpRequestArgs(options);\n return this.httpSend(args.url, {\n method: args.method,\n headers: args.headers,\n }, args.body);\n }", "function userService($http) {\n\n\n var api = {\n \"findUserByCredentials\": findUserByCredentials,\n \"findUserById\": findUserById,\n \"updateUser\": updateUser,\n \"deleteUser\": deleteUser,\n \"createUser\": createUser,\n \"findUserByUsername\": findUserByUsername,\n \"addToLibrary\": addToLibrary,\n \"getBooksFromLibrary\": getBooksFromLibrary,\n \"getBooksOfUserLibrary\":getBooksOfUserLibrary,\n \"getImageLink\": getImageLink,\n \"findUserByIdUsingObjects\": findUserByIdUsingObjects,\n \"logggedIn\": logggedIn,\n \"logout\": logout,\n \"isAdmin\": isAdmin,\n \"findAllUsers\": findAllUsers,\n \"findByIdUser\": findByIdUser,\n \"adminupdateUser\": adminupdateUser,\n \"checkBuyer\":checkBuyer,\n \"removeFromLibrary\":removeFromLibrary,\n \"checkSeller\":checkSeller,\n \"addUserByAdmin\":addUserByAdmin\n\n\n };\n return api;\n\n\n function getBooksOfUserLibrary(someUserId) {\n var obj={\n \"someUserId\":someUserId\n };\n console.log(\"inside service\"+someUserId);\n return $http.get(\"/api/admin/\"+someUserId+\"/viewLibrary/\",obj);\n }\n\n\n\n\n function addUserByAdmin(user) {\n return $http.post(\"/api/admin/createUser\",user);\n }\n\n\n\n\n function removeFromLibrary(bookId,userId) {\n var obj={\n \"bookId\":bookId,\n \"userId\":userId\n };\n // var xyz=Object.values(obj.bookId);\n // console.log(\"xyz\"+xyz);\n return $http.post(\"/api/user/userId/viewLibrary\", obj);\n }\n function adminupdateUser(userId, newUser) {\n\n return $http.post(\"/api/admin/user/\" + userId, newUser);\n }\n\n function findByIdUser(userId) {\n return $http.get(\"/api/admin/user/\" + userId);\n }\n\n function findAllUsers() {\n return $http.get(\"/api/admin/user\");\n }\n\n function getImageLink(uIds, userId) {\n return $http.get(\"/api/get/Image/user/\" + userId, uIds);\n }\n\n function findUserByIdUsingObjects(userId) {\n return $http.get(\"/api/usingObjects/user/\" + userId);\n }\n\n function getBooksFromLibrary(userId) {\n return $http.get(\"/api/user/userId/viewLibrary/\");\n }\n\n function addToLibrary(bookEntry, bookId, userId) {\n return $http.put(\"/api/user/\" + userId + \"/search/\" + bookId, bookEntry);\n\n }\n\n function findUserByUsername(username) {\n\n return $http.get(\"/api/user?username=\" + username);\n\n }\n\n\n function deleteUser(userId) {\n return $http.delete(\"/api/admin/user/\" + userId);\n }\n\n\n function createUser(user) {\n\n return $http.post(\"/api/user/createUser\", user);\n\n // user._id=(new Date()).getTime().toString();\n // users.push(user);\n }\n\n function findUserByCredentials(username, password) {\n return $http.post(\"/api/user?username=\" + username + \"&password=\" + password);\n //retrieve data from the server on server will listen to this request\n }\n\n function updateUser(userId, newUser) {\n\n return $http.put(\"/api/user/\" + userId, newUser);\n // for(var u in users)\n // {\n // if(users[u]._id==userId)\n // {\n // users[u].firstName=newUser.firstName;\n // users[u].lastName=newUser.lastName;\n // return users[u];\n // }\n //\n // }\n // return null;\n }\n\n function findUserById(userId) {\n\n console.log(\"userId\" + userId);\n return $http.get(\"/api/user/\" + userId);\n\n }\n\n function logggedIn() {\n return $http.post('/api/user/loggedin')\n .then(\n function (response) {\n return response.data;\n }\n )\n\n\n }\n\n function logout() {\n return $http.post(\"/api/user/logout\")\n .then(\n function (response) {\n return response.data;\n }\n )\n }\n\n function isAdmin() {\n\n return $http.post('/api/user/isadmin')\n .then(\n function (response) {\n return response.data;\n }\n );\n\n }\n\n function checkBuyer() {\n return $http.post('/api/user/isBuyer')\n .then(\n function (response) {\n return response.data;\n }\n );\n\n }\n\n function checkSeller() {\n return $http.post('/api/user/is/Seller') .then(\n function (response) {\n return response.data;\n }\n );\n\n }\n }", "function setupResumeCase10() {\n console.log(\"setupResumeCase10\");\n var promiseArray1 = [];\n var promiseArray2 = [];\n var promiseArray3 = [];\n var promiseArray4 = [];\n var currentdate = getCurrentDatetime();\n\n if(config.AllowMultipleOperator){//Multiple Operator\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/setupResumeCase10_1', {\n 'StopDateTime': currentdate,\n 'endType': 'SetupContinue',\n 'WOID': $scope.selectedWOIDData['woid'],\n 'McID': $scope.McID,\n 'WorkCenter': $scope.WorkCenter,\n 'ProcOpSeq': $scope.ProcOpSeq,\n 'OperatorName': String($scope.OperatorName).trim(),\n\n })\n );\n } else {\n promiseArray1.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_1', {\n 'StopDateTime': currentdate,\n 'endType': 'SetupContinue',\n 'WOID': $scope.selectedWOIDData['woid'],\n 'McID': $scope.McID,\n 'WorkCenter': $scope.WorkCenter,\n 'ProcOpSeq': $scope.ProcOpSeq\n\n })\n );\n }\n\n\n $q.all(promiseArray1).then(function (response) {\n console.log(\"setupResumeCase10 productionResumeCase10_1\", response);\n\n promiseArray2.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_2', {\n 'WOID': $scope.selectedWOIDData['woid'],\n 'WorkCenter': $scope.WorkCenter,\n 'RouteID': $scope.RouteID,\n 'OpSeq': $scope.OpSeq,\n 'ProcOpSeq': $scope.ProcOpSeq,\n 'StartDateTime': currentdate,\n 'StartType': 'SetupContinue',\n 'McID': $scope.McID,\n 'McType': $scope.McType,\n 'reason': 'SetupContinue',\n 'OperatorID': String(authService.currentUser.userName).trim(),//\n 'OperatorName': String($scope.OperatorName).trim()//\n })\n );\n\n\n $q.all(promiseArray2).then(function (response) {\n console.log(\"setupResumeCase10 productionResumeCase10_2\", response);\n\n var TotalSetupDuration = 0;\n var subcontime = 0;\n if (String($scope.McType).trim() == \"Subcon\") {\n\n if (String($(\"#wotracking-table3-total\").val()).trim() == '') {\n subcontime = 0;\n } else {\n subcontime = parseFloat(String($(\"#wotracking-table3-total\").val()).trim());\n\n }\n TotalSetupDuration = 0;\n // $(\"#wotracking-table3-productiontotalduration\").val(String($(\"#wotracking-table3-total\").val()).trim());\n $(\"#wotracking-table3-total\").val(subcontime);\n } else {\n if (String($(\"#wotracking-table3-setuptotalduration\").val()).trim() == \"\") {\n $(\"#wotracking-table3-setuptotalduration\").val(\"0.00\") //todo display in hour\n }\n if (String($(\"#wotracking-table3-productiontotalduration\").val()).trim() == \"\") {\n $(\"#wotracking-table3-productiontotalduration\").val(\"0.00\")// todo display in hour\n }\n subcontime = $(\"#wotracking-table3-productiontotalduration\").val();\n TotalSetupDuration = $(\"#wotracking-table3-setuptotalduration\").val();\n }\n\n $scope.WOExecutionStatus = \"ProcessingStart\";\n promiseArray3.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_3', {\n 'WOStatus': $scope.WOExecutionStatus,//\n // 'SetupStartDate': TotalSetupDuration,\n 'OperatorID': String(authService.currentUser.userName).trim(),//\n 'OperatorName': String($scope.OperatorName).trim(),//\n 'ShiftID': 0,//\n 'McID': $scope.McID,//\n 'TotalSetupDuration': parseFloat(TotalSetupDuration),//\n 'ProdTotalDuration': convertDatetimeToSecond(subcontime),//\n //'Remark': String($('#select_wotrackingremark option:selected').text()).trim(),//\n 'Remark': String($('#select_wotrackingremark-input').val()).trim(),//\n 'WOID': $scope.selectedWOIDData['woid'],//\n 'ProcOpSeq': $scope.ProcOpSeq,//\n 'WorkCenter': $scope.WorkCenter//\n\n })\n );\n\n $q.all(promiseArray3).then(function (response) {\n console.log(\"setupResumeCase10 productionResumeCase10_3\", response);\n fnUpdateOperator(\"ProcessingStart\",3);//multiple operator\n promiseArray4.push(\n $http.post(config.baseUrlApi + 'HMLVTS/productionResumeCase10_4', {\n 'WOID': $scope.selectedWOIDData['woid'],//\n 'ProcOpSeq': $scope.ProcOpSeq,//\n 'ExStatus': 7,\n 'UpdatedDate': currentdate,\n 'OperatorID': String(authService.currentUser.userName).trim(),//\n 'OperatorName': String($scope.OperatorName).trim(),//\n 'reason': ''\n })\n );\n $q.all(promiseArray4).then(function (response) {\n console.log(\"setupResumeCase10 productionResumeCase10_4\", response);\n CheckWOOpnStatus();\n });\n\n\n });\n\n });\n });\n\n\n\n\n\n //$q.all(promiseArray1).then(function (response) {\n // console.log(\"productionResumeCase10_1\", response);\n // $q.all(promiseArray2).then(function (response) {\n // console.log(\"productionResumeCase10_2\", response);\n // $q.all(promiseArray3).then(function (response) {\n // console.log(\"productionResumeCase10_3\", response);\n // $q.all(promiseArray4).then(function (response) {\n // console.log(\"productionResumeCase10_4\", response);\n // reload();\n // });\n // });\n // });\n //});\n\n\n\n }", "function myHttpInterceptor($q, $rootScope) {\n var loadingCount = 0;\n return {\n request: function (config) {\n if(++loadingCount === 1) $rootScope.$broadcast('loading:progress');\n return config || $q.when(config);\n },\n\n response: function (response) {\n if(--loadingCount === 0) $rootScope.$broadcast('loading:finish');\n return response || $q.when(response);\n },\n\n responseError: function (response) {\n if(--loadingCount === 0) $rootScope.$broadcast('loading:finish');\n return $q.reject(response);\n }\n };\n\n }", "sendRequest(options,data) {\n\n return new Promise((resolve,reject) =>\n {\n let req = http.request(options, res => {\n // console.log(`statusCode: ${res.statusCode}`)\n res.on('data', d => {\n d = d.toString('utf8');\n resolve(d)\n })\n })\n \n req.on('error', error => {\n console.log(error)\n console.log(\"Another player did not connect within 3 minutes, or the server is no longer available\")\n \n if (this.connected) {\n this.closeRequest().then((response =>{\n console.log(response)\n process.exit()\n }))\n }\n else {\n process.exit()\n }\n \n \n \n })\n \n if (data !== undefined) {\n // console.log(\"data wrote\")\n req.write(data)\n }\n \n req.end()\n });\n \n }", "performPRTGAPIRequest(method, params) {\n var queryString = 'username=' + this.username + '&passhash=' + this.passhash + '&' + params;\n var options = {\n method: 'GET',\n url: this.url + '/' + method + '?' + queryString\n };\n \n if (this.inCache(options.url)) {\n return this.getCache(options.url);\n } else {\n return this.setCache(options.url, this.backendSrv.datasourceRequest(options)\n .then(response => {\n if (!response.data) {\n return Promise.reject({message: \"Response contained no data\"});\n } \n \n if (response.data.groups) {\n return response.data.groups;\n }\n else if (response.data.devices) {\n return response.data.devices;\n }\n else if (response.data.sensors) {\n return response.data.sensors;\n }\n else if (response.data.channels) {\n return response.data.channels;\n }\n else if (response.data.values) {\n return response.data.values;\n }\n else if (response.data.sensordata) {\n return response.data.sensordata;\n }\n else if (response.data.messages) {\n return response.data.messages;\n }\n else if (response.data.Version) { //status request\n return response.data;\n } else { //All else is XML from table.xml so throw it into the transformer and get JSON back.\n if (response.data == \"Not enough monitoring data\") {\n //Fixes Issue #5 - reject the promise with a message. The message is displayed instead of an uncaught exception.\n return Promise.reject({message: \"<p style=\\\"font-size: 150%; font-weight: bold\\\">Not enough monitoring data.</p><p>Request:<br> &quot;\" + params + \"&quot;</p>\"});\n }\n return new XMLXform(method, response.data);\n }\n }, err => {\n if (err.data.match(/<error>/g)) {\n var regex = /<error>(.*)<\\/error>/g;\n var res = regex.exec(err.data);\n err.message = res[1];\n } else {\n err.message = \"Unknown error: \" + err.data;\n }\n return Promise.reject(err);\n }));\n } \n }", "getAllMessageCtrl(req, res) {\n try {\n // called next method \n let response = {};\n let getallmessageServicePromise=service.getAllMessage();\n getallmessageServicePromise.then(function(data){\n // make response array with it's field \n response.success = true;\n response.message = \"get all message successful\"\n response.content = data;\n // send respose to server \n return res.status(200).send(response)\n }).catch(function(err){\n //make response array with it's field\n response.success = false;\n response.error = err;\n response.message = \"get all message failed\"\n // send respose to server \n return res.status(422).send(response)\n })\n } catch (err) {\n console.log(err);\n }\n }", "function json_call_ajax(method, params, numRets, callback, errorCallback) {\r\n var deferred = $.Deferred();\r\n\r\n if (typeof callback === 'function') {\r\n deferred.done(callback);\r\n }\r\n\r\n if (typeof errorCallback === 'function') {\r\n deferred.fail(errorCallback);\r\n }\r\n\r\n var rpc = {\r\n params : params,\r\n method : method,\r\n version: \"1.1\",\r\n id: String(Math.random()).slice(2),\r\n };\r\n\r\n var beforeSend = null;\r\n var token = (_auth_cb && typeof _auth_cb === 'function') ? _auth_cb()\r\n : (_auth.token ? _auth.token : null);\r\n if (token !== null) {\r\n beforeSend = function (xhr) {\r\n xhr.setRequestHeader(\"Authorization\", token);\r\n }\r\n }\r\n\r\n var xhr = jQuery.ajax({\r\n url: _url,\r\n dataType: \"text\",\r\n type: 'POST',\r\n processData: false,\r\n data: JSON.stringify(rpc),\r\n beforeSend: beforeSend,\r\n success: function (data, status, xhr) {\r\n var result;\r\n try {\r\n var resp = JSON.parse(data);\r\n result = (numRets === 1 ? resp.result[0] : resp.result);\r\n } catch (err) {\r\n deferred.reject({\r\n status: 503,\r\n error: err,\r\n url: _url,\r\n resp: data\r\n });\r\n return;\r\n }\r\n deferred.resolve(result);\r\n },\r\n error: function (xhr, textStatus, errorThrown) {\r\n var error;\r\n if (xhr.responseText) {\r\n try {\r\n var resp = JSON.parse(xhr.responseText);\r\n error = resp.error;\r\n } catch (err) { // Not JSON\r\n error = \"Unknown error - \" + xhr.responseText;\r\n }\r\n } else {\r\n error = \"Unknown Error\";\r\n }\r\n deferred.reject({\r\n status: 500,\r\n error: error\r\n });\r\n }\r\n });\r\n\r\n var promise = deferred.promise();\r\n promise.xhr = xhr;\r\n return Promise.resolve(promise);\r\n }", "function invokeRequest(request, success, error, handler, httpClient, context) {\n\n return httpClient.request(request, function (response) {\n try {\n if (response.headers) {\n normalizeHeaders(response.headers);\n }\n\n if (response.data === undefined && response.statusCode !== 204) {\n handler.read(response, context);\n }\n } catch (err) {\n if (err.request === undefined) {\n err.request = request;\n }\n if (err.response === undefined) {\n err.response = response;\n }\n error(err);\n return;\n }\n // errors in success handler for sync requests result in error handler calls. So here we fix this. \n try {\n success(response.data, response);\n } catch (err) {\n err.bIsSuccessHandlerError = true;\n throw err;\n }\n }, error);\n}", "sendRequest(url, opts) {\n const { axios, tracer, serviceName } = this;\n const { method } = opts;\n\n return new Promise((resolve, reject) => {\n tracer.scoped(() => {\n tracer.setId(tracer.createChildId());\n const traceId = tracer.id;\n\n tracer.recordServiceName(serviceName);\n tracer.recordRpc(method.toUpperCase());\n tracer.recordBinary('http.url', url);\n tracer.recordAnnotation(new Annotation.ClientSend());\n\n const config = Request.addZipkinHeaders(opts, traceId);\n config.url = url;\n axios.request(config)\n .then(result => {\n tracer.scoped(() => {\n tracer.setId(traceId);\n tracer.recordBinary('http.status_code', result.status.toString());\n tracer.recordAnnotation(new Annotation.ClientRecv());\n });\n resolve(result);\n })\n .catch(err => {\n tracer.scoped(() => {\n tracer.setId(traceId);\n tracer.recordBinary('request.error', err.toString());\n tracer.recordAnnotation(new Annotation.ClientRecv());\n });\n reject(err);\n });\n });\n });\n }", "function sendPostRequest( url, data ) {\n if (mockPost) {\n var deferred;\n deferred = $q.defer();\n deferred.resolve({ data: data });\n return deferred.promise;\n } else {\n return $http.post( url, data );\n }\n }", "function RadnikService($http) {\n var service = {};\n\n service.create = create;\n service.get = get;\n service.update = update;\n\n return service;\n \n function create(link, employee) {\n console.log(employee);\n return $http.post('api/users/' + link + '/create/', angular.toJson(employee));\n }\n\n function get(id) {\n return $http.get('api/users/employee/' + id + '/');\n }\n\n function update(id, data) {\n return $http.patch('api/users/employee/update/' + id + '/', angular.toJson(data));\n }\n\n \n}", "ajax(method, url, args){\n\n // Return the promise\n return new Promise((resolve, reject) => {\n\n // Instantiates the XMLHttpRequest\n let client = new XMLHttpRequest();\n let uri = url;\n\n if (args && (method === 'POST' || method === 'PUT')) {\n\n uri += '?';\n let argcount = 0;\n\n for (let key in args) {\n if (args.hasOwnProperty(key)) {\n\n if (argcount++) {\n uri += '&';\n }\n\n uri += encodeURIComponent(key) + '=' + encodeURIComponent(args[key]);\n }\n }\n }\n\n client.open(method, uri);\n client.send();\n\n client.onload = () => {\n if (this.status >= 200 && this.status < 300) {\n // Performs the function \"resolve\" when this.status is equal to 2xx\n resolve(this.response);\n } else {\n // Performs the function \"reject\" when this.status is different than 2xx\n reject(this.statusText);\n }\n };\n\n client.onerror = () => {\n reject(this.statusText);\n };\n\n });\n\n }", "function PluppRequest(service, data) {\n\tvar self = this; // keep reference to this object to be used independent of call context\n\tthis.reply = null; // complete JSON reply returned by request on success\n\tthis.root = \"api.php\";\n\tthis.service = service;\n\tthis.data = data;\n\tthis.status = null; // null equals not completed, true if completed successfully and false if completed with errors\n\n\tthis.onSuccess = function(reply) {\n\t\tself.reply = reply;\n\t\tif (self.reply.request != true) {\n\t\t\tself.status = false;\n\t\t\tconsole.log(\"Request error: \" + JSON.stringify(self.reply.error));\n\t\t}\n\t\telse {\n\t\t\tself.status = true;\n\t\t}\n\t}\n\n\tthis.onError = function(error) {\n\t\tself.status = false;\n\t}\n\n\t// run the request, return deferred object\n\tthis.run = function() {\n\t\tvar jqxhr;\n\t\tif (typeof(self.data) === 'undefined') {\n\t\t\tjqxhr = $.get(\"api.php/\" + self.service);\n\t\t}\n\t\telse {\n\t\t\tjqxhr = $.post(\"api.php/\" + self.service, self.data);\n\t\t}\n\n\t\tjqxhr.done(self.onSuccess)\n\t\t\t .fail(self.onError);\n\n\t\treturn jqxhr;\n\t}\t\n}", "function Request(url, method, data, headers, cache) {\n var xhrObject, api, statusCode, dataURI, rawHeaders, responseHeaders, hI, header, key, value;\n\n //defaults\n data = data || null;\n method = method.toUpperCase() || 'GET';\n if(typeof method === 'object') {\n cache = headers;\n headers = data;\n data = method;\n method = 'GET';\n }\n if(typeof data === 'boolean') {\n cache = data;\n data = headers = null;\n }\n if(typeof headers === 'boolean') {\n cache = headers;\n headers = null;\n }\n\n //validate\n if(typeof url !== 'string') { throw new Error('Cannot issue request. The url must be a string.'); }\n if(typeof method !== 'string') { throw new Error('Cannot issue request. The method must be a string.'); }\n if(data && typeof data !== 'string' && typeof data !== 'object') { throw new Error('Cannot issue request. If given the data must be a string or an object.'); }\n if(headers && typeof headers !== 'object') { throw new Error('Cannot issue request. If given the headers must be an object.'); }\n if(typeof cache !== 'undefined' && typeof cache !== 'boolean') { throw new Error('Cannot issue request. The cache flag is set it must be a boolean.'); }\n\n //create an emitter\n api = EventEmitter();\n\n //attach clear\n api.clear = clear;\n\n //if no cache then append the time\n if(!cache) {\n if(url.indexOf('?') > -1) {\n url += '&t=' + Date.now();\n } else {\n url += '?t=' + Date.now();\n }\n }\n\n //create the XHR object\n xhrObject = createXHR() || createActiveXXHR() || (function() { throw new Error('Cannot issue request. Failed to construct XHR object. The host document object model does not support AJAX.') })();\n\n //setup an event handler\n xhrObject.onreadystatechange = function(){\n if(xhrObject.readyState === 4) {\n //find a matching status code\n statusCode = statusCodes[xhrObject.status];\n if(!statusCodes[xhrObject.status]) {\n statusCode = {'name': 'unknown', 'type': 'error' }\n }\n\n //parse the headers\n rawHeaders = xhrObject.getAllResponseHeaders().split('\\n');\n responseHeaders = {};\n for(hI = 0; hI < rawHeaders.length; hI += 1) {\n header = rawHeaders[hI].split(':');\n key = header[0];\n value = header[1];\n if(key && value) {\n responseHeaders[key.trim()] = value.trim();\n }\n }\n\n //trigger the events\n api.trigger([xhrObject.status.toString(), statusCode.name, statusCode.type], xhrObject.responseText, responseHeaders);\n\n //if a server error occurs also fire the error event\n if(statusCode.type === 'servererror') {\n api.trigger('error', xhrObject.responseText, responseHeaders);\n }\n\n //fire the status event\n api.trigger('status', xhrObject.status, statusCode.name, statusCode.type);\n }\n };\n\n //send the request\n try {\n\n //POST\n if(method === 'POST') {\n xhrObject.open(method, url, true);\n\n if(typeof data === 'object') {\n try {\n data = JSON.stringify(data);\n } catch(e) {\n throw new Error('Failed to convert data into JSON.');\n }\n dataURI = 'data=' + encodeURIComponent(data);\n } else if(typeof data === 'string') {\n dataURI = encodeURIComponent(data);\n }\n\n setHeaders();\n xhrObject.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\n xhrObject.send(dataURI);\n }\n\n //PUT\n else if(method === 'PUT') {\n\n xhrObject.open(method, url, true);\n\n if(typeof data === 'object') {\n\n data = JSON.stringify(data);\n setHeaders();\n xhrObject.setRequestHeader(\"Content-type\", \"application/json\");\n\n } else {\n xhrObject.setRequestHeader(\"Content-type\", \"text/plain\");\n setHeaders();\n }\n\n xhrObject.send(data);\n\n } else if(method === 'GET') {\n\n if(typeof data === 'object') { data = JSON.stringify(data); }\n\n if(data !== 'null') {\n dataURI = '?data=' + encodeURIComponent(data);\n } else {\n dataURI = '';\n }\n\n xhrObject.open(method, url + dataURI, true);\n setHeaders();\n xhrObject.send();\n\n } else {\n xhrObject.open(method, url, true);\n setHeaders();\n xhrObject.send();\n }\n\n } catch(err) {\n api.trigger('failed', err);\n }\n\n return api;\n\n /**\n * Creates an XHR\n */\n function createXHR() {\n try {\n return new XMLHttpRequest();\n } catch(e) {}\n\n return false;\n }\n\n /**\n * Creates an ActiveX XHR\n */\n function createActiveXXHR() {\n try {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch(e) {}\n\n return false;\n }\n\n\n function setHeaders() {\n var key;\n\n if(headers) {\n for(key in headers) {\n if(!headers.hasOwnProperty(key)) { continue; }\n xhrObject.setRequestHeader(key, headers[key]);\n }\n }\n }\n\n function clear() {\n xhrObject.onreadystatechange = function(){};\n\n return true;\n }\n }" ]
[ "0.6736197", "0.66600055", "0.6587212", "0.65860957", "0.6478822", "0.6451742", "0.6240921", "0.6240921", "0.6129252", "0.61199594", "0.6053019", "0.60494494", "0.6043353", "0.6043353", "0.6043353", "0.6043353", "0.6043353", "0.6005646", "0.5918464", "0.59064585", "0.5866175", "0.5860862", "0.58344114", "0.5834251", "0.5816783", "0.5777947", "0.5768919", "0.5727997", "0.57171166", "0.57124573", "0.57124573", "0.570113", "0.5646055", "0.56307316", "0.5625579", "0.56197655", "0.5604098", "0.55997014", "0.559793", "0.5594003", "0.55638814", "0.5563231", "0.5563231", "0.5559976", "0.55481035", "0.55403453", "0.5536936", "0.55353075", "0.5518485", "0.55135274", "0.5511868", "0.5507384", "0.55002093", "0.5496118", "0.5494629", "0.54907584", "0.5485385", "0.5480629", "0.5479403", "0.54763985", "0.5474767", "0.54669154", "0.54639953", "0.5445263", "0.54361266", "0.54349136", "0.54287064", "0.5425221", "0.54098", "0.5395197", "0.53924644", "0.53924644", "0.53924644", "0.53924644", "0.53924644", "0.53877586", "0.5383417", "0.53752875", "0.5375283", "0.5368217", "0.5366297", "0.5365338", "0.5363279", "0.5355387", "0.53540313", "0.5350432", "0.53422767", "0.53346187", "0.533254", "0.53281474", "0.5327803", "0.53204906", "0.53193814", "0.5317297", "0.5317077", "0.5312585", "0.53066313", "0.5303804", "0.5302435", "0.5300288" ]
0.73862135
0
Description: this will read items form array and append the div into number screen for each number in list
function screenView(){ boardItems.forEach((item, index) =>{ // this will add the items to web screen view $("#number-screen").append(`<div class="col-md-4"> <div class="card screen-card" style="background-color:`+ colors[index]+`">`+ item +`</div> </div>`); // this will add the items to mobile screen view $("#number-screen-mobile").append(`<div class="col-md-4"> <div class="card board-mobile-card" style="border-left: 10px solid `+ colors[index]+`">`+ item +`</div> </div>`); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readDisplay() {\n // delete all arr item\n while (theFullDisplay.length > 0) {\n theFullDisplay.pop();\n }\n for (let i = 0; i < dispSize; i++) {\n theFullDisplay.push(\n document.querySelectorAll(\".digit.pos\" + (i + 1) + \" .segment\")\n );\n }\n}", "function showItems(arr) {\r\n document.write('your to list has :\\n');\r\n for (let i = 0; i < arr.length; i++) {\r\n document.write(`${arr[i]} \\n`);\r\n }\r\n}", "generateItems() {\r\n const itemCount = slider.value;\r\n let colors = this.generateColors(itemCount);\r\n while (screenDiv.firstChild) {\r\n screenDiv.removeChild(screenDiv.lastChild);\r\n }\r\n for (let i = 0; i < itemCount; i++) {\r\n let div = document.createElement(\"div\");\r\n div.classList.add(\"item\");\r\n div.style.backgroundColor = colors[i];\r\n this.items.push(new Color(div, i, colors[i]));\r\n }\r\n }", "showItems() {\r\n this.generateItems();\r\n this.shuffleItems();\r\n this.items.forEach((item) => {\r\n screenDiv.appendChild(item.div);\r\n });\r\n }", "function render() {\n myLibrary.forEach(function(e, i){\n var li = document.createElement(\"li\");\n li.classList.add(\"row\");\n \n ul.appendChild(li);\n\n var div = document.createElement(\"div\");\n li.appendChild(div)\n div.classList.add(\"innercols\")\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.title\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.author\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.pages\n \n var p = document.createElement(\"p\"); \n p.classList.add('read');\n p.classList.add(i); //adds to index of the added book to the innercols div as a class. beginning at 0.\n div.appendChild(p);\n p.innerText = e.read\n\n readClicks();\n })\n}", "function displayItems(items) {\n const contents = document.getElementById('contents');\n const html = items.map(item => createHTMLString(item));\n contents.innerHTML = items.map(item => createHTMLString(item)).join('');\n}", "function displayItems(items) {\r\n const container=document.querySelector('.items');\r\n container.innerHTML=items.map(item=>createHTMLString(item)).join('');\r\n}", "function getItems(){\n var dist=\"Distributor : \" + db.getItem(\"adist\");\n var item=\"Item : \" + db.getItem(\"aitem\");\n var quantity=\"Quantity : \" + db.getItem(\"aquantity\");\n var amount=\"Amount : \" + db.getItem(\"aamount\");\n var ordered=\"Ordered? : \" + db.getItem(\"aordered\");\n var orderdate=\"Order Date : \" + db.getItem(\"aorderdate\");\n var note=\"Notes : \" + db.getItem(\"anote\");\n \n var viewItems = [\n dist,\n item,\n quantity,\n amount,\n ordered,\n orderdate,\n note\n ];\n \n // hide div:main show div:clear //\n document.getElementById(\"main\").style.display = \"none\";\n document.getElementById(\"clear\").style.display = \"block\";\n // depending on what distributor - show image //\n var dist2= db.getItem(\"adist\"); \n if (dist2==\"BestMeats\") {\n document.getElementById(\"distpic1\").style.display =\"block\";\n }else if (dist2==\"USFoods\") {\n document.getElementById(\"distpic2\").style.display =\"block\";\n }else if (dist2==\"Condiments\") {\n document.getElementById(\"distpic3\").style.display =\"block\";\n }\n // list item info //\n var getMyList = document.getElementById(\"list\");\n for (var i=0, j=viewItems.length; i<j; i++){\n var newP = document.createElement(\"p\");\n var itemTxt = document.createTextNode(viewItems[i]);\n newP.appendChild(itemTxt);\n getMyList.appendChild(newP);\n }\n //alert(viewItems);\n \n}", "function displayList(arr) {\n\tvar i;\n\tvar out = '';\n\t\n\tfor (i = 0; i < arr.length; i++) {\n\t\tout += \n\t\t'<div class=\"activity-item container\">' + \n\t\t\t'<div ng-app=\"croppy\"><img src=\"' + arr[i].image + '\" width=\"70\" height=\"70\" alt=\"thumbnail\"></div>' + \n\t\t\t'<h2>' + arr[i].name + '</h2>' + \n\t\t\t'<em>' + arr[i].date + '</em>' + \n\t\t\t'<a href=\"#\" onclick=\"toggle(\\'' + arr[i].id + '\\')\" class=\"activity-item-toggle\" style=\"font-size:18px;\">+</a>' + \n\t\t\t'<div id=\"selected' + arr[i].id + '\" class=\"activity-item-detail\">' + \n\t\t\t\t'<table style=\"width:100%\">' + \n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"viewImage(\\'' + arr[i].image + '\\')\"><i class=\"fa fa-picture-o\"></i> View image</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"sync(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-refresh\"></i> Sync</a></td>' + \n\t\t\t\t\t'</tr>' + \n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"drawing(\\'' + arr[i].image + '\\', \\'' + arr[i].id + '\\')\"><i class=\"fa fa-pencil\"></i> Create drawing</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"removePatient(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-trash\"></i> Delete</a></td>' + \n\t\t\t\t\t'</tr>' +\n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"drawingsScores(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-bar-chart\"></i> View drawings and scores</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\"><i class=\"fa fa-times\"></i> Close</a></td>' + \n\t\t\t\t\t'</tr>' + \n\t\t\t\t'</table>' + \n\t\t\t'</div>' + \n\t\t'</div>' + \n\t\t'<div class=\"border\"></div>';\n\t}\n\t\n\tdocument.getElementById(\"list\").innerHTML = out;\n}", "function build_list(arr) {\n\t\t\titems.each(function () {\n\t\t\t\t$(this).detach();\n\t\t\t});\n\t\t\tvar len = arr.length;\n\t\t\tfor (var x = 0; x < len; x++) {\n\t\t\t\tcontainer.append(arr[x]);\n\t\t\t}\n\t\t}", "function generateNumberList(){\n \n const $numberItem= document.createElement('div')\n $numberItem.classList.add('numbersEntered')\n \n $numberItem.setAttribute('data-id', (numEntered.length-1).toString())\n $numberItem.innerHTML= `<h2>${$EL_entry.value}</h2> <button class=\"buttonMod\">Mod</button> <button class=\"buttonDel\">Elim</button> `\n $EL_numsEntered.firstElementChild.appendChild($numberItem)\n const item =getItemsSameID($numberItem)\n deleteEvent(item[0], item[1], $numberItem.getAttribute('data-id'), $numberItem)\n modEvent(item[0], item[2], $numberItem.getAttribute('data-id'), $numberItem)\n\n}", "function render(arr) {\n\tvar todoItems = '';\n\n\tdocument.querySelector('.txtArea').innerHTML = '';\n\tfor (var i = 0; i < arr.length; i++) {\n\t\n\ttodoItems = (todoItems + arr[i].toString() + '<br>'); \n\t}\n\tdocument.querySelector('.txtArea').innerHTML = todoItems; \n}", "function loadAscNum() {\n var inputArray = activeArray[enlarged].input.split(\"\");\n for (var i = 1; i <= 4; i++) {\n $('#numberSection' + i).html(activeArray[enlarged].data[i - 1].value);\n $('#numberSection' + i).css('visibility', 'visible');\n }\n for(var value in inputArray){\n $('#numberSection' + inputArray[value]).css('visibility', 'hidden');\n }\n}", "function displayData(allData) {\n const data = allData.data\n console.log(data)\n let list =[]\n //put 10 data as object into list-----------------------\n for (let i = 0; i < 10; i++) {\n const item = {\n title: data[i].title,\n albumTitle: data[i].album.title,\n albumImage: data[i].album.cover_small,\n artistName: data[i].artist.name,\n artistPicture: data[i].artist.picture_small,\n albumDuration: data[i].duration, \n }\n list.push(item)\n console.log(list) \n }\n//*********** showing output result as html into displayResults area***************\n let displayResults = document.getElementById(\"output\")\n displayResults.innerHTML = \"\"\n displayResults.style.display = 'block'\n for (let i = 0; i < list.length; i++) {\n let {title, albumTitle, albumImage, artistName, artistPicture, albumDuration} = list[i];\n \n displayResults.innerHTML += \n `<div class=\"single-result row align-items-center my-3 p-3\">\n <div class=\"col-md-6\">\n <h3 class=\"lyrics-name mb-3\">${title}</h3>\n <p class=\"author lead\">Artist: <span style=\"font-weight:600\">${artistName}</span></p>\n <p style=\"margin-top: -15px;\" class=\"author lead\">Album: <span style=\"font-weight:600\">${albumTitle}</span></p>\n <p style=\"margin-top: -15px;\" class=\"author lead\">Album duration: <span style=\"font-weight:600\">${albumDuration}</span></p>\n </div>\n <div class=\"col-md-3\">\n <img src=\"${albumImage}\" class=\"img-fluid rounded-circle\">\n <img src=\"${artistPicture}\" class=\"img-fluid rounded-circle\">\n </div>\n <div class=\"col-md-3 text-md-right text-center\">\n <button onclick=\"getLyrics('${title}', '${artistName}', '${albumImage}', '${artistPicture}')\" class=\"btn btn-success\">Get Lyrics</button>\n </div>\n </div>`\n }\n}", "function createItems() {\n for (var i = 0; i <= 5; i++) {\n gridWrapper.append('<div class=\"gallery_mars__item___hide\"></div>');\n }\n }", "function displayLibrary(array) {\n // loop through myLibrary array and displays on page\n for (let i = 0; i < array.length; i++) {\n //create and append elements\n const bookDiv = document.createElement(\"div\");\n bookDiv.className = \"bookCard\";\n bookHolder.appendChild(bookDiv);\n const title = document.createElement(\"div\");\n title.className = 'title';\n bookDiv.appendChild(title);\n title.textContent = `Title: ${array[i].title}`;\n const author = document.createElement(\"div\");\n author.className = 'author';\n bookDiv.appendChild(author);\n author.textContent = `Author: ${array[i].author}`;\n const pageCount = document.createElement(\"div\");\n pageCount.className = 'pageCount';\n bookDiv.appendChild(pageCount);\n pageCount.textContent = `Page Count: ${array[i].pages}`;\n const read = document.createElement(\"button\");\n read.className = 'read';\n bookDiv.appendChild(read);\n read.textContent = 'Read?';\n const remove = document.createElement(\"button\");\n remove.className = 'remove';\n bookDiv.appendChild(remove);\n remove.textContent = 'Remove';\n }\n}", "appendHtml() {\n this.wrapper.innerHTML = '';\n this.totalDigits = etapas.reduce((acc, { numeros }) => {\n return [...acc, numeros];\n }, []);\n\n for (let index = 0; index < this.totalDigits[this.currentStage]; index++) {\n const divElement = this.createDigit();\n this.wrapper.appendChild(divElement);\n this.activeDigits();\n }\n }", "function renderToPage(){\n var targetDisplayParent = document.getElementById('choices'); \n var newDisplayContent = findThreeUniq();\n \n for(var i = 0; i <= 2; i++){\n var newDisplayEl = document.createElement('img');\n var newLi = document.createElement('li');\n newDisplayEl.src = newDisplayContent[i].imageUrl;\n newDisplayEl.id = newDisplayContent[i].product;\n newLi.appendChild(newDisplayEl);\n newDisplayContent[i].views ++;\n targetDisplayParent.appendChild(newLi);\n \n } \n}", "function listAllItems(vendingInventory) {\n $(\"#itemAreaMainDiv\").empty();\n var rowLetters = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\"];\n var row_header = \"<div class='row text-center'>\";\n var colDiv = \"<div class='col-sm-4 item-container'>\";\n\n\n var numItems = vendingInventory.length;\n var numRows = 0;\n\n if (numItems % 3 === 0) {\n numRows = numItems / 3;\n } else {\n numRows = (numItems - numItems % 3) / 3 + 1;\n }\n\n var itemList = [];\n var letterIndex = 0;\n var numIndex = 0;\n\n\n // Go through the returned item list and build a list of element objects.\n // Each object contains the complete HTML for one item\n $.each(vendingInventory, function (index, item) {\n\n numIndex += 1;\n if (index % 3 === 0 && index > 0) {\n letterIndex += 1;\n numIndex = 1;\n }\n\n var itemDisplayId = rowLetters[letterIndex] + numIndex;\n\n\n itemList[index] =\n \"<a class = 'itemBox'>\" +\n \"<div class='item rounded'>\" +\n \"<div class='itemInner'>\" +\n \"<div class='itemDisplayNumber' id='\" + itemDisplayId + \"'>\" + itemDisplayId + \"</div>\" +\n \"<div class='itemName'>\" + item.name + \"</div>\" +\n \"<div class='itemPrice'>$\" + item.price.toFixed(2) + \"</div>\" +\n \"<div class='itemQuantity'>Remaining: \" + item.quantity + \"</div>\" +\n \"<div class='itemNumber' id='\" + item.id + \"'>\" + item.id + \"</div>\" +\n \"</div></div></a>\";\n });\n\n // Blank place holder to be used if there are no more items\n var blankSpace = \"<a class = 'itemBox'>\" +\n \"<div class='item rounded'>\" +\n \"<div class='itemInner'>\" +\n \"<div class='itemDisplayNumber'>&nbsp</div>\" +\n \"<div class='itemName'>< No Item ></div>\" +\n \"<div class='itemPrice'>&nbsp</div>\" +\n \"<div class='itemQuantity'>&nbsp</div>\" +\n \"<div class='itemNumber' id='-1'>&nbsp</div>\" +\n \"</div></div></a>\";\n\n\n // Go through the list of items and construct each row by taking them 3 at a time.\n var index = 0;\n for (var j = 0; j < numRows; j++) {\n var rowContent = row_header;\n for (var i = 0; i < 3; i++) {\n // build the item\n\n if (index > itemList.length){\n rowContent += colDiv + blankSpace + \"</div>\";\n } else {\n rowContent += colDiv + itemList[index] + \"</div>\";\n }\n\n index += 1;\n }\n rowContent += \"</div>\";\n\n // Finally, post the items to the main item grid\n $(\"#itemAreaMainDiv\").append(rowContent);\n }\n\n\n $(\"#itemAreaMainDiv\").append(\"<div style='text-align: left; color: #e7e8ea; font-size: 12px;\" +\n \"margin-bottom: -10px; margin-left: -5px;'>\" +\n \"Danimae Janssen - 2017</div>\");\n\n\n // Listen for item clicks so they can be loaded\n $(\".itemBox\").on(\"click\", function () {\n var itemId = $(this).find('div.itemNumber').attr('id');\n var displayId = $(this).find('div.itemDisplayNumber').attr('id');\n\n loadItem(itemId, displayId);\n });\n\n\n}", "function mdpp2ListDiv(input_content) {\n variable_manager.clearVariables();\n var ListDiv = [];\n [preprocessed_content, parse_result, ListMdppObject] = html_preprocessing(input_content);\n for (var i = 0; i < ListMdppObject.length; i++) {\n switch (ListMdppObject[i].property) {\n case \"markdown_input\": {\n var html_results = markdown.toHTML(ListMdppObject[i].data);\n ListDiv.push(html_results);\n break;\n }\n case \"html\": {\n ListDiv.push(ListMdppObject[i].data);\n break;\n }\n case \"u2b\": {\n ListDiv.push(ListMdppObject[i].data);\n break;\n }\n case \"pdf\": {\n var pdf_content = \"<embed src= \\\"\";\n pdf_content += ListMdppObject[i].data;\n pdf_content += \"\\\" width= \\\"100%\\\" height=\\\"400\\\">\";\n ListDiv.push(pdf_content);\n break;\n }\n case \"ref\": {\n ListDiv.push(ListMdppObject[i].data);\n break;\n }\n case \"list\": {\n ListDiv.push(ListMdppObject[i].data);\n break;\n }\n case \"list_ref\": {\n ListDiv.push(\"\");\n break;\n }\n case \"menu\": {\n ListDiv.push(ListMdppObject[i].data);\n break;\n }\n case \"ls\": {\n //console.log(ListMdppObject[i].data);\n\n var ls_content = \"[system message] syntax: ls [type] : show all resources with specific type.<br/>\"\n ls_content += \"loading...<br/>\"\n ls_content += ListMdppObject[i].data;\n ls_content += \"<br/>\"\n ListDiv.push(ls_content);\n break;\n }\n case \"ls_export\": {\n //console.log(ListMdppObject[i].data);\n ListDiv.push(\"\");\n break;\n }\n case \"mp3\": {\n //console.log('image');\n //var image_content = \"<img src=\\\"https://drive.google.com/uc?export=view&id=\";\n\n //var mp3_content = \"<audio controls><source src=\\\"https://drive.google.com/uc?export=view&id=\";\n var mp3_content = \"<audio controls><source src=\\\"\";\n //var tmp_length_array = ListMdppObject[i].data.split(\"=\").length;\n mp3_content += ListMdppObject[i].data;\n mp3_content += \"\\\" type=\\\"audio/ogg\\\">\";\n mp3_content += \"</audio>\"\n //mp3_content += \"<audio controls><source src=\\\"https://drive.google.com/uc?export=view&id=\";\n var mp3_content = \"<audio controls><source src=\\\"\";\n var tmp_length_array = ListMdppObject[i].data.split(\"=\").length;\n //mp3_content += ListMdppObject[i].data.split(\"=\")[tmp_length_array - 1];\n mp3_content += ListMdppObject[i].data;\n mp3_content += \"\\\" type=\\\"audio/mpeg\\\">\";\n mp3_content += \"</audio>\"\n ListDiv.push(mp3_content);\n break;\n }\n case \"image\": {\n //console.log('image');\n //var image_content = \"<img src=\\\"https://drive.google.com/uc?export=view&id=\";\n\n var image_content = \"<img class=\\\"rotation\\\" src=\\\"https://drive.google.com/uc?export=view&id=\";\n var tmp_length_array = ListMdppObject[i].data.split(\"=\").length;\n image_content += ListMdppObject[i].data.split(\"=\")[tmp_length_array - 1];\n image_content += \"\\\">\";\n ListDiv.push(image_content);\n break;\n }\n case \"image_rotation\": {\n console.log(ListMdppObject[i].data);\n //var image_content = \"<img src=\\\"https://drive.google.com/uc?export=view&id=\";\n var rotation_degrees = ListMdppObject[i].data.split(' ')[1];\n var image_content = \"<img class=\\\"rotation\" + rotation_degrees + \"\\\" src=\\\"https://drive.google.com/uc?export=view&id=\";\n var tmp_length_array = ListMdppObject[i].data.split(' ')[0].split(\"=\").length;\n image_content += ListMdppObject[i].data.split(' ')[0].split(\"=\")[tmp_length_array - 1];\n image_content += \"\\\">\";\n\n //console.log(rotation_degrees);\n //console.log(image_content);\n ListDiv.push(image_content);\n break;\n }\n case \"flowchart\": {\n var tmp = ListMdppObject[i].data;\n var diagram = flowchart.parse(tmp);\n $('#diagram').html('');\n //diagram.drawSVG('diagram');\n\n ListDiv.push($('#diagram').html());\n break;\n }\n case \"plot\": {\n var plot_content = \"\";\n plot_content += \"@plot\\n\"\n plot_content += ListMdppObject[i].data;\n ListDiv.push(plot_content);\n break;\n }\n case \"set\": {\n var set_content = \"\";\n set_content += \"@set\\n\"\n set_content += ListMdppObject[i].data;\n ListDiv.push(set_content);\n break;\n }\n case \"jog\": {\n var jog_content = \"\";\n jog_content += \"@jog\\n\"\n jog_content += ListMdppObject[i].data;\n ListDiv.push(jog_content);\n break;\n }\n case \"print\": {\n var print_content = \"\";\n print_content += \"@print\\n\"\n print_content += ListMdppObject[i].data;\n ListDiv.push(print_content);\n break;\n }\n case \"whos\": {\n var whos_content = \"\";\n whos_content += \"@whos\\n\"\n whos_content += ListMdppObject[i].data;\n ListDiv.push(whos_content);\n break;\n }\n case \"ui_slidebar\": {\n var ui_slidebar_content = \"\";\n ui_slidebar_content += \"@ui_slidebar\\n\"\n ui_slidebar_content += ListMdppObject[i].data;\n ListDiv.push(ui_slidebar_content);\n break;\n }\n case \"marked\": {\n var marked_content = \"\";\n //marked_content+= ListMdppObject[i].data;\n ListDiv.push(marked_content);\n break;\n }\n }\n }\n return [ListMdppObject, ListDiv];\n\n}", "function renderContent(array) {\n cards.innerHTML = array.map(function (number) {\n return `<span class=\"card card-${number}\">${number}</span>`;\n }).join(\"\");\n}", "function displayAllBooks() {\r\n myLibrary.forEach(item => {\r\n let bookContainer = document.createElement(\"div\");\r\n bookContainer.classList.add(\"book-container\");\r\n let infoContainer = document.createElement(\"div\");\r\n infoContainer.classList.add(\"info-container\");\r\n //Adding the info text\r\n infoContainer.innerHTML = bookInfo(item);\r\n //Appending the elements to their parents\r\n bookContainer.appendChild(infoContainer);\r\n container.appendChild(bookContainer);\r\n })\r\n}", "function ShowItems() {\n for (let book of Books) {\n makeBookItem(book).appendTo(\"#AllBooks\");\n }\n }", "function DisplayList(items, wrapper, rows_per_page, page) {\n\t// this function displays the list per page.\n\t// i'll explain line by line\n\n\t// the wrapper.innerHTML = \"\" is meant to create\n\t// a an empty html section which well use later\n\twrapper.innerHTML = \"\";\n\n\t// pages are displayed by index so we need the index of each page\n\t// so we substruct one from the current page\n\t// meaning if you are on page 1, index will be 0\n\t// page 2 index is 1.\n\tpage--;\n\n\t// now when we start the loop, we have to get index of all Items\n\t// the start variable below defines where we start the loop from\n\t// and the end variable ends it\n\t// for eg if row_per_page is 5 and pageIndex is 0, our start variable will be 0\n\t// then end will be 0+5 which is 5\n\tlet start = rows_per_page * page;\n\tlet end = start + rows_per_page;\n\t// so the paginated items are the items that will be shown on each page\n\t// we use slice to return items in a certain range of index\n\t// so with the eg above where start=0 and end=5, we have items.slice(0,5)\n\t// which will return items with index 0-4 without the one with index 5\n\t// i'm scrolling up to explain\n\tlet paginatedItems = items.slice(start, end);\n\t// now that we have the items per page, we loop through them to display in the list div\n\n\tfor (let i = 0; i < paginatedItems.length; i++) {\n\t\t// i'll log this in the console for you to see\n\t\t// console.log(paginatedItems[i])\n\t\t// the items are listed in the console below\n\t\t// i'll change the page and number of items for you to see\n\t\t// we can make these changes in only one place\n\n\t\t// now we store the item as we go through the loop\n\t\tlet item = paginatedItems[i];\n\n\t\t// create a div for the item with a class item\n\t\tlet item_element = document.createElement('div');\n\t\titem_element.classList.add('item');\n\t\t// then we put in what ever text we want (in this case the strigs in the list_items array)\n\t\t// if its a bigger project with html tags, well have to do more than just put in strings\n\t\titem_element.innerText = item;\n\n\t\t// after creating every div, we append to the last div in the wrapper\n\t\t/**\n\t\t * like so\n\t\t * <wrapper>\n\t\t * \t<div class=\"item\">\n\t\t * \t\titem 1 \n\t\t * </div>\n\t\t * <div class=\"item\">\n\t\t * \t\titem 2\n\t\t * </div>\n\t\t * </wrapper>\n\t\t */\n\t\twrapper.appendChild(item_element);\n\t}\n}", "function getMultipleNumbers(favNumbers = [1,5,9], listEl) {\n let listOfResponses = []\n let response = axios.get(`${url}/${favNumbers}?json`)\n response.then(\n res => {\n for (const [key, value] of Object.entries(res.data)) {\n listOfResponses.push(generateHTML(value))\n listEl.innerHTML = listOfResponses.join('\\n\\n')\n }\n }\n )\n \n}", "function showArray() {\n showFancyArray2();\n document\n .querySelector('#myList')\n .innerHTML =\n '[' + myArray.join(', ') + ']';\n //saving array to div\n}", "function showItemNumbers() {\n let storedObjects = JSON.parse(localStorage.getItem(\"todos\"));\n let allItemNumber = 0;\n let importantItemNumber = 0;\n let semiimportantItemNumber = 0;\n let notimportantItemNumber = 0;\n\n if (storedObjects) {\n allItemNumber = storedObjects[\"datas\"].length;\n for (let important in storedObjects[\"importance\"]) {\n if (storedObjects[\"importance\"][important] === \"Important\") {\n importantItemNumber++;\n } else if (\n storedObjects[\"importance\"][important] === \"Semi-Important\"\n ) {\n semiimportantItemNumber++;\n } else {\n notimportantItemNumber++;\n }\n }\n }\n\n let allItemNumbersHTML = `<button class=\"btn number-btn\">${allItemNumber}</button>`;\n let importantNumbersHTML = `<button class=\"btn number-btn\">${importantItemNumber}</button>`;\n let semiimportantNumbersHTML = `<button class=\"btn number-btn\">${semiimportantItemNumber}</button>`;\n let notimportantNumbersHTML = `<button class=\"btn number-btn\">${notimportantItemNumber}</button>`;\n\n $(allItemNumbersHTML).appendTo($(\"#all-items\"));\n $(importantNumbersHTML).appendTo($(\"#important-items\"));\n $(semiimportantNumbersHTML).appendTo($(\"#semi-inportant-items\"));\n $(notimportantNumbersHTML).appendTo($(\"#not-important-items\"));\n }", "function fill_list(arr) {\r\n var o = \"\";\r\n var i;\r\n for(i = 0; i < arr.length; i++) {\r\n // open new divider (change css in styles if needed)\r\n o += '<div class=\"ak_card\">';\r\n // set image\r\n o += '<a href=\"' + arr[i].url_king + '\"><img src=\"' + arr[i].thumbnail + '\" alt=\"' + arr[i].name + ' Logo\"></a>';\r\n // name and url\r\n o += '<div><a class=\"ad_title\" href=\"' + arr[i].url_king + '\">' + arr[i].name + '</a>';\r\n // value of the airdrop or TBA (automatically)\r\n o += '<span class=\"value\">' + money_icon + '$' + arr[i].value + '</span>'\r\n // load rating if available (-1 == not rated yet)\r\n if (arr[i].like_ratio >= 0) {\r\n o += '<span class=\"rating\">' + icon_thumbsup + ' ' + arr[i].like_ratio + '%</span>';\r\n }\r\n // days left absoulte position\r\n o += '<span class=\"days_left\">' + arr[i].days_left + ' days left</span>';\r\n o += '</div></div>';\r\n }\r\n // Powered by Airdrop King API - we would appreciate if you would not remove this. Thanks :)\r\n o += '';\r\n\r\n// finally write all serialized and fetched data into the div with the id=airdropKingList\r\n// If you change this id you also have to change the one from your divider\r\ndocument.getElementById(\"airdropKingList\").innerHTML = o;\r\n}", "function onBoardList(item) {\n const container = document.querySelector('.myList');\n\n if(added.length > 5){\n document.querySelector('.myList').style.overflowY= \"scroll\";\n }\n\n container.innerHTML =\n item.map(item => createList(item));\n}", "function generateList(array,ID,x){\n $(`#${ID}`).append('<h4>Ingredient List: </h4>')\n for (let x = 0; x<array.length;x++)\n {\n $(`#${ID}`).append(\n `<li>${array[x]}</li>`\n )\n }\n}", "function renderAll(listsArray){\n $(\"#packing-list\").html(\" \");\n var end = listsArray.length - 1;\n var lastUL = \"#packing\"+end;\n for (var i = 0; i < listsArray.length; i++) {\n $('#packing-list').append(\"<div class = 'span1 packing-list'><ul id = 'packing\" + i+\"'></ul></div>\");\n listsArray[i].render($('#packing'+ i));\n }\n $(lastUL).append(modalPrintButton);\n}", "function itemsCount() {\n $(\"#itemsShow\").html(items);\n }", "function updateUL() {\n clearUL();\n for(let i = 0; i < numbers.length; i++) {\n addToUL(numbers[i]);\n }\n}", "function updatelist(profile_display) {\r\n \tdocument.getElementById(\"item01\").innerHTML = profile_display[0];\r\n\tdocument.getElementById(\"item02\").innerHTML = profile_display[1];\r\n\tdocument.getElementById(\"item03\").innerHTML = profile_display[2];\r\n\tdocument.getElementById(\"item04\").innerHTML = profile_display[3];\r\n\tdocument.getElementById(\"item05\").innerHTML = profile_display[4];\r\n\tdocument.getElementById(\"item06\").innerHTML = profile_display[5];\r\n\tdocument.getElementById(\"item07\").innerHTML = profile_display[6];\r\n\tdocument.getElementById(\"item08\").innerHTML = profile_display[7];\r\n\tdocument.getElementById(\"item09\").innerHTML = profile_display[8];\r\n\tdocument.getElementById(\"item10\").innerHTML = profile_display[9];\r\n}", "function displayHTML(array){\n for (var i = 0; i < array.length; i++){\n document.getElementById(divID).innerHTML += array[i];\n }\n //Insert CSS class for first streetview\n document.getElementById(divID).firstChild.className += ' current-image';\n initializePage();\n }", "function addGeneratedItemsToList() {\n var array = [],\n mold = '';\n\n for (var i = 1; i <= 5; i++) {\n array.push('Num: ' + i);\n }\n\n array.forEach(function (val) {\n mold += '<li>' + val + '</li>';\n });\n\n $('#list1').html('<ul>' + mold + '</ul>');\n }", "function displayManga(arr) {\n $('main').append('<h2>Manga</h2>');\n for (index in arr) {\n let thisManga = arr[index];\n $('main').append(\n `\n <div class=\"manga\" id=${thisManga.id}>\n <h3>${thisManga.title}</h3>\n <p>by, ${thisManga.author}</p>\n <p>Published ${thisManga.published}</p>\n <div class=\"updateable\">\n <p>${thisManga.pagesRead}/<span class=\"total-pages\">${thisManga.pages}</span> pages</p>\n <p class=\"rating\">Rating: ${thisManga.rating}</p>\n <button class=\"put\">Update</button>\n <button class=\"del\">Remove from list</button>\n </div>\n </div>\n `\n );\n }\n}", "function appendCards(arr, number = 20) {\n let childs = pdl.children().length;\n\n let len;\n\n if (childs >= arr.length) {\n len = arr.length;\n } else {\n len = childs + number;\n }\n\n for (let i = childs; i < len; i++) {\n const e = arr[i];\n let html = createCard(e);\n pdl.append(html);\n }\n\n if (localStorage['courseUSD']) {\n changeCourse(pdl.children().not(`[data-uah=1]`));\n }\n\n if (childs == arr.length) {\n $(`#showCardsBtn`).hide();\n }\n}", "function createImageList(array, divId)\n{\n \n var listDiv = document.getElementById(divId);\n\n\n for(var i=0; i<array.length; i++)\n { \n var des = document.createTextNode(array[i].catName);\t\t \n var img = document.createElement(\"img\");\n img.src = array[i].imageUrl;\n img.addClass(\"deviceImage\");\n\n var div = document.createElement(\"div\");\n div.addClass(\"draggable\");\n\n div.appendChild(img); \n div.appendChild(des);\n div.id = array[i].catName;\n listDiv.appendChild(div);\n }\n}", "function displayGroceries() {\n\n let listContainer = document.getElementById(\"groceries\");\n\n for(let i = 0; i < groceries.length; i++){\n\n let itemContainer = document.createElement('li');\n itemContainer.setAttribute('id', 'listItem'+ i )\n listContainer.appendChild(itemContainer);\n\n itemContainer.innerText = groceries[i];\n }\n\n}", "function displayDataList(data) {\n let htmlContent = ''\n data.forEach(function (item) {\n htmlContent += `\n <div class=\"col-sm-3\">\n <div class=\"card mb-2\">\n <img class=\"card-img-top \" src=\"${POSTER_URL}${item.image}\" alt=\"Card image cap\">\n <div class=\"card-body movie-item-body\">\n <h6 class=\"card-title\">${item.title}</h6>\n <div class=\"d-flex flex-row flex-wrap\">\n `\n for (let i = 0; i < item.genres.length; i++) {\n htmlContent += `<div class=\"genresIcon\">${genresTypes[item.genres[i]]}</div>`\n }\n htmlContent += `\n </div>\n </div >\n </div >\n </div >\n `\n })\n dataPanel.innerHTML = htmlContent\n }", "function populateEpisodes(arr) {\n const $epList = $('#episodes-list')\n const $epArea = $('#episodes-area')\n $epList.empty()\n \n for (index in arr) {\n let $ep = $('<li>')\n \n $ep.text(`${arr[index].name} (season ${arr[index].season}, number ${arr[index].number})`)\n $epList.append($ep)\n }\n\n $epArea.show()\n\n}", "CreateListElements(dataArray) {\n for(let i = 0; i < dataArray.length; i++) {\n this.m_Output += \"<div class='col'><div><p>\" + dataArray[i].name + \"</p></div></div>\";\n }\n }", "function add_numbers_to_slides() {\n bullet = $('.rsDefault .rsBullet');\n numbers = new Array('01', '02','03','04','05','06','07','08','09','10','11', '12');\n bullet.each(function() {\n $(this).find('span').text(numbers[$(this).index()]);\n });\n }", "function display(data) {\n div = document.createElement(\"div\");\n div.className = \"container-fluid row justify-content-center\";\n div.id = \"row\";\n // using foreach loop to iterate through data----------------------\n data.forEach((element) => {\n const newdiv = document.createElement(\"div\");\n newdiv.className = \"col-10 col-sm-5 col-lg-3\";\n // adding name to the div----------------------------------------\n const name = document.createElement(\"h3\");\n name.innerHTML = `${element.name}`;\n newdiv.appendChild(name);\n // adding type to div--------------------------------------------\n const type = document.createElement(\"p\");\n type.innerHTML = `brewery type : ${element.brewery_type}`;\n type.id = \"type\";\n newdiv.appendChild(type);\n // adding address to div-----------------------------------------\n const address = document.createElement(\"p\");\n // checking for street name if null it will execute if part else it will ecxecute else part.\n if (element.street == null) \n address.innerHTML = `Address: , ${element.city}, ${element.state}, ${element.country}, ${element.postal_code.split('-')[0]}.`;\n else\n address.innerHTML = `Address: ${element.street}, ${element.city}, ${element.state}, ${element.country}, ${element.postal_code.split('-')[0]}.`;\n newdiv.appendChild(address);\n // adding website to div-----------------------------------------\n const web = document.createElement(\"p\");\n // checking for website if null it will display Not Available else it will display website name.\n web.id=\"web\";\n if (element.website_url == null)\n web.innerHTML = `<i class=\"fa fa-globe\" aria-hidden=\"true\"></i> - Not Available`;\n else\n web.innerHTML = `<i class=\"fa fa-globe\" aria-hidden=\"true\"></i> ${element.website_url}`;\n newdiv.appendChild(web);\n // adding number to div------------------------------------------\n const phone = document.createElement(\"p\");\n // checking for number if null it will display Not Available else it will display number.\n if (element.phone == null)\n phone.innerHTML = `<i class=\"fa fa-phone\" aria-hidden=\"true\"></i> - Not Available `;\n else\n phone.innerHTML = `<i class=\"fa fa-phone\" aria-hidden=\"true\"></i>${element.phone}`;\n newdiv.appendChild(phone);\n div.appendChild(newdiv);\n root.appendChild(div);//appending all element to root element\n });\n}", "function myFunction(arr) {\n var out = \"\";\n var i;\n for(i = 0; i < arr.data.children.length; i++) {\n var currArr = arr.data.children[i].data;\n\n //Formatted Article Display\n out += '<div class=\"article\">' + \n currArr.title + \n '<br>' +\n '<a href=\"' + currArr.url + '\"; target=_;>Article</a>' + \n ' ' + \n '<a href=\"https://reddit.com' + currArr.permalink + '\" target=\"_\">Comments</a>' +\n '</div>' +\n '<br>';\n }\n document.getElementById('content').innerHTML = out;\n}", "function populateApp(){\n for (let i = 0; i < myGroceryList.length; i++){\n console.log()\n groceryItem.innerHTML += `\n <div class=\"item\">\n <p>${myGroceryList[i]}</p>\n <div class=\"item-btns\">\n <i class=\"fa fa-edit\"></i>\n <i class=\"fa fa-trash-o\"></i>\n </div>\n </div>`\n clearBtnToggle()\n queryEditBtn()\n queryDeleteBtn()\n }\n}", "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}", "function matchCartArraytoCartDisplay(){\n for (var item =0; item<cart.length; item++) {\n //add html\n $('.order').append(\"\\\n <div id='item'>\\\n <h3></h3>\\\n <p></p>\\\n </div>\\\n <div>\\\n <p></p>\\\n <p id='editor'> x </p>\\\n <p id='editor'> Edit </p>\\\n <p>\\\n </div>\");\n }\n}", "function countListItems(array) {\n if (array.length >= 1 && array.length <= 9) {\n counter.removeClass('hidden');\n counter.html(`<p>${array.length}</p>`);\n } else if (array.length > 9) {\n counter.html(`<p>9+</p>`);\n } else {\n counter.addClass('hidden');\n }\n}", "function refreshItems(items) {\n //empty() method removes all child nodes and content from the selected elements\n $('#items').empty();\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n let itemFormat =\n\n `<div class=\"selection\" data-itemId =\"${items[i].id}\">\n <p class=\"text-left\">${items[i].id}</p>\n <p class=\"text-center\">${items[i].name}</p>\n <p class=\"text-center\">$ ${items[i].price.toFixed(2)}</p>\n <p class=\"text-center\">Quantity Left: ${items[i].quantity}</p>\n </div>`;\n // will add the format created above\n $(\"#items\").append(itemFormat);\n }\n\n}", "render() {\n this.list.innerHTML = '';\n\n startingData.forEach(item => {\n this.createDomElements(item.id);\n this.li.insertAdjacentHTML('afterbegin', item.authorLast+\", \"+item.authorFirst+\". \"+\"<i>\"+item.title+\". \"+\"</i>\"+item.publisher+\": \"+item.year+\".\");\n this.list.appendChild(this.li);\n });\n }", "renderLoop(arr, target) {\n const wrapper = document.createElement('div');\n for (let val of arr) {\n wrapper.appendChild(val.domElem);\n }\n\n this.addToDom(wrapper, target);\n }", "async function render() {\n var toDoList = await axios.get(url).then(res => res.data);\n if (toDoList)\n for (let item of toDoList) {\n document.getElementById('list-item').appendChild(generatingItem(item.id, item.content));\n if (itemIndex < item.id)\n itemIndex = Number.parseInt(item.id);\n }\n else\n toDoList = [];\n}", "_appendLis () {\n let i = this.currentCount;\n while ((i < this.maxCount + this.currentCount) && (i < this.data.length)) {\n let li = document.createElement('li');\n li.dataset.index = i;\n\n let divWrap = this._addDiv(['wrap']);\n\n let divThumb = this._addDiv(['thumb']);\n let thumbnail = this._addElement('img', this.data[i].thumb_url)();\n divThumb.append(thumbnail);\n\n let divTitle = this._addDiv(['title'], this.data[i].title);\n let divPrice = this._addDiv(['price'], this.data[i].price_formatted);\n\n let divKeywords = this._addDiv(['keywords'], this.data[i].keywords);\n\n divWrap.append(divThumb, divTitle, divPrice);\n li.append(divWrap, divKeywords);\n\n this.ul.append(li);\n\n i++;\n }\n\n this.currentCount = i;\n }", "function outputItems() {\n let html = '';\n const output = document.getElementById('text'); /* Points to h1 tag */\n\n for (let x = 0; x < values.length; x++) {\n html += (x + 1) + '. ' + values[x] + '<br>'; /* Output index value + corresponding item for each iteration */\n }\n output.innerHTML = html;\n }", "function displayArticles(arr, n){\n // clear any previously displayed articles\n $(\"#results\").empty();\n // create new list and append it to our 'results' div (span?)\n var articleList = $(\"<ol>\");\n $(\"#results\").append(articleList);\n\n // for loop through the response.data array\n for (var a = 0; a < n; a++){\n // create new list item\n var newArt = $(\"<li>\");\n\n // add headline\n if (arr[a].headline.main){\n var headline = \"<h2>\" + arr[a].headline.main + \"</h2><br>\";\n newArt.append(headline);\n }\n\n // add date and time\n if (arr[a].pub_date){\n var dateTime = \"<h6>\" + arr[a].pub_date + \"</h6><br>\";\n newArt.append(dateTime);\n }\n\n // add author\n if (arr[a].byline.original){\n var author = \"<h5>\" + arr[a].byline.original + \"</h5><br>\";\n newArt.append(author);\n }\n\n // add link to article\n if (arr[a].web_url){\n var webLink = \"<a href = '\" + arr[a].web_url + \"'>\" + arr[a].web_url + \"</a>\";\n // console.log(webLink);\n newArt.append(webLink);\n }\n\n // add list item to list\n articleList.append(newArt);\n }\n }", "function toHTML(array) {\n var mainDiv = document.querySelector('.shapceship-list');\n for (let i = 0; i < array.length; i++) {\n var individualDiv = document.createElement('div');\n var img = document.createElement('img');\n var modelP = document.createElement('p');\n var manufacturerP = document.createElement('p');\n var denominationP = document.createElement('p');\n var cargoP = document.createElement('p');\n var passengersP = document.createElement('p');\n var crewP = document.createElement('p');\n var lengthinessP = document.createElement('p');\n var consumablesP = document.createElement('p');\n var atmospheringSpeedP = document.createElement('p');\n var costP = document.createElement('P');\n var hr = document.createElement('hr')\n individualDiv.classList.add('inDiv');\n img.setAttribute('src', `img/${array[i].image}`);\n img.setAttribute('alt', `${array[i].image}`);\n modelP.innerText = `Model: ${array[i].model}`;\n manufacturerP.innerText = `Manufacturer: ${array[i].manufacturer}`;\n denominationP.innerText = `Denomination: ${array[i].denomination}`;\n cargoP.innerText = `Cargo capacity: ${array[i].cargo_capacity}`;\n passengersP.innerText = `Passengers: ${array[i].passengers}`;\n crewP.innerText = `Crew: ${array[i].crew}`;\n lengthinessP.innerText = `Lengthiness: ${array[i].lengthiness}`;\n consumablesP.innerText = `Consumables: ${array[i].consumables}`;\n atmospheringSpeedP.innerText = `Maximum atmosphering speed: ${array[i].max_atmosphering_speed}`;\n costP.innerText = `Cost: ${array[i].cost_in_credits}`;\n mainDiv.appendChild(individualDiv);\n individualDiv.appendChild(img);\n individualDiv.appendChild(modelP);\n individualDiv.appendChild(manufacturerP);\n individualDiv.appendChild(denominationP);\n individualDiv.appendChild(cargoP);\n individualDiv.appendChild(passengersP);\n individualDiv.appendChild(crewP);\n individualDiv.appendChild(lengthinessP);\n individualDiv.appendChild(consumablesP);\n individualDiv.appendChild(atmospheringSpeedP);\n individualDiv.appendChild(costP);\n individualDiv.appendChild(hr);\n\n }\n }", "function displayList(event) {\n var uList = document.getElementById('items-clicks');\n for (let index = 0; index < itemsArray.length; index++) {\n var listItem = document.createElement('li');\n listItem.textContent = itemsArray[index].name + \" had \" + itemsArray[index].vote + \" votes,\" + \"and was seen \" + itemsArray[index].time + \" times.\";\n uList.appendChild(listItem);\n\n }\n storeData();\n}", "function renderFilmList(data) {\n var strHTML = ``;\n var orderNum = 1;\n data.forEach(film => {\n strHTML += `\n <li class=\"animated fadeIn delay-2s\">\n <i class=\"fas fa-film\"></i><span>#${orderNum}</span>\n <p><b>Title: </b>${film.title}</p>\n <p><b>Year: </b>${film.release_year}</p>\n <p><b>Producer: </b>${film.director}</p>\n <button \n onclick=\"onMoreInfo('${film.locations}', '${film.actor_1}', '${film.actor_2}', '${film.actor_3}', '${film.writer}', '${film.production_company}')\">\n <i class=\"fas fa-hand-point-right\"></i>\n More Info</button>\n </li> \n `;\n orderNum++;\n });\n document.querySelector('.films-list').innerHTML = strHTML;\n\n //Lasy Loading with JQuery\n $(\"#li-list li\").slice(20).hide();\n var mincount = 5;\n var maxcount = 10;\n $(window).scroll(function () {\n if ($(window).scrollTop() + $(window).height() >= $(document).height() - 400) {\n $(\"#li-list li\").slice(mincount, maxcount).fadeIn(1200);\n mincount = mincount + 10;\n maxcount = maxcount + 10;\n }\n });\n}", "function showArray () {\ndocument.getElementById(\"inputArr\").textContent = console.log(itemsArr);\n\n}", "function displayItems(length, element, array) {\n const elem = element;\n for (let i = 0; i < length; i += 1) {\n if (!array[i]) {\n break;\n }\n elem.innerHTML += `${array[i].word} <span class=\"detailedStats\">(${array[i].times})</span>, `;\n }\n }", "function showAll(arr) {\r\n for (var i = 0; i < arr.length; i++) {\r\n var frontContent = arr[i].front;\r\n var backContent = arr[i].back;\r\n $(\"#studyCards\").append(\"<div class =\\\"card front study\\\">\" + frontContent + \"</div>\");\r\n $(\"#studyCards\").append(\"<div class = \\\"card back study\\\" style = \\\"vertical-align:top\\\">\" + backContent + \"</div><br>\");\r\n }\r\n}", "function writeNumbers(numbers){\n\tnumbers.forEach((element,index)=>{\n\tdocument.write(\"<li>\"+element+\"</li>\");\n\t})\n}", "function displayInventory(arr){\n arr.map(function (item){ \n displayItem(item, 1, \".inventory-container\"); \n })\n displayAddCartButton();\n addToCartListener();\n calcTotalPriceListener(); \n}", "function displayDataOnPage(topNews, counter){\n // console.log(topNews);\n topNews.articles.forEach(content => {\n const spanNode = document.createElement(\"li\"); // make fresh <li>\n spanNode.innerHTML = // news contents\n `<a href=\"${content.url}\">\n <img src=\"${content.urlToImage}\" alt=\"news image\">\n <h3>${content.source.name}</h3>\n <h2>${content.title}</h2>\n <p>${content.description}</p></a>`;\n parentNode.appendChild(spanNode); // pushing to the <ul>\n });\n }", "function renderDetailItem(arr,task){\n var objKeys = Object.keys(arr[showIndex]);\n var objValues = Object.values(arr[showIndex]);\n\n // Removes all previous listed div elements\n while(detailSection.childElementCount > 0) {\n detailSection.removeChild(detailSection.lastElementChild);\n }\n\n document.getElementById('titleName').textContent = task;\n\n //Loops through each Key of the Object\n for(var x = 1; x < objKeys.length; x++){\n var objType = typeof objValues[x]; //Gets the object value\n var elID = `${objKeys[x]}`;\n\n //--creates element id: ex: 'lbl_Exercise'\n //--appends to the div:'infoSection'\n var keyLabel = document.createElement('label');\n keyLabel.textContent = objKeys[x];\n keyLabel.class = `lbl_${objKeys[x]}`;\n detailSection.appendChild(keyLabel);\n\n // Loops through the value if it is an array/object\n if (objType === 'object'){\n\n var divInput = document.createElement('div');\n divInput.id = `${objKeys[x]}`;\n detailSection.appendChild(divInput);\n\n //sets objLen to 1, if nothing is listed\n var objLen = objValues[x].length;\n if(objLen === 0){objLen=1;}\n\n //Loops through the Key Array value, sets up Input Box\n for(var y = 0; y < objLen; y++){\n var arrInput = document.createElement('textarea');\n arrInput.rows = 1;\n arrInput.id = `${objKeys[x]}_${y}`;\n arrInput.className = `arr_${objKeys[x]}`;\n divInput.appendChild(arrInput);\n var txt = SearchArr[showIndex][elID][y];\n\n if(txt === undefined || txt === null){txt = '';}\n arrInput.value = txt;\n autoRender(arrInput);\n }\n\n //Create the Add button for the array\n var addBtn = document.createElement('button');\n addBtn.textContent = '+';\n addBtn.id = `add_${objKeys[x]}`;\n keyLabel.appendChild(addBtn);\n\n } else { //Create the label with input value\n var xKey = `${objKeys[x]}`;\n var valueInput = document.createElement('input');\n if(xKey === 'prepTime' || xKey === 'cookedTime'){\n txt = returnTime(SearchArr[showIndex][elID]);\n } else {\n txt = SearchArr[showIndex][elID];\n }\n valueInput.id = `${objKeys[x]}`;\n keyLabel.appendChild(valueInput);\n\n if(txt === undefined || txt === null){txt = '';}\n valueInput.value = txt;\n }\n }\n}", "function displayProductAPIData(data){\n\n console.log(currentPerPage);\n\n for (var i=0; i<currentPerPage; i++){\n\n var id = data[i].id;\n\n productArray.push(data[i]);\n\n var imageURL = \"https:\" + data[i].image.outfit;\n // var imageURL2 = \"https://cache.net-a-porter.com/images/products/\"+id+\"/\"+id+\"_in_sl.jpg\";\n // console.log(imageURL2);\n\n var prodContainer = document.createElement('div');\n var prodImage = document.createElement('div');\n var prodDesigner = document.createElement('div');\n var prodName = document.createElement('div');\n var prodPrice = document.createElement('div');\n\n prodContainer.className = 'prod-container';\n prodImage.className = 'prod-image';\n prodDesigner.className = 'prod-designer';\n prodName.className = 'prod-name';\n prodPrice.className = 'prod-price';\n\n prodImage.style.backgroundImage = \"url(\" + imageURL + \")\";\n prodDesigner.innerHTML = \"<span>\" + data[i].designer + \"</span>\";\n prodName.innerHTML = \"<span>\" + data[i].name + \"</span>\";\n prodPrice.innerHTML = \"<span>\" + data[i].price + \"</span>\";\n\n container.append(prodContainer);\n\n prodContainer.append(prodImage);\n prodContainer.append(prodDesigner);\n prodContainer.append(prodName);\n prodContainer.append(prodPrice);\n // console.log(i);\n totalProductsOnScreen += 1;\n }\n console.log(\"totalProductsOnScreen \" + totalProductsOnScreen);\n // console.log(productArray);\n // priceHighToLow();\n // priceLowToHigh();\n }", "function renderArticleResultsCards(results) {\n // Loop through the response\n for (var i = 0; i < 3; i++) {\n // Get data object data\n var question = results.items[i].title;\n var link = results.items[i].link;\n var answers = results.items[i].answer_count;\n var views = results.items[i].view_count;\n var createDate = results.items[i].creation_date;\n // Format the date created\n var createDateFormatted = moment.unix(createDate).format(\"MM/DD/YYYY\");\n\n // Decode text strings coming from the array\n var decodeHTML = function (question) {\n var txt = document.createElement('textarea');\n txt.innerHTML = question;\n return txt.value;\n };\n\n question = decodeHTML(question);\n // Render HTML elements to display \n var questionHeader = $('<h5/>');\n var questionCard = $('<div class=\"card results-card card-question\" />');\n var questionContainer = $('<span class=\"card-title\" />');\n var createDateContainer = $('<span class=\"create-date\" />');\n var answersContainer = $('<span class=\"side-container\"/>');\n var answersNumber = $('<span class=\"answers\"/>')\n var viewsContainer = $('<span class=\"side-container\"/>');\n var viewsNumber = $('<span class=\"views\" />');\n var linkButton = $('<a class=\"btn purple darken-3\" target=\"_blank\" />');\n var favoriteIcon = $('<span class=\"icon\"><i class=\"far fa-bookmark\"></i></span>');\n var div = $('<div />');\n var div2 = $('<div />');\n var div3 = $('<div />');\n // Put data into the elements\n questionHeader.text(question);\n linkButton.text('View').attr('href', link);\n answersContainer.text('Answers');\n answersNumber.text(answers)\n viewsContainer.text('Views');\n viewsNumber.text(views);\n viewsContainer.append(viewsNumber);\n answersContainer.append(answersNumber);\n createDateContainer.text(createDateFormatted);\n // Create structure\n div.append(answersContainer).append(viewsContainer);\n div2.append(questionHeader).append(createDateContainer).append(questionContainer);\n div3.append(favoriteIcon).append(linkButton);\n questionCard.append(div).append(div2).append(div3);\n // Assemble card\n resultsContainer.append(questionCard);\n }\n}", "function DisplayItems() {\r\n\r\n // Generate items \r\n for(let i = 0; i < ObjectArray.length; i++) {\r\n\r\n // Parent\r\n let Item_Parent = document.querySelector(\"#Recommendations__container\");\r\n\r\n // Container\r\n let Item_container = document.createElement(\"article\");\r\n Item_container.className = \"Recommendations__item\";\r\n Item_Parent.appendChild(Item_container);\r\n \r\n // Img\r\n let Item_img = document.createElement(\"img\");\r\n Item_img.className = \"Recommendations__item-image\";\r\n Item_img.src = ObjectArray[i].imgsrc;\r\n Item_container.appendChild(Item_img);\r\n\r\n // Title\r\n let Item_title = document.createElement(\"h2\");\r\n Item_title.className = \"Recommendations__item-title\";\r\n Item_title.classList.add(\"General-text\");\r\n Item_title.textContent = ObjectArray[i].title;\r\n Item_container.appendChild(Item_title);\r\n\r\n \r\n // Price\r\n let Item_text = document.createElement(\"p\");\r\n Item_text.className = \"Recommendations__item-price\";\r\n Item_text.classList.add(\"General-text\");\r\n Item_text.textContent = ObjectArray[i].price;\r\n Item_container.appendChild(Item_text); \r\n\r\n // Button\r\n let Item_button = document.createElement(\"button\");\r\n Item_button .className = \"Recommendations__item-button\";\r\n Item_button.classList.add(\"General-text\");\r\n Item_button.textContent = \"Favorit\"\r\n Item_container.appendChild(Item_button);\r\n\r\n\r\n\r\n // Check how many items exist\r\n if(i < 1) {\r\n\r\n // Initiator\r\n DisplayOffer()\r\n };\r\n\r\n // Function: display offer\r\n function DisplayOffer() {\r\n // Button\r\n let Item_offer = document.createElement(\"p\");\r\n Item_offer .className = \"Recommendations__item-offer\";\r\n Item_offer.classList.add(\"General-text\");\r\n Item_offer.textContent = \"-30%\"\r\n Item_container.appendChild(Item_offer);\r\n };\r\n };\r\n}", "function createItems(){\n scrollCount = 0;\n for (var i = markers.length - 1; i >= 0; i--) {\n var listItem = document.createElement(\"a\");\n listItem.setAttribute(\"class\",\"list-group-item\");\n listItem.setAttribute(\"onclick\",\"clickList(this)\");\n listItem.innerHTML = \"<h4 class=list-group-item-heading>\" + markers[i].data.property_name +\"</h4>\" + \"<p class=list-group-item-text>\" \n + \"<span class=\\'label label-info\\'>\" + \"Distance: \" + markers[i].distance.toFixed(2) + \"km\" +\"</span>\" \n + \" \"+ \"<span class=\\'label label-info\\'>\" + \"Security: \" + markers[i].security +\"</span>\"\n + \" \"+ \"<span class=\\'label label-info\\'>\" + \"Libraries: \" + markers[i].libraries +\"</span>\" \n + \" \"+ \"<span class=\\'label label-info\\'>\" + \"Parks: \" + markers[i].parks +\"</span>\" \n +\"</p>\";\n listItem.marker = markers[i];\n $(\"#list\").append(listItem);\n\n // Association between markers and listItem\n markers[i].item = listItem; \n\n // Set scroll control\n listItem.scroll = scrollCount;\n scrollCount += 63; \n }\n}", "function populateLists(res, m) {\n\n\n var accordion = $(\"#accordion\");\n accordion.empty();\n\n for(var item in res){\n if( Array.isArray( res[item] ) && res[item].length>0 ){\n\n var m = res[item];\n\n\n if(m[m.length-1]==\"\"){\n m.pop();\n }\n\n var t_item = item.replace(\"orig\",\"\");\n t_item = t_item.replace(\"i\",\"\");\n t_item = t_item.replace(\"N\",\"-\");\n t_item = t_item.toUpperCase();\n\n \n\n var t_id = \"c\" + t_item;\n\n var title = $(\"<h3>\"+t_item+\"</h3>\");\n var contents = $(\"<div id=\\\"\"+t_id+\"\\\" >\"+\"<h5>\"+m.length+\"</h5>\"+\"<p>\"+m+\"</p>\"+\"</div>\");\n \n accordion.append(title);\n accordion.append(contents);\n }\n }\n\n accordion.accordion(\"refresh\");\n\n\n\n\n\n\n}", "function populateRecentDrink(arr) {\n savedDrinks.innerHTML = \"<h3>Drinks</h3>\";\n for (let i = 0; i < arr.length; i++) {\n var item = arr[i];\n var li = document.createElement(\"li\");\n li.innerText = item;\n savedDrinks.append(li);\n }\n}", "function loadItems(items){\n $('#menus').empty();\n console.log(4, \"Finished the call\");\n \n for(var i=0; i<items.length; i++){\n console.log(items[i]);\n\n var row = \n `\n <div class=\"menudisplay col-md-3\" data-id=\"${items[i].id}\">\n <p> ${items[i].id}</p>\n <p style='text-align: center'> ${items[i].name}</p>\n <p style='text-align: center'> ${items[i].price}</p>\n <p style='text-align: center'> Quantity: ${items[i].quantity}</p>\n </div>`\n $('#menus').append(row); \n \n } \n\n}", "function render(){\n\t\t// console.log(obj2);\n\t\t// console.log(curpage);\n\t\tvar fanye = \"\";\n\t\tobj3 = obj2.slice((curpage-1)*qty,qty*curpage);\n\t\tconsole.log(obj3);\n\t\tfor(var g=0;g<obj3.length;g++){\n\t\tfanye += '<li class=\"\">'\n\t\t+'<a href=\"\" class=\"img\" rel=\"nofollow\" target=\"_blank\">'\n\t\t+'<i class=\"today-new\"></i> '\n\t\t+'<img src=\"'+obj3[g].imgurl+'\"width=\"260px\" height=\"260px\">'\n\t\t+'</a>'\n\t\t+'<div class=\"goods-padding\">'\n\t\t+'<div class=\"coupon-wrap clearfix\">'\n\t\t+'<span class=\"price\"><b><i>¥</i>'+obj3[g].nowprice+'</b>券后</span>'\n\t\t+'<span class=\"old-price\"><i>¥</i>'+obj3[g].passprice+'</span>'\n\t\t+'<span class=\"coupon\"><em class=\"quan-left\"></em>券<b><i>¥</i>10</b><em class=\"quan-right\"></em></span>'\n\t\t+'</div>'\n\t\t+'<div class=\"title\">'\n\t\t+'<a target=\"_blank\" href=\"detail.html\">'+obj3[g].tittle\n\t\t+'</a>'\n\t\t+'</div>'\n\t\t+'<div class=\"goods-num-type\">'\n\t\t+'<div class=\"goods-type\">'\n\t\t+'<i class=\"tmall\" title=\"天猫\"></i>'\n\t\t+'</div>'\n\t\t+'</div>'\n\t\t+'</div>'\n\t\t+'</li>'\n\t\t}\n\t\t$(\".list2\").append(fanye);\n\t}", "function renderList() {\n viewSection.innerHTML = \"\";\n counter.innerText = todoList.length;\n for(const todo of todoList) {\n const todoElement = createTodoElement(todo);\n viewSection.appendChild(todoElement);\n }\n}", "function addItem() {\n const inputText = document.getElementById('item').value; // Captures user input from HTML input tag\n values.push(inputText);\n outputItems(); /* Outputs values to HTML */\n\n function outputItems() {\n let html = '';\n const output = document.getElementById('text'); /* Points to h1 tag */\n\n for (let x = 0; x < values.length; x++) {\n html += (x + 1) + '. ' + values[x] + '<br>'; /* Output index value + corresponding item for each iteration */\n }\n output.innerHTML = html;\n }\n}", "function renderItems(){\n for (let info of productos){\n\n\n // tarjeta de producto\n let tarjeta=document.createElement('div');\n tarjeta.classList.add('body-tarjeta');\n\n //Titulo\n let nombre=document.createElement('h3');\n nombre.classList.add('titulo');\n nombre.textContent=info['nombre'];\n\n //Genero\n let genero=document.createElement('p');\n genero.classList.add('genero');\n genero.textContent=info['genero'];\n\n //Imagen\n let imagen=document.createElement('img');\n imagen.classList.add('img');\n imagen.setAttribute('src', info['imagen']);\n\n //Precio\n let precio=document.createElement('h3');\n precio.classList.add('precio');\n precio.textContent=info['precio']+'€';\n\n //Boton\n let boton=document.createElement('button');\n boton.classList.add('boton');\n boton.textContent='Añadir a cesta';\n boton.setAttribute('marcador',info['tag']);\n boton.addEventListener('click', insertarenCesta);\n \n\n //insertar\n tarjeta.appendChild(imagen);\n tarjeta.appendChild(nombre);\n tarjeta.appendChild(genero);\n tarjeta.appendChild(precio);\n tarjeta.appendChild(boton);\n $items.appendChild(tarjeta);\n }\n\n\n}", "function disp(){\r\n var str = '';\r\n str = `<h2> Total number of tasks to do : ${data.length} </h2>`;\r\n data.forEach( (elem, index) => {\r\n str += `<p> ${elem} <span><a href=# onClick=\"remove_element( ${index} )\"> \\u00D7</a></span></p>`; // adding each element with key number to variable\r\n document.getElementById('myRES').innerHTML = str; // Display the elements of the array\r\n });\r\n }", "function renderLibrary() {\r\n let iterateNum = 0;\r\n for (const book of library) {\r\n const displayBook = document.createElement('div');\r\n displayBook.setAttribute('class', 'book');\r\n for (const prop in book) {\r\n const cardItem = document.createElement('div');\r\n cardItem.setAttribute('class', 'book-item');\r\n cardItem.innerText = `${prop.charAt(0).toUpperCase() + prop.slice(1)}: ${book[prop]}`;\r\n displayBook.appendChild(cardItem);\r\n }\r\n // create garbage can for delete\r\n const exitBook = document.createElement('div');\r\n exitBook.innerHTML = '<i class=\"fas fa-trash\"></i>';\r\n exitBook.setAttribute('class', 'exit');\r\n exitBook.setAttribute('data-num', iterateNum);\r\n\r\n displayBook.appendChild(exitBook);\r\n // add button for read mode\r\n const readBtn = document.createElement('button');\r\n readBtn.innerText = 'Was read?';\r\n readBtn.setAttribute('class', 'read');\r\n readBtn.setAttribute('data-readnum', iterateNum);\r\n displayBook.appendChild(readBtn);\r\n // push book to html container\r\n cardContainer.appendChild(displayBook);\r\n iterateNum++;\r\n }\r\n deleteBook();\r\n toggleRead();\r\n}", "function addNumbers(el){\n \n if(dontRun){return;}\n var len = beforeN;\n numbers = \"<ul class='slider-numbers slider-numbers-\"+el+\"'>\";\n var i=0;\n for(;i<len;i++){\n numbers +=\"<li><a href=''>\"+(i+1)+\"</a></li>\";\n }\n numbers += \"</ul>\";\n $(element).after(numbers);\n numbers = \".slider-numbers-\"+el+\" a\";\n /*\n * Bind click event to each number and set first element to active\n */\n $(numbers).each(function(i){\n if(i===0){$(this).addClass(\"active\");}\n \n $(this).click(function(){\n \n goToIndex(i);\n return false;\n\n });\n });\n \n }", "function populateHtml (array){\n //prendo il div che devo popolare\n const cardsContainer = $(\".cards-container\");\n cardsContainer.html('');\n //itero sull'array degli oggetti (che contiene anche i colori)\n for (const icon of array) {\n //estrapolo le informazioni che mi servono per creare le mie cards\n let {name, prefix, family, color} = icon;\n //definisco tramite i backticks e i valori degli oggetti che aspetto avranno le cards nella pagina html\n const iconaHtml = `\n <div class=\"card\">\n <i class='${family} ${prefix}${name} ${color}'></i>\n <h5>${name}</h5>\n </div>`;\n \n //aggiungo a cardsContainer\n cardsContainer.append(iconaHtml);\n }\n }", "function addEl(arr) {\n\tlet number = '';\n\tfor(let i = 0; i < arr.length; i += 1){\n\t\tif (i + 1 == arr.length) {\n\t\t\tnumber += '<li>' + arr[i] + '</li>';//for last element of \"display\" array\n\t\t} else {\n\t\t\tnumber += '<li>' + arr[i] + ',' + '</li>';\n\t\t}\n\t}\nreturn number;\n}", "function itemtoHTML() {\n for (let i = 0; i < all_html.length; i++) {\n $(\".items\").append([all_html[i]].map(movie_item_template).join(\"\"));\n }\n }", "function display_books_in_ui(characters) {\n let content = '<div class=\"items_box\">'\n for (i = 0; i < characters.length; i++) {\n content += '<a class=\"item\" id=\"' + characters[i].id + '\">';\n content += '<div class=\"image\">';\n content += '<img src=\"' + characters[i].picture + '\" alt=\"' + characters[i].name + '\" width=\"100\" height=\"100\">';\n content += '</div>';\n content += '<div class=\"text\">';\n content += '<h2>' + characters[i].name + '</h2><p>' + characters[i].species + '</p>';\n content += '</div>';\n content += '</a>';\n }\n content += '</div>';\n $(\"#CharactersList\").append(content);\n }", "function displaycard(num){\n for(let i =0; i<num; i++){\n //add details\n let articleEl = document.createElement('article')\n let h2El = document.createElement('h2')\n let imgEl = document.createElement('img')\n let divEl = document.createElement('div')\n let gameEl = document.createElement('span')\n //set class\n articleEl.setAttribute('class', 'card')\n h2El.setAttribute('class', 'card--title')\n imgEl.setAttribute('class', 'card--img')\n divEl.setAttribute('class', 'card--text')\n articleEl.setAttribute('class', 'card')\n h2El.innerText = data[i].name\n // varible\n imgEl.setAttribute('src', data[i].sprites.other[\"official-artwork\"].front_default )\n imgEl.setAttribute('width','256')\n // varible\n const stats = data[i].stats\n for(const item of stats){\n let pEl = document.createElement('p')\n pEl.innerText = `${item.stat.name.toUpperCase()}: ${item.base_stat}`\n divEl.append(pEl)\n }\n // chanllenge1\n const gameIndices = data[i].game_indices\n for(const indice of gameIndices ){\n gameEl.innerText = gameEl.innerText + indice.version.name +'/ '\n divEl.append(\n gameEl\n )\n }\n //chanllenge1\n let sectionEl = document.querySelector('section')\n sectionEl.append(articleEl)\n articleEl.append(h2El, imgEl,divEl)\n } \n}", "function for_Loop() {\n for(y=0; y < Instruments.length; y++) {\n content += Instruments[y] + \"<br>\";\n }\n document.getElementById(\"List_of_Instruments\").innerHTML = content;\n}", "function displaySongInfo(){\n // BELOW Use forEach Loop to display the data from each of your arrays in the correct div\n songs.forEach(function(songItem){\n $(\"#songs\").append(\"<p>\" + songItem +\"</p>\" + \"<br>\");\n });\n\n imageLinks.forEach(function(image){\n $(\"#images\").append(\"<img src=\" + image + \">\" + \"<br>\");\n });\n\n artists.forEach(function(artist){\n $(\"#artists\").append(\"<p>\" + artist + \"</p>\" + \"<br>\");\n });\n\n songLengths.forEach(function(length){\n $(\"#lengths\").append(\"<p>\" + length + \"</p>\" + \"<br>\");\n });\n\n links.forEach(function(link){\n $(\"#links\").append(\"<a href=\" + link + \">\" + link + \"</a>\" + \"<br>\");\n });\n\n}", "function render(callback) {\n itemlist.forEach(function(value, key) {\n if(value.length != 0) {\n $('.inventar_div .no_items').fadeOut('fast').promise().done(function() {\n $(this).remove();\n if($('.inventar_div').find('.inventar_item.' + key).length === 0) {\n $('<div class=\"inventar_item '+key+'\" draggable=\"true\" ondragstart=\"drag(event)\"><span class=\"item_number strokeme\">'+value.length+'</span></div>').appendTo('.inventar_div').show('slow');\n } else {\n $('.inventar_item.'+key+' .item_number').html(value.length);\n }\n });\n } else {\n $('.inventar_item.'+key).hide('slow', function() { $(this).remove(); });\n }\n });\n\n return callback();\n }", "function menuDisplay(menuItems) {\n//create variable \"showItems\" to iterate item elements with map\n\nlet showItems = menuItems.map((item) => {\n \n//return the entire section html to show all items inside \"categories\"\n \n return `<article class=\"category\">\n </div><div class=\"box-item\" id=\"box\">\n <img src=${item.img} alt=${item.img}>\n <p class=\"title\">${item.title}</p>\n <p class=\"parraf\">${item.desc}</p>\n <p class=\"price\">$ ${item.price}</p>\n </div></article>`\n\n}); \n// console.log(showItems);\n \n//now showItems has return has an array [], let's use join now\nshowItems = showItems.join('');\n \n//finally, categories id will be equal to showItems, now all items will display in the DOM\ncategories.innerHTML = showItems;\n// box2.innerHTML = showItems;\n// box3.innerHTML = showItems;\n}", "showNumberOfItems() {\n const message = document.createTextNode(\"Items:\" + this.data.length),\n numOfItems = document.getElementById(\"number-of-items\");\n numOfItems.innerHTML = \"\";\n numOfItems.appendChild(message);\n }", "function renderesults(result){\r\n let div=document.createElement('div')\r\n document.body.append(div);\r\n div.setAttribute('id','divid')\r\n const list=document.createElement('ul')\r\ndocument.body.append(list)\r\nlist.setAttribute('id','listid')\r\n const ollist=document.getElementById(\"listid\")\r\n ollist.innerHTML=\"\";\r\n result.forEach(re=>{\r\n const element=document.createElement('li')\r\n element.setAttribute('id','listid')\r\n list.append(ollist)\r\n element.innerText=re;\r\n ollist.append(element)\r\n })\r\n}", "function showScores(){\n highScoreList.innerHTML = \"\"; \n\n for(var i = 0; i < dataFromStorage.length; i++){\n var listEl = document.createElement(\"li\");\n var paraEl = document.createElement(\"p\");\n paraEl.setAttribute(\"class\", \"highscore\");\n paraEl.textContent = (i + 1) + \". \" + dataFromStorage[i].initials + \"- \" + dataFromStorage[i].score;\n\n listEl.appendChild(paraEl);\n highScoreList.appendChild(listEl);\n\n }\n}", "function populatePage() {\n var boxes = document.createDocumentFragment();\n\n for (var i=0; i < appdata.app_id.length; i++){\n var boxdiv = document.createElement('div');\n boxdiv.draggable = 'true';\n boxdiv.className = 'box';\n boxdiv.innerHTML = \"<a href=\\'\"+appdata.link[i]+\"\\'>\"+appdata.name[i]+\" (\" + appdata.description[i] + \")</a>\";\n boxdiv.style = 'background-color:'+appdata.color[i];\n boxes.appendChild(boxdiv);\n }\n var cont = document.getElementById('boxcontainer');\n cont.appendChild(boxes);\n }", "function arrayLoadPage(q, n){\n for (var i = 0; i < n; i++) {\n var j = i+1;\n $(\"#qq\" + j).html(q[i].question);\n $(\"#q\" + j + \"al\").html( q[i].a);\n $(\"#q\" + j + \"bl\").html( q[i].b);\n $(\"#q\" + j + \"cl\").html( q[i].c);\n $(\"#q\" + j + \"dl\").html( q[i].d);\n $(\"#q\" + j + \"el\").html( q[i].e);\n }\n}", "function showPopularMoviesDOM(data){\n clearFields();\n let output = '';\n data.results.forEach((item) => { \n console.log(item);\n output += `\n <div class=\"card\">\n <div class=\"card-img--container\"></div>\n <img src=\"${`https://image.tmdb.org/t/p/w500${item.backdrop_path}`}\" alt=\"\" />\n <div class=\"card-info--container\">\n <p>Title: ${item.original_title}</p>\n <span class=\"badge badge-primary\">Popularity: ${item.popularity}</span>\n <span class=\"badge badge-success\">Votes: ${item.vote_count}</span>\n <span class=\"badge badge-success\">Release Date: ${item.release_date}</span>\n\n </div>\n </div>\n `\n }); \n popularResults.innerHTML = output;\n}", "function showRandomNumbers() {\n for (var i = 0; i < randomArray.length; i++) {\n console.log(randomArray[i]);\n document.querySelector(\".t1\").innerHTML = randomArray;\n\n }\n}", "function mostReadArticlesToday() { \n mostReadArticlesArray.slice(1, 20).forEach(item => {\n // console.log('mostReadArticlesArray: ', mostReadArticlesArray)\n const allMostReadToday = document.createElement('div')\n allMostReadToday.classList.add('all-most-read-today')\n // ARTICLE LINKS\n const link = document.createElement('a')\n if (item.url) {\n link.href = item.url\n } else {\n link.href = item.webUrl \n }\n link.title = 'Read Full Article' // Info when hovering on image\n link.target = '_blank' // OPEN ARTICLE IN NEW TAB\n // ARTICLE PICTURE\n const mostReadPicture = document.createElement('img')\n mostReadPicture.loading = 'lazy'\n mostReadPicture.classList.add('most-read-pictures')\n if (item.fields) {\n mostReadPicture.src = item.fields.thumbnail\n } else {\n mostReadPicture.src = item.media[0]['media-metadata'][2].url\n }\n // CONNECT THE DOM NODES\n link.append(mostReadPicture)\n allMostReadToday.append(link)\n bottomRow.append(allMostReadToday)\n newsContainer.appendChild(bottomRow)\n })\n}", "function addDataToPage(array){\n\n for (var i = 0; i < array.length; i++){\n var languageBox = \"<div class=\"+\"language_box\"+\">\";\n languageBox = languageBox + '<span class=\"language_name\">'+array[i].name+'</span></br>';\n languageBox = languageBox + '<span class=\"percent\">'+array[i].repos_percent+'%</span></br>';\n languageBox = languageBox + '<span class=\"language_info\">of new repositories on GitHub</span></br>';\n languageBox = languageBox + '<span class=\"percent\">'+array[i].questions_percent+'%</span></br>';\n languageBox = languageBox + '<span class=\"language_info\">of new questions on Stackoverflow</span></br>';\n $(\"#container\").append(languageBox);\n }\n\n}", "function loadHtml(products) {\n fetch('Items.json')\n .then(response => response.json())\n .then(data => {\n products = data;\n });\n\n products.forEach(function (item) {\n const list = document.createElement('div');\n list.classList.add('col-10', 'col-sm-6', 'col-lg-4', 'mx-auto', 'my-3')\n\n list.innerHTML = `<div class=\"card \">\n <div class=\"img-container\" id=${item.id}>\n <img src=\"${item.source}\" width=\"100%;\" height=\"250px\" alt=\"\">\n \n </div>\n <div class=\"card-body\">\n <div class=\"card-text d-flex justify-content-between text-capitalize\">\n <h5 id=\"store-item-name\">${item.name}</h5>$\n <h5 class=\"store-item-value\"> <strong id=\"store-item-price\" class=\"font-weight-bold\">${item.price}</strong></h5>\n \n </div>\n <div class=\"store-item-icon\">\n <div class=\"row\"><span><span >☆</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span> </span>\n <ion-icon name=\"cart\" size=\"large\"></ion-icon></div>\n </div>\n </div>\n \n \n </div>\n `\n\n const storeItem = document.getElementById(\"store-items\");\n const container = document.querySelector(\".container\");\n if (storeItem != null) {\n storeItem.insertBefore(list, container.nextSibling);\n }\n\n\n });\n\n}" ]
[ "0.6590578", "0.64869386", "0.6464906", "0.6448085", "0.6432464", "0.63927585", "0.63749", "0.63395625", "0.6336661", "0.6308334", "0.6206958", "0.6171083", "0.6170295", "0.6167196", "0.6164353", "0.616267", "0.613647", "0.6121676", "0.610843", "0.61018384", "0.60835385", "0.60832804", "0.6076806", "0.60662395", "0.605949", "0.6047843", "0.604394", "0.60386217", "0.6033879", "0.60285664", "0.600577", "0.5991289", "0.59719914", "0.59701365", "0.5965806", "0.5955496", "0.5950242", "0.5946594", "0.59375256", "0.59335953", "0.5932192", "0.59169203", "0.59007686", "0.5897633", "0.5894574", "0.5887481", "0.5875515", "0.5872833", "0.58655757", "0.5865414", "0.5863322", "0.586037", "0.5848779", "0.58424854", "0.5842202", "0.5840825", "0.58361334", "0.58314407", "0.5830938", "0.58187616", "0.5813276", "0.58032054", "0.5797947", "0.5792636", "0.5789715", "0.57869637", "0.57825845", "0.57784176", "0.57776755", "0.57706857", "0.5767607", "0.57666516", "0.5763322", "0.57630444", "0.5762126", "0.5758317", "0.57555413", "0.5748026", "0.5747332", "0.57431245", "0.5742565", "0.57401955", "0.57382244", "0.57340646", "0.57302755", "0.5724227", "0.57230186", "0.57188755", "0.57173854", "0.5717237", "0.57166743", "0.5711375", "0.57075465", "0.57032603", "0.57027906", "0.5699885", "0.5699349", "0.56964976", "0.56952083", "0.5690539" ]
0.64540213
3
Description: this will shuffle the numbers in
function shuffleBoard(array) { this.clearBoards() boardItems.sort(() => Math.random() - 0.5); screenView() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shuffle() {\n // TODO\n }", "shuffle()\n\t{\n\t\tlet temp;\n\t\tlet arraySpot;\n\t\tlet arraySpot2;\n\t\tfor (let x = 0; x < 1000000; x++)\n\t\t{\n\t\t\tarraySpot = Math.floor(Math.random() * this.numCards);\n\t\t\tarraySpot2 = Math.floor(Math.random() * this.numCards);\n\n\t\t\ttemp = this.cards[arraySpot];\n\t\t\tthis.cards[arraySpot] = this.cards[arraySpot2];\n\t\t\tthis.cards[arraySpot2] = temp;\n\t\t}\n\t}", "function shuffle() {\n var newPos;\n var temperoryNum;\n for (var i = dublicateNumbers.length - 1; i > 0; i--) {\n newPos = Math.floor(Math.random() * i + 1);\n //This is the value we have\n temperoryNum = dublicateNumbers[i];\n //This the position of that value which we replace with new position\n dublicateNumbers[i] = dublicateNumbers[newPos];\n //This is the new position which we set that value on this position\n dublicateNumbers[newPos] = temperoryNum;\n }\n return dublicateNumbers;\n}", "function shuffle(a) {\n\t\t\t\tvar j, x, i;\n\t\t\t\tfor (i = a.length; i; i -= 1) {\n\t\t\t\t\tj = Math.floor(Math.random() * i);\n\t\t\t\t\tx = a[i - 1];\n\t\t\t\t\ta[i - 1] = a[j];\n\t\t\t\t\ta[j] = x;\n\t\t\t\t}\n\t\t\t}", "function shuffleNums(sort = false) {\r\n\r\n var allNums = document.querySelectorAll('.grid-item');\r\n\r\n handleTilts(allNums, TILTDESTROY);\r\n if (!sort) {\r\n\r\n iso.shuffle();\r\n\r\n } else {\r\n\r\n // iso.arrange({ sortBy: 'original-order' });\r\n iso.sortAscending = gCount % 2 ? false : true;\r\n\r\n console.log('SHUFFLE: ', iso.sortAscending);\r\n\r\n iso.arrange({ sortBy: 'number' });\r\n }\r\n\r\n setTimeout(function () {\r\n handleTilts(allNums, TILTINIT);\r\n }, 600);\r\n}", "shuffle(a, rng) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(rng() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n \n }\n }", "shuffle() {\n for (var i = this._deck.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = this._deck[i];\n this._deck[i] = this._deck[j];\n this._deck [j] = temp;\n }\n }", "function shuffle() {\n\t\tfor(let i = 0; i < 1000; i++){\n\t\t\tlet arr = findMovablePieces(xCoordinate,yCoordinate);\n\t\t\tlet rand = parseInt(Math.random() * arr.length);\n\t\t\tswap(arr[rand]);\n\t\t}\n\t}", "function shuffle(a){for(var c,d,b=a.length;b;)d=Math.floor(Math.random()*b--),c=a[b],a[b]=a[d],a[d]=c;return a}", "function shuffleCards() {\n\t\t\tvar curr_index = cards.length, \n\t\t\t\ttemp_value, \n\t\t\t\trand_index;\n\t\t\twhile (0 !== curr_index){\n\t\t\t\t// Pick random value\n\t\t\t\trand_index = Math.floor(Math.random() * curr_index);\n\t\t\t\tcurr_index--;\n\t\t\t\t// Swap the randomly picked value with the current one\n\t\t\t\ttemp_value = cards[curr_index];\n\t\t\t\tcards[curr_index] = cards[rand_index];\n\t\t\t\tcards[rand_index] = temp_value;\n\t\t\t}\n\t\t}", "shuffle() {\n for (let i = this.cards.length - 1; i > 1; i--) {\n let x = Math.floor(Math.random() * i);\n let temp = this.cards[i];\n this.cards[i] = this.cards[x];\n this.cards[x] = (temp);\n }\n }", "function shuffle(arr){\n\t\t\t\t\t\t for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);\n\t\t\t\t\t\t return arr;\n\t\t\t\t\t\t}", "function shuffleDeck(x) {\n var i = 0,\n j = 0,\n temp = null;\n for (let i = x.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1));\n temp = x[i];\n x[i] = x[j];\n x[j] = temp;\n }\n}", "function shuffle(a){\n var j, x, i;\n for (let i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function shuffle () {\n for(let i=setDeck.length-1; i >= 0; i--){\n let j = Math.floor(Math.random() * i)\n let temp = setDeck[i]\n setDeck[i] = setDeck[j]\n setDeck[j] = temp\n }\n}", "function shuffle(){\n\tvar pArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];\n\tfor (var i=mypuzzle.length; i>0; i){\n\t\tvar j = Math.floor(Math.random() * i);\n\t\tvar x = pArray[--i];\n\t\tvar test = pArray[j];\n\t\tif(test == \"0\") { \n\t\t\tmypuzzle[i].addClassName(\"puzzlepiece\");\n\t \t\tblankPiece(mypuzzle[i]);\n\t \t\tmypuzzle[i].innerHTML = \"\";\n\t\t\t\t\t}\n\t\telse{\n \t\t\tmypuzzle[i].innerHTML = pArray[j];\n \t\t\tregularP(mypuzzle[i]);\n \t\t\tbackgroundPos(mypuzzle[i], test);\n }\n\t\t\tpArray[j] = x;\n }\n \tmoveable();\n }", "function shuffle(a) {\n let x;\n let y;\n for (let i = a.length - 1; i > 0; i--) {\n x = Math.floor(Math.random() * (i + 1));\n y = a[i];\n a[i] = a[x];\n a[x] = y;\n }\n shuffleDeck = a;\n}", "shuffle(a) {\r\n let j, x, i\r\n for (i = a.length - 1; i > 0; i--) {\r\n j = Math.floor(Math.random() * (i + 1))\r\n x = a[i]\r\n a[i] = a[j]\r\n a[j] = x\r\n }\r\n\r\n return a\r\n }", "shuffle() {\n for(let i = 0; i < this.library.length; i++) {\n let swapWith = Math.floor(Math.random() * this.library.length);\n\n let temp = this.library[i];\n this.library[i] = this.library[swapWith];\n this.library[swapWith] = temp;\n }\n }", "function shuffle (cards){\n let random = 0; \n let temp = 0;\n for(let i=0;i<cards.length ;i++){\n random = Math.round(Math.random()*i) ;\n //console.log(random);\n temp = cards[i];\n cards[i] = cards[random];\n cards[random] = temp;\n }\n console.log(cards);\n }", "function shuffle() {\n\tshuffleCards = cards.sort(function(a,b){return 0.5 - Math.random()});\n}", "function shuffleit() {\n list_cards = shuffle(list_cards);\n shuffle_cards(list_cards);\n}", "function shuffle() {\n\t\tfor (var i = 0; i < 1000; i++) {\n\t\t\tvar neighbors = getEmptyNeighbors();\n\t\t\tvar index = Math.round(Math.random() * (neighbors.length - 1));\n\t\t\tvar id = empty + neighbors[index];\n\t\t\tvar piece = document.getElementById(\"x\" + id);\n\t\t\tmovePiece(piece);\n\t\t}\n\t}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length; i; i--) {\n j = ~~(Math.random() * i);\n x = a[i - 1];\n a[i - 1] = a[j];\n a[j] = x;\n }\n}", "function shuffle (questions) {\n var j, x, i\n for (i = questions.length; i; i--) {\n j = Math.floor(Math.random() * i)\n x = questions[i - 1]\n questions[i - 1] = questions[j]\n questions[j] = x\n }\n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "shuffle() {\n let remainingCardTobeShuffled = this.deck.length, randomCardSwapIndex;\n\n // Swaps 52 times\n while (remainingCardTobeShuffled) {\n\n // Create a random index to be swapped\n randomCardSwapIndex = Math.floor(Math.random() * remainingCardTobeShuffled--);\n\n // Shortcut in js to swap two elements\n [this.deck[remainingCardTobeShuffled], this.deck[randomCardSwapIndex]] = [this.deck[randomCardSwapIndex], this.deck[remainingCardTobeShuffled]];\n }\n\n }", "shuffleCards() {\n\n \t\tfor(var i = 0; i < this.cards.length; i++) {\n \t\t\tvar randomIndex = Math.floor(Math.random() * this.cards.length);\n \t\tvar temp = this.cards[i];\n \t\t\n \t\tthis.cards[i] = this.cards[randomIndex];\n \t\tthis.cards[randomIndex] = temp;\n \t\t}\n\t }", "function shuffleInplace (arr) {\n var j, tmp;\n for (var i = arr.length - 1; i > 0; i--) {\n j = baseRandInt(i + 1);\n tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }\n }", "function shuffle(a) {\n for (let i = a.length; i; i--) {\n let j = Math.floor(Math.random() * i);\n [a[i - 1], a[j]] = [a[j], a[i - 1]];\n }\n }", "function shuffle(a) {\n for (let i = a.length; i; i--) {\n let j = Math.floor(Math.random() * i);\n [a[i - 1], a[j]] = [a[j], a[i - 1]];\n }\n }", "function generate(){\n numbers = [];\n var amount = document.getElementById(\"amount\").value;\n createCookie(\"ss_amount\", amount, 10000);\n for(var i = 0; i < amount; i++){\n numbers.push(i+1);\n }\n numbers = shuffle(numbers);\n printNumbers();\n}", "function shuffle(cards)\n{\n\t// for loop???\n\t \n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n}", "function suffle() {\n renderContent(numArray.sort(() => Math.random() - 0.5));\n}", "function shuffle(array){\n\t\t\t\t\t\t\t\t \tvar currentIndex = array.length;\n\t\t\t\t\t\t\t\t \tvar temporaryValue;\n\t\t\t\t\t\t\t\t \t//var randIndex;\n\n\t\t\t\t\t\t\t\t \twhile (currentIndex > 0){\n\t\t\t\t\t\t\t\t \t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\t\t\t\t\t\t \t\tcurrentIndex --;\n\n\t\t\t\t\t\t\t\t \t\ttemporaryValue = array[currentIndex];\n\t\t\t\t\t\t\t\t \t\tarray[currentIndex] = array[randomIndex];\n\t\t\t\t\t\t\t\t \t\tarray[randomIndex] = temporaryValue;\n\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t \t\treturn array;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "shuffle(list) {\n list = list.slice();\n let shuffled = [];\n while (list.length) {\n let pos = (config.PRNG.nextFloat() * list.length)|0;\n shuffled.push( list.splice(pos,1)[0] );\n }\n return shuffled;\n }", "shuffleCards() {\n let random = 0;\n let temp = 0;\n for (i = 1; i < game.cards.length; i++) {\n random = Math.round(Math.random() * i);\n temp = game.cards[i];\n game.cards[i] = game.cards[random];\n game.cards[random] = temp;\n }\n game.assignData();\n \n }", "shuffle ()\r\n {\r\n for (let i = this.arr.length - 1; i > 0; i--)\r\n {\r\n let num = Math.floor (Math.random () * (i + 1));\r\n this.arr [num].style.order = i;\r\n this.arr [i].style.order = num;\r\n }\r\n }", "function shuffle(a) {\n\tfor (let i = a.length; i; i--) {\n\t\tlet j = Math.floor(Math.random() * i);\n\t\t[a[i - 1], a[j]] = [a[j], a[i - 1]];\n\t}\n}", "function shuffle(a) {\n\tfor (let i = a.length; i; i--) {\n\t\tlet j = Math.floor(Math.random() * i);\n\t\t[a[i - 1], a[j]] = [a[j], a[i - 1]];\n\t}\n}", "function shuffle(a) {\n\tfor (let i = a.length; i; i--) {\n\t\tlet j = Math.floor(Math.random() * i);\n\t\t[a[i - 1], a[j]] = [a[j], a[i - 1]];\n\t}\n}", "_shuffle(o){\n\t\t\tfor(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\t\treturn o;\n\t}", "shuffle(a) {\n let j, x, i;\n for (let i = a.length; i; i--) {\n let j = Math.floor(Math.random() * i);\n [a[i - 1], a[j]] = [a[j], a[i - 1]];\n }\n return a;\n }", "function shuffleDeck(){\n var firstIndex, secondIndex, firstCard, secondCard;\n for(var swaps = 0; swaps < 1000; swaps++){\n firstIndex = Math.floor(Math.random() * 48);\n secondIndex = Math.floor(Math.random() * 48);\n\n firstCard = currentDeck[firstIndex];\n secondCard = currentDeck[secondIndex];\n\n currentDeck[firstIndex] = secondCard;\n currentDeck[secondIndex] = firstCard;\n }\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function slv_shuffle(a) {\n for (var i = a.length - 1; i >= 1; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n if (j < i) {\n var tmp = a[j];\n a[j] = a[i];\n a[i] = tmp;\n }\n }\n }", "shuffleDeck() {\n\t\t// Loop through the deck and shuffle cards\n \t\tfor (let i = this.mCardDeck.length - 1; i > 0; i--) {\n \tconst j = Math.floor(Math.random() * (i + 1));\n \t[this.mCardDeck[i], this.mCardDeck[j]] = [this.mCardDeck[j], this.mCardDeck[i]];\n \t}\n \t}", "shuffle() {\n for(let x = 0; x < 2; x++) { \n for (let i = this.cards.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1)); // random index from 0 to i\n [this.cards[i], this.cards[j]] = [this.cards[j], this.cards[i]]; // swap elements\n }\n }\n }", "function shufflePls(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i+1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function shuffle(num) {\n cards.forEach(card => {\n let randomNum = Math.floor(Math.random() * (num*2));\n card.style.order = randomNum;\n });\n}", "function shuffle(arr) {\n var j, x, i;\n for (i = arr.length; i; i--) {\n j = Math.floor(Math.random() * i);\n x = arr[i - 1];\n arr[i - 1] = arr[j];\n arr[j] = x;\n }\n}", "function shuffle (a) { \n\tvar o = [];\n\n\tfor (var i=0; i < a.length; i++) {\n\t\to[i] = a[i];\n\t}\n\n\tfor (var j, x, i = o.length;\n\t i;\n\t j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\t\n\treturn o;\n}", "function shuffleDeck() {\n // for 1000 turns\n // switch the values of two random cards\n for (var i = 0; i < 1000; i++) {\n var location1 = Math.floor(Math.random() * deck.length);\n var location2 = Math.floor(Math.random() * deck.length);\n var tmp = deck[location1];\n\n deck[location1] = deck[location2];\n deck[location2] = tmp;\n }\n}", "static shuffle(deck){\n\t var randomIndex;\n\t var temp;\n\t for(var i = 0; i < deck.length; i++){\n\t //pick a random index from 0 to deck.length - 1\n\t randomIndex = Math.floor(Math.random() * deck.length);\n\n\t temp = deck[i];\n\t deck[i] = deck[randomIndex];\n\t deck[randomIndex] = temp;\n\n\t }\n\t }", "function shuffle()\n{\n var tem = getRandom(shuffleIndexCount);\n var tem2 = shuffleIndex[tem];\n shuffleIndex[tem] = shuffleIndex[shuffleIndexCount];\n\n shuffleIndexCount--;\n if(shuffleIndexCount < 0)\n {\n shuffleIndexCount = songsList.length;\n }\n return tem2;\n}", "function shuffle () {\n for (var i = 0; colorSet.length > 0; i += 1) {\n colorShuffled = colorShuffled.concat(colorSet.splice(Math.floor(Math.random() * colorSet.length), 1));\n }\n}", "reshuffle() {\n this._deck = [];\n for(var i = 0; i < 52; i++) {\n\t\t\tthis._deck.push(i);\n\t\t}\n \n this.shuffle();\n }", "shuffleDeck() {\n let n = this.deck.length;\n for (let i = 0; i < n; i++) {\n var r = Math.floor(Math.random() * n);\n this.shuffledCards.push(this.deck[r]);\n this.deck[r] = this.deck[n - 1];\n n--;\n }\n }", "shuffle() {\n let currentIndex = this.length;\n let temp, randomIndex;\n\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temp = this[currentIndex];\n this[currentIndex] = this[randomIndex];\n this[randomIndex] = temp;\n }\n }", "function shuffleFunc() {\n\tresetFunc();\n\tshuffle();\n}", "function shuffle(num) {\n return ingredients[num];\n}", "function shuffleDeck(){\n for(let i=0;i<deck.length;i++ ){\n swapIdx=Math.trunc( Math.random() * deck.length);\n let temp =deck[swapIdx];\n deck[swapIdx]=deck[i];\n deck[i]=temp;\n }\n}", "function shuffle(input) {\r\n let array = [...input];\r\n\r\n let count = array.length;\r\n let randomnumber;\r\n let temp;\r\n while (count) {\r\n randomnumber = Math.random() * count-- | 0;\r\n temp = array[count];\r\n array[count] = array[randomnumber];\r\n array[randomnumber] = temp;\r\n }\r\n\r\n return array;\r\n }", "function shuffle(X) {\n var N = X.length - 1;\n var t = 0;\n for (var i = N; i > 0; i--) {\n var r = Math.floor(( i + 1) * Math.random());\n//r is random integer from 0 to i;\n// swap the ith element with the rth element;\n t = X[r];\n X[r] = X[i];\n X[i] = t;\n }\n return X\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "shuffle() {\n this._decks.forEach(deck => deck.shuffle())\n return super.shuffle();\n }", "shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function createShuffle() {\r\n shuffled = [];\r\n for (var i = 0; i < songs.length; i++) {\r\n shuffled.push(i);\r\n }\r\n return randomize(shuffled);\r\n }", "function shuffleCards() {\n for (var i = 0; i < 52; i++) {\n var randIndex = getRand();\n if (i == 0) {\n deckCards.arrayOfCards[i] = randIndex;\n } else {\n while (deckCards.arrayOfCards.indexOf(randIndex) != -1) {\n randIndex = getRand();\n }\n deckCards.arrayOfCards[i] = randIndex;\n }\n }\n}", "function shuffle(o) { //v1.0\n\tfor (var j, x, i = o.length; i; j = parseInt(Math.random() * i,10), x = o[--i], o[i] = o[j], o[j] = x);\n\treturn o;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "shuffle() {\n // -- To shuffle an array a of n elements (indices 0..n-1):\n // for i from n−1 downto 1 do\n // j ← random integer such that 0 ≤ j ≤ i\n // exchange a[j] and a[i]\n for (let n = this.cards.length - 1; n > 0; --n)\n {\n //Step 2: Randomly pick a card which has not been shuffled\n let k = Math.floor(Math.random() * (n + 1));\n\n //Step 3: Swap the selected item with the last \"unselected\" card in the collection\n let temp = this.cards[n];\n this.cards[n] = this.cards[k];\n this.cards[k] = temp;\n }\n }", "function shuffle(o){ //v1.0\n\t\t\tfor(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\t\treturn o;\n\t\t}", "function shuffle(a) {\n for (let i = a.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [a[i], a[j]] = [a[j], a[i]];\n }\n }", "function getShuffled() {\r\n return shuffled;\r\n }", "function shuffle() {\n // for 1000 turns\n // switch the values of two random cards\n for (let i = 0; i < 1000; i++) {\n let location1 = Math.floor(Math.random() * cards.length);\n let location2 = Math.floor(Math.random() * cards.length);\n let tmp = cards[location1];\n\n cards[location1] = cards[location2];\n cards[location2] = tmp;\n }\n\n // console.log(cards);\n}", "function shuffle(a) {\n for (let i = a.length; i; i--) {\n let j = Math.floor(Math.random() * i);\n [a[i - 1], a[j]] = [a[j], a[i - 1]];\n }\n}", "function shuffle (array) {\r\n var i = 0\r\n , j = 0\r\n , temp = null\r\n\r\n for (i = array.length - 1; i > 0; i -= 1) {\r\n j = Math.floor(Math.random() * (i + 1))\r\n temp = array[i]\r\n array[i] = array[j]\r\n array[j] = temp\r\n }\r\n }", "function shuffleDeckEn() {\n $(\".game-card-en\").each(function () {\n let shuffledDeckEn = Math.floor(Math.random() * 21);\n this.style.order = shuffledDeckEn;\n });\n }", "shuffleCards(a) {\n for(let i=a.length-1;i>0;i--){\n const j = Math.floor(Math.random() * (i + 1));\n [a[i], a[j]] = [a[j], a[i]];\n }\n }", "function shuffle(a) {\r\n for (let i = a.length - 1; i > 0; i--) {\r\n const j = Math.floor(Math.random() * (i + 1));\r\n [a[i], a[j]] = [a[j], a[i]];\r\n console.log(\"I am shuffled \"+a[i]);\r\n }\r\n return a;\r\n}", "function shuffle(a) {\n\t\tfor (let i = a.length; i; i--) {\n\t\t\t// The next semicolon is due to a bug in babel es2015 presets\n\t\t\t// https://github.com/babel/babel/issues/2304\n\t\t\t// which seems closed and unresolved\n\t\t\tlet j = Math.floor(Math.random() * i);\n\t\t\t[a[i - 1], a[j]] = [a[j], a[i - 1]]\n\t\t}\n\t return a\n\t}", "function shuffle()\n\t{\n\t\tvar o = slides;\n\t\tfor (var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\tslides = o;\n\t}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function scramble(arr) {\n for (let i = arr.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * i);\n const temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n return arr;\n }", "randomShuffle() {\n const shuffled = [];\n const unshuffled = this.cards.slice();\n\n while (unshuffled.length > 0) {\n const randomCard = Math.floor(Math.random() * unshuffled.length);\n shuffled.push(unshuffled.splice(randomCard, 1)[0]);\n }\n\n this.cards = shuffled;\n }", "function shuffle(newArray) {\n let num1 = newArray.length;\n let num2 = 0;\n let temp;\n while (num1--) {\n num2 = Math.floor(Math.random() * (num1 + 1));\n temp = newArray[num1];\n newArray[num1] = newArray[num2];\n newArray[num2] = temp;\n }\n return newArray;\n }", "function shuffle (a)\n{\n var o = [];\n\n for (var i=0; i < a.length; i++) {\n o[i] = a[i];\n }\n\n for (var j, x, i = o.length;\n i;\n j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n return o;\n}", "shuffle(v) {\n for (var j, x, i = v.length; i; j = parseInt(Math.random() * i, 10), x = v[--i], v[i] = v[j], v[j] = x);\n return v;\n }", "static shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffle(array) {\n//randomizes the order of the figures in the array\n let currentIndex = array.length, randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n [array[currentIndex], array[randomIndex]] = [\n array[randomIndex], array[currentIndex]];\n }\n return array;\n}", "function shuffle(o){ //v1.0\n\t for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\treturn o;\n\t}", "shuffleCards() {\n for (var i = cards.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1))\n var temp = cards[i]\n cards[i] = cards[j]\n cards[j] = temp\n }\n }", "shuffle() {\n for (let i = this.cards.length - 1; i > 0; i--) {\n const newIndex = Math.floor(Math.random() * (i + 1)); //get random index before the current card to swap with\n const oldValue = this.cards[newIndex];\n this.cards[newIndex] = this.cards[i];\n this.cards[i] = oldValue;\n //Looping through all of our cards and swapping them with another card to get a random shuffle\n }\n }" ]
[ "0.76403165", "0.7630073", "0.7626577", "0.74867874", "0.73588365", "0.7339221", "0.7332727", "0.7319219", "0.728344", "0.72733736", "0.723786", "0.72317904", "0.72301614", "0.7219366", "0.7194882", "0.7194467", "0.7157791", "0.7142489", "0.7142117", "0.71336997", "0.71317905", "0.71259695", "0.7121532", "0.7120075", "0.7114188", "0.71130866", "0.71123666", "0.7111866", "0.71109295", "0.7101837", "0.7100341", "0.70975035", "0.70932746", "0.7089423", "0.70727974", "0.70702225", "0.7069479", "0.7069459", "0.7069459", "0.7065336", "0.7064391", "0.70598304", "0.70581496", "0.70581496", "0.70581496", "0.7048703", "0.7040208", "0.70355713", "0.70306325", "0.7018271", "0.7016757", "0.7016161", "0.70160824", "0.7005444", "0.69944113", "0.69917256", "0.6988362", "0.69883585", "0.6985258", "0.69850683", "0.6984404", "0.6983407", "0.6983219", "0.69795823", "0.6973446", "0.6964123", "0.69605553", "0.69592994", "0.6952077", "0.6952077", "0.6945388", "0.6936288", "0.69211566", "0.69202566", "0.6920194", "0.6917668", "0.6914567", "0.6913055", "0.69118565", "0.6909949", "0.69074845", "0.6906917", "0.69037414", "0.6897681", "0.6893825", "0.68926626", "0.68921787", "0.689017", "0.68830574", "0.68830574", "0.68830574", "0.6881548", "0.6879128", "0.68767655", "0.68704253", "0.68698895", "0.6867473", "0.68647134", "0.6852134", "0.68515974", "0.6850833" ]
0.0
-1
Description: this will sort the numbers array
function sortNumberBoard(){ this.clearBoards() boardItems.sort(); screenView() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortNumbers(arr) {\n arr.sort((a, b) => {\n return a - b;\n });\n return arr;\n}", "function Numsort(a,b) { return a - b; }", "function numsort(a, b) {return (a - b);}", "function nSort(numArray) {\n return numArray.sort((function (a, b) { return a - b; }));\n}", "function numSort(a,b) { \n\t\t\t\treturn a - b; \n\t\t\t}", "function numsort(a, b) {\n return b - a;\n }", "function sortNumAsc() {\n let array = [9, 2, 0, 5, 3, 6, 1, 7, 8, 4];\n\n for (let i = array.length; i >= 0; i--) {\n for (let j = array.length - 1; j >= 0; j--) {\n if (array[i] > array[j]) {\n let tempNum = array[i];\n array[i] = array[j];\n array[j] = tempNum;\n }\n }\n }\n\n return array;\n}", "function numsort(a, b) {\n return b - a;\n }", "function sortNums(numbers,desc=false) {\n numbers.sort(function(a, b){return a-b});\n numbers.sort(function(a, b){return b-a});\n }", "function sortNumber(a,b){\n\t//this is done so as to sort the negative numbers in the array.\n return a - b;\n}", "function sorting(arrNumber) {\n\tvar sortedNumber = arrNumber.sort(function(a, b) {return b - a});\n\treturn sortedNumber;\n}", "function sort() {\n myArray.sort(compareNumbers);\n showArray();\n}", "function sortNumDesc() {\n let array = [9, 2, 0, 5, 3, 6, 1, 7, 8, 4];\n\n for (let i = array.length; i >= 0; i--) {\n for (let j = array.length - 1; j >= 0; j--) {\n if (array[i] < array[j]) {\n let tempNum = array[i];\n array[i] = array[j];\n array[j] = tempNum;\n }\n }\n }\n\n return array;\n}", "function sort() {\n renderContent(numArray.sort());\n}", "function sort(){\n myArray.sort(compareNumbers);\n\n showAray();\n}", "function sort(numbers) {\n for (let j = 1; j < numbers.length; j++) {\n let flag = 0;\n\n for (let i = 0; i < numbers.length - j; i++) {\n if (numbers[i] > numbers[i + 1]) {\n [numbers[i], numbers[i + 1]] = [numbers[i + 1], numbers[i]];\n flag = 1;\n }\n }\n\n if (flag === 0) {\n break;\n }\n }\n\n return numbers;\n}", "function sortArrayNumerically(a, b) {\n return a > b ? 1 : b > a ? -1 : 0;\n}", "function mergeSort(numArray){\n\n}", "function numberSortFunction(a, b) {\n return a - b;\n}", "function numSort(a, b) {\n return a - b;\n }", "function numSort(a, b) {\n return a - b;\n }", "function sortNumber(a,b) {\r\n\t\t\treturn b - a;\r\n\t\t}", "sortNumber(a, b) {\n return a - b;\n }", "function sortNums(numbers,desc=false) {\n console.log(numbers.sort((a, b) => a - b))\n console.log(numbers.sort((a, b) => b - a))\n }", "function numberSort (a, b) {\n if (a > b) {\n return -1;\n } else if (a < b) {\n return 1;\n }\n\n return 0;\n}", "function sortNumber (a, b) {\n return a - b;\n }", "function sorting(arrNumber) {\n // code di sini\n var current = false\n while (current === false) {\n current = true\n for (var i = 1; i < arrNumber.length; i++) {\n if (arrNumber[i-1] > arrNumber[i]) {\n current = false\n var move = arrNumber[i-1]\n arrNumber[i-1] = arrNumber[i]\n arrNumber[i] = move\n }\n }\n }\n return arrNumber\n }", "function sortNumber(a,b) {\n \treturn a - b;\n\t}", "function sortNumber(a, b) {\n return a - b;\n }", "function sortNumber(a, b) {\n return b - a;\n }", "sort() {\n let a = this.array;\n const step = 1;\n let compares = 0;\n for (let i = 0; i < a.length; i++) {\n let tmp = a[i];\n for (var j = i; j >= step; j -= step) {\n this.store(step, i, j, tmp, compares);\n compares++;\n if (a[j - step] > tmp) {\n a[j] = a[j - step];\n this.store(step, i, j, tmp, compares);\n } else {\n break;\n }\n }\n a[j] = tmp;\n this.store(step, i, j, tmp, compares);\n }\n this.array = a;\n }", "function sortNumbers(a,b) {\nreturn (a-b);\n}", "function sortVersionArray(arr) {\n return arr.map( a => a.replace(/\\d+/g, n => +n+100000 ) ).sort()\n .map( a => a.replace(/\\d+/g, n => +n-100000 ) );\n}", "function sortNumbers(arr, order){\n var a = arr.sort(function(a, b){ return a - b; });\n return order == \"desc\" ? a.reverse() : a;\n }", "function sortNumbersAscending(a, b) {\n\t return a - b;\n\t}", "function numbers(num) {\n num[0] = random(1, 91);\n for (var i = 1; i < 5; i++) {\n do {\n num[i] = random(1, 91);\n var equal = false;\n for (var j = 0; j < i; j++) {\n if (num[i] == num[j]) {\n equal = true;\n }\n }\n\n }\n while (equal == true);\n }\n num.sort(sortNumber);\n console.log(num);\n}", "sort(arr) {\n function IsNumber(arr) {\n for (let i = 0; i < arr.length; i++) {\n\n if (typeof arr[i] === 'number') {\n return arr.sort(function (a, b) { return a - b });\n } else if (typeof arr[i] === 'string') {\n return arr.sort();\n } else {\n return [];\n }\n }\n }\n return IsNumber(arr);\n }", "function sortNumber(event){\n\tevent.preventDefault();\n\t// Sort numbers\n\tbubbleSort(list)\n\tlist.reverse();\n\t// Print array\n\tprintArray(list);\n}", "function sortNumberArray(theArray,theOperation) {\n var sortedArray = theArray;\n\n if (theOperation==\"ASC\") {\n sortedArray.sort(function(a,b){return a-b});\n } else {\n sortedArray.sort(function(a,b){return b-a});\n }\n\n console.log(sortedArray);\n return sortedArray;\n}", "function sortNums(num1, num2) {\n return num1 - num2;\n}", "function numericalArraySortAscending(a, b)\n{\n return (a-b);\n}", "function sortNumber(a,b){\n\treturn a - b;\n}", "function sortNumber(a, b) {\n\treturn a - b;\n}", "function sortNumber(a, b) {\n return a - b;\n}", "function start()\n{\n var a = [ 10, 1, 9, 2, 8, 3, 7, 4, 6, 5 ];\n\n outputArray( \"Data items in original order: \", a,\n document.getElementById( \"originalArray\" ) ); \n a.sort( compareIntegers ); // sort the array\n outputArray( \"Data items in ascending order: \", a,\n document.getElementById( \"sortedArray\" ) ); \n} // end function start", "function sortNumber(a,b) {\n return a - b;\n}", "function sortNumber(a,b) {\n return a - b;\n}", "function SortNumbers(a, b) {\n return (a - b);\n}", "function sortNumber(a, b) {\n return a - b;\n}", "function sortNumber(a, b){\n return a-b;\n }", "function sort(theArray){\n\n}", "function sortArrayDesc(arr) {\n var num = 0;\n for (var i = 0;i<arr.length;i++){\n for (var j = 0;j<arr.length-i;j++){\n if (arr[j]<arr[j+1]){\n num=arr[j];\n arr[j]=arr[j+1];\n arr[j+1]=num;\n }\n }\n }\n return arr;\n}", "function numSort(a, b) {\n if (a > b) {\n return -1\n } else if (a < b) {\n return 1\n } else {\n return 0\n }\n}", "getSortArray() {\n const sortable = []; // {\"1\": 10, \"49\": 5}\n for (const key in this.numberPool) \n sortable.push([Number(key), this.numberPool[key]]);\n \n sortable.sort((a, b) => b[1] - a[1]); // Descending\n return sortable;\n }", "function sort(array){\n var buckets = [], // empty array to hold the intermediate values during the sort.\n bLen = 0, // length of each bucket\n len = array.length,\n div = 10,\n bucketIdx = 0,\n curSize = 0,\n maxSize = 0,\n iter = 0\n\n // Find the maximum number of digits comprising any element in the array. That will decide how many iterations we go into\n for(let i = 0; i < len; i++){\n curSize = Math.floor(Math.log10(array[i])) + 1\n maxSize = (maxSize < curSize) ? curSize : maxSize\n }\n\n // Now iterate over the array to sort it. per Wikipedia, I am doing an LSD radix sort (least significant digit)\n while (iter < maxSize){\n // create the empty buckets\n buckets = []\n for(let i = 0; i < 10; i++){\n buckets.push([])\n }\n\n // Populate the buckets\n for(let i = 0; i < len; i++){\n // Find the lest significant digit to sorton. With each iteration, this moves 1 digit to the left\n bucketIdx = Math.floor((array[i] % div) / (div/10))\n buckets[bucketIdx].push(array[i])\n }\n\n // Reset the array.\n array = []\n // write contents of buckets back into array\n for(let i = 0; i < 10; i++){\n bLen = buckets[i].length\n if (bLen > 0){\n for(let j = 0; j < buckets[i].length; j++)\n array.push(buckets[i][j])\n }\n }\n\n // increment the divisor\n div *= 10\n // increment the iteration count\n iter += 1\n }\n\n // return the sorted array\n return array\n}", "function sortNum(a, b) {\n return a - b;\n}", "function start() {\n\tvar a = [10, 1, 9, 2, 8, 3, 7, 4, 6, 5];\n\n\toutputArray(\"Data items in original order: \", a, document.getElementById('originalArray'));\n\ta.sort(compareIntegers); //sort the array\n\toutputArray(\"Data items in ascending order: \", a, document.getElementById('sortedArray'));\n} //end function start", "function bubblesort(){\n\tfor(var i = 0; i < numbers.length - 1; i ++){\n\t\tif(numbers[i] > numbers[i+1]) {\n\t\t\tswap(numbers, i, i+1);\n\t\t}\n\t}\n}", "function sortNumeric(a, b) {\n return a - b;\n}", "function radixSort(arr) {\n\tconst digitCount = mostDigits(arr);\n\t// Loop through digit indexes\n\tfor (let d = 0; d < digitCount; d++) {\n\t\t// Create digit buckets\n\t\tconst digitBuckets = Array.from({ length: 10 }, () => []);\n\n\t\t// Loop through numbers in array\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\t// Get current digit for current number and add to proper bucket\n\t\t\tconst currentDigitIndex = getDigit(arr[i], k);\n\t\t\tdigitBuckets[currentDigitIndex].push(arr[i]);\n\t\t}\n\t\t// Reasign list of numbers each time to get closer to sorted\n\t\tarr = [].concat(...digitBuckets);\n\t}\n\treturn arr;\n}", "function sortNums(numbers,desc=false) {\n if (desc) {\n numbers.sort((a, b) => {return b- a});\n } else {\n numbers.sort((a, b) => {return a - b});\n }\n console.log(numbers);\n}", "function sortByNum(a, b) {\n return (a.peoplenum + a.recognized) < (b.peoplenum + b.recognized);\n }", "function solution(nums){\n return Array.isArray(nums) ? nums.sort((a, b) => a - b) : [];\n}", "function Reordernar(numeros) {\n\t\tfor(var i = 0; i < numeros.length; i++){\n\t\t\tfor(j=i+1; j < numeros.length; j++){\n\t\t\t\tif(numeros[i] > numeros[j]){\n\t\t\t\t\tauxiliar = numeros[i];\n\t\t\t\t\tnumeros[i] = numeros[j];\n\t\t\t\t\tnumeros[j] = auxiliar;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn numeros;\n\t}", "function sortDesc(arrayNr) {\n\tfor(let i=0; i<arrayNr.length-1; ++i) {\n\t\tfor(let j=i+1; j<arrayNr.length; ++j) {\n\t\t\tif(arrayNr[i]<arrayNr[j]) {\n\t\t\t\tlet sw=arrayNr[i];\n\t\t\t\tarrayNr[i]=arrayNr[j];\n\t\t\t\tarrayNr[j]=sw;\n\t\t\t}\n\t\t}\n\t}\n\treturn arrayNr;\n}", "function filterNumbers(array) {\n var bucket=[];\n array.forEach(function(element) {\n if (typeof element === \"number\") {\n bucket.push(element);\n }\n })\n return bucket.sort(function(a, b){return a-b});\n}", "function sort(array) {\n var buf;\n\n for (var j = 0; j < array.length-1; j++)\n for (var i = 0; i < array.length-j; i++) {\n if (array[i] > array[i+1]) {\n buf = array[i];\n array[i] = array[i+1];\n array[i+1] = buf;\n }\n }\n\n return array;\n }", "function radixSort (numbers) {\n function emptyBuckets () { // empties buckets and adds contents back to workArray\n workArray.length = 0;\n for (i = 0; i < 10; i += 1) { // could have used buckets forEach but this is quicker on average\n if(buckets[i].length > 0){\n workArray.push(...buckets[i]);\n buckets[i].length = 0;\n }\n }\n }\n var i; // hoist declarations \n const results = []; // array that holds the finnal sorted numbers\n const buckets = [[], [], [], [], [], [], [], [], [], []]; // buckets\n const workArray = [...numbers]; // copy the numbers\n var power = 0; // current digit as a power of ten\n var tenPow = 1; // ten to the power of power\n if(numbers.length <= 1){ // if one or no items then dont sort\n return workArray; // dont sort if there is no need.\n }\n // as numbers are sorted and moved to the result array the numbers \n while (workArray.length > 0) {\n for (i = 0; i < workArray.length; i += 1) { // for all numbers still being sorted\n if (workArray[i] < tenPow) { // is the number samller than the current digit\n results.push(workArray[i]); //Yes it is sorted then remove a put o nthe result array\n } else {\n // add to bucket. Use Math.floor and save complexity doing it in one statement line\n buckets[Math.floor(workArray[i] / tenPow) % 10].push(workArray[i]);\n }\n }\n power += 1;\n tenPow = Math.pow(10, power); \n emptyBuckets();\n }\n return results;\n}", "function numericalSort(a, b) {\n return a > b ? 1 : b > a ? -1 : 0;\n }", "function sortNumeric(val1, val2)\n{\n return val1 - val2;\n}", "function newOrder(numeros) {\n\n numeros.sort(function(a,b) {\n return a -b ;\n });\n return console.log(numeros);\n}", "function Sort(arr)\n{\n\n}", "function setup() {\n for (var i = 0; i < arr.length - 1; i++)\n {\n var index = i;\n for (var j = i + 1; j < arr.length; j++)\n if (arr[j] < arr[index])\n index = j;\n \t\t // Swapping Code\n var smallerNumber = arr[index];\n arr[index] = arr[i];\n arr[i] = smallerNumber;\n }\n}", "function Sort() {}", "function numberSort(wert){\n\tmembers.sort(function(a, b){\n\treturn b[wert]-a[wert];\n\t});\n}", "numericSort(a, b, invert) {\r\n\t\tif (invert){\r\n\t\t\treturn b.value - a.value;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn a.value - b.value;\r\n\t\t}\r\n\t}", "function myarrayresult(){\r\narray2.sort(function (a,b) {\r\n return a-b; //For assending order \r\n return b-a; //For descendening Order // Correct \r\n});\r\n}", "function task14_16_10(){\n var scores =[320,230,480,120];\n document.write(\"Scores of Students : \"+scores + \"<br>\");\n scores.sort();\n document.write(\"Ordered Score of Students : \"+scores);\n}", "static sort(arr) {\n const n = arr.length;\n \n for (let i = 1; i < n; i++) {\n for (let j = i; j > 0 && less(arr[j], arr[j - 1]); j--) {\n swap(arr, j, j - 1);\n }\n }\n }", "function sortArr2(arr) {\n console.table(arr.sort((a, b) => a - b)\n );\n}", "sort() {\n for (let i = 0; i < this.values.length - 1; i++) {\n let min = i;\n for (let j = i + 1; j < this.values.length; j++) {\n if (this.values[j] < this.values[min]) min = j;\n }\n\n this.swap(i, min);\n }\n }", "function bubbleSort(num){\n for(let i = num.length; i >= 0; i--){\n for(let j = 0; j < i - 1; j++){\n console.log(num , num[j], num[j +1]);\n if(num[j] > num[j + 1]){\n let temp = num[j];\n num[j] = num[j + 1];\n num[j + 1] = temp;\n }\n }\n }\n return num\n}", "function alfa (arr){\n\tfor (var i = 0; i< arr.length;i++){\n\t\tarr[i].sort();\n\t}\n\treturn arr;\n}", "function sort() {\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (var i = 1; i < _Array.length - 1; i += 2) {\n if (_Array[i] > _Array[i + 1]) {\n swap(i, i + 1);\n sorted = false;\n }\n }\n for (var i = 0; i < _Array.length - 1; i += 2) {\n if (_Array[i] > _Array[i + 1]) {\n swap(i, i + 1);\n sorted = false;\n }\n }\n }\n }", "function sortArr(a, b){\n return a - b ;\n }", "function rankitup(array) {\narray.sort(function(a, b){return a-b});\n}", "function bubbleSort(numArray){\n let temp = 0;\n let sorted;\n\n for(i = 0; i < numArray.length - 1; i++){\n sorted = true;\n\n for(j = 0; j < numArray.length - i + 1; j++){\n if (numArray[j] > numArray[j + 1]){\n temp = numArray[j];\n numArray[j] = numArray[j+1];\n numArray[j + 1] = temp;\n sorted = false;\n } \n }\n\n if (sorted){\n break;\n }\n }\n return numArray;\n}", "function sortNums(nums) {\n\n console.log('original array = ', nums);\n\n var copyOfNums = nums.slice();\n var sorted = [];\n\n for (var i = 0; i < nums.length; i++) {\n var min = Infinity; //or min = CopyOfNums[0];\n var indexMin = -1; //or indexMin = 0;\n\n //for each item in CopyOfNums\n for (var j = 0; j < copyOfNums.length; j++) {\n if (copyOfNums[j] < min) {\n min = copyOfNums[j];\n indexMin = j;\n\n /*\n //instead can do this\n if (CopyOfNums[j] < CopyOfNums[indexMin]) indexMin = j;\n \n */\n }\n }\n sorted.push(min);\n copyOfNums.splice(indexMin, 1);\n }\n\n console.log(sorted);\n return sorted;\n}", "function promtNumber(ynum) {\n for (var i = 0; i < 5; i++) {\n do {\n ynum[i] = prompt(i + 1 + \" szám amit tippelsz\");\n var equal = false;\n for (var j = 0; j < i; j++) {\n if (ynum[i] == ynum[j]) {\n equal = true;\n }\n }\n }\n while (ynum[i] < 1 || ynum[i] > 90 || isFinite(ynum[i]) == false||equal ==true)\n }\n ynum.sort(sortNumber);\n console.log(ynum);\n}", "function sortArray() {\n\n //PRZYPISANIE WARTOSCI DO TABLICY\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //SORTOWANIE OD NAJMNIEJSZEJ DO NAJWIEKSZEJ\n points.sort(function (a, b) {\n //POROWNANIE DWOCH ELEM. TABLICY - MNIEJSZY STAWIA PO LEWEJ, WIEKSZY PO PRAWEJ\n return a - b;\n });\n\n //ZWROCENIE POSORTOWANEJ TABLICY\n return points;\n}", "static sort(a)\n{//return a if array lenth is less then 2.\n if(a.length<2)\n return a;\n else{\n for(var i=0;i<a.length;i++){\n for(var j=0;j<a.length-i-1;j++)\n {//checks first value with next value\n if(a[j]>a[j+1]){\n //swap the values\n var temp=a[j];\n a[j]=a[j+1];\n a[j+1]=temp;\n }//end if\n }//end for j\n }//end for i\n }//end else\n//making the sorted array global\n module.exports.a=a;\n //returns a\n return a;\n}", "function sortNumber(a, b) {\n return b.puntuacion - a.puntuacion;\n}", "function sortNumber(a, b) {\n return b.puntuacion - a.puntuacion;\n}", "function numberCompare(a, b) {\n\t if (sortAscending) {\n\t \treturn a - b;\n\t } else {\n\t \treturn b - a;\n\t }\n\t}", "function selectionSort(numbers) {\n var length = numbers.length;\n for (var index = 0; index < length; index++) {\n var smallestNumIndex = index;\n for (var nextNumIndex = index + 1; nextNumIndex < length; nextNumIndex++) {\n if (numbers[nextNumIndex] < numbers[smallestNumIndex]) {\n smallestNumIndex = nextNumIndex;\n }\n }\n if (smallestNumIndex != index) {\n var currentNumber = numbers[index];\n numbers[index] = numbers[smallestNumIndex];\n numbers[smallestNumIndex] = currentNumber;\n }\n }\n return numbers;\n}", "function sortArray() {\n //Twoj komentarz ...\n //deklaracje tablicy z elemtami\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //Twoj komentarz ...\n points.sort(function(a, b) {\n //Twoj komentarz ...\n\n return a - b;\n });\n\n //Twoj komentarz ...\n //zwrócenie tablicy points\n return points;\n}", "function sortNumbers() {\n numbers = [8, 6, 1, 3];\n console.log(`This is the array not sorted: ${numbers}`);\n return (`This is the array sorted: ${numbers.sort()}`)\n}", "function threeNumberSort(array, order) {\n\tlet lastNonNumIdx = 0;\n \torder.forEach(num => {\n\t\tfor (let i = lastNonNumIdx; i < array.length; i++) {\n\t\t\tif (array[i] === num) {\n\t\t\t\t[array[i],array[lastNonNumIdx]] = [array[lastNonNumIdx],array[i]] \t\n\t\t\t\tlastNonNumIdx++;\n\t\t\t}\n\t\t}\n\t})\n\t\n\treturn array;\n}", "function sortArray1(arr) {\n return arr.sort((a, b) => a-b)\n}", "function sort(arr){\n\t\n for(var i = 0; i < arr.length; i++){\n\n for(var j = 0; j < ( arr.length - i -1 ); j++){\n if(arr[j] < arr[j+1]){\n var temp = arr[j]\n arr[j] = arr[j + 1]\n arr[j+1] = temp\n }\n }\n }\n console.log(arr);\n }", "function sort(unsortedArray) {\n // Your code here\n}" ]
[ "0.8030156", "0.7556718", "0.7548461", "0.75326174", "0.74906075", "0.74823415", "0.7468869", "0.74661523", "0.7354888", "0.73415333", "0.7325714", "0.7317334", "0.73063064", "0.72526586", "0.7228599", "0.7224971", "0.72163576", "0.72051525", "0.71884114", "0.7185287", "0.7185287", "0.7157089", "0.71386874", "0.7132699", "0.71300083", "0.7128097", "0.71162546", "0.7069657", "0.7049474", "0.70484835", "0.70464104", "0.7040984", "0.7037667", "0.7016085", "0.7014448", "0.7012942", "0.69879234", "0.69611305", "0.69497", "0.692726", "0.68956226", "0.6891372", "0.6890524", "0.6883943", "0.6883575", "0.6844771", "0.6844771", "0.6838138", "0.68157756", "0.68124056", "0.68077505", "0.680166", "0.67980635", "0.6776573", "0.67738134", "0.6762472", "0.67604405", "0.6734551", "0.6709777", "0.6708874", "0.67073774", "0.66925347", "0.6681741", "0.6674041", "0.6659133", "0.6656995", "0.6635552", "0.66348183", "0.663309", "0.66265", "0.6621601", "0.6616775", "0.659658", "0.6581147", "0.6573092", "0.65604377", "0.6536068", "0.6513334", "0.650776", "0.65040517", "0.6502779", "0.650195", "0.6501129", "0.6500625", "0.6498871", "0.64859474", "0.6471995", "0.64718866", "0.6449864", "0.64376765", "0.6422906", "0.64126825", "0.64126825", "0.6401088", "0.6396586", "0.63794553", "0.63701916", "0.63696074", "0.6368575", "0.6367456", "0.6365774" ]
0.0
-1
Function that updates the list of Online TA's If the user is a TA then he/she does not get a join/leave option while a student does
function get_ta_status(data) { var parser = document.createElement('a'); parser.href = window.location.href; var ta_net_id = parser.pathname.split('/')[2]; // student var mydiv = document.getElementById('ta_status'); // Creates HTML List with all TA's if (data){ var html_data = ""; for (var i = 0; i< Object.keys(data).length; i++) { var ta_net_id = data[i]["net_id"]; var ta_status = data[i]["status"]; var ta_name = data[i]['name']; id_add = ta_net_id; id_remove = ta_net_id ; path = "../static/data/img/" + ta_net_id + ".jpg"; if(window.location.href.indexOf("TA") > -1){ html_data = html_data.concat('<div class = "row">'); html_data = html_data.concat('<div class = "chip large"><img src ='); html_data = html_data.concat(path); html_data = html_data.concat('></img>'); html_data = html_data.concat(ta_name); html_data = html_data.concat('</h5></div></div>'); } else{ html_data = html_data.concat('<div class = "row"></div><a class="btn-floating btn-large green" onclick = \"add_queue(this);\" id = \"'); html_data = html_data.concat(id_add); html_data = html_data.concat('\">Join</a>'); html_data = html_data.concat('<a class="btn-floating red btn-large" onclick = \"remove_queue(this'); html_data = html_data.concat(');\" id = \"'); html_data = html_data.concat(id_remove); html_data = html_data.concat('\">Leave</a>'); html_data = html_data.concat('<div class = "chip large"><img src ='); html_data = html_data.concat(path); html_data = html_data.concat('></img>'); html_data = html_data.concat(ta_name); html_data = html_data.concat('</h5></div></div>'); } } // Updates HTML Content $(mydiv).html(""); $(mydiv).html(html_data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateActivityStatus(list){\n\tif(list[\"selectedKeys\"][0]==\"1\")\n\t\taudienceStatus=true;\n\telse\n\t\taudienceStatus=false;\n\t//kony.print(\"\\nActivity:-\"+audienceStatus);\n}", "function updateMissionUserList(){\n var userString = \"\";\n var mission = clientGame.missions[clientGame.missionNumber];\n\n if(clientUser.clientId == mission.leader.clientId){\n $(\"#startTeamSelection\").show();\n } else {\n $(\"#startTeamSelection\").hide();\n }\n userString += \"<li class='list-group-item list-group-item-warning'>Leader: \"+ mission.leader.username +\"</li>\";\n for(var i = 0; i < mission.selectedUsers.length; i++){\n userString += \"<li class='list-group-item'>\"+ mission.selectedUsers[i].username +\"</li>\";\n }\n\n $(\"#currentMissionUserList\").html(userString);\n}", "function processActiveUsersList() {\n $(\"#rlc-activeusers ul\").empty();\n updateArray = [];\n\n for(let i = 0; i <= activeUserArray.length; i++){\n if (updateArray.indexOf(activeUserArray[i]) === -1 && activeUserArray[i] !== undefined) {\n updateArray.push(activeUserArray[i]);\n $(\"#rlc-activeusers ul\").append(`<li>\n <span class='activeusersUser'>${activeUserArray[i]}</span> @\n <span class='activeusersTime'>${activeUserTimes[i]}</span>\n </li>`);\n } /*else if (updateArray.indexOf(activeUserArray[i]) > -1) {\n TODO: Add things.\n\n Add message counter value\n Check if timestamp is recent enough?\n }*/\n }\n }", "function updateLangStaff() {\n showOrder(currentTableID);\n showAccountBox();\n}", "function updateUsersActivity() {\n SBF.updateUsersActivity(agent_online ? SB_ACTIVE_AGENT['id'] : -1, activeUser() != false ? activeUser().id : -1, function (response) {\n if (response == 'online') {\n if (!SBChat.user_online) {\n $(conversations_area).find('.sb-conversation .sb-top > .sb-labels').prepend(`<span class=\"sb-status-online\">${sb_('Online')}</span>`);\n SBChat.user_online = true;\n }\n } else {\n $(conversations_area).find('.sb-conversation .sb-top .sb-status-online').remove();\n SBChat.user_online = false;\n }\n });\n }", "function User_Update_TVA_Liste_des_T_V_A_0(Compo_Maitre)\n{\n var Table=\"tva\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tv_taux=GetValAt(154);\n if (!ValiderChampsObligatoire(Table,\"tv_taux\",TAB_GLOBAL_COMPO[154],tv_taux,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tv_taux\",TAB_GLOBAL_COMPO[154],tv_taux))\n \treturn -1;\n var tv_code=GetValAt(155);\n if (!ValiderChampsObligatoire(Table,\"tv_code\",TAB_GLOBAL_COMPO[155],tv_code,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tv_code\",TAB_GLOBAL_COMPO[155],tv_code))\n \treturn -1;\n var cg_numero=GetValAt(156);\n if (cg_numero==\"-1\")\n cg_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"cg_numero\",TAB_GLOBAL_COMPO[156],cg_numero,true))\n \treturn -1;\n var tv_actif=GetValAt(157);\n if (!ValiderChampsObligatoire(Table,\"tv_actif\",TAB_GLOBAL_COMPO[157],tv_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tv_actif\",TAB_GLOBAL_COMPO[157],tv_actif))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"tv_taux=\"+(tv_taux==\"\" ? \"null\" : \"'\"+ValiderChaine(tv_taux)+\"'\" )+\",tv_code=\"+(tv_code==\"\" ? \"null\" : \"'\"+ValiderChaine(tv_code)+\"'\" )+\",cg_numero=\"+cg_numero+\",tv_actif=\"+(tv_actif==\"true\" ? \"true\" : \"false\")+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function modifyTable(data,prescription_id,requested_by){\n var current_patient_id = data.session_info.id;\n \n for(var i=0; i< data.user_data.patient.length;i++){\n \n if(data.user_data.patient[i].id == current_patient_id){\n //var prescriptions = data.user_data.patient[i].prescriptions;\n \n for(var j=0; j<data.user_data.patient[i].prescriptions.length; j++){\n if(data.user_data.patient[i].prescriptions[j].id == prescription_id){\n if(requested_by.includes(\"doctor\") == true){\n for(var k=0; k<data.user_data.patient[i].prescriptions[j].action.doctors.length; k++){\n if(data.user_data.patient[i].prescriptions[j].action.doctors[k].doctor_id == requested_by){\n data.user_data.patient[i].prescriptions[j].action.doctors[k].status = \"approved\";\n }\n } \n }else{\n for(var k=0; k<data.user_data.patient[i].prescriptions[j].action.pharmacist.length; k++){\n if(data.user_data.patient[i].prescriptions[j].action.pharmacist[k].pharmacist_id == requested_by){\n data.user_data.patient[i].prescriptions[j].action.pharmacist[k].status = \"approved\";\n }\n } \n }\n \n } \n }\n }\n }\n localStorage.setItem('added-items', JSON.stringify(data));\n}", "statusOfLesson(lessonList, userId)\n {\n let statusOfLesson = 'Minus';\n for (let i = 0; i < lessonList.length >= 0; i++)\n {\n if (lessonList[i].attending.indexOf(userId) >= 0)\n {\n statusOfLesson = 'Check';\n break;\n }\n }\n\n return statusOfLesson;\n\n /*const userId = user.id;\n\n for (let k = 0; k < classStore.getAllClasses().length; k++)\n\n var classList = classStore.getAllClasses();\n var classId = classList[k].classId;\n let attendingClass = classStore.getClassById(classId);\n\n for (let j = 0; j < attendingClass.lessons.length; j++) {\n let lessonId = attendingClass.lessons[j].lessonId;\n const attendingLesson = classStore.getLesson(classId, lessonId);\n const attendList = attendingLesson.attending;\n\n for (let i = 0; i < attendList.length; i++) {\n\n\n let attendingStatus = 'red Minus';\n\n if (attendingLesson.attending[i] === userId) {\n attendingStatus = 'green Check';\n }\n }\n }\n attendList[i].attendingStatus = attendingStatus;*/\n }", "function AnalyList(aList)\n{\n\tfor(var j = 0; j < courseList.length; j++)\n\t{\n\t\tvar roomString=\"\";\n\t\tvar timeString=\"\";\n\t\tfor(var i = 0; i < aList.length; i++)\n\t\t\tif(aList[i] == j)\n\t\t\t{\n\t\t\t\tvar roomIndex = Math.floor( i / 35);\n\t\t\t\tvar timeIndex = i % 35;\n\t\t\t\tprint(\"courseID: \"+ courseList[j].cid + \" room: \" + roomList[roomIndex].rid + \" time: \"\n\t\t\t\t\t+ Math.floor(timeIndex / 5) + \"-\"+ (timeIndex % 5));\n\t\t\t\troomString = roomList[roomIndex].rid;\n\t\t\t\ttimeString = timeString + Math.floor(timeIndex / 5 + 1) + \"-\"+ (timeIndex % 5 + 1)+\";\";\n\t\t\t}\n\t\t\t\n\t\t\n\t\tvar conditions = { _id: courseList[j].cid }\n \t\t, update = { $set: { coursetime: timeString, room: roomString}}\n \t\t, options = { multi: true };\n \t\tCourse.update(conditions, update, options, function(err,doc){});\n\t}\n\treturn;\n}", "function updateUserList() {\n io.emit('online-users',Object.keys(oUsers));\n\n}", "function updateSharedWithUsers() {\n var data = $('#relationsTable').bootstrapTable('getData');\n // start from second row, first is already handled in updateShareWithUser()\n for (var i = 1; i < data.length; i++) {\n var progName = data[i].name;\n var sharedWith = data[i].sharedWith;\n var rightOld = data[i].read; //or .write\n var changed = true;\n var right = 'NONE';\n if ($(\"#checkRead\" + i).is(':checked')) {\n right = 'READ';\n }\n if ($(\"#checkWrite\" + i).is(':checked')) {\n right = 'WRITE';\n }\n if (right !== rightOld) {\n PROGRAM.shareProgram(progName, sharedWith, right, function(result) {\n if (result.rc === 'ok') {\n MSG.displayMessage(result.message, \"TOAST\", sharedWith);\n LOG.info(\"share program \" + progName + \" with '\" + sharedWith + \" having right '\" + right + \"'\"); \n }\n });\n }\n }\n $('#progList').find('button[name=\"refresh\"]').trigger('click');\n $('#show-relations').modal(\"hide\");\n }", "function updateOnlineUsers(){\n \t io.emit('online users', onlineUsers);\n }", "function updateAllUsersLS() {\n\tif(DEBUG) console.info(\"Updating Last Seen info of everybody.\");\n\t\n\tfor (var i in usersOnThisPage) {\n\t\tgetUserOptions(i);\n\t}\n}", "function updateSubjectList() {\n // check the task list for each subject\n taskList.forEach(function(task) {\n let taskSubject = task.subject.trim().toUpperCase()\n let duplicate = false\n // if the subject already exists in the subjectlist, its a duplicate so don't push\n for (let i = 0; i < subjectList.length; i ++) {\n if (subjectList[i] == taskSubject) {\n duplicate = true\n }\n }\n // otherwise, it's a unique subject, save to datalist --> user be recommended subjects they have already inputted when creating new tasks\n if (duplicate == false) {\n subjectList.push(taskSubject)\n }\n })\n\n // actually setting the options in the subjectlist\n let subjectOptions = document.querySelector('datalist#subject')\n subjectOptions.innerHTML = ''\n subjectList.forEach(function(subject) {\n let option = document.createElement('option')\n option.textContent = subject\n subjectOptions.appendChild(option)\n })\n}", "function updateOnlineUsers (OnlineUsers) {\n\n\t\tclient.channels.get(\"426411909697372160\").setName(`Online Users: ${OnlineUsers}`)\t//Edit Voice Channel to reflect # of online users\n\t\t\t.catch(console.error);\n\n\t\tlet areis;\n\t\tif (OnlineUsers == 1) {\n\t\t\tareis = \"is\";\n\t\t} else {areis = \"are\";}\n\n\t\treturn console.log(`> Online Users updated! There ${areis} currently ${OnlineUsers} user(s) online in ${message.guild.name}.`);\n\t}", "function twpro_updateList() {\r\n\t\tif (TWPro.twpro_failure) return;\r\n\t\tif (!TWPro.twpro_calculated) {\r\n\t\t\tvar twpro_jobCount = 0;\r\n\t\t\tfor (var twpro_job in JobList) {\r\n\t\t\t\tTWPro.twpro_jobs[parseInt(twpro_job)] = JobList[twpro_job];\r\n\t\t\t\tTWPro.twpro_jobs[parseInt(twpro_job)].twpro_calculation = TWPro.twpro_jobs[parseInt(twpro_job)].formular.replace(/skills\\./g, 'Character.skills.');\r\n\t\t\t\ttwpro_jobCount++;\r\n\t\t\t}\r\n\t\t\tTWPro.twpro_jobs[TWPro.twpro_jobs.length] = {\r\n\t\t\t\t'twpro_calculation': '3 * Character.skills.build + 1 * Character.skills.repair + 1 * Character.skills.leadership',\r\n\t\t\t\t'malus': 0,\r\n\t\t\t\t'name': TWPro.lang.CONSTRUCTION,\r\n\t\t\t\t'shortName': 'construct'\r\n\t\t\t};\r\n\t\t\ttwpro_jobCount++;\r\n\t\t\tTWPro.twpro_jobs[TWPro.twpro_jobs.length] = {\r\n\t\t\t\t'twpro_calculation': '1 * Character.skills.health',\r\n\t\t\t\t'malus': -1,\r\n\t\t\t\t'name': TWPro.lang.HEALTH,\r\n\t\t\t\t'shortName': 'lifepoints'\r\n\t\t\t};\r\n\t\t\ttwpro_jobCount++;\r\n\t\t\tTWPro.twpro_jobs[TWPro.twpro_jobs.length] = {\r\n\t\t\t\t'twpro_calculation': '1 * Character.skills.aim + 1 * Character.skills.dodge + 1 * Character.skills.appearance + 1 * Character.skills.shot',\r\n\t\t\t\t'malus': -1,\r\n\t\t\t\t'name': TWPro.lang.DUELSHOOTINGATT,\r\n\t\t\t\t'shortName': 'duelshootingatt'\r\n\t\t\t};\r\n\t\t\ttwpro_jobCount++;\r\n\t\t\tTWPro.twpro_jobs[TWPro.twpro_jobs.length] = {\r\n\t\t\t\t'twpro_calculation': '1 * Character.skills.aim + 1 * Character.skills.dodge + 1 * Character.skills.tactic + 1 * Character.skills.shot',\r\n\t\t\t\t'malus': -1,\r\n\t\t\t\t'name': TWPro.lang.DUELSHOOTINGDEF,\r\n\t\t\t\t'shortName': 'duelshootingdef'\r\n\t\t\t};\r\n\t\t\ttwpro_jobCount++;\r\n\t\t\tTWPro.twpro_jobs[TWPro.twpro_jobs.length] = {\r\n\t\t\t\t'twpro_calculation': '1 * Character.skills.aim + 1 * Character.skills.reflex + 1 * Character.skills.tough + 1 * Character.skills.punch',\r\n\t\t\t\t'malus': -1,\r\n\t\t\t\t'name': TWPro.lang.DUELVIGOR,\r\n\t\t\t\t'shortName': 'duelvigor'\r\n\t\t\t};\r\n\t\t\ttwpro_jobCount++;\r\n\t\t\tTWPro.twpro_jobs[TWPro.twpro_jobs.length] = {\r\n\t\t\t\t'twpro_calculation': '1 * Character.skills.aim + 1 * Character.skills.dodge + 2 * Character.skills.leadership + 2 * Character.skills.endurance + 1 * Character.skills.health',\r\n\t\t\t\t'malus': -1,\r\n\t\t\t\t'name': TWPro.lang.FORTATTACK,\r\n\t\t\t\t'shortName': 'fortatt'\r\n\t\t\t};\r\n\t\t\ttwpro_jobCount++;\r\n\t\t\tTWPro.twpro_jobs[TWPro.twpro_jobs.length] = {\r\n\t\t\t\t'twpro_calculation': '1 * Character.skills.aim + 1 * Character.skills.dodge + 2 * Character.skills.leadership + 2 * Character.skills.hide + 1 * Character.skills.health',\r\n\t\t\t\t'malus': -1,\r\n\t\t\t\t'name': TWPro.lang.FORTDEFEND,\r\n\t\t\t\t'shortName': 'fortdef'\r\n\t\t\t};\r\n\t\t\ttwpro_jobCount++;\r\n\t\t\tTWPro.twpro_jobs[TWPro.twpro_jobs.length] = {\r\n\t\t\t\t'twpro_calculation': '1 * Character.skills.ride ',\r\n\t\t\t\t'malus': -1,\r\n\t\t\t\t'name': TWPro.lang.SKILLRIDE,\r\n\t\t\t\t'shortName': 'ride'\r\n\t\t\t};\r\n\t\t\ttwpro_jobCount++;\r\n\t\t\tTWPro.twpro_sortJobs();\r\n\t\t\twhile (TWPro.twpro_jobs.length > twpro_jobCount) {\r\n\t\t\t\tTWPro.twpro_jobs.pop();\r\n\t\t\t}\r\n\t\t}\r\n\t\tTWPro.twpro_calculateJobs();\r\n\t\tTWPro.twpro_sortJobs();\r\n\t\tTWPro.twpro_insertListItems();\r\n\t\tdocument.getElementById('twpro_wait').text = TWPro.lang.CHOOSEJOB;\r\n\t}", "function updateUserOnlineStatus() {\n var userParam = JSON.parse(Auth.isLoggedIn());\n if(userParam) {\n var data = {\n currentUser: userParam[0].id\n };\n var config = {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'\n }\n };\n UsersService.post('online/update', JSON.stringify(data), config)\n .then(function (data, status, headers, config) {\n if (data.status == 200) {\n //update current user online status\n getOnlineUser($scope)\n }\n })\n , function (error) {\n };\n }\n }", "function update_enrollment() {\n\tvar student = [];\n\t\n\t$('#area_students').hide();\n\t$('#area_loader').show();\n\t\n\t$(\"tbody\").children(\"tr\").each(function (index) {\n\t\tstudent[index] = { id : $(this).attr(\"id\"),\n\t\t\t\t enrolled : $(this).find(\"input\").prop(\"checked\") ? STUDENT_IS_ENROLLED : STUDENT_NOT_ENROLLED};\n\t});\n\t\n\t$.ajax({\n\t\turl: \"ajax/update_enrollment.php\",\n\t\ttype: \"POST\",\n\t\tdata : {\n\t\t\tclass_id : class_id,\n\t\t\tstudent : student\n\t\t},\n\t\tsuccess : function (student_list) {\n\t\t\t$(\"#tbl_students\").html(student_list);\n\t\t\twindow.scroll(0,0);\n\t\t\tupdate_row_click_events();\n\t\t\t\n\t\t\t$('#area_students').animate({ scrollTop: 0 }, 1);\n\t\t\t$('#area_loader').hide();\n\t\t\t$('#area_students').show();\n\t\t\t\n\t\t}\n\t});\n}", "function completed(currentList, currentUser) {\n\n $http.put(`/users/${currentUser._id}/lists/${currentList._id}`, { name: currentList.name, complete: !currentList.complete} )\n .then(function(response) {\n console.log(response);\n list.userList = response.data.user.list;\n // list.updateList(currentUser, list);\n // $state.go('user', {id: currentUser._id});\n });\n }", "function updateData() {\n updateStudentList();\n gradeAverage();\n}", "markAttendance(username, status = \"present\") {\n let foundStudent = this.findStudent(username);\n if (status === \"present\") {\n foundStudent.attendance.push(1);\n } else {\n foundStudent.attendance.push(0);\n }\n updateRoster(this);\n }", "function changeList($list) {\r\n\t//if they select the student list create and show the students.\r\n if($list == \"student\"){\r\n \t//updateing the choose to clear option\r\n \tchangeClear.innerHTML = \"Clear Info\";\r\n \t//updateing listInfo to be blank.\r\n \tlistInfo.innerHTML = \"\";\r\n \t//updating postion number\r\n \tp = 1;\r\n \tfor (let i = 0; i < students.length; i++){ \t\t\r\n\t\t\t//if we are on our last itterartion put a different message.\r\n\t\t\tif (i === students.length -1){\r\n\t\t\t\tstudentList += \"<p>and Hello <b>\" + students[i] + \"</b>, you're last in the list!<p>\";\r\n\t\t\t}\r\n\t\t\t//run through all students and welcome them to the list.\r\n\t\t\telse{\r\n\t\t\t\tstudentList += \"<p>Hello <b>\" + students[i] + \"</b>, you're #\" + p + \" in the list!<p>\";\r\n\t\t\t\tp++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//now to change the list content.\r\n\t\tlistContent.innerHTML = studentList;\r\n }\r\n if($list == \"instructor\"){\r\n \t//updateing the choose to clear option\r\n \tchangeClear.innerHTML = \"Clear Info\";\r\n \t//updateing listInfo to be blank.\r\n \tlistInfo.innerHTML = \"\";\r\n \t//updating postion number\r\n \tp = 1;\r\n \tfor (let i = 0; i < instructors.length; i++){ \t\t\r\n\t\t\t//if we are on our last itterartion put a different message.\r\n\t\t\tif (i === instructors.length -1){\r\n\t\t\t\tinstructorList += \"<p>and Hello <b>\" + instructors[i] + \"</b>, you're last in the list!<p>\";\r\n\t\t\t}\r\n\t\t\t//run through all instructors and welcome them to the list.\r\n\t\t\telse{\r\n\t\t\t\tinstructorList += \"<p>Hello <b>\" + instructors[i] + \"</b>, you're #\" + p + \" in the list!<p>\";\r\n\t\t\t\tp++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//now to change the list content.\r\n\t\tlistContent.innerHTML = instructorList;\r\n }\r\n if($list == \"default\"){\r\n \t//updating the clear back to choose.\r\n \tchangeClear.innerHTML = \"Choose List...\";\r\n \t//updateing listInfo to be show the msg again.\r\n \tlistInfo.innerHTML = \"Please select a list from above.\";\r\n \t//this will clear the content.\r\n \tlistContent.innerHTML = \"\";\r\n }\r\n}", "function changeStatus(event) {\n // Get index of the list item to be updated\n let index = findIndexById(event.target.parentElement.id);\n\n // Make sure there is an index to use.\n if (index !== false) {\n // When the task is completed we update the text to have a line through it,\n // and then update the completed status and update the local storage\n if (event.target.checked) {\n event.target.parentElement.style.textDecoration = \"line-through\";\n toDos[index].completed = true;\n ls.setJSON(key, JSON.stringify(toDos));\n }\n // When the task is completed we update the text to remove the line, and then\n // update the completed status and update the local storage\n else {\n event.target.parentElement.style.textDecoration = \"none\";\n toDos[index].completed = false;\n ls.setJSON(key, JSON.stringify(toDos));\n }\n }\n}", "function checkStatus() {\n\n var users = getUsers();\n // variable count is used to monitor how many users are loged in, if more than\n // one then it sets the loged in status of all users to false\n var count = 0;\n\n for(var k = 0; k < users.length; k++) {\n if(users[k].loggedIn == true) {\n loggedIn = [true, k];\n count += 1;\n }\n }\n //if user is logged in changes the login tab to user information tab\n if(loggedIn[0] && count == 1) {\n if(document.getElementById(\"LoggedInAs\") != null && document.getElementById(\"playersHighscore\") != null) {\n document.getElementById(\"LoggedInAs\").innerHTML = \"Logged in as: \" + users[loggedIn[1]].name;\n document.getElementById(\"playersHighscore\").innerHTML = \"Highest score: \" + users[loggedIn[1]].score;\n selectTab(event, 'logedIn');\n } else {\n //sets the login / sign up value inside the navigation bar to a users username\n document.getElementById(\"user\").innerHTML = users[loggedIn[1]].name;\n }\n } else {\n for(var l = 0; l < users.length; l++) {\n users[l].loggedIn = false;\n }\n }\n }", "function updateStudent(id) {\n let list = students[id - 1];\n console.log(list);\n setName(list.name)\n setRollNo(list.rollno)\n setStudentID(list.id)\n setFlag(false);\n }", "updateStudent() {\n\n\t}", "function update() {\n\n // Select all politicians in list\n for (var i = 0; i < $currentList.length; i++) {\n\n var politicianId = $currentList[i].getAttribute('data-politician');\n var departments = common.getDepartments().filter(function (department) {\n return department.politician == politicianId;\n });\n\n // Toggle highlighting\n $currentList[i].classList.toggle('picked', departments.length === 1);\n }\n }", "function UpdateUsers(userList) {\n users.empty();\n for (var i = 0; i < userList.length; i++) {\n if (userList[i].username != myName) {\n users.append('<li class=\"player\" id=\"' + userList[i].id + '\"><a href=\"#\">' + userList[i].username + '</a></li>')\n }\n }\n }", "function updateTaskList(list) {\n list.forEach(function(user) {\n addItemTask(user);\n });\n}", "function updateParticipantStatus(data) {\n if (data.params.Status == \"join\") {\n insertParticipant(data.params);\n }\n if (data.params.Status == \"leave\") {\n removeParticipant(data.params);\n }\n}", "function convertList(roomName, occupants, isPrimary) {\n console.log('----------Room Entry Name---------');\n console.log(roomName);\n if (roomName == 'global' || roomName == 'default')\n return;\n var new_users = [];\n\n\n if (needToCallOtherUsers) {\n //first entry room\n console.log('----------First Entry Room---------');\n var list = [];\n var connectCount = 0;\n for (var easyrtcid in occupants) {\n list.push(easyrtcid);\n }\n //\n // Connect in reverse order. Latter arriving people are more likely to have\n // empty slots.\n //\n function establishConnection(position) {\n function callSuccess() {\n console.log('call success');\n }\n\n function callFailure() {\n if (position > 0 && connectCount < maxUserNum) {\n establishConnection(position - 1);\n } else {\n confirm_owner(new_users);\n }\n }\n\n function wasAccepted(wasAccepted, easyrtcid) {\n if (wasAccepted) {\n connectCount++;\n new_users.push({\n id: list[position],\n name: occupants[list[position]].username\n });\n }\n if (position > 0 && connectCount < maxUserNum) {\n establishConnection(position - 1);\n } else {\n confirm_owner(new_users);\n }\n }\n\n easyrtc.call(list[position], callSuccess, callFailure, wasAccepted);\n }\n\n if (list.length > maxUserNum) {\n alert('sorry, this room is full.');\n return false;\n } else if (list.length > 0) {\n establishConnection(list.length - 1);\n }\n needToCallOtherUsers = false;\n } else {\n console.log('room occupants');\n //check other user list\n var list = [];\n var old_users = users;\n for (var easyrtcid in occupants) {\n list.push(easyrtcid);\n }\n if (list.length == (old_users.length - 1 ))\n return;\n if (list.length > (old_users.length - 1)) {\n\n } else {\n //check out user\n var out_users = [];\n var out_flag = false;\n for (var i = 1; i < old_users.length; i++) {\n out_flag = true;\n for (var j = 0; j < list.length; j++) {\n if (old_users[i].id == list[j]) {\n out_flag = false;\n break;\n }\n }\n if (out_flag) {\n out_users.push(old_users[i]);\n }\n }\n goout_users(out_users);\n }\n }\n}", "function updateSharedTrip(){\n\tconsole.log(\"if update shared trip \", User.tripPatners.length)\n\t$('#friendsemail').empty();\n\tif(User.tripPatners.length > 0){\n\t\tconsole.log(\"in if\")\n\t\t$.each(User.tripPatners, function(i, val){\n\t\t\tconsole.log(val)\n\t\t\t$('#friendsemail').append(\"<div id='emailNum\" + i + \"'>\" + val + \"</div>\");\n\t\t\t$('#emailNum' + i).append(\"<button id='deleteMailFromSchedule'> &#10006 </button>\");\n\t\t});\n\t}\n}", "function update_lista()\n{\n\t// Recupera los datos\n\tvar datosUsuario\t= sessionStorage.getItem('datosUsuario');\n\tvar datosPassword\t= sessionStorage.getItem('datosPassword');\n\t\n\t// Actualitza listasubastas\n\t\n\tvar url=\"http://elmundo.webexpo.es/subastas.php\";\n\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&accion=listar\";\n\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\n\t\tvar newRow = '';\n\n\t\tif (mensaje.lista === null) {\n\t\t\tnewRow = newRow + \"<tr class='success'><td colspan=6 class='videfech text-center'><strong>En estos momentos no dispone de ninguna subasta activa de las categorías contradadas</strong></td></tr>\";\n\t\t\t$(\"#mostrarsubastas\").empty();\n\t\t\t$(newRow).appendTo(\"#mostrarsubastas\");\n\t\t\t\n\t\t}\n\t\telse {\n\n\t\t\t$.each(mensaje.lista, function(ID, data) {\n\t\t\t\n\t\t\t\t// Preparación de datos\n\t\t\t\tvar img = data.Image;\n\n\t\t\t\tif (!img || img === null || img === 'null') // Si vuelve nulo\n\t\t\t\t\t{var img = 'http://elmundo.webexpo.es/pix.gif';}\t\n\t\t\t\t\n\t\t\t\tvar time = data.RemainTime;\n\t\t\t\t// color\n\t\t\t\tvar color = \"blue\";\n\t\t\t\tif (time<3600) color = \"orange\";\n\t\t\t\tif (time<300) color = \"red\";\n\t\t\t\tvar TxtRemainTime = strtotime(time);\n\t\t\t\t\n\t\t\t\tif (time>=0)\n\t\t\t\t\tvar TxtDisplay = 'inline';\n\t\t\t\telse\n\t\t\t\t\tvar TxtDisplay = 'none';\n\n\n\t\t\t\tswitch (Number(data.Status)) {\n\t\t\t\t\tcase 0: // Agotado, finalizado\n\t\t\t\t\t\tvar Txt = \"Cancelada por el usuario\";\n\n\n\t\t\t\t\t\t\n//000 modificado\n//newRow = newRow + \"<tr><td rowspan='3' width='13%'><div id='time_\"+data.Id+\"' style='color:\"+color+\"'>\"+TxtRemainTime+\"</div><input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='34%'>\"+data.CreationDate+\"</td><td width='44%'>\"+data.Price+\"&nbsp;&euro;</td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons' style='display:\"+ TxtDisplay +\"'></div><div class='grupbtns'><button type='button' class='btn btn-danger' id='cancelar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2'>\"+data.Description+\"</td></tr>\";\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'><div id='time_\"+data.Id+\"' style='color:\"+color+\"'>\"+TxtRemainTime+\"</div><input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons' style='display:\"+ TxtDisplay +\"'></div><div class='grupbtns'><button type='button' class='btn btn-danger' id='cancelar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n \n \t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 1: // Activa\n\t\t\t\t\tcase 2: // Modificada\n\t\t\t\t\tcase 3: // Lliberada\n\n\t\t\t\t\t\tswitch (Number(data.Status)) {\n\t\t\t\t\t\t\tcase 2: Estat = ' (modificada)'; break;\n\t\t\t\t\t\t\tcase 3:\tEstat = ' (liberada por asociado)'; break;\n\t\t\t\t\t\t\tdefault : Estat = '';\t\n\t\t\t\t\t\t}\n\n//001 modificado\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\"+Estat+\"<div id='time_\"+data.Id+\"' style='color:\"+color+\"'>\"+TxtRemainTime+\"</div><input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons' style='display:\"+ TxtDisplay +\"'></div><div class='grupbtns'><button type='button' class='btn btn-danger' id='cancelar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n \n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 5: // Asignada\n\t\t\t\t\t\tEstat = 'Asignada';\n\t\t\t\t\t\t\n//002 modificado\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\"+Estat+\"<div id='time_\"+data.Id+\"' style='color:\"+color+\"'>\"+TxtRemainTime+\"</div><input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons' style='display:\"+ TxtDisplay +\"'></div><div class='grupbtns'><div class='grupbtns' id='capabotons_\"+data.Id+\"'></div></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n \t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\tcase 8: // Confirmada\n\t\t\t\t\t\tEstat = 'Confirmada por vendedor';\n\n//003 modificado\t\t\t\t\t\t\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>&nbsp;</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'></div><div class='grupbtns'><button type='button' class='btn btn-danger' id='cancelar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 10: // Conpletada\n\t\t\t\t\t\tEstat = 'Completado por vendedor';\n\n//004\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'><button type='button' class='btn btn-warning' data-toggle='modal' data-target='#my-modal' id='valorar_\"+data.Id+\"'><i class='fa fa-star-o fa-2x' aria-hidden='true'></i></button><button type='button' class='btn btn-danger' id='borrar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n \t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\tcase 18: // Cancelada\n\t\t\t\t\t\tEstat = 'Cancelada por el vendedor';\n\n//005\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'><button type='button' class='btn btn-danger' id='ocultar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 20: // Valorada por el cliente\n\t\t\t\t\t\tEstat = 'Valorada por mi, esperamos valoración del vendedor';\n//006\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%' class='success'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 25: // Valorada por el asociado\n\t\t\t\t\t\tEstat = 'Valorada por el vendendor';\n//007\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'><button type='button' class='btn btn-warning' data-toggle='modal' data-target='#my-modal' id='valorar_\"+data.Id+\"'><i class='fa fa-star-o fa-2x' aria-hidden='true'></i></button><button type='button' class='btn btn-danger' id='borrar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 30: // Valorados por ambos\n\t\t\t\t\tcase 26: // Borrado por el cliente\n\t\t\t\t\tcase 94: // Borrado por el cliente\n\t\t\t\t\t\tEstat = 'Valorado';\n//008\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'><button type='button' class='btn btn-danger' id='borrar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 90: // Cancelada por el cliente\n\t\t\t\t\tcase 91: // Cancelada por el cliente\n\t\t\t\t\t\tEstat = \"Cancelada por el usuario\";\n\n//009\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"</td><td width='27%'>&nbsp;</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'><button type='button' class='btn btn-danger' id='ocultar_\"+data.Id+\"'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 21: // Borrado por el cliente\n\t\t\t\t\tcase 92: // Borrado por el cliente\n\t\t\t\t\tcase 98: // Historificado\n\t\t\t\t\tcase 99: // Borrado, no sale nada.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault: // Otro Estado\n\t\t\t\t\t\tEstat = \"Estado no definido correctamente. Estado \" + data.Status;\n\n//010\t\t\t\t\t\t\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"</td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\t\t \n\t\t\t$(\"#mostrarsubastas\").empty();\n\t\t\t$(newRow).appendTo(\"#mostrarsubastas\");\n\n\t\t\t// Botones de acción\n\t\t\t$.each(mensaje.lista, function(ID, data) {\n\n\t\t\t\tvar nom = '';\n\t\t\t\t// Edicio per 'usuari\n\t\t\t\tif (data.Status == 1 || data.Status==2 || data.Status ==3) {\n\t\t\t\t\tnom = '#editar_' + data.Id;\n\t\t\t\t\t$(nom).click(function () {\n\t\t\t\t\t\n\t\t\t\t\t\tsessionStorage.setItem('Explicacion', data.Description);\n\t\t\t\t\t\tsessionStorage.setItem('imgData', data.Image);\t\n\n\t\t\t\t\t\tsessionStorage.setItem('CategoriaBase', data.CategoryCodes[0].substring(0,4)); \n\t\t\t\t\t\tsessionStorage.setItem('CategoriaNivel1', data.CategoryCodes[0].substring(0,6));\n\t\t\t\t\t\tsessionStorage.setItem('CategoriaNivel2', 0);\n\n\t\t\t\t\t\tif (data.CategoryCodes[0].length>6)\n\t\t\t\t\t\t\tsessionStorage.setItem('CategoriaNivel2', data.CategoryCodes[0]);\n\n\t\t\t\t\t\tsessionStorage.setItem('idsubasta', data.Id);\n\t\t\t\t\t\tsessionStorage.setItem('precio', data.Price);\n\t\t\t\t\t\tsessionStorage.setItem('periodo', data.Period);\n\t\t\t\t\t\tsessionStorage.setItem('actualitzacio', 1);\n\t\t\t\t\t\twindow.location.href = 'segunda.html?update='+data.Id;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Cancelar per l'usuari\n\t\t\t\tif (data.Status == 0 || data.Status == 1 || data.Status == 2 || data.Status == 3) {\n\t\t\t\t\tnom = '#cancelar_' + data.Id;\n\t\t\t\t\t$(nom).click(function () {\n\t\t\t\t\t\tparar_reloj();\n\t\t\t\t\t\tconfirmar = confirm ('Deseas cancelar la oferta de \"' + data.Description + '\" ?');\n\t\t\t\t\t\tif (confirmar) {\n\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=cancelar\";\n\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\talert ('La oferta ha sido cancelada');\n\t\t\t\t\t\t\t\t\twindow.location.href = 'mis_subastas.html';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para cancelar la oferta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tarrancar_reloj();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (data.Status == 10 || data.Status == 25 || data.Status == 30 || data.Status == 94) {\n\t\t\t\t\tnom = '#borrar_' + data.Id;\n\t\t\t\t\t$(nom).click(function () {\n\t//\t\t\t\t\tconfirmar = confirm ('Deseas cancelar la oferta de \"' + data.Description + '\"');\n\t//\t\t\t\t\tif (confirmar) {\n\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=ocultar\";\n\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t//\t\t\t\t\t\t\t\talert ('La oferta ha sido cancelada');\n\t\t\t\t\t\t\t\t\twindow.location.href = 'mis_subastas.html';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para borrar esta oferta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\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\n\t\t\t\tif (data.Status == 10 || data.Status == 25) {\n\t\t\t\t\tnom = '#valorar_' + data.Id;\n\t\t\t\t\t$(nom).click(function () {\n\t\t\t\t\t\tsessionStorage.setItem(\"subastaseleccionada\", data.Id);\n\t\t\t\t\t\t//$('#my-modal').modal('show');\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Ocultar per l'usuari\n\t\t\t\tif (data.Status == 18 || data.Status == 90 || data.Status == 91) {\n\t\t\t\t\tnom = '#ocultar_' + data.Id;\n\t\t\t\t\t$(nom).click(function () {\n\t//\t\t\t\t\tconfirmar = confirm ('Deseas cancelar la oferta de \"' + data.Description + '\"');\n\t//\t\t\t\t\tif (confirmar) {\n\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=ocultar\";\n\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t//\t\t\t\t\t\t\t\talert ('La oferta ha sido cancelada');\n\t\t\t\t\t\t\t\t\twindow.location.href = 'mis_subastas.html';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para ocultar esta oferta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\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\n\n\t\t\t});\n\t\t}\n\t});\t\n}", "function updateStatusForFriends($eventData) {\n vm.friends.forEach(function (friend) {\n if (friend.username == $eventData.username) {\n friend = usersFactory.setStatus(friend, $eventData.statusIndex);\n }\n });\n vm.blockedFriends.forEach(function (oldFriend) {\n if (friend.username == $eventData.username) {\n oldFriend = usersFactory.setStatus(oldFriend, $eventData.statusIndex);\n }\n });\n vm.allFriends.forEach(function (friend) {\n if (friend.username == $eventData.username) {\n friend = usersFactory.setStatus(friend, $eventData.statusIndex);\n }\n if (!Methods.isNullOrEmpty(vm.activeFriend)) {\n if (vm.activeFriend.username == friend.username) {\n vm.friendStatus = friend.status;\n }\n }\n });\n\n }", "function update() {\n displayed = false;\n prev_subject = curr_subject;\n curr_subject = select(\"#phrase\").value();\n loadJSON(api+curr_subject+access_token, gotData);\n}", "function updateLearnerProfile(data){\n\tif(data.type == \"correctness feedback\"){\n\t\tconsole.log(\"update learner profiles here\");\n\t\tif(data.parameter == \"correct\"){\n\t\t\tconsole.log(\"correct solution, updating profile\");\n\t\t\tajax(APP.LEARNER_PROFILE_UPDATE + \"?correct=true\" + \"&stepList=\" + escape(JSON.stringify(APP.currentStepsList)) + \"&problemObj=\" + escape(JSON.stringify(APP.currentProblem)));\n\t\t\t// DEBUG\n\t\t\t// window.open(\"http://127.0.0.1:8000/mobileinterface/learnerprofile/index\");\n\t\t}\n\t\telse if(data.parameter == \"incorrect\"){\n\t\t\tconsole.log(\"incorrect solution, updating profile\");\n\t\t\t// TODO Jon implement\n\t\t\tvar check = JSON.stringify(APP.currentProblem)\n\t\t\tajax(APP.LEARNER_PROFILE_UPDATE + \"?correct=false\" + \"&stepList=\" + escape(JSON.stringify(APP.currentStepsList)) + \"&problemObj=\" + escape(JSON.stringify(APP.currentProblem)) + \"&data=\" + escape(JSON.stringify(data)) )\n\t\t}\n\t}\n\t// some other action is being performed, check for actions\n\telse if(data.type == \"moveDistance\" || data.type == \"turnAngle\" || data.type == \"plotPoint\"){\n\n\t}\n}", "update() {\n\t\t$('.js-login').prop('disabled', false);\n\t\tlet loggedIn = this.accessToken;\n\t\t$('.js-getMyself').prop('disabled', !loggedIn);\n\t\t$('.js-getRecents').prop('disabled', !loggedIn);\n\t}", "function updateOnlineUsers(){\n\t\tio.sockets.emit('online', Object.keys( $registeredUsers))\n\t}", "function updateAllTimeLeaderboard() {\n\tfetch('https://trivia.tekno.icu/all_time_leaderboard.php')\n\t\t.then(response => {\n\t\t\treturn response.json();\n\t\t})\n\t\t.then(data => {\n\t\t\tvar sortable = [];\n\t\t\tfor (var user in data) {\n\t\t\t\tsortable.push([user, data[user]]);\n\t\t\t}\n\t\t\tsortable.sort((a, b) => {\n\t\t\t\treturn b[1] - a[1];\n\t\t\t});\n\t\t\tsortedLeaderboardAllTimeData = sortable;\n\t\t\tsortedLeaderboardAllTimeData.forEach(userData => {\n\t\t\t\tvar tr = document.createElement('tr'),\n\t\t\t\t\ttdUsername = document.createElement('td'),\n\t\t\t\t\ttdCoinsWon = document.createElement('td');\n\n\t\t\t\ttdUsername.innerText = userData[0];\n\t\t\t\ttdCoinsWon.innerText = String(Math.floor(userData[1]));\n\t\t\t\ttr.append(tdCoinsWon);\n\t\t\t\ttr.prepend(tdUsername);\n\t\t\t\tdocument.querySelector('#leaderboardAllTime').append(tr);\n\t\t\t});\n\t\t\twindow.allTimeLeaderboard = sortedLeaderboardAllTimeData;\n\t\t});\n}", "addAvailableTa(courseTa, crn, taIndex, uofmID, prevUofmID, inputID, hours) {\n console.log(\"I am in the addAvailableTa function\");\n console.log(courseTa);\n console.log(crn);\n console.log(taIndex);\n console.log(uofmID);\n console.log(hours);\n console.log(prevUofmID);\n\n\n console.log(this.state.courses);\n\n // let TaArray = this.state.courses[0].CourseTA;\n // TaArray[0] = courseTa;\n // console.log(TaArray);\n let that = this;\n let coursesObject = this.state.courses; // will be used to make the new array of course objects.\n console.log(coursesObject);\n let tasObject = this.state.tas; // will be used to make the new array of tas objects.\n // let courseObject = this.state.courses;\n // console.log(courseObject);\n // courseObject[0].CourseTA[0] = courseTa;\n // console.log(courseObject[0].CourseTA[0]);\n // this.setState({\n // courses: courseObject\n // })\n let index = 0;\n this.state.courses.forEach(function(course) {\n\n if (course.crn === crn)\n {\n //console.log(TaArray);\n // console.log(\"Hello\");\n //\n // let courseObjectTest = that.state.courses;\n // console.log(taIndex);\n // courseObjectTest[index].CourseTA[taIndex] = courseTa;\n // courseObjectTest[index].TaUofMID[taIndex] = UofMID;\n //\n // that.setState({\n // courses: courseObjectTest,\n // });\n\n coursesObject[index].CourseTA[taIndex] = courseTa;\n coursesObject[index].TaUofMID[taIndex] = uofmID;\n coursesObject[index].TAHOURSUsed[taIndex] = hours;\n\n }\n index++;\n });\n\n let indexForTaArray = 0;\n this.state.tas.forEach(function(ta) {\n if (prevUofmID === ta.UofMID)\n {\n if (inputID === tasObject[indexForTaArray].inputsUsed[0]) {\n console.log(\"I am in here the first if statement changing prevUofmID hours and InputID\");\n tasObject[indexForTaArray].HoursUsed[0] = \"0\";\n tasObject[indexForTaArray].inputsUsed[0] = '';\n }\n else if(inputID === tasObject[indexForTaArray].inputsUsed[1]) {\n console.log(\"I am in here the else if statement changing prevUofmID hours and InputID\");\n tasObject[indexForTaArray].HoursUsed[1] = \"0\";\n tasObject[indexForTaArray].inputsUsed[1] = '';\n }\n else {\n console.log(\"I am in here the else statement changing prevUofmID hours and InputID\");\n tasObject[indexForTaArray].HoursUsed[2] = \"0\";\n tasObject[indexForTaArray].inputsUsed[2] = '';\n }\n\n }\n\n if (ta.UofMID === uofmID && !(hours === undefined)) {\n console.log(\"I am in the loop\");\n if (tasObject[indexForTaArray].inputsUsed[0] === '' || inputID === tasObject[indexForTaArray].inputsUsed[0]) {\n console.log(\"I am in here the first if statement\");\n tasObject[indexForTaArray].HoursUsed[0] = hours;\n tasObject[indexForTaArray].inputsUsed[0] = inputID;\n }\n else if(tasObject[indexForTaArray].inputsUsed[1] === '' || inputID === tasObject[indexForTaArray].inputsUsed[1]) {\n console.log(\"I am in here the else if statement\");\n tasObject[indexForTaArray].HoursUsed[1] = hours;\n tasObject[indexForTaArray].inputsUsed[1] = inputID;\n }\n else {\n console.log(\"I am in here the else statement\");\n tasObject[indexForTaArray].HoursUsed[2] = hours;\n tasObject[indexForTaArray].inputsUsed[2] = inputID;\n }\n }\n\n\n ++indexForTaArray;\n })\n console.log(this.state.courses[0].CourseTA[0]);\n\n this.setState({\n courses: coursesObject,\n tas: tasObject\n });\n }", "function updateActiveUsersList() {\n $.ajax({\n url: '/users/active',\n method: 'get',\n dataType: 'json',\n success: function(data, textStatus, jqXHR) {\n $('#active-users-list').html('');\n if (data.message === 'success') {\n for (let username of data.list) {\n $('#active-users-list').append(\n '<button type=\"button\" class=\"list-group-item list-group-item-action\">' + username + '</button>');\n }\n } else {\n addToLogs('updateActiveUsersList: Couldn\\'t update active users list', 'internal');\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n addToLogs('updateActiveUsersList: Couldn\\'t update active users list', 'internal');\n }\n });\n}", "function updateList(newList) {\n newList = JSON.parse(newList);\n let newUsers = newList.filter((u) => !list.includes(u));\n\n list = newList;\n\n // Update the client list\n asideClients.innerHTML = \"\";\n list.forEach((client) => {\n asideClients.appendChild(elt(\"p\", {}, client));\n });\n\n for (let game of document.querySelectorAll(\".game:not(.join)\")) {\n sock.emit(\"punto\", { action: \"data\", game: game.dataset.gameid });\n }\n }", "function updateUI() {\n \n //updating seats\n const seatsSelected = JSON.parse(localStorage.getItem('seatsSelected'));\n console.log(seatsSelected)\n if (seatsSelected !== null && seatsSelected .length > 0) {\n seats.forEach((seat, index) => {\n if (seatsSelected .indexOf(index) > -1) {\n seat.classList.add('selected')\n }\n });\n }\n\n // Updating moive lis dropdown\n const currentMovie = localStorage.getItem('movieIndex');\n if (currentMovie !== null) {\n movieList.selectedIndex = currentMovie;\n }\n}", "function updateAvailableACsUI(currentAvailableACs) {\n availableACs.innerHTML = currentAvailableACs;\n}", "function updateCurrentStatus(user) {\n $(\"#current-status\").empty().append(\n `<h4>` + user[\"family_name\"] + \", \" + user[\"given_name\"] + `</h4>\n <h4>UIN: ` + user[\"uin\"] + `</h4>\n <p>Current Entry Status = ` + user[\"status\"] + `</p>`\n ).show();\n}", "function twpro_clickList() {\r\n\t\tif (TWPro.twpro_failure) return;\r\n\t\tif (document.getElementById('twpro_wait').text != TWPro.lang.CALCJOB && document.getElementById('twpro_wait').text != TWPro.lang.CHOOSEJOB) {\r\n\t\t\tdocument.getElementById('twpro_wait').text = TWPro.lang.CALCJOB;\r\n\t\t\twindow.setTimeout(TWPro.twpro_updateList, 0);\r\n\t\t}\r\n\t}", "function updateAdmins() {\n // Get all players\n var players = room.getPlayerList();\n if ( players.length < 2 ) return; // No players left, do nothing.\n if ( players.find((player) => player.admin) > 1 ) return; // There's an admin left so do nothing.\n room.setPlayerAdmin(players[1].id, true); // Give admin to the first non admin player in the list\n}", "function setUserStatus(status) {\n // Set our status in the list of online users.\n currentStatus = status;\n myUserRef.set({ name: name, status: status });\n }", "function setUserStatus(status) {\n // Set our status in the list of online users.\n currentStatus = status;\n myUserRef.set({ name: name, status: status });\n }", "function updateUserList(users) {\n users.forEach(function(user) {\n if (user.id == me.id) {return;}\n addUser(user);\n });\n}", "function CONTACT_SetAwayStatus()\n{\n\tvar Select = document.getElementById(\"UserStatusSelect\");\n\n\tMainData.AwayCounter = MainData.AwayCounter - 1;\n\n\tif(MainData.AwayCounter == 0)\n\t{\n\t\tif((MainData.Status != \"playing\")&&(MainData.Status != \"unavailable\"))\n\t\t{\n\t\t\tCONTACT_ChangeStatus(\"away\");\n\t\t\t\n\t\t\t// Select away status \n\t\t\tSelect.selectedIndex = 3;\n\t\t}\n\t}\n}", "function flushUsers(users) {\n // clear the list. set all as gray\n $(\"#list\").empty().append('<li title=\"double click to talk\" alt=\"all\" class=\"sayingto\" onselectstart=\"return false\">all</li>');\n \n for (var i in users) {\n $(\"#list\").append('<li alt=\"' + users[i] + '\" title=\"double click to talk\" onselectstart=\"return false\">' + users[i] + '</li>');\n }\n //talk to somebady\n $(\"#list > li\").dblclick(function() {\n //peopel cannot talk to themselves\n if ($(this).attr('alt') != from) {\n //\n to = $(this).attr('alt');\n //cancel \"grey\"\n $(\"#list > li\").removeClass('sayingto');\n \n $(this).addClass('sayingto');\n \n showSayTo();\n }\n });\n }", "function onUpdateStudent() {\n\n if (classesSelectedIndex == -1 || classesSelectedIndex == 0) {\n updateTableOfStudents(true, true);\n } else {\n // retrieve key of currently selected class\n var keyClass = classes[classesSelectedIndex - 1].key;\n updateTableOfStudents(true, true, keyClass);\n }\n }", "function updateUserList(ajax) {\n var remoteList = JSON.parse(ajax.responseText);\n removeFromLocalList(remoteList);\n addToLocalList(remoteList);\n setTimeout(userListLongPooling, 1500); \n}", "function updateAll()\n{\n\twindow.clearTimeout( timeID );\n\tgetUserList();\n\tsetTimers();\n}", "toggleStatus(userId) {\n const existing = LobbyStatus.findOne(userId);\n if (!existing) {\n throw new Meteor.Error(403, ErrMsg.userNotInLobbyErr);\n }\n const newStatus = !existing.status;\n LobbyStatus.update(userId, { $set: { status: newStatus } });\n\n const asst = TurkServer.Assignment.getCurrentUserAssignment(userId);\n return Meteor.defer(() => this.events.emit(\"user-status\", asst, newStatus));\n }", "function updateFriendNewStatus(params) {\n /**\n * Moves an user from an array to another one, not before changing the\n * status of the user with the specific ID.\n *\n * @param userID: the user id of the user to be moved\n * @param firstArray: the first array to be used\n * @param secondArray: the second array to be used\n */\n function moveUser(userID, firstArray, secondArray) {\n let userIndex = undefined;\n firstArray.forEach((u, i) => {\n if (u._id === userID) {\n u.status = params.status;\n userIndex = i;\n }\n });\n\n if (userIndex > -1) {\n secondArray.push(firstArray[userIndex]);\n firstArray.splice(userIndex, 1);\n }\n }\n\n if (params.status === \"offline\") {\n moveUser(params._id, $scope.onlineFriends, $scope.offlineFriends);\n } else if (params.status === \"online\") {\n moveUser(params._id, $scope.offlineFriends, $scope.onlineFriends);\n }\n\n applyChanges();\n }", "aiUpdate(){\n ai.updateCurrentTargetList(player);\n }", "function mostrarUsuarios(tipo) {\n const inscriptions = course.inscriptions;\n let lista = null;\n\n users = inscriptions?.map((inscription) => inscription.user);\n const teacher = new Array(course.creator);\n const delegate = new Array(course.delegate);\n\n if (tipo === 'Profesor') {\n lista = <UsersList courseId={courseId} users={teacher} setSelectedUser={(a)=>{console.log(a);}}/>;\n } else if (tipo === 'Delegados') {\n lista = <UsersList courseId={courseId} users={delegate} setSelectedUser={(a)=>{console.log(a);}} />;\n } else {\n lista = <UsersList courseId={courseId} users={users} setSelectedUser={(a)=>{console.log(a);}} />;\n }\n\n return lista;\n }", "function update_lista_subastas()\t\n{\n\n\t// Recupera los datos\n\tvar datosUsuario\t= sessionStorage.getItem('datosUsuario');\n\tvar datosPassword\t= sessionStorage.getItem('datosPassword');\n\t\n\t// Actualitza listasubastas\n\t\n\tvar url=\"http://elmundo.webexpo.es/subastas.php\";\n\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&accion=asociado\";\n\t$.getJSON(url,function(mensaje, validacion){\n\n\t\tvar newRow = '';\n\t\t\n\t\tif (validacion === 'success') {\n\t\t\tif (mensaje.validacion === 'ok') {\n\t\t\t\t\n\t\t\t\tif (mensaje.lista === null)\n\t\t\t\t\t{\n\t\t\t\t\tnewRow = newRow + \"<tr class='success'><td colspan=6 class='videfech text-center'><strong>En estos momentos no hay ninguna subasta activa de las categorías contradadas</strong></td></tr>\";\n\t\t\t\t\tnewRow = newRow + \"<tr class='success'><td colspan=6 class='videfech text-center'><strong>Existen un total de \"+ mensaje.total +\" subastas actualmente activas en la aplicaci&oacute;n</strong></td></tr>\";\n\t\t\t\t\t\n\t\t\t\t\t$(\"#mostrarsubastas\").empty();\n\t\t\t\t\t$(newRow).appendTo(\"#mostrarsubastas\");\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t$.each(mensaje.lista, function(ID, data) {\n\n\t\t\t\t\t\tvar img = data.Image;\n\t\t\t\t\t\tif (!img || img === null || img === 'null') // Si vuelve nulo\n\t\t\t\t\t\t\timg = 'http://elmundo.webexpo.es/pix.gif';\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar time = data.RemainTime;\n\t\t\t\t\t\t// color\n\t\t\t\t\t\tvar color = \"blue\";\n\t\t\t\t\t\tif (time<3600) color = \"orange\";\n\t\t\t\t\t\tif (time<300) color = \"red\";\n\t\t\t\t\t\tvar TxtRemainTime = strtotime(time);\n\n\t\t\t\t\t\tif (time>=0)\n\t\t\t\t\t\t\tvar TxtDisplay = 'inline';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tvar TxtDisplay = 'none';\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar soyyo = data.Itsme;\n\t\t\t\t\t\tvar Estat = '';\n\t\n\t\t\t\t\t\tswitch (Number(data.Status)) {\n\t\t\t\t\t\t\tcase 0: // Agotado, finalizado\n\n//011\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'><div id='time_\"+data.Id+\"' style='color:\"+color+\"'>\"+TxtRemainTime+\"</div><input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"' style='display:\"+ TxtDisplay +\"'></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 1: // Activa\n\t\t\t\t\t\t\tcase 2: // Modificada\n\t\t\t\t\t\t\tcase 3: // Lliberada\n\t\n\t\t\t\t\t\t\t\t\tswitch (Number(data.Status)) {\n\t\t\t\t\t\t\t\t\t\tcase 2: Estat = ' (modificada por el usuario)'; break;\n\t\t\t\t\t\t\t\t\t\tcase 3:\tEstat = ' (liberada por asociado)'; break;\n\t\t\t\t\t\t\t\t\t\tdefault : Estat = '';\t\n\t\t\t\t\t\t\t\t\t}\n\n//012\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\"+Estat+\"<div id='time_\"+data.Id+\"' style='color:\"+color+\"'>\"+TxtRemainTime+\"</div><input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"' style='display:\"+ TxtDisplay +\"'><button type='button' class='btn btn-success' id='aceptar_\"+data.Id+\"'><i class='fa fa-check-square fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\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\tbreak;\n\n\n\t\t\t\t\t\t\tcase 5: // Asignada para mi\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Aceptada por mí\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tvEstat = \"Aceptada por otro asociado\";\n\t\t\t\t\t\t\t\t\t}\n//013\t\t\t\t\t\t\t\t\t\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>a\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n//014\nnewRow = newRow + \"<tr><td rowspan='3' >b<div class='grupbtns' id='capabotons_\"+data.Id+\"'><button type='button' class='btn btn-info' id='verdatos_\"+data.Id+\"'><i class='fa fa-users fa-2x' aria-hidden='true'></i></button><button type='button' class='btn btn-success' id='confirmar_\"+data.Id+\"'><i class='fa fa-check-square fa-2x' aria-hidden='true'></i></button><button type='button' class='btn btn-warning' id='liberar_\"+data.Id+\"'><i class='fa fa-undo fa-2x' aria-hidden='true'></i></button></div></td></tr>\";\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\t} else {\n//015\nnewRow = newRow + '<tr><td rowspan=\"3\">c</td></tr>'; // Todos los botones desactivados\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 8: // Confirmada por mi\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Confirmada por mí\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Confirmada por otro asociado\";\n\t\t\t\t\t\t\t\t\t}\n//016\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='14%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='20%'>\";\n\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + '<div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-success\" id=\"cerrar_'+data.Id+'\"><i class=\"fa fa-check-square fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" data-toggle=\"modal\" data-target=\"#my-modal2\" id=\"rechazar_'+data.Id+'\"><i class=\"fa fa-times fa-2x\" aria-hidden=\"true\"></i></button></div>'; \n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + ''; // Todos los botones desactivados\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\nnewRow = newRow + \"</div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 10: // Completada\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Completada por mi\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Cerrada\";\n\t\t\t\t\t\t\t\t\t}\n//017\nnewRow = newRow + \"<tr class='success'><td class='videfech text-center'><strong>55\"+data.CreationDate+\"</strong></td><td class='videfech'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td>\"+data.Price+\"&nbsp;&euro;</td><td rowspan='3' width='20%'>\";\n\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\t//newRow = newRow + '<tr><td class=\"text-left\" colspan=\"4\"><div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-warning\" data-toggle=\"modal\" data-target=\"#my-modal3\" id=\"valorar_'+data.Id+'\"><i class=\"fa fa-star-o fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" id=\"borrar_'+data.Id+'\"><i class=\"fa fa-trash fa-2x\" aria-hidden=\"true\"></i></button></div></td></tr>'; \n\t\t\t\t\t\t\t\t\t\t\tnewRow = newRow + '<div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-success\" id=\"cerrar_'+data.Id+'\"><i class=\"fa fa-check-square fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" data-toggle=\"modal\" data-target=\"#my-modal2\" id=\"rechazar_'+data.Id+'\"><i class=\"fa fa-times fa-2x\" aria-hidden=\"true\"></i></button></div>'; \n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + ''; // Todos los botones desactivados\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\nnewRow = newRow + \"</div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\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\tbreak;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 18: // Cancelada por el associado\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Cancelada por mí\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Cancelada por otro asociado\";\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\n//018\t\t\t\t\t\t\t\t\t\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\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\tbreak;\n\n\t\t\t\t\t\t\tcase 20: // Valorada por el cliente\n\t\t\t\t\t\t\tcase 21: // Borrado por el cliente\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Completada por mi\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Cerrada\";\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\tnewRow = newRow + \"<tr class='success'><td class='videfech text-center'><strong>77\"+data.CreationDate+\"</strong></td><td class='videfech'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td>\"+data.Price+\"&nbsp;&euro;</td><td rowspan='3' width='20%'>\";\n\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\t//newRow = newRow + '<tr><td class=\"text-left\" colspan=\"4\"><div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-warning\" data-toggle=\"modal\" data-target=\"#my-modal3\" id=\"valorar_'+data.Id+'\"><i class=\"fa fa-star-o fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" id=\"borrar_'+data.Id+'\"><i class=\"fa fa-trash fa-2x\" aria-hidden=\"true\"></i></button></div></td></tr>'; \n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + '<div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-success\" id=\"cerrar_'+data.Id+'\"><i class=\"fa fa-check-square fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" data-toggle=\"modal\" data-target=\"#my-modal2\" id=\"rechazar_'+data.Id+'\"><i class=\"fa fa-times fa-2x\" aria-hidden=\"true\"></i></button></div>'; \n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + ''; // Todos los botones desactivados\n\t\t\t\t\t\t\t\t\t}\n\tnewRow = newRow + \"</div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\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\tbreak;\n\n\t\t\t\t\t\t\tcase 25: // Valorada por el asociado\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Valorada por mí\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Cerrada\";\n\t\t\t\t\t\t\t\t\t}\n\nnewRow = newRow + \"<tr><td rowspan='3' width='30%'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td width='27%'>\"+data.CreationDate+\"</td><td width='34%'><strong>\"+data.Price+\"&nbsp;&euro;</strong></td><td rowspan='3' width='9%'><div class='grupbtns' id='capabotons_\"+data.Id+\"'><button type='button' class='btn btn-info' id='verdatos_\"+data.Id+\"'><i class='fa fa-users fa-2x' aria-hidden='true'></i></button></div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 30: // Valorada por el asociado\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Valorada por mí y por el cliente\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Cerrada\";\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tnewRow = newRow + \"<tr class='success'><td class='videfech text-center'><strong>99\"+data.CreationDate+\"</strong></td><td class='videfech'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td>\"+data.Price+\"&nbsp;&euro;</td>\";\n\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\t//newRow = newRow + '<tr><td class=\"text-left\" colspan=\"4\"><div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" id=\"borrar_'+data.Id+'\"><i class=\"fa fa-trash fa-2x\" aria-hidden=\"true\"></i></button></div></td></tr>'; \n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + '<div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-success\" id=\"cerrar_'+data.Id+'\"><i class=\"fa fa-check-square fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" data-toggle=\"modal\" data-target=\"#my-modal2\" id=\"rechazar_'+data.Id+'\"><i class=\"fa fa-times fa-2x\" aria-hidden=\"true\"></i></button></div>'; \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + ''; // Todos los botones desactivados\n\t\t\t\t\t\t\t\t\t}\n\tnewRow = newRow + \"</div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\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\tbreak;\n\n\t\t\t\t\t\t\tcase 92: // Valorada por el asociado\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Valorada por mí y por el cliente\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tEstat = \"Cerrada\";\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tnewRow = newRow + \"<tr class='success'><td class='videfech text-center'><strong>111\"+data.CreationDate+\"</strong></td><td class='videfech'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td>\"+data.Price+\"&nbsp;&euro;</td>\";\n\n\t\t\t\t\t\t\t\t\tif (soyyo) {\n\t\t\t\t\t\t\t\t\t\t//newRow = newRow + '<tr><td class=\"text-left\" colspan=\"4\"><div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" id=\"borrar_'+data.Id+'\"><i class=\"fa fa-trash fa-2x\" aria-hidden=\"true\"></i></button></div></td></tr>'; \n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + '<div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-info\" id=\"verdatos_'+data.Id+'\"><i class=\"fa fa-users fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-success\" id=\"cerrar_'+data.Id+'\"><i class=\"fa fa-check-square fa-2x\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"btn btn-danger\" data-toggle=\"modal\" data-target=\"#my-modal2\" id=\"rechazar_'+data.Id+'\"><i class=\"fa fa-times fa-2x\" aria-hidden=\"true\"></i></button></div>'; \n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewRow = newRow + ''; // Todos los botones desactivados\n\t\t\t\t\t\t\t\t\t}\n\tnewRow = newRow + \"</div></td></tr><tr><td colspan='2' class='minnst'><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/></td></tr><tr><td colspan='2' class='descrclass'>\"+data.Description+\"</td></tr>\";\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\tbreak;\n\n\n\t\t\t\t\t\t\tcase 90: // Cancelada por el cliente\n\t\t\t\t\t\t\t\t\tEstat = \"Cancelada recientemente por el usuario\";\n\n\t\t\t\t\t\t\t\t\tnewRow = newRow + \"<tr class='success'><td class='videfech text-center'><strong>222\"+data.CreationDate+\"</strong></td><td class='videfech'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/>\"+data.Description+\"</td><td>\"+data.Price+\"&nbsp;&euro;</td></tr>\";\n\n\t\t\t\t\t\t\t\t\tnewRow = newRow + '<tr><td class=\"text-left\" colspan=\"4\"><div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"><button type=\"button\" class=\"btn btn-danger\" id=\"borrar_'+data.Id+'\"><i class=\"fa fa-trash fa-2x\" aria-hidden=\"true\"></i></button></div></td></tr>'; // Todos los botones desactivados\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 99: // Borrado\n\t\t\t\t\t\t\tcase 98: // Historificado\n\t\t\t\t\t\t\tcase 94: // Borrado por el asociado\n\t\t\t\t\t\t\tcase 26: // Borrado por el asociado\n\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\tdefault:\n\t\t\t\t\t\t\t\t\tEstat = \"Estado no definido correctamente. Estado \" + data.Status;\n\n\t\t\t\t\t\t\t\t\tnewRow = newRow + \"<tr class='success'><td class='videfech text-center'><strong>333\"+data.CreationDate+\"</strong></td><td class='videfech'>\" + Estat + \"<input class='cronos' type='hidden' name='limit_\"+data.Id+\"' value='\"+data.RemainTime+\"' estado='\"+data.Status+\"'></td><td><img src='\"+img+\"' id='image_\"+data.Id+\"' class='thumb'/>\"+data.Description+\"</td><td>\"+data.Price+\"&nbsp;&euro;</td></tr>\";\n\n\t\t\t\t\t\t\t\t\tnewRow = newRow + '<tr><td class=\"text-left\" colspan=\"4\"><div class=\"grupbtns\" id=\"capabotons_'+data.Id+'\"></div></td></tr>'; // Todos los botones desactivados\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t\t$(\"#mostrarsubastas\").empty();\n\t\t\t\t\t$(newRow).appendTo(\"#mostrarsubastas\");\n\n\t\t\t\t\t// Botones de acción\n\t\t\t\t\t$.each(mensaje.lista, function(ID, data) {\n\n\t\t\t\t\t\tvar soyyo = data.Itsme;\n\n\t\t\t\t\t\t// Botones de acción\n\n\t\t\t\t\t\tif (data.Status ==1 || data.Status==2 || data.Status ==3) {\n\t\t\t\t\t\t\tvar nom = '#aceptar_' + data.Id;\n\t\t\t\t\t\t\t$(nom).click(function () {\n\t\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=aceptar\";\n\t\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\t\talert ('Has aceptado la oferta. Ahora podrás ver los datos del ofertante.');\n\t\t\t\t\t\t\t\t\t\twindow.location.href = 'subastas_asociados.html';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para aceptar la oferta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Botón ver datos\n\t\t\t\t\t\t//if ((data.Status ==5 || data.Status ==8 || data.Status ==10 || data.Status ==20 || data.Status ==25 || data.Status ==30 || data.Status ==92 || data.Status ==94 || data.Status ==98) && soyyo) {\n\t\t\t\t\t\t\tvar nom1 = '#verdatos_' + data.Id;\n\n\t\t\t\t\t\t\t$(nom1).click(function () {\n\t\t\t\t\t\t\t\t\tsessionStorage.setItem('subastaseleccionada', data.Id);\n\t\t\t\t\t\t\t\t\twindow.location.href = 'esta_subasta.html';\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t//}\n\n\t\t\t\t\t\tif (data.Status ==5 && soyyo) {\n\t\t\t\t\t\t\tvar nom2 = '#confirmar_' + data.Id;\n\t\t\t\t\t\t\tvar nom3 = '#liberar_' + data.Id;\n\n\t\t\t\t\t\t\t$(nom2).click(function () {\n\t\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=confirmar\";\n\t\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\t\talert ('Has confirmado que aceptas la oferta. Esta oferta solo podrá cerrarse o cancelarse.');\n\t\t\t\t\t\t\t\t\t\twindow.location.href = 'subastas_asociados.html';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para aceptar la oferta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t$(nom3).click(function () {\n\t\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=liberar\";\n\t\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\t\talert ('Has liberado esta oferta. La oferta sigue su curso.');\n\t\t\t\t\t\t\t\t\t\twindow.location.href = 'subastas_asociados.html';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para liberar la oferta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.Status ==8 && soyyo) {\n\t\t\t\t\t\t\tvar nom2 = '#cerrar_' + data.Id;\n\t\t\t\t\t\t\tvar nom3 = '#rechazar_' + data.Id;\n\n\t\t\t\t\t\t\t$(nom2).click(function () {\n\t\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=cerrar\";\n\t\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\t\talert ('Has confirmado que se ha efecturado correctamente la venta y la oferta se marcará como completada.');\n\t\t\t\t\t\t\t\t\t\twindow.location.href = 'subastas_asociados.html';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para completar la oferta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t$(nom3).click(function () {\n\t\t\t\t\t\t\t\tsessionStorage.setItem('subastaseleccionada', data.Id);\n\t\t\t\t\t\t\t\twindow.location.href = 'insert_motivo.html';\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\tvar resultado = confirm('¿Realmente quieres cancelar esta oferta ? Esta oferta quedará completamente cancelada y afectará a la valoración del cliente, para ello vamos a pedirte que expliques el motivo de la cancelación, habiéndola confirmado anteriormente.');\n\t\t\t\t\t\t\t\tif (resultado)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=rechazar\";\n\t\t\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\t\t\talert ('Has rechazado la venta una vez confirmada, necesitaremos que nos expliques el motivo.');\n\t\t\t\t\t\t\t\t\t\t\twindow.location.href = 'insert_motivo.html';\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para rechazar la oferta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Botón valorar\n\t\t\t\t\t\tif ((data.Status ==10 || data.Status ==20 ) && soyyo) {\n\t\t\t\t\t\t\tvar nom2 = '#valorar_' + data.Id;\n\n\t\t\t\t\t\t\t$(nom2).click(function () {\n\t\t\t\t\t\t\t\tsessionStorage.setItem(\"subastaseleccionada\", data.Id);\n\t\t\t\t\t\t\t\t//$('#my-modal').modal('show');\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t// Botón borrar\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ((data.Status ==10 || data.Status ==30) && soyyo) {\n\t\t\t\t\t\t\tvar nom3 = '#borrar_' + data.Id;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(nom3).click(function () {\n\t\t\t\t\t\t\t\tsessionStorage.setItem('subastaseleccionada', data.Id);\n\t\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=ocultarventa\";\n\t\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\t\twindow.location.href = 'subastas_asociados.html';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para borrar la venta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Botón borrar\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (data.Status ==90) {\n\t\t\t\t\t\t\tvar nom3 = '#borrar_' + data.Id;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(nom3).click(function () {\n\t\t\t\t\t\t\t\tsessionStorage.setItem('subastaseleccionada', data.Id);\n\t\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=borradoasociado\";\n\t\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\t\twindow.location.href = 'subastas_asociados.html';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para borrar la venta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Botón REACTIVAR /para pruebas solamente\n\t\t\t\t\t\tif (data.Status ==98 && soyyo) {\n\t\t\t\t\t\t\tvar nom2 = '#reactivar_' + data.Id;\n\n\t\t\t\t\t\t\t$(nom2).click(function () {\n\t\t\t\t\t\t\t\tvar url = \"http://elmundo.webexpo.es/subastas.php\";\n\t\t\t\t\t\t\t\turl = url + \"?usuario=\" + datosUsuario + \"&password=\" + datosPassword + \"&idsubasta=\"+ data.Id +\"&accion=reactivar\";\n\t\t\t\t\t\t\t\t$.getJSON(url,function(mensaje, validacion) {\n\t\t\t\t\t\t\t\t\tif (validacion == 'success') {\n\t\t\t\t\t\t\t\t\t\talert ('Has reactivado la valoración de la venta.');\n\t\t\t\t\t\t\t\t\t\twindow.location.href = 'subastas_asociados.html';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\talert ('Ha habido algun problema para reactivar la venta. El motivo es : ' + html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\n\n\n\t\t\t\t\t});\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t} else { alert ('Ha habido un error, motivo '+ html_entity_decode(mensaje.mensaje, 'ENT_QUOTES'));}\n\t\t} else { alert ('Ha habido un error, motivo '+ html_entity_decode(validacion, 'ENT_QUOTES'));}\n\t});\n\t\t\t\n\t\n}", "function changeRoles(configPass){\n\t$(\"ul.filter li\").on('touchstart click', function(e){\t\n\t\te.preventDefault();\t\n\t\t$(\"ul.filter li\").removeClass(\"active\");\n\t\t$(this).addClass(\"active\");\n\t\t$('div.content').empty().addClass('spinner');\t\n\t\tvar asRole = $(this).data('asrole');\n\t\tlocalStorage.setItem('sd_user_role', asRole);\n\t\t//localStorage.removeItem('sd_from_queueid');\t\t\t\n\t\t//SherpaDesk.init();\n\t\tlocalStorage.setItem('sd_is_from', 'tickets');\n\t\tlocalStorage.setItem('sd_is_from_id', '');\n\t\tSherpaDesk.getTickets(configPass);\n\t\t});\n\t}", "updatePlayerInRoomList() {\n var players = this.players;\n var tableHtml = \"<table id=privateRoomList class='bordered'>\";\n tableHtml += \"<tr> <th> Name </th> <th> Rating </th> </tr>\";\n players.forEach(function(player, index) {\n if(index == 0) { //leader\n tableHtml += \"<tr> <td>\" +player.name+ \" (Leader) </td> <td> \"+player.rating+\" </td> </tr>\";\n }else {\n tableHtml += \"<tr> <td>\" +player.name+ \" </td> <td> \"+player.rating+\" </td> </tr>\";\n }\n });\n tableHtml += \"</table>\";\n \n this.io.to(this.roomId).emit('updatePlayerList', {\n\t\t\ttableHtml : tableHtml\n\t\t});\n }", "function makeStudentActive(activate) {\n localStorage.setItem('activeUser', JSON.stringify(activate));\n}", "async function updateDevicesStatus() {\n //Zera as duas listas\n devicesOnline.splice(0,devicesOnline.length)\n devicesOffline.splice(0,devicesOffline.length)\n\n connectedClients = await getAllConnectedClients()\n devicesDB = await getAllDevices()\n\n devicesDB.forEach((currentDevice) => {\n if (connectedClients.indexOf(currentDevice.clientID) == -1)\n devicesOffline.push(currentDevice)\n else\n devicesOnline.push(currentDevice)\n })\n console.log(\"[LOG] Lista de dispositivos online atualizada.\")\n\n await updateDevicesSignalsNames()\n sendClientDevices()\n }", "function updateOnlineStatusOfClients(all_occupants_details){\n //first every user's status label to offline\n $(\".online_status\").text(' (Offline) ').css('color', '#C0C0C0');\n\n //then update the online status based on logged in clients.\n for(var i=0; i<all_occupants_details.length; i++){\n var userEmail = all_occupants_details[i].email;\n $('#online_status_'+convertEmailToID(userEmail)).text(' (Online) ').css('color', '#0f0');\n }\n}", "function updateOnlineStatusOfClients(all_occupants_details){\n //first every user's status label to offline\n $(\".online_status\").text(' (Offline) ').css('color', '#C0C0C0');\n\n //then update the online status based on logged in clients.\n for(var i=0; i<all_occupants_details.length; i++){\n var userEmail = all_occupants_details[i].email;\n $('#online_status_'+convertEmailToID(userEmail)).text(' (Online) ').css('color', '#0f0');\n }\n}", "function updateUser(username,fullname,email,phone) {\n let navbarLogin = document.getElementById(\"navbar-login\");\n let logoutButton = document.getElementById(\"logout-button\");\n let profileUserInfo = document.getElementById(\"profile-user-info\");\n let profileHistory = document.getElementById(\"profile-history\");\n\n if(username){\n // user is logged in\n navbarLogin.innerHTML = fullname;\n navbarLogin.setAttribute(\"onclick\",\"switchProfile()\");\n\n logoutButton.innerHTML = \"Logout\";\n logoutButton.setAttribute(\"onclick\",\"logout()\");\n\n profileUserInfo.innerHTML = `<h3>${fullname}</h3>\n <p>${username}</p>\n <p>${email}</p>\n <p>${phone}</p>\n <br>\n <a onclick=\"switchEditProfileDialog()\">Edit Profile</a>`;\n profileHistory.innerHTML = `<h3>Check-In History</h3>\n <a>View All</a>`;\n\n // fetch check-in info here\n // <h3>Check-In History</h3>\n\n // <p>14/05/2021 9:41AM</p>\n // <p>The University of Adelaide</p>\n // <br />\n\n // <p>14/05/2021 12:12PM</p>\n // <p>Hungry Jacks Rundle Mall</p>\n // <br />\n\n // <p>14/05/2021 4:55PM</p>\n // <p>Coles Rundle Mall</p>\n // <br />\n\n // <a>View All</a>\n }else{\n // user not logged in\n navbarLogin.innerHTML = \"Login\";\n navbarLogin.setAttribute(\"onclick\",\"switchLoginDialog()\");\n\n logoutButton.innerHTML = \"Login\";\n logoutButton.setAttribute(\"onclick\",\"switchLoginDialog()\");\n\n profileUserInfo.innerHTML = \"<h3>Please Login</h3>\";\n profileHistory.innerHTML = \"\";\n }\n}", "function setUserStatus(status) {\n\t// Set our status in the list of online users.\n\tcurrentStatus = status;\n\tif (presname != undefined && status != undefined){\n\t\tmyUserRef.set({ name: presname, status: status });\n\t}\n}", "function ProfileLeftCol(props) {\n // Authenticated user's state\n const [userState, setUserState] = useState({});\n\n // Current state of teachersList array\n const [teachers, setTeachers] = useState([]);\n\n useEffect(() => {\n async function loadData() {\n if (props.type === \"teacher\") {\n const data = await API.getTeacher();\n setUserState({\n type: props.type,\n imageUrl: data.data.imageUrl\n })\n } else {\n const data = await API.getStudentData();\n console.log(\"Loading student's data...\", data.data);\n setUserState({\n type: props.type,\n imageUrl: data.data.imageUrl,\n teachers: data.data.teachers,\n school: data.data.school\n })\n // console.log(\"Printing data.data.teachers from getStudentData()...\", data.data.teachers);\n const teachers = await API.getTeachersBySchool(data.data.school);\n setTeachers(teachers.data);\n // console.log(\"Printing teachers.data...\", teachers.data);\n }\n }\n loadData();\n }, []);\n\n const [checkTeachers, setCheckTeachers] = useState([]);\n // Handle for checking checkboxes for teachers\n function handleCheckbox(e) {\n // console.log('checked', e.target.checked);\n // console.log('name', e.target.name);\n const newTeachers = [...checkTeachers];\n if (e.target.checked) {\n newTeachers.push(e.target.name);\n }\n else {\n const index = newTeachers.indexOf(e.target.name)\n newTeachers.splice(index, 1);\n }\n setCheckTeachers(newTeachers);\n }\n // Update student's list of teachers in the db\n async function saveTeachers(e) {\n e.preventDefault();\n const newData = await API.updateStudentsTeachers(checkTeachers);\n console.log(\"Student's teachers updated...printing new data...\", newData.data);\n // setUserState({\n // type: newData.data.userType,\n // imageUrl: newData.data.imageUrl,\n // teachers: newData.data.teachers,\n // school: newData.data.school\n // });\n window.location.reload(false);\n }\n\n let imageUrlRef = useRef();\n // Update user's imageUrl field with the new url\n const handleSave = async (e) => {\n e.preventDefault();\n\n // Make a put request to update user's data with the image\n if (props.type === \"teacher\") {\n await API.updateTeacher(props.id, {\n imageUrl: imageUrlRef.current.value\n })\n } else if (props.type === \"student\") {\n await API.updateStudent(props.id, {\n imageUrl: imageUrlRef.current.value\n })\n }\n setUserState({\n type: props.type,\n imageUrl: imageUrlRef.current.value\n })\n }\n\n //initialize i for incrememnting teacher emails in props\n var i = -1;\n return (\n\n <div className=\"left-col-container uk-align-left uk-flex uk-flex-column uk-padding\" >\n <div className=\"uk-text-large\">\n {props.name}\n </div>\n <div className=\"uk-text-small uk-margin-bottom\">\n {props.school}\n </div>\n <div className=\"uk-flex uk-flex-column image-and-info\">\n <div className=\"uk-inline-clip uk-transition-toggle uk-light profile-pic-container uk-flex uk-flex-center uk-flex-middle\" tabIndex=\"0\">\n <img src={userState.imageUrl || (props.type === \"teacher\" ? teacherImg : studentImg)} alt=\"Profile Avatar\" className=\"profile-picture\" />\n <div className=\"uk-position-center\">\n <span className=\"uk-transition-fade edit-pic-btn\" uk-icon=\"icon: pencil\" uk-toggle=\"target: #image-url-input\"></span>\n </div>\n </div>\n <div id=\"image-url-input\" uk-modal=\"true\">\n <div className=\"uk-modal-dialog uk-modal-body\">\n <button className=\"uk-modal-close-default\" type=\"button\" uk-close=\"true\"></button>\n <form className=\"uk-form-stacked uk-position-relative studentForm\" uk-height-viewport=\"expand: true\">\n <h3>Enter a hyperlink for your profile picture</h3>\n <div className=\"uk-margin\">\n <label className=\"uk-form-label uk-text\">Image Url</label>\n <div className=\"uk-form-controls\">\n <input className=\"uk-input uk-form-width-medium stuInput\" id=\"imageUrl\" type=\"text\" placeholder=\"https://www.image.com/image.png\" ref={imageUrlRef} />\n </div>\n </div>\n <p className=\"uk-text-right\">\n <button className=\"uk-button uk-modal-close uk-margin-small-right secondaryBtn\" type=\"button\">Cancel</button>\n <button className=\"uk-button uk-modal-close primaryBtn\" type=\"button\" onClick={handleSave}>Save</button>\n </p>\n </form>\n </div>\n </div>\n <div className=\"uk-flex uk-flex-column\">\n {props.teachers ? (\n <div className=\"uk-text-small uk-margin-top user-info\">\n <div className=\"uk-flex uk-flex-middle\">\n <div className=\"uk-text-small uk-margin-small-right\">Teachers</div>\n <button uk-icon=\"icon: pencil; ratio: .9\" type=\"button\" uk-toggle=\"target: #teachers-update\"></button>\n </div>\n <div id=\"teachers-update\" uk-modal=\"true\">\n <div className=\"uk-modal-dialog uk-modal-body\">\n <h2 className=\"uk-modal-title\">Update Teachers</h2>\n <div className=\"uk-margin uk-grid-small uk-child-width-auto uk-grid\">\n {\n teachers && teachers.length > 0 ? (\n teachers.map(teacher => {\n return <label key={teacher._id}>\n <input\n name={teacher._id}\n className=\"uk-checkbox\"\n type=\"checkbox\"\n onClick={handleCheckbox}\n />\n {teacher.name}\n </label>\n })\n ) : <p className=\"uk-text-danger\">No teachers found under this school.</p>\n }\n\n </div>\n <div className=\"uk-flex uk-flex-right uk-margin-large-top\">\n <button className=\"uk-button secondaryBtn uk-modal-close uk-margin-small-right\" type=\"button\">Cancel</button>\n <button className=\"uk-button primaryBtn\" type=\"button\" onClick={saveTeachers}>Save</button>\n </div>\n </div>\n </div>\n {props.teachers.map(item => {\n i++;\n return (\n <div uk-tooltip={props.teacheremails[i]} key={item}>{item}</div>\n )\n })}\n {/* {props.teachers.join(\", \")} */}\n </div>\n ) : <div></div>}\n {props.subjects ? (\n <div className=\"uk-margin-top\">\n <div className=\"uk-text-small\">Subjects</div>\n {props.subjects.join(\", \")}\n </div>\n ) : <div></div>}\n {props.email ? (\n <div className=\"uk-margin-small-top\">\n <div className=\"uk-text-small\">Email</div>\n {props.email}\n </div>\n ) : <div></div>}\n </div>\n </div>\n </div>\n )\n}", "function refreshListOfUsersWhoHaveAddedYou(l) { User.downloadListOfUsersWhoHaveAddedYou(l); }", "async changeIsActive(req, res) {\n const { id } = req.params\n const user = await User.findOne({ where: { id: id } })\n if (user.isOnline === true) {\n const updatedLastName = await user.update({ isOnline: false })\n return res.json(updatedLastName)\n } else {\n const updatedLastName = await user.update({ isOnline: true })\n return res.json(updatedLastName)\n }\n }", "function userLoggedIn(inUsers){\r\n\t//logically\r\n\tif(Array.isArray(inUsers)){\r\n\t\tinUsers.forEach(e => CLIENT_GAME.addUserToWaitingList(JSON.stringify(e)));\r\n\t} else {\r\n\t\tCLIENT_GAME.addUserToWaitingList(JSON.stringify(inUsers));\r\n\t}\r\n\r\n\t//on UI\r\n\tuiRefreshUsersList();\r\n\tif(!(Array.isArray(inUsers))){\r\n\t\tupdateUI();\r\n\t}\r\n}", "grabUserListsUpdated(data, mode = 'All') {\n let key = 'UserListsUpdated_' + mode;\n let cond = \"1=1\";\n if (mode == 'WithList')\n cond = \"list_update_ts is not null and is_deleted = false\";\n else if (mode == 'WithoutList')\n cond = \"list_update_ts is null and is_deleted = false\";\n else if (mode == 'Active')\n cond = \"list_update_ts > ('now'::timestamp - '1 year'::interval) and is_deleted = false\";\n else if (mode == 'NonActive')\n cond = \"list_update_ts < ('now'::timestamp - '1 year'::interval) and is_deleted = false\";\n return this.grabByIds({\n key: key,\n isByListOfIds: true,\n getTotalIdsCnt: () => data.totalIdsCnt,\n getListOfIds: () => data.listOfIds,\n /*getNextIds: (nextId, limit) => {\n return this.db.manyOrNone(\"\\\n select id, trim(login) as login, list_update_ts \\\n from malrec_users \\\n where id >= $(nextId) and need_to_check_list = false \\\n and \"+ cond +\" \\\n order by id asc \\\n limit $(limit) \\\n \", {\n nextId: nextId,\n limit: limit,\n }).then((rows) => {\n let ids = [], data = {};\n if (rows)\n for (let row of rows) {\n ids.push(parseInt(row.id));\n data[row.id] = {\n login: row.login, \n listUpdatedTs: row.list_update_ts, \n };\n }\n return {ids: ids, data: data};\n });\n },*/\n getDataForIds: (ids) => {\n return this.db.manyOrNone(\"\\\n select id, trim(login) as login, list_update_ts \\\n from malrec_users \\\n where id in (\" + ids.join(', ') + \") \\\n \").then((rows) => {\n let data = {};\n if (rows)\n for (let row of rows) {\n data[row.id] = {\n login: row.login, \n listUpdatedTs: row.list_update_ts, \n };\n }\n return data;\n });\n },\n fetch: (id, data) => {\n return this.provider.getLastUserListUpdates({login: data.login});\n },\n process: (id, updatedRes, data) => {\n return this.processer.processUserListUpdated(id, data.login, \n data.listUpdatedTs, updatedRes);\n },\n });\n }", "function updateLocalStatus(todo) {\n let todos, todosDone;\n todos = JSON.parse(localStorage.getItem(\"remaining\"));\n if (localStorage.getItem(\"completed\") == null) {\n todosDone = [];\n } else {\n todosDone = JSON.parse(localStorage.getItem(\"completed\"));\n }\n if (todo.classList[1] === \"completed\") {\n todos.splice(todos.indexOf(todo.innerText), 1);\n localStorage.setItem(\"remaining\", JSON.stringify(todos));\n todosDone.push(todo.innerText);\n localStorage.setItem(\"completed\", JSON.stringify(todosDone));\n } else {\n todosDone.splice(todosDone.indexOf(todo.innerText), 1);\n localStorage.setItem(\"completed\", JSON.stringify(todosDone));\n todos.push(todo.innerText);\n localStorage.setItem(\"remaining\", JSON.stringify(todos));\n }\n}", "updateProfile() {}", "function updateAssessmentList(page_num) {\n var text = \"\";\n// startWaiting();\n console.log(page_num);\n $.ajax({\n url: 'update_assess',\n type: 'GET',\n data: {'page_num' : page_num},\n async: false,\n success: function (response) {\n console.log(response);\n var assessments = response['assessments'];\n var pages=response['pages'];\n var page_num=response['page_num'];\n\n $.each(assessments, function (key, value) {\n console.log(value['displayName']['text']);\n text += '<a href=\"#\" class=\"mylist-item assess-item\" id=\"' + value['id'] + '\"><div class=\"mylist-item-text\">' + value['displayName']['text'] + '</div></a>';\n\n });\n $('#assess-list').html(text);\n selectedAssessment = null;\n $('.assess-item').click(function () {\n if (wait == false) {\n clickAssessment($(this));\n }\n return false;\n });\n addAssessPageMenu(pages,page_num);\n\n\n }\n }).done(function(){\n\n console.log(\"Done updating assess list\");\n// stopWaiting();\n\n });\n console.log('Exiting updateAssessmentList');\n\n\n}", "toggleCompletadas(ids=[]) {\n\n //Este primer pedazo es para cambiar el estado de completadoEn de\n //las tareas como completadas por la fecha en que se completo\n ids.forEach(id => {\n \n const tarea = this._listado[id];\n if( !tarea.completadoEn){\n\n //La funcion new Date().toISOString ya esta predeterminada por node y me permite extraer un string\n //con la fecha actual en la que se completo la tarea y se le asigna dicho valor a la tarea\n\n //Tener en cuenta que a pesar que el cambio se le esta haciendo a una constante dentro del metodo, \n //como se esta haciendo por referencia global esta implicitamente se cambia dentro del objeto global _listado\n tarea.completadoEn = new Date().toISOString()\n }\n });\n\n //Ya este pedazo es para volver a cambiar el estado de una tarea que habia marcado como confirmada\n //ya no es asi\n this.listadoArr.forEach(tarea=>{\n\n //ids.includes(tarea.id) me permite mirar si dentro del arreglo que recibo de ids \n //se encuentra el id de tarea.id si no es asi lo cambio nuevamente a nulo \n if( !ids.includes(tarea.id) ){\n\n this._listado[tarea.id].completadoEn=null;\n }\n })\n }", "function editSaveAcc() {\n const editUserId = accounts.find(update => update.username == (document.getElementById(\"editUsernameTitle\").innerHTML)).username;\n console.log(editUserId);\n \n for (let i = 0; i < accounts.length; i++) {\n if (accounts[i].username == editUserId) {\n console.log(accounts[i]);\n\n accounts[i].name = document.getElementById(\"editFullName\").value;\n console.log(accounts[i].name);\n\n accounts[i].username = document.getElementById(\"editUsername\").value;\n console.log(accounts[i].username);\n\n accounts[i].email = document.getElementById(\"editEmail\").value;\n console.log(accounts[i].email);\n\n accounts[i].suspended = document.getElementById(\"editSuspended\").checked;\n console.log(accounts[i].suspended);\n\n // Update password\n if (document.getElementById(\"editPassword\").value) {\n accounts[i].password = document.getElementById(\"editPassword\").value;\n console.log(\"Password changed to\", document.getElementById(\"editPassword\").value);\n }\n\n // Update userType\n const userTypes = document.getElementsByName(\"editUserType\");\n console.log(userTypes);\n \n for (let j = 0; j < userTypes.length; j++) {\n const userType = userTypes[j];\n if (userType.checked) {\n console.log(\"User type checked:\", userType.value);\n accounts[i].userType = userType.value;\n }\n }\n }\n }\n saveAcc();\n window.location.reload();\n console.log({accounts});\n}", "approveLeave(id) {\n Auth.approveLeaveStatus(id).then(response => {\n var listOfLeaves = [];\n var listOfAllLeaves = [];\n this.setState({\n show: false,\n showAlert: true,\n alertMessage: response.message\n });\n listOfLeaves = this.state.dataPerPage;\n listOfAllLeaves = this.state.todos;\n for (var i = 0; i < listOfLeaves.length; i++) {\n var obj = listOfLeaves[i];\n if (response.message == \"Leave approved by Admin\") {\n this.setState({\n show: false,\n showAlert: true,\n alertMessage: response.message\n });\n if (obj._id == id) {\n listOfLeaves[i].message = \"Approved By HR\";\n }\n } else if (response.message == \"Leave approved by SuperAdmin\") {\n this.setState({\n show: false,\n showAlert: true,\n alertMessage: response.message\n });\n if (obj._id == id) {\n listOfLeaves[i].message = \"Approved By Delivery Head\";\n }\n }\n else if (response.message == \"Leave approved by HR\") {\n this.setState({\n show: false,\n showAlert: true,\n alertMessage: response.message\n });\n if (obj._id == id) {\n listOfLeaves[i].message = \"Approved By HR\";\n }\n }\n\n if (obj._id == id && response.message == \"Leave updated successfully\") {\n this.state.dataPerPage.splice(i, 1);\n this.setState({\n dataPerPage: this.state.dataPerPage,\n todos: listOfAllLeaves\n });\n } else {\n this.setState({\n dataPerPage: listOfLeaves\n });\n }\n }\n });\n setTimeout(() => {\n this.setState({ alertMessage: \"\", showAlert: false });\n }, 4000);\n }", "function accountUpdate(account) {\n if (currentAccount != account) {\n currentAccount = account;\n\n if (typeof account == 'undefined') {\n toast(\"Please unlock account\");\n $(\"#main\").load(\"./views/locked.html\");\n $(\"#navbarNavAltMarkup\").find(\"#cntAsAccount\").text(\"User : Locked\");\n isAccountLocked = true;\n\n return;\n }\n else\n {\n\t\t\t//Account not undefined\n\t\t\tupdateDisplayAppReady();\n\n\t\t\tprovider.eth.defaultAccount = account;\n\t\t\t$(\"#navbarNavAltMarkup\").find(\"#cntAsAccount\").text(\"User : \" + account.substring(0, 10) + \"[...]\");\n\n\t\t\tisAccountLocked = false;\n\n\t\t\tsignIn().then(function() {\n\t\t\t\treloadPreference();\n\t\t\t});\n\t\t}\n\t}\n}", "function refreshListOfAddedUsers(l) { User.downloadListOfAddedUsers(l); }", "function checkAllTask(e){\n\n var status = false;\n if(e.target.checked){\n status = true;\n }\n\n for(var i = 0 ; i < loginUser.tasks.length; i++){\n loginUser.tasks[i].status = status;\n }\n collectionOfUser.update(\n {\n id : loginUser.id,\n tasks : loginUser.tasks\n },\n function(user){\n loginUser = user;\n $('#containerShowTask').html('');\n showAllTasks(loginUser.tasks);\n },\n error \n );\n }", "updateSpendList(state, spends) {\r\n state.spendsList = spends; \r\n }", "function course_watcher() {\r\n\t\tsql.open({filename: \"./Objects/coursewatcher.sqlite\", driver: sqlite3.Database}).then((db) => {\r\n\t\t\t(async () => {\r\n\t\t\t\tdb.all(`SELECT * FROM courseWatchUsers`).then(userRows => {\r\n\t\t\t\t\tfor (var userRow of userRows) {\r\n\t\t\t\t\t\tconsole.log(\"Going through course watchlist for \" + userRow.userId);\r\n\t\t\t\t\t\tdb.all(`SELECT * FROM courseWatch WHERE userId =\"${userRow.userId}\"`).then(rows => {\r\n\t\t\t\t\t\t\t(async () => {\r\n\t\t\t\t\t\t\t\tvar classList = [];\r\n\t\t\t\t\t\t\t\tvar skipList = [];\r\n\t\t\t\t\t\t\t\tvar thisUser = \"\";\r\n\t\t\t\t\t\t\t\tif (rows.length > 0) {\r\n\t\t\t\t\t\t\t\t\tthisUser = rows[0].userId;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tfor (var row of rows) {\r\n\t\t\t\t\t\t\t\t\tawait new Promise(next => {\r\n\t\t\t\t\t\t\t\t\t\tif (!row.section) {\r\n\t\t\t\t\t\t\t\t\t\t\tskipList.push(row.abbr + row.num + \" skipped because it has no section (not implemented yet)\");\r\n\t\t\t\t\t\t\t\t\t\t\treturn next();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tvar url = \"https://prv-web.sens.buffalo.edu/apis/schedule2/schedule2/course/semester/fall/abbr/\" + row.abbr + \"/num/\" + row.num + \"/section/\" + row.section;\r\n\r\n\t\t\t\t\t\t\t\t\t\t(async () => {\r\n\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\tconst response = await got(url);\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar parsed = JSON.parse(response.body);\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar openSeats = parsed.enrollment.section - parsed.enrollment.enrolled;\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar seatStr = \"seat\" + (openSeats === 1 ? \"\" : \"s\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar str = parsed.catalog.abbr + parsed.catalog.num + \" \" + parsed.section + \": \" + (openSeats > 0 ? (\"**\" + openSeats + \" open \" + seatStr + \"!**\") : openSeats + \" open \" + seatStr) + \" (\" + parsed.enrollment.enrolled + \"/\" + parsed.enrollment.section + \"; room cap \" + parsed.enrollment.room + \")\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tparsed.notes.forEach(function (e) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tstr += \" [Note: \" + e.note + \"]\";\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\tclassList.push(str);\r\n\t\t\t\t\t\t\t\t\t\t\t\tnext();\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\tcatch (error) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(error.toString());\r\n\t\t\t\t\t\t\t\t\t\t\t\tnext();\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})();\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (thisUser !== \"\" && classList.length !== 0) { // TODO: users with no more watchers should be removed from the JSON file\r\n\t\t\t\t\t\t\t\t\tclient.users.fetch(thisUser).then(user => {\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"Sending course watchlist to \" + user_form(user));\r\n\t\t\t\t\t\t\t\t\t\tvar date = new Date();\r\n\t\t\t\t\t\t\t\t\t\tvar month = date.getMonth() + 1;\r\n\t\t\t\t\t\t\t\t\t\tvar day\t= date.getDate();\r\n\t\t\t\t\t\t\t\t\t\tday = (day < 10 ? \"0\" : \"\") + day;\r\n\t\t\t\t\t\t\t\t\t\tvar str = \"Course watchlist for \" + month + \"/\" + day + \":\\n\";\r\n\t\t\t\t\t\t\t\t\t\tstr += classList.sort().join(\"\\n\");\r\n\t\t\t\t\t\t\t\t\t\tstr += \"\\n\" + skipList.sort().join(\"\\n\");\r\n\t\t\t\t\t\t\t\t\t\tuser.send(str).catch(error => {\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Could not send reminder to \" + user_form(user) + \" (probably blocked)\");\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})();\r\n\t\t\t\t\t\t});\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}", "function ModConfirmOpen_AddFromPreviousExamyears() {\n //console.log(\" ----- ModConfirmOpen_AddFromPreviousExamyears ----\")\n\n mod_dict = {mode: \"add_from_prev_examyears\"};\n mod_dict.user_pk_list = [];\n if(permit_dict.permit_crud_sameschool){\n\n // --- loop through tblBody.rows and fill user_pk_list, only users of other years\n for (let i = 0, tblRow; tblRow = tblBody_datatable.rows[i]; i++) {\n if (tblRow.classList.contains(cls_selected)) {\n const data_dict = user_dicts[tblRow.id];\n if (data_dict){\n if (data_dict.ey_other){\n mod_dict.user_pk_list.push(data_dict.id);\n };\n };\n };\n };\n mod_dict.user_pk_count = (mod_dict.user_pk_list) ? mod_dict.user_pk_list.length : 0;\n\n const header_txt = loc.Add_users_from_prev_year;\n el_confirm_header.innerText = header_txt\n\n el_confirm_btn_save.innerText = loc.OK;\n add_or_remove_class (el_confirm_btn_save, cls_hide, !mod_dict.user_pk_count);\n\n el_confirm_btn_cancel.innerText = (mod_dict.user_pk_count) ? loc.Cancel : loc.Close ;\n\n const msg_list = [\"<p>\"];\n if (!mod_dict.user_pk_count){\n msg_list.push(...[loc.There_are_no_users_of_prev_ey, \"</p><p class='pt-2'>\",\n loc.Click_show_all_users, loc.to_show_users_of_prev_years,\"</p>\"]);\n } else {\n if (mod_dict.user_pk_count === 1){\n const data_dict = user_dicts[\"user_\" + mod_dict.user_pk_list[0]]\n if (data_dict){\n msg_list.push(...[loc.User, \" '\", data_dict.last_name, \"' \"]);\n } else {\n msg_list.push(...[loc.There_is_1_user_selected, \"</p><p>\", loc.That_user])\n };\n msg_list.push(loc.willbe_added_to_this_examyear_sing);\n } else {\n msg_list.push(...[\"<p>\", loc.There_are, mod_dict.user_pk_count, loc.users_of_prev_years_selected, \"</p><p>\",\n loc.Those_users, loc.willbe_added_to_this_examyear_plur]);\n };\n msg_list.push(...[\"</p><p class='pt-2'>\", loc.Do_you_want_to_continue + \"</p>\"]);\n };\n el_confirm_msg_container.innerHTML = msg_list.join(\"\");\n\n $(\"#id_mod_confirm\").modal({backdrop: true});\n };\n }", "function followOpt(username){\n const follow = document.getElementById('follow_button_3');\n const unfollow = document.getElementById('follow_button_4');\n \n const headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization' : 'Token ' + checkStore('token'),\n };\n const method = 'PUT';\n\n follow.onclick = async function() {\n const path = 'user/follow?username='+ username;\n await api.makeAPIRequest(path, {\n method, headers\n }).then(function (res) {\n buttonInit();\n document.getElementById('follow_option').style.display = 'block';\n document.getElementById('follow_option').innerHTML = '';\n const info = createElement('b', res.message);\n document.getElementById('follow_option').appendChild(info);\n location.reload(); \n });\n }\n\n unfollow.onclick = async function() {\n const path = 'user/unfollow?username='+ username;\n await api.makeAPIRequest(path, {\n method, headers\n }).then(function (res) {\n buttonInit();\n document.getElementById('follow_option').style.display = 'block';\n document.getElementById('follow_option').innerHTML = '';\n const info = createElement('b', res.message);\n document.getElementById('follow_option').appendChild(info);\n location.reload(); \n });\n }\n}", "function updateUsers(room) {\n\t\t$users.empty();\n\n\t\tfor (let i = 0; i < room.users.length; i++) {\n\t\t\tconst user = room.users[i];\n\t\t\tlet meBadge = \"\";\n\t\t\tlet timeBadge = \"\";\n\n\t\t\tif (selfUser.socketID === user.socketID) {\n\t\t\t\tmeBadge = `<span class=\"badge badge-pill badge-primary\"> Me </span>`;\n\t\t\t}\n\n\t\t\tif (user.usersTurn) {\n\t\t\t\ttimeBadge = `<span id=\"time-left\" class=\"badge badge-pill badge-warning\"> ${MAX_TIME_PER_TURN} seconds left </span>`;\n\t\t\t}\n\n\t\t\t$users.append(`\n\t\t\t\t<li class=\"list-group-item\" style=\"color: ${user.color}\">\n\t\t\t\t\t<span class=\"badge badge-pill badge-dark\"> ${i + 1} </span>\n\t\t\t\t\t${user.name}\n\t\t\t\t\t${meBadge}\n\t\t\t\t\t${timeBadge}\n\t\t\t\t</li>`);\n\n\t\t\t$timeLeft = $(\"#time-left\");\n\t\t}\n\n\t\tif (room.usersNeeded > 0) {\n\t\t\t$users.append(`<li class=\"list-group-item\">${room.usersNeeded} users needed</li>`);\n\t\t}\n\t}", "updateOmissions () {\n // We don't want anything from the accepted list or the suggestion pool;\n this.omissions = this.suggestionPool.map(el => el.name);\n this.omissions = this.omissions.concat(this.state.accepteds.map(el => el.name));\n }", "function updatelist() {\n // get the #logged-in-list element\n var list_element = document.getElementById('logged-in-list');\n\n // check the element exists \n if (list_element) {\n // get the #logged-in element\n var list_container_element = document.getElementById('logged-in');\n\n // check the element exists and that we should be changing the styles\n if (list_container_element)\n // if there are no logged in users, \"hide\" the element, otherwise \"show\" it\n list_container_element.style.visibility = loggedusers.length === 0 ? 'hidden' : 'visible';\n\n // we take the first child with a while loop\n while (list_element.firstChild)\n // remove the child, and it will repeat doing so until there is no firstChild left for the list_element\n list_element.removeChild(list_element.firstChild);\n\n // we loop through every logged in user\n for (var id in loggedusers) {\n // get the user by ID\n var user = getUserById(id);\n\n // check if that user is a user\n if (user) {\n // we create necessary elements to cover our logout functionality\n var p = document.createElement('P');\n p.innerText = user.username;\n var a = document.createElement('A');\n a.userid = id;\n a.href = '#';\n a.innerHTML = '(logout)';\n\n // we bind an onclick event listener to the link\n a.addEventListener('click', function(e) {\n e.preventDefault();\n\n // we will now execute the logout function for this user ID\n logout(e.srcElement.userid);\n });\n\n // we append the link to the paragraph element\n p.appendChild(a);\n\n // we append the paragraph to the list element\n list_element.appendChild(p);\n }\n }\n\n return true;\n }\n\n return false;\n}", "function updateLocalStorage(){\n localStorageService.set(listKey, this.acListP);\n }", "function updateAppStatus() {\n record(curAlist.toNumList());\n curAlist = getAdjlist();\n updateAdjlistFrame();\n updatePropFrame();\n}", "function showShareTodoList() {\n hideTodosLayers();\n var listId = document.forms.todoForm.listId.value;\n if (listId != null && listId != \"null\" && listId != \"\") {\n $(\"shareListDiv\").style.display=\"inline\";\n todo_lists.getTodoListUsers(listId, replyShareTodoListUsers);\n document.forms.shareListForm.login.focus();\n tracker('/ajax/showShareTodoList');\n }\n}", "function update_story_list() {\n\t$('#story_list').empty();\n\t$.post('/student/stories-request', function (result) {\n\t\tif (result == 'EMPTY_RESULT') {\n\t\t\t$('#story_list').append($('<p>', { text: \"You haven't started any stories yet!\" }));\n\t\t}\n\t\telse {\n\t\t\tfor (item in result) {\n\t\t\t\tvar story = result[item];\n\t\t\t\tif (story.progress === story.phrases.length)\n\t\t\t\t\tcontinue;\n\t\t\t\t$('#story_list').append($('<a>', {\n\t\t\t\t\thref: '#',\n\t\t\t\t\tclass: \"story_item list-group-item\",\n\t\t\t\t\t\"data-id\": story._id\n\t\t\t\t}).append(\n\t\t\t\t\t$('<h4>', {\n\t\t\t\t\t\ttext: story.words.character + \"'s Story\",\n\t\t\t\t\t\tclass: 'list-group-item-heading'\n\t\t\t\t\t}), ($('<p>', {\n\t\t\t\t\t\t\ttext: \"Completed \" + story.progress + \" out of \" + story.phrases.length + \" puzzles.\",\n\t\t\t\t\t\t\tclass: \"list-group-item-text\"\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\t\t\tif ($('#story_list').html() === \"\") {\n\t\t\t\t$('#story_list').append($('<p>', { text: \"You haven't started any stories yet!\" }));\n\t\t\t}\n\t\t}\n\t});\n}", "function updateList(currentUser, currentList) {\n console.log($stateParams);\n console.log(\"***LIST: \", currentList);\n $http.put(`/users/${currentUser._id}/lists/${$stateParams.listId}`, { name: list.name} )\n .then(function(response) {\n console.log(response);\n list.userList = response.data.user.list;\n\n $state.go('user', {id: currentUser._id});\n });\n }", "function updateUsers(dcnt) {\n io.sockets.emit('join', {\n names: Object.keys(allUsrName), //just get all their names\n dcnt: dcnt\n });\n }", "function updateList () {\r\n list.push(xLB); // Aktuelle Messstrecke zur Liste hinzufügen\r\n var s = ta.value; // Bisheriger Inhalt des Textbereichs\r\n s += value(xLB,3,meter)+\"; \"; // Weglänge hinzufügen\r\n s += value(tLB,3,second)+\"\\n\"; // Zeit hinzufügen\r\n ta.value = s; // Textbereich aktualisieren\r\n }", "function updateUserList() {\n let ul=document.querySelector('.userList');\n\n ul.innerHTML='';\n\n userList.forEach((item)=>{\n ul.innerHTML +='<li>'+item+'</li>'\n });\n}", "async setUsersStatusToLoggedIn(user) {\n const hoursToStayLoggedIn = 24;\n const now = new Date();\n user.loggedInUntil = now.setHours(now.getHours() + hoursToStayLoggedIn);\n await this.chatDAO.updateUser(user);\n }", "function updateAnimeFromUserList(animeID, notes) {\n db.transaction((tx) => {\n tx.executeSql(\n \"update userlist set notes = ? where id = ?\",\n [notes, Number(animeID)],\n () => {\n console.log(\n `useDB: Updated note property of anime with id ${animeID} from userlist to \"${notes}\" in database!`\n );\n dispatch(editUserDataListItemNotes({ id: animeID, notes }));\n }\n );\n });\n }", "function updateNavBar(userauth)\r\n{\r\n console.log(\"user auth state is :\",userauth);\r\n console.log(\"type of userauth : \",typeof userauth);\r\n if(userauth == true)\r\n {\r\n console.log(\"inside true procedure\");\r\n //add profile button.\r\n let item = document.createElement(\"li\");\r\n item.classList.add(\"nav-item\");\r\n let link = document.createElement(\"a\");\r\n link.classList.add(\"nav-link\");\r\n link.href = \"profile.html\";\r\n link.innerText=\"My Profile\";\r\n item.appendChild(link);\r\n $(\"#home_profile\").append(item);\r\n //add My Tickets button.\r\n item = document.createElement(\"li\");\r\n item.classList.add(\"nav-item\");\r\n link = document.createElement(\"a\");\r\n link.classList.add(\"nav-link\");\r\n link.href = \"Tickets.html\";\r\n link.innerText=\"My tickets\";\r\n item.appendChild(link);\r\n $(\"#home_profile\").append(item);\r\n\r\n //add log out button instead of login.\r\n let item2 = document.createElement(\"li\");\r\n item2.classList.add(\"nav-item\");\r\n let link2 = document.createElement(\"a\");\r\n link2.classList.add(\"nav-link\");\r\n link2.addEventListener(\"click\",function()\r\n {\r\n logout(userauth);\r\n });\r\n let span = document.createElement(\"span\");\r\n span.classList.add(\"fas.fa-user\");\r\n link2.innerText=\"log out\";\r\n link2.appendChild(span);\r\n item2.appendChild(link2); \r\n $(\"#Navauth\").append(item2);\r\n }\r\n else//guest\r\n {\r\n //add signup and login button.\r\n let item = document.createElement(\"li\");\r\n item.classList.add(\"nav-item\");\r\n let link = document.createElement(\"a\");\r\n link.classList.add(\"nav-link\");\r\n link.href = \"signup.html\";\r\n let span = document.createElement(\"span\");\r\n span.classList.add(\"fas.fa-user\");\r\n link.innerText=\"Sign Up\";\r\n link.appendChild(span);\r\n item.appendChild(link);\r\n $(\"#Navauth\").append(item);\r\n\r\n let item2 = document.createElement(\"li\");\r\n item2.classList.add(\"nav-item\");\r\n let link2 = document.createElement(\"a\");\r\n link2.classList.add(\"nav-link\");\r\n link2.href = \"signin.html\";\r\n let span2 = document.createElement(\"span\");\r\n span2.classList.add(\"fas.fa-sign-in-alt\");\r\n link2.innerText=\"Login\";\r\n link2.href=\"signin.html\";\r\n link2.appendChild(span2);\r\n item2.appendChild(link2);\r\n $(\"#Navauth\").append(item2);\r\n }\r\n}" ]
[ "0.5897628", "0.5866655", "0.56738603", "0.56585455", "0.5641588", "0.5548418", "0.55180913", "0.55110157", "0.5487486", "0.5478259", "0.5402353", "0.53743976", "0.53704494", "0.53670806", "0.5355145", "0.5333174", "0.53196067", "0.5303543", "0.5302797", "0.52695954", "0.5264739", "0.5244847", "0.5242578", "0.52346873", "0.52289075", "0.52203965", "0.52095526", "0.5202815", "0.51736975", "0.51643544", "0.515455", "0.5149522", "0.51239425", "0.5123426", "0.5119541", "0.5110799", "0.5108181", "0.510163", "0.5089375", "0.5089039", "0.5079101", "0.507386", "0.50700635", "0.50644714", "0.50606376", "0.50596964", "0.50544363", "0.50475115", "0.50475115", "0.5042259", "0.503953", "0.50355715", "0.5031771", "0.5018859", "0.5016198", "0.50118005", "0.50063187", "0.5002677", "0.49918136", "0.4990389", "0.4987834", "0.4984638", "0.49751464", "0.49742025", "0.49717578", "0.49717578", "0.49686515", "0.4967758", "0.49556607", "0.49443576", "0.4943524", "0.49349037", "0.49342245", "0.49299988", "0.49298367", "0.49253008", "0.49104613", "0.4907558", "0.49059412", "0.4903234", "0.4897091", "0.48926273", "0.48926038", "0.48921975", "0.48917192", "0.4890718", "0.48905274", "0.48899508", "0.48842025", "0.48812237", "0.48810992", "0.48674807", "0.4866623", "0.48658335", "0.48654982", "0.4860737", "0.48580897", "0.4856668", "0.48516092", "0.48512477" ]
0.4961183
68
Function to remove student from Queue on click of "LEAVE" button
function remove_queue(id){ socket.emit('remove_student', {"net_id":id.id}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeStudent(){\n var parentIndex = $(this).parents('tr').index();\n var idOfStudentInArray = student_array[parentIndex].id;\n student_array.splice(parentIndex,1);\n $(this).parents(\"tr\").remove();\n calculateGradeAverage();\n deleteStudentFromServer(idOfStudentInArray);\n\n}", "removeStudentFromStudentsExams(studentID){\n let check = this.checkIfStudentInExamList(studentID);\n if(check[0]){\n this.students_exams.splice(check[1], 1);\n }\n }", "function removeStudent(e) {\n e.preventDefault();\n // Find if the remove button was clicked\n const currentRow = e.target.parentElement.parentElement;\n const removingID = currentRow.firstChild.textContent;\n if (e.target.className === \"remove\") {\n // AJAX POST to remove the student from database\n $.ajax({\n type: \"delete\",\n url: \"/admin/remove/\" + removingID,\n // data: {id: removingID},\n success: function(response) {\n console.log(\"SUCCESS REMOVING A STUDENT\");\n window.location.href=\"/admin\";\n },\n error: function(response) {\n console.log(\"PROBLEM REMOVING A STUDENT\");\n }\n });\n }\n}", "'click .remove-student'(event, template){\n var newStudents = template.students.get().filter(function(student) {\n return student.username !== event.target.getAttribute('data-id');\n });\n template.students.set(newStudents);\n\t}", "function removeStudent(){\r\n var name = prompt(\"Name to remove:\")\r\n var index = roster.indexOf(name);\r\n roster.splice(index,1);\r\n}", "function dellStudent() {\n if (!confirm(\"Вы уверены?\"))\n return;\n var student = window.event.currentTarget;\n var studentId = student.id;\n student = student.parentElement;\n student = student.parentElement;\n\n var rootUrl = location.host;\n var url = location.protocol + \"//\" + rootUrl + \"/Admin/DellStudent\";\n\n jQuery.ajax({\n url: url,\n type: \"POST\",\n data: { studentId: studentId },\n success: function () {\n student.remove();\n }\n });\n}", "function squadAutoRemove(student) {\n document.querySelector(\n `#${student.firstname}_${student.house}`\n ).checked = false;\n\n let indexFound = findInSquad(student.firstname);\n if (indexFound > -1) {\n squadList.splice(indexFound, 1);\n console.log(squadList);\n }\n}", "function removeStudent(student,trElement) {\n \n var dataToUpload = { \n student_id:student.id\n }\n $.ajax({\n //url: 'http://localhost:3000/sgt/delete',\n url: './php/datapoint.php?action=delete',\n method: 'POST',\n dataType: 'JSON', \n data: dataToUpload,\n success: function(data) {\n //If everything went well we add the id to the student and add the student to the array\n if(data.success){\n // look for the object in the array to get the index\n var index = student_array.indexOf(student);\n //delete the object from the array of students\n student_array.splice(index, 1);\n //recalculate the average\n var average = calculateGradeAverage(student_array);\n renderGradeAverage(average);\n //remove the html elment (tr) from the table\n trElement.remove();\n }else{\n if(data.errors === undefined){\n showErrorModal(data.error); \n }else{\n showErrorModal(data.errors);\n }\n }\n $('.glyphicon-refresh-animate').remove();\n },\n error: function(err) {\n showErrorModal('We have some issues with the server. Please try again later.'); \n $('.glyphicon-refresh-animate').remove();\n }\n });\n \n}", "function deleteRowOfStudent(button){\nvar deleteRow = button. parentNode.parentNode;\ndeleteRow.parentNode.removeChild(deleteRow);\n }", "function removeButton() {\n topics.pop(topics); \n renderButtons(); \n return false; \n}", "function remove(name) {\n var name = prompt(\"Type the name of the student you would like to remove from the roster:\");\n var index = roster.indexOf(name);\n if(index > -1){\n roster.splice(index, 1);\n }\n}", "function removeFromQueue(i,x) {\n $('.queue-label.scheduling-row-title#activity-id-' + i).parent().remove();\n $('.resource_individuals .activity_id-' + i).parent().find('.queue-scheduling-icon').removeClass('queue-added');\n \n if( $('.scheduling-container tr').length == 1 && !x ) {\n schedulingClose();\n bodyScroll();\n $('.scheduling-icon').fadeOut();\n }\n \n getSchedulingQueue();\n return;\n}", "function removeMe(e){\r\n var linkToRemove = e.target.getAttribute(\"myid\");\r\n bookMarksArray.splice(linkToRemove,1)\r\n saveBookMarks();\r\n updateBookMarkList();\r\n}", "function removeData() {\n remove(ref(db, \"Students/\" + usn.value))\n .then(() => {\n alert(\"Data updated successfully \");\n })\n .catch((err) => {\n alert(\"Unsuccessfull \" + err);\n })\n }", "denqueue() {\n debug(`\\nLOG: remove the queue`);\n this.queue.shift();\n }", "function removeFromWaitingRoom(){\n\t \tmodel.help.remove({complaint_id:req.body.sendObj.compaintId},function(err,info){\n\t \t});\n\t \tres.send({message: msgInfo,balance:debitor.ewallet.available_amount});\n\t console.log(\"note deleted\"); \t\t \n\t }", "function removeHold(student) {\n let resultStudent = student\n resultStudent.student_hold = 0\n // modifies the student object by posting new object to server\n axios.post(props.url + \"/modify\", resultStudent).then((response) => {\n window.location.reload()\n });\n }", "handleRemoveStudent(e){\n e.preventDefault()\n const editCampusThunk = editStudentCampusThunk(this.state.removeStudentId, null, 'remove');\n store.dispatch(editCampusThunk)\n }", "function removeGroup() {\n if(group){\n var data = localStorage.getItem(\"groups\");\n if(data && data != null){\n var list = $.parseJSON(data);\n for(var i = 0; i < list.length; i++){\n var g = list[i];\n if(g.id == group.id){\n list.splice(i, 1);\n break;\n }\n }\n localStorage.setItem(\"groups\", JSON.stringify(list));\n $(\"#students-div\").hide();\n\t\t\tgroup = undefined;\n retrieveGroups();\n }\n }else{\n shakeElement(\"minus\");\n }\n}", "function onDeleteStudent() {\n 'use strict';\n if (lastCheckedStudent === -1) {\n window.alert(\"Warning: No student selected !\");\n return;\n }\n\n var student = FirebaseStudentsModule.getStudent(lastCheckedStudent);\n txtStudentToDelete.value = student.firstname + ' ' + student.lastname;\n dialogDeleteStudent.showModal();\n }", "removeAssessmentList(userid) {\n let assessmentList = this.getAssessmentList(userid);\n if (assessmentList) {\n this.store.remove(this.collection, assessmentList);\n this.store.save();\n }\n\n logger.info('assessmentlist to be removed is ', assessmentList);\n }", "function DelStudent( TrObj )\r\r\n{\r\r\n\tvar index = Search_Index_In_Add_Ary( TrObj.childNodes[0].StudentName, TrObj.childNodes[0].StudentClassName );\r\r\n\r\r\n\t// Delete student info from Student_Add_Ary\r\r\n\tStudent_Add_Ary[0].splice( index, 1 );\r\r\n\tStudent_Add_Ary[1].splice( index, 1 );\r\r\n\tStudent_Add_Ary[2].splice( index, 1 );\r\r\n\tStudent_Add_Ary[3].splice( index, 1 );\r\r\n\tStudent_Add_Ary[4].splice( index, 1 );\r\r\n\tStudent_Add_Ary[5].splice( index, 1 );\r\r\n\r\r\n\tTrObj.parentNode.deleteRow(TrObj.rowIndex);\r\r\n}", "function handleMemberRemove() {\n $scope.getGroupingInformation();\n $scope.syncDestArray = [];\n }", "function removeCandidate(applicantId) {\n /* Do AJAX Stuff here to remove the candidate from the DB. */\n // console.log($(\"#queue-\" + applicantId));\n $(\"#queue-\" + applicantId).remove();\n }", "function removeStudent(studentId) {\n StudentsModel.deleteStudent(studentId);\n loadStudents();\n }", "remove(job) {\n this.queue = this.queue.filter(function(item) {\n return item !== job;\n });\n }", "function removeAbsentStudents() {\n var retrievedData = localStorage.getItem(\"absentStudents\");\n absentStudents = JSON.parse(retrievedData);\n students = studentsFullList.clone();\n\n for (var i = 0; i < students.length; i++) {\n for (var j = 0; j < absentStudents.length; j++) {\n var nameToRemove = absentStudents[j];\n if (students[i].name === nameToRemove) {\n console.log(\"remove: \" + nameToRemove);\n var removedObject = students.splice(i, 1);\n removedObject = null;\n }\n }\n }\n console.dir(students);\n }", "function removeCourse(e){\n\n if(e.target.classList.contains('remove')){\n e.target.parentElement.parentElement.remove();\n }\n}", "function removeCourse(){\r\n if (course_count > 1){\r\n var top_course = document.getElementById('top_div' + course_count);\r\n top_course.parentNode.removeChild(top_course);\r\n course_count = course_count - 1;\r\n }\r\n else{\r\n return false;\r\n }\r\n}", "function removeUser(e) {\n if(e.target.classList.contains('tab_span')) {\n\n let response = confirm(\"Mean to delete member from list?\");\n\n if(response) {\n let data = JSON.parse(localStorage.getItem(\"users\"));\n\n let tr = e.target.parentNode.parentNode.id;\n\n data.forEach((obj, index) => {\n if(obj.userID === (+tr)) {\n data.splice(index, 1);\n }\n })\n\n if(data.length === 0) {\n localStorage.removeItem(\"users\");\n \n form_block.style.display = \"none\";\n\n return ( userID = 1, usersArr = [] );\n } else {\n usersArr = [...data];\n\n localStorage.setItem(\"users\", JSON.stringify(data));\n\n return updateTable();\n }\n } \n }\n}", "function uQueue(m, pams) {\n\t//normal user, skip self\n\tif(pams.length <1)\n\t\t//if singing and singer tries to skip self, NO\n\t\tif(singing ? m.author.id != queue[0].id : true)\n\t\t\t//if user is in queue, else NO\n\t\t\tif(queue.includes(m.member)) {\n\t\t\t\tqueue.splice(queue.indexOf(m.member), 1)\n\t\t\t\tm.reply('you have been unqueued :blush:')\n\t\t\t} else return\n\t\telse return\n\t//managing user, skip position\n\telse if(cRoles(m)) {\n\t\tlet x = parseInt(pams, 10)\n\t\t//if x is not a number, NO\n\t\tif(isNaN(x))\n\t\t\treturn\n\t\t//x is withing range, if singing and x is 0, NO\n\t\tif(x < queue.length && (singing ? x != 0 : true)) {\n\t\t\tlet name = queue[x].displayName\n\t\t\tqueue.splice(x, 1)\n\t\t\tm.channel.sendMessage(`\\`${name}\\` has been unqueued from position #\\`${x}\\` :blush:`)\n\t\t}\n\t}\n}", "function removeWithId(){\n Users.removeUser(idSave);\n warning.style.display=\"none\";\n backgroundPicked.style.display = \"none\";\n printEmployees();\n}", "remove(){\n //\n }", "function popProfile(to_delete) {\n\n document.getElementById(\"old_profile\").remove();\n\n}", "remove(){\n\n }", "removeSubject() {\n \n if(!this.state.subjectSelected){\n return alert('please select a subject');\n }\n \n let subjects = this.state.subjects;\n let selectedSubject = this.state.subjectSelected;\n\n var new_sbjects = subjects.filter(e => {\n return e.id != selectedSubject\n });\n\n // remove object\n \n this.setState({\n subjects: new_sbjects\n });\n }", "function removeEmployee() {\n console.log('Employee Fired');\n $(this).parent().parent().remove();\n\n let value = this.id\n\n employees.splice(value, 1)\n calculateMonthlyCost();\n\n}", "function onClickRemoveQuestion(){\n let question = $(this).parent().parent();\n let index = $(\".question\").index(question);\n question.remove();\n surveyChanged[\"questions\"].splice(index,1);\n}", "removeElement(){\n // TODO alert() if want to remove the current form element \n this.props.handleDelete(this.state.id);\n }", "function removeQuestion(ins_id, q_id) {\n if(!isEdit){\n for (let i = 0; i < allInstuctions.length; i++) {\n if (allInstuctions[i].id == ins_id) {\n if (allInstuctions[i].questions.length > 1) {\n for (let j = 0; j < allInstuctions[i].questions.length; j++) {\n if (allInstuctions[i].questions[j].id == q_id) {\n allInstuctions[i].questions.splice(j, 1);\n }\n }\n if(i===allInstuctions.length-1){\n removeQuestionCard(q_id);\n rerangeQuizNumber(allInstuctions[i].questions.length)\n }\n } else if (allInstuctions[i].questions.length === 1) {\n if (allInstuctions.length > 1) {\n if(i===allInstuctions.length-1){\n // $(\"#quiz\").empty().append(`<h3 class=\"text-center p-10\">Current Instruction Was Remove</h3>`)\n allInstuctions.splice(i, 1);\n addDefaultCard();\n }else {\n allInstuctions.splice(i, 1);\n }\n } else if (allInstuctions.length === 1) {\n $(\"#quiz\").empty().append(`<h1 class=\"text-center p-10\">${noQuizText}</h1>`);\n allInstuctions = [];\n }\n }\n }\n }\n $(\"#totalInstruction\").text(allInstuctions.length);\n isEdit = false;\n preview();\n }else {\n warningModal(mustFinishUpdate);\n }\n\n}", "function exitClassroomStudent(id) {\n\t// server-side\n\t// remove client from classroom\n\tvar classroomid = clients[id].classroomid;\n\t// you can only remove the student from the classroom if the classroom exists\n\tif (classroomid && classrooms[classroomid]) {\n\t\tdelete classrooms[classroomid].students[id];\n\t}\n\t\n}", "removeAssessment(userId, assessmentId) {\n let assessmentList = this.getAssessmentList(userId);\n _.remove(assessmentList.assessments, { id: assessmentId });\n this.store.save();\n }", "handleDel() {\n if (this.props.userID === this.state.team.teamLeaderID) {\n //delete Team\n this.deleteTeam()\n }\n else {\n //leaveTeam\n this.leaveTeam()\n\n }\n this.handleClick(-2)\n }", "Remove() {}", "removeAttendanceRow(studentID) {\n const { attendance } = this.state;\n for (let i = 0; i < attendance.length; i++) {\n if (attendance[i].studentID === studentID) {\n attendance.splice(i, 1);\n }\n }\n this.setState({attendance: attendance});\n }", "function removeTask(span, task){\n span.onclick = function(){\n if(task.classList.value === \"checked\"){\n var index = myTaskList.completed.indexOf(task);\n myTaskList.completed.splice(index, 1);\n updateTaskList();\n }\n if(task.classList.value === \"\"){\n var index = myTaskList.incomplete.indexOf(task);\n myTaskList.incomplete.splice(index, 1);\n updateTaskList();\n }\n }\n}", "function removeJob() {\n axios.delete(`/jobs/${info._id}`)\n .then(res => {\n console.log(res)\n setJobList(prevList => prevList.filter(savedJob => savedJob._id !== info._id))\n alert(`You have successfully removed ${info.position} at ${info.company} from your job list.`)\n })\n .catch(err => console.log(err.response.data.errMsg))\n }", "function removeEmployee(){\n const id = $(this).parent().data('id');\n employeeInfo.splice(id, 1);\n render();\n\n}", "function delSpanEvent(event){\n axios.delete(`http://localhost:3000/tags/${event.target.parentNode.id}`) // Remove item from database\n .then(res => {\n event.target.parentNode.remove(); // Remove tag from the list\n })\n .catch(err => {\n console.log(err);\n })\n}", "removeUser(user) {\n // User in Array suchen und \"rausschneiden\"\n for (var i=this.users.length; i >= 0; i--) {\n if (this.users[i] === user) {\n this.users.splice(i, 1);\n }\n }\n // geänderte Raumdetails wieder an alle senden\n var room = this;\n room.sendDetails();\n}", "handleRemove(event)\r\n\t{\r\n\t\tconst {name, value, type, checked} = event.target\r\n\t\tconst {member} = this.state;\r\n\t\talert(\"YOU ARE DELETING \" + this.mail.value);\r\n \tfetch(`http://localhost:5000/description/del?email_address=${this.mail.value}`) \t\r\n \t.then(response => response.json())\r\n \t.then(response => this.setState({members: response.data}))\r\n \t.catch(err => console.error(err))\r\n\t\twindow.location.reload(false);\r\n\t}", "function removeFromAvailableBooks(id ,indx){\n console.log(id,indx)\n firebase.database().ref(\"availableBooks/\"+id).remove()\n .then(()=>{\n console.log(\"success\")\n AvailableBooks.splice(indx,1)\n })\n .catch((error)=>console.log(\"error\",error.message))\n}", "function removeRingMember(ip_address) \n{\n if(tokenRing.indexOf(ip_address) != -1) \n {\n var index = tokenRing.indexOf(ip_address);\n\t tokenRing.splice(index, 1);\n ringRoles.splice(index, 1);\n if(debug) console.log(\"Removing node at \" + ip_address);\n\n }\n else\n {\n if(debug) console.log(\"DNE: \"+ ip_address);\n }\n\n if(debug) console.log(\"Current group : \" + tokenRing);\n}", "function deleteIssueFromUI(e) {\r\n if (e.target.classList.contains('btn-danger')) {\r\n\r\n var issue = e.target.parentElement;\r\n issueList.removeChild(issue);\r\n };\r\n}", "function deleteStudentFromDatabase() {\n const roll = document.getElementById(\"delete_student_info\").value;\n\n const tx = db.transaction(\"StudentTable\", \"readwrite\");\n const studentInfo = tx.objectStore(\"StudentTable\");\n\n studentInfo.delete(roll);\n}", "function removeFromUnAvailableBooks(id ,indx){\n console.log(id,indx)\n firebase.database().ref(\"unavailableBooks/\"+id).remove()\n .then(()=>{\n console.log(\"success\")\n unAvailableBooks.splice(indx,1)\n })\n .catch((error)=>console.log(\"error\",error.message))\n}", "function onClick() {\n currentStudent++;\n//if currentstudent is less than length-1 then display next student, else remove event from button\n if (currentStudent <= people.length-1) {\n nameContent.innerHTML = \"Name: \" + people[currentStudent].name;\n addContent.innerHTML = \"Address: \" + people[currentStudent].address.street + \" \" + people[currentStudent].address.city + \", \" + people[currentStudent].address.state;\n gpaContent.innerHTML = \"GPA: \" + people[currentStudent].gpa;\n dateContent.innerHTML = \"Date: \" + people[currentStudent].date;\n gpaAvgContent.innerHTML = \"Average GPA: \" + people[currentStudent].avgGpa;\n } else {\n button.removeEventListener(\"click\", onClick);\n button.innerHTML = \"Done!\";\n }\n }", "function remove(){ //removes task from array\n var id = this.getAttribute('id');\n var todos = getTodos();\n todos.splice(id,1);\n todos.pop(task); //removes from array\n localStorage.setItem('todo', JSON.stringify(todos));\n\n show(); //how to display a removed item on screen\n\n return false;\n\n}", "function deleteStudent(student_id_to_delete) {\n return new Promise(\n (resolve, reject) => {\n $.post(\"/delete_student\", {student_id: student_id_to_delete}, function(data) {\n resolve();\n });\n }\n );\n}", "function removeUser(){\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name == savedMem){\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tdelete currentProject.members[i].name;\n\t\t\t\tdelete currentProject.members[i].role[j];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tdocument.getElementById(\"EditUser\").style.display = \"none\";\n\tpopTable();\n}", "function deleteCurrentItem(event) {\n let item = event.target;\n courses.remove(item);\n}", "function removeBook(event){\n const bookId = event.target.id\n myLibrary.splice(bookId, 1)\n displayBooks()\n \n}", "removePerson(socketId) {\n /* Check patient from patient queue */\n const patientIndex = this.patientsQueue\n .getCollection()\n .findIndex((entry) => entry.socketid === socketId);\n /* Remove disconnected person from queue */\n if (patientIndex >= 0) {\n this.patientsQueue.getCollection().splice(patientIndex, 1);\n return;\n }\n /* Check counselor queue */\n const counselorIndex = this.patientsQueue\n .getCollection()\n .findIndex((entry) => entry.socketid === socketId);\n /* Remove disconnected person from queue */\n if (counselorIndex >= 0) {\n this.patientsQueue.getCollection().splice(counselorIndex, 1);\n return;\n }\n }", "handleRemove(event) {\n try {\n this.isForCodeSelected = false;\n this.pincodeSetOption = [];\n event.preventDefault();\n this.showTable = false;\n this.forCodeName = '';\n this.forCodeRecordId = '';\n this.forCodeData = false;\n this.forCodeFilteredList = [];\n\n } catch (error) {\n console.log('errooo--------', error);\n }\n }", "function leave(uid) {\n _playerList.remove(uid);\n }", "function remove(request, sender, sendResponse) {\n chrome.storage.sync.get('savedCourses', function (data) {\n var courses = data.savedCourses;\n console.log(courses);\n var index = 0;\n while (index < courses.length && courses[index].unique != request.course.unique) {\n index++;\n }\n courses.splice(index, 1);\n chrome.storage.sync.set({\n savedCourses: courses\n });\n sendResponse({\n done: \"Removed: (\" + request.course.unique + \") \" + request.course.coursename,\n label: \"Add Course +\"\n });\n });\n}", "function removeTask(button) {\n let li = button.parentNode;\n /* \n let ul = li.parentNode;\n ul.removeChild(li);\n */\n li.remove();\n}", "function removeMe(res) {\n var name = res.message.user.name\n , user = {name: name};\n\n if (!queue.contains(user)) {\n res.reply('No sweat! You weren\\'t even in the queue :)');\n } else if (queue.isCurrent(user)) {\n res.reply('You\\'re deploying right now! Did you mean `deploy done`?');\n return;\n }\n\n queue.remove(user);\n res.reply('Alright, I took you out of the queue. Come back soon!');\n }", "function expellStudent() {\n console.log(\"expellStudent\");\n if (student.firstName != \"Esther\") {\n let studentPosition = listOfStudents.indexOf(student);\n student.expelled = true;\n document.querySelector(\"#expell\").removeEventListener(\"click\", expellStudent);\n document.querySelector(\"#expell\").classList.add(\"dissabled\");\n document.querySelector(\"p#expelled span\").textContent = \"Yes\";\n expelledStudents.push(student);\n listOfStudents.splice(studentPosition, 1);\n } else {\n document.querySelector(\"#expell\").removeEventListener(\"click\", expellStudent);\n document.querySelector(\"#expell\").classList.add(\"dissabled\");\n document.querySelector(\"#warning-message p\").textContent = \"(!) Sorry, this student cannot be expelled.\";\n }\n }", "static DeleteSelected(){\n ElmentToDelete.parentElement.remove();\n UI.ShowMessage('Elemento eliminado satisfactoriamente','info');\n }", "function deleteStudent(student){\n debugger;\n console.log(student)\n console.log(data)\n for(var i in data){\n // console.log(data[i])\n // console.log(i)\n if(i == student){\n var fbRef = firebase.database();\n fbRef.ref(`students/${i}`).set(null)\n }\n }\n\n}", "function removeTasks(elmA, elemB, elemC) { //this could be shorter if I had added the task (box, name, br) in a div\n localStorage.removeItem(elemB.id);\n index = elemB.id;\n document.getElementById(\"submit\").disabled = false;\n elmA.remove();\n elemB.remove();\n elemC.remove();\n}", "deletehsSubject(hssubject){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('subjectModel').indexOf(hssubject);\n var restemp = this.get('subjectModel').objectAt(index);\n console.log(restemp);\n restemp.deleteRecord();\n restemp.save();\n }\n }", "function leaveQueue(io, socket) {\n return (data) => {\n let queue = data[\"queue\"];\n let user = socket.user;\n\n leave(user, queue).then((data) => {\n io.sockets.sockets[socket.id].emit('left', {\n 'queue': queue\n });\n\n getQueue(queue).then((data) => {\n console.log(data);\n\n io.emit('update', {'waiting': data, 'queue': queue});\n });\n });\n };\n}", "removeReview(){\n\t\tif(this.reviews >0){\n\t\t\tthis.reviews--;\n\t\t\tconsole.log('Review Removed!');\n\t\t\tlogger +='\\nReview Removed! \\n'+this.info + this.reviews + ' reviews' // add the console log message to logger\n\t\t\tthis.emit(eventsConfig.events.REVIEWREMOVED,this.info + this.reviews + ' reviews');//fires event with message\n\t\t}\n\t\telse{ //Trying to decrease the amount of reviews while the amount is 0\n\t\t\tconsole.log('Current amount of review is 0, unable to decrease it');\n\t\t\tvar noReviewsError = 'Amount of reviews cannot be < 0 !';\n\t\t\tlogger += '\\nCurrent amount of review is 0, unable to decrease it\\n'+noReviewsError; // add the console log message to logger\n\t\t\tthis.emit(eventsConfig.events.ERROR,noReviewsError); //fires event with message\n\t\t}\t\n\t}", "function removeCourse(e) {\n let course, courseId;\n\n // Remove from the dom\n if (e.target.classList.contains('remove')) {\n course = e.target;\n courseId = course.getAttribute('id');\n e.target.parentElement.parentElement.remove();\n\n\n\n }\n // remove from the local storage\n removeCourseLocalStorage(courseId);\n\n }", "function removePendingQueueByUsername(username) {\n //find all pending member queues by this user name\n Admin.PendingQueue.find({ userName: username }).then((toDelete) => {\n if (toDelete && toDelete.length > 0) {\n //iterate through and delete them\n toDelete.forEach(ele => {\n ele.remove();\n console.log(username + ' scrubbed from pending queue.'); //static logging\n });\n }\n }, (err) => {\n console.log('Error ' + username + ' not removed from queue'); //static logging\n })\n}", "removeTask(e) {\n const index = e.target.parentNode.dataset.key;\n this.tasks.removeTask(index);\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "function remove(node)\n{\n let empData = employeePayrollList.find(emp=>emp.id == node.id);\n if(!empData) return;\n let index = employeePayrollList.map(emp=>emp.id).indexOf(empData.id);\n employeePayrollList.splice(index,1);\n if(site_properties.use_local_storage.match(\"true\"))\n {\n localStorage.setItem('EmployeePayrollList',JSON.stringify(employeePayrollList));\n CreateInnerHTML();\n }\n else\n {\n const deleteURL = site_properties.server_url + empData.id.toString();\n makeServiceCall(\"DELETE\", deleteURL, false)\n .then(responseText => {\n CreateInnerHTML();\n })\n .catch(error => {\n console.log(\"DELETE Error Status: \" + JSON.stringify(error));\n }\n );\n }\n document.querySelector('.emp-count').textContent = employeePayrollList.length;\n}", "function cancelAddTopping() {\n $(\"#student-add-row\").hide();\n}", "leaveTeam(){\n axios.patch('/remove:team', {user:this.props.user, teamId:this.props.team._id}).then(this.props.onParticipationChange);\n }", "function watchRemove(){\n\t$('.js-buses').on(\"click\", \".js-removestop\", function(e) {\n e.preventDefault();\n if(window.confirm(\"Do you want to delete this bus stop?\")){\n \tconsole.log(\"remove\");\n\t var stopid = parseInt($(this).closest(\".busStop\").find(\"h2\").text().substring(1));\n\t delete state.stops[\"id\"+stopid];\n\t storeData(null);\n }\n \n });\n}", "function removeFromList(){\n event.target.parentNode.remove();\n\n}", "function expelStudent(student) {\n console.log(`${student.firstName} is now expelled`);\n\n expelledStudents.push(student);\n student.isMemberOfInqSquad = false;\n student.isPrefect = false;\n allStudents.splice(allStudents.indexOf(student), 1);\n\n displayList(allStudents);\n}", "function removeTask(e) {\n if(e.target.parentElement.classList.contains\n ('delete-item')) {\n if(confirm('Are You Sure?')) {\n e.target.parentElement.parentElement.remove();\n //Remove from LS\n removeTaskFromLocalStorage\n (e.target.parentElement.parentElement);\n\n \n }\n}\n\n}", "function onDelete(td) { \r\n let selectedRow = td.parentElement.parentElement;\r\n let tempIndex = (selectedRow.rowIndex - 1);\r\n \r\n if (confirm(\"This course will be deleted.\")){\r\n //Removes the corresponding table row.\r\n document.querySelector(\".students-table\").deleteRow(selectedRow.rowIndex);\r\n //Removes the corresponding object from the courses array.\r\n students.splice(tempIndex, 1);\r\n }\r\n //Checking\r\n console.log(students);\r\n}", "function removeTrain(){\n\tid = $(this).attr(\"key\");\n\tdbRef.child(id).remove(function(error) {\n\t\tif(error)\n\t\t\tconsole.log(\"Uh oh!\");\n\t\telse \n\t\t\tconsole.log(\"Success\");\n\t});\n}", "function removeTask(elem) {\n elem.parentNode.parentNode.removeChild(elem.parentNode);\n LIST[elem.id].trash = true;\n}", "function remove(name){\n\t\tsubs = subscribers_array.map(function(sub, pos){\n\t\t\treturn sub.name\n\t\t});\n\n\t\tpos = subs.indexOf(name)\n\n\t\tif(pos != -1) {\n\t\t\tsubscribers_array.splice(pos, 1)\n\t\t\t_render()\n\t\t\treturn\n\t\t}\n\n\t\talert(name + ' does not exist currently. Maybe you typed a mistyped the case?')\n\t}", "onDeleteClicked(sector_id) {\n this.props.onRemoveSector(this.state.enterprise_id, sector_id).then(res=>{\n this.props.flashSuccess({\n text: \"Se ha eliminado el registro\",\n target: \"list\"\n })\n this.resetForm();\n }).catch(_=>{\n this.props.flashError({\n text: \"Hubo un error eliminando el registro\",\n target: \"list\"\n })\n }); \n }", "function removeCourse(e) {\n\n let course, courseId;\n\n // remove element from the DOM\n if(e.target.classList.contains('remove')) {\n e.target.parentElement.parentElement.remove();\n course = e.target.parentElement.parentElement;\n courseId = course.querySelector('a').getAttribute('data-id') ;\n }\n // Remove from storage when removed from DOM\n removeCoursesessionStorage(courseId);\n}", "function removeItem(e) {\n\t\tvar id = jQuery(this).parents('li').attr('data-id');\n\t\tif(id){\n\t\t\tfirebase.database().ref().child('/messages/'+id).remove();\n\t\t}\n\t}", "function removeEmployee(){\n connection.query(queryList.managerList, function(err, res){\n if (err) throw err;\n let list = res\n let choices = [new q.queryAdd(\"delete\", \"Which employee would you like to delete?\", res.map(e => e.name))]\n inquirer\n .prompt(choices)\n .then(answer => {\n let id = list.filter(e => e.name === answer.delete).map(id => id.id).shift()\n connection.query(queryList.updateEmployee, [{manager_id:null},{manager_id:id}], function(err, res){\n if (err) throw err;\n console.log(\"employees managed by this one have been deassigned\")\n connection.query(queryList.deleteEmployee, {id:id}, function(err, res){\n if (err) throw err;\n console.log(\"Employee deleted.\")\n startQ();\n });\n })\n })\n .catch(err => {\n if (err) throw err;\n });\n });\n}", "function removeItem(event){\n if(event.target.classList.contains('del')){\n var li = event.target.parentElement;\n taskList.removeChild(li);\n }\n}", "function processRemove(req, plus, oauth2Client, res) {\n gplus.getDatabaseUserWithPermission(pool, plus, oauth2Client, \"can_remove=1\", function(err, gp_user, db_user) {\n if (err != null) {\n res.send(err.message, err.code)\n } else {\n console.log(\"Whitelisted:\" + gp_user.displayName + \", \" + gp_user.id);\n \n var query = 'update tasks set is_hidden=1 where id=' +\n pool.escape(req.body.taskId) + ';';\n console.log(query);\n pool.query(query, function(err, info, fields) {\n if (err) {\n console.log(\"error remove: \" + err);\n res.send('Invalid remove query', 500);\n } else {\n console.log(info.insertId);\n console.log(\"removal complete!\");\n res.send({taskId : req.body.taskId}, 200);\n }\n });\n }\n });\n}", "function eliminarBox(event) { \n event.target.parentNode.parentNode.remove();\n}", "function deleteBook(id ,indx){\n console.log(id,indx)\n firebase.database().ref(\"availableBooks/\"+id).remove()\n .then(()=>{\n console.log(\"success\")\n AvailableBooks.splice(indx,1)\n })\n .catch((error)=>console.log(\"error\",error.message)) \n display();\n}", "leaveCourt() {\n // User is not queued and is thus playing on this court\n this.props.removeUserFromActive();\n }", "onEventRemove({ records, isMove, isCollapse }) {\n if (!isMove && !isCollapse) {\n const assignments = [];\n\n records.forEach((record) => {\n // traversing in a flat structure will only call fn on self, no need to handle tree case differently\n record.traverse((eventRecord) => {\n assignments.push(...eventRecord.assignments);\n });\n });\n\n // Flag that remove is caused by removing events, to prevent getting stuck in removal loop in SchedulerStores\n this.isRemovingEvent = true;\n assignments.length && this.remove(assignments);\n this.isRemovingEvent = false;\n }\n }", "function removeButton(){\n $(\"#car-view\").empty();\n var topic = $(this).attr('data-name');\n var itemindex = topics.indexOf(topic);\n if (itemindex > -1) {\n topics.splice(itemindex, 1);\n renderButtons();\n }\n }" ]
[ "0.6608754", "0.647318", "0.63003695", "0.6284494", "0.62583566", "0.6242361", "0.62414056", "0.6158881", "0.60977745", "0.6072461", "0.6058396", "0.6016377", "0.59667987", "0.595647", "0.59081304", "0.58904797", "0.58578426", "0.58553135", "0.58446056", "0.5841992", "0.57771003", "0.57769114", "0.5774114", "0.5755882", "0.5711251", "0.57048976", "0.5688222", "0.5682951", "0.56664073", "0.56641954", "0.5647068", "0.5644042", "0.5643844", "0.5638163", "0.563015", "0.5625987", "0.56025004", "0.5591005", "0.55868304", "0.55760235", "0.5572529", "0.5551525", "0.554853", "0.5546748", "0.55452526", "0.5544915", "0.5537338", "0.55308646", "0.55261314", "0.55251247", "0.5523409", "0.5517104", "0.55151767", "0.5505772", "0.5505604", "0.5505025", "0.5503436", "0.5502044", "0.5495604", "0.5494105", "0.5491511", "0.5481851", "0.5474721", "0.5467976", "0.54662085", "0.54556346", "0.54545856", "0.5453212", "0.5451371", "0.5448818", "0.54459655", "0.5444425", "0.5440529", "0.54380435", "0.54326135", "0.543064", "0.5423789", "0.5422903", "0.54204947", "0.5419337", "0.541929", "0.5415206", "0.5415166", "0.5413653", "0.5413371", "0.5410405", "0.5409822", "0.5408951", "0.54077053", "0.54067457", "0.54066974", "0.5403186", "0.53933203", "0.53929216", "0.5386784", "0.5386672", "0.5384487", "0.53792936", "0.53740615", "0.53680295" ]
0.7036834
0
Emits a socket io call to add a student to a TA's queue
function add_queue(id){ socket.emit('add_student', {"net_id":id.id}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_queue(id){\n socket.emit('remove_student', {\"net_id\":id.id});\n}", "function addStudentToList(id,name) {\n students2.push({\n id: id,\n name: name,\n isLoggeIn: false,\n requestConection() {\n console.log('deseo ingresar a clases');\n }\n });\n}", "function enrollStudent(newSt) {\r\n // Assume that this function will send data to the server.\r\n // So to make it asynchronous we use setTimeout callback function.\r\n\r\n // After 3 sec this callback fn will execute in background..\r\n setTimeout(function() {\r\n students.push(newSt);\r\n console.log(`Students have been enrolled..`);\r\n }, 3000);\r\n // Lets say this process will take 8 sec hence we set 8000 ms in setTimeout\r\n}", "function sendEvent(message){\n socket.emit('chat', {\n student: student.name,\n message: message\n });\n}", "function addStud(student){\n\tconn.query(\"INSERT INTO students (name, place, class, help) VALUES (?, ?, ?, ?)\", [student.name, student.place, student.class, student.help], function(err, data){\n\t\tif (err) throw err;\n\t});\n}", "function add(){\n var str = base64.encode(new Date().valueOf());\n queueSvc.createMessage(\"zhf-bash-1-queue\", str, function(error, results, response){\n if(!error){\n console.log(\"Success - createMessage\");\n } else {\n console.error(\"Error - createMessage\", error);\n }\n });\n}", "function onConnect() {\n console.log(\"onConnect\");\n client.subscribe(\"student/id\");\n}", "function callbackFunctionToCallWhenNewClientHasArrived(socket) { \n socket.write(JSON.stringify(auditor.getArrayMusicians()));\n socket.end();\n\n}", "addNewContact() {\n this.socket.on(\"AddNewContactRequest\", async id => {\n try {\n if (id !== this.socket.request.user.id) {\n const result = await ContactController.addNewContact(\n id,\n this.socket.request.user.id\n );\n ContactController.subscribeToContact(result, this.socket);\n this.socket.emit(\"AddNewContactDone\");\n } else {\n throw new Error(\"Cant add contact with self\");\n }\n } catch (error) {\n console.error(error.message);\n }\n });\n }", "function send(instrument) {\n socket.emit('selected instrument', instrument);\n\n}", "function addTask (room,peer_id,socket) {\n const taskKey = datastore.key(room);\n const entity = {\n key: taskKey,\n data: [\n {\n name: 'peer_id',\n value: peer_id\n\t},\n ]};\n\n datastore.save(entity)\n .then(() => {\n //console.log(`Task ${taskKey.id} created successfully.`);\n\t socket.send(JSON.stringify({taskId:taskKey.id}));\n })\n .catch((err) => {\n console.error('addTask ERROR:', err);\n });\n}", "formClick(link) {\n // TODO this functionality should be replaced with socket logic.\n let newQueues = [...this.state.queues];\n newQueues.push(link); \n this.setState({ queues: newQueues});\n $.ajax({\n url: HOST+\"/queue\",\n type:\"POST\",\n data: JSON.stringify({link: link}),\n contentType:\"application/json; charset=utf-8\",\n dataType:\"json\",\n });\n }", "add(newItem) {\n // Create a new Node from the item received\n const node = new Node();\n node.set(newItem);\n\n // If the queue head is empty, add the new item received to the head and the tail\n if (this.head == null) {\n this.head = node;\n this.tail = node;\n\n // Log out the operation\n console.log('Item with ID : ' + this.head.data['id'] + ' and name ' + this.head.data['name'] + ' added to head. Total number in the queue: ' + this.count());\n\n // Begin emitting objects for the attached observer\n if (this.observer != null) {\n\n // Setup a timer to pop every 300 ms\n // this.timer.subscribe(this.this$PiFrame.timerSubscription);\n this.timerSubscription = this.timer.subscribe(() => this.executeSubscription(), () => {}, () => {});\n }\n } else {\n\n // Set the new received node as the 'next' node of the current node\n this.tail.next = node;\n\n // Update the current tail with the one received\n this.tail = node;\n\n // Log out the operation\n console.log('Item with ID : ' + this.tail.data['id'] + ' and name ' + this.tail.data['name'] + ' added to tail. Total number in the queue: ' + this.count());\n }\n }", "async function sendStudentMessage(data) {\n\t//Ensure the producer is connected\n\tawait producer.connect()\n\n\t//Send message\n\tawait producer.send({\n\t\ttopic: options.kafkaTopicTracking,\n\t\tmessages: [\n\t\t\t{ value: JSON.stringify(data) }\n\t\t]\n\t})\n}", "function addStudent(){\n\t\tvar newStudent = new Student(\n\t\t\t\"Wayne Rooney\",\n\t\t\t\"789 Fake St\",\n\t\t\t\"Orlando\",\n\t\t\t\"Florida\",\n\t\t\t[3.6,4.0,2.7]\n\t\t);\n\t\tstudentArray.push(newStudent);\n\t\tconsole.log(\"New Student Added!!!\")\n\t}", "enqueue(data) {\n this.append(data)\n }", "enqueue() {\n\n }", "sendCustomerRequest(){\n // request will be sent to the customer that requested the ride\n var request= {\n taxiNumber: this.state.taxiNumber,\n id: this.socket.id,\n phoneNumber: this.state.phoneNumber,\n }\n this.socket.emit('customer request', request);\n }", "function sendData(newData,avg10,avg1000){\n newData.title = 'newData';\n newData.description = 'Data prints in at 1/s';\n avg10.title = 'avg10';\n avg10.description = 'average of the last 10 shots';\n avg1000.title = 'avg1000';\n avg1000.description = 'average of last 1000 shots';\n var brainDataChunk = [ newData, avg10, avg1000 ];\n // var brainDataChunk = [ newData ];\n console.log( brainDataChunk );\n io.sockets.emit( 'brain-data' , brainDataChunk );\n}", "function confusedStudent (name){\n\t\tsocket.emit('confusion', {\n\t\t\tlectureID: 'RECURSION',\n\t\t\tstudentID: name\n\t\t});\n\t\tconsole.log('I done got clicked.');\n\t}", "function postEvents(req, res, next) {\n jackalopeApp.jackrabbitConnection.publish('queue.simple', req.body);\n res.status(200).end();\n }", "_addToQue(...args) {\n let method = args[0].shift();\n this.quedTasks.push({\n method: method,\n args: args[0]\n });\n }", "enqueue(item) {\n this.items.push(item); // adds an item to the queue\n }", "function onConnect(socket) {\n // When the client emits 'info', this listens and executes\n socket.on('info', data => {\n socket.log(JSON.stringify(data, null, 2));\n });\n socket.on('sendSocket', function(data){\n console.log('sendSocket')\n data.socket=socket.id\n User.findOne({name:data.name},function(err,user){\n user.socket=data.socket;\n user.save();\n })\n })\n\n socket.on('sendSocketQQ', function(data){\n data.socket=socket.id\n User.findOne({name:data.name},function(err,user){\n user.socket=data.socket;\n user.save();\n //QQArtist.createAsync(data)\n QqSystem.QQNewArtist(data)\n })\n });\n\n // Insert sockets below\n require('../api/regularrequest/regularrequest.socket').register(socket);\n //require('../api/privaterequest/privaterequest.socket').register(socket);\n //require('../api/publicrequest/publicrequest.socket').register(socket);\n require('../api/currentrequest/currentrequest.socket').register(socket);\n //require('../api/qqartist/qqartist.socket').register(socket);\n //require('../api/qqrequest/qqrequest.socket').register(socket);\n require('../api/thing/thing.socket').register(socket);\n\n}", "listen(){\n this.namespace.on('connection', (socket)=>{\n socket.on('teacher start exit', (teacherSocketId, quiz) => {\n this.handleStartQuiz(teacherSocketId, quiz);\n });\n\n socket.on('student submit exit', (sessionId, firstname, answersInfo) =>{\n console.log(\"Student\" + firstname);\n console.log(\"Student responded \" + answersInfo);\n this.handleSubmitExit(sessionId,firstname,answersInfo);\n\n })\n });\n }", "enqueue(sa) { \r\n this.Array.push(sa);\r\n}", "function emitMsg(data) {\n // console.log('\\n\\n\\nEmitting message\\n\\n\\n')\n ioClient.emit('new message', data)\n}", "function subscribe(socket, uri) {\n var events = ['ql.io-script-ack', 'ql.io-script-compile-error', 'ql.io-script-compile-ok',\n 'ql.io-statement-error', 'ql.io-statement-in-flight', 'ql.io-statement-success',\n 'ql.io-statement-request', 'ql.io-statement-response', 'ql.io-script-done'];\n var packet = {\n type: 'events',\n data: JSON.stringify(events)\n }\n if(socket) {\n return socket.send(JSON.stringify(packet));\n }\n else if(uri) {\n return uri + '&events=' + JSON.stringify(packet);\n }\n }", "function addStudent (student) {\n\tvar actionType = '[addStudent]:';\n\tif (!student.name) {\n\t\treturn console.log(actionType, 'Name of the student is not defined.');\n\t}\n\tif (!student.surname) {\n\t\treturn console.log(actionType, 'Surname of the student is not defined.');\n\t}\n\tif (!student.phone) {\n\t\treturn console.log(actionType, 'Please provide a phone of the student.');\n\t}\n\tvar phoneRegex = new RegExp(\"^\\\\+[0-9]*$\");\n\tif (!phoneRegex.test(student.phone)) {\n\t\treturn console.log(actionType, 'Phone number is invalid');\n\t}\n\n\tstudent.id = students.length;\n\tstudent.rating = 0;\n\tstudents.push(student);\n\treturn console.log(actionType, `Student ${student.name} ${student.surname} has been added successfully.`);\n}", "addMsg(msg){\n this.socket.send(JSON.stringify(msg));\n }", "enqueue(data) {\n if (this.hasRoom()) {\n this.queue.addTail(data);\n this.size++;\n console.log(\n `'${data}' was added to the queue! The queue is now ${this.size}`\n );\n } else throw new Error(`The Queue has no more room to add new data!`)\n }", "function emitGiveMeTweets(fireid) {\n socket.emit(\"giveMeTweets\", {\n id: fireid\n });\n}", "function sendUserInfo() {\n var task = new Task(\"setUser\");\n task.user_id = user.id;\n task.username = user.username;\n var jsonStringTask = JSON.stringify(task);\n webSocket.send(jsonStringTask);\n}", "addUserName(userInfo){\n this.socket.send(JSON.stringify(userInfo));\n }", "function answer_student(id) {\n var parser = document.createElement('a');\n parser.href = window.location.href;\n var ta = parser.pathname.split('/')[2];\n socket.emit('remove_student_answer', {net_id: id.id, ta:ta});\n socket.emit('answer_student', {\"net_id\":id.id, \"ta\": ta});\n\n}", "submit(work) {\n this.socket.send(JSON.stringify({\n method: \"submit\",\n params: work\n }));\n }", "function addUser(socket, io, data) {\n users[socket.id] = socket;\n handles[socket.id] = data.handle;\n io.sockets.emit('addUser', { 'id' : socket.id , 'handle' : data.handle });\n console.log('Userid=' + socket.id + ' has connected and set handle to ' + data.handle + '.');\n}", "function add() {\n console.warn(event);\n const input = document.getElementById('todo-input');\n\n // Emit the new todo as some data to the socket\n socket.emit('make', {\n title : input.value,\n completed : false\n });\n\n // Clear the input\n input.value = '';\n input.focus();\n}", "function addStudent(){\n // event.preventDefault()\n let name = $(\"#studentName\").val();\n let course = $(\"#course\").val()\n let grade = $(\"#studentGrade\").val()\n\n let dataToSend = {\n student_name: name,\n course: course,\n grade: grade,\n }\n // var fbRef = firebase.database();\n fbRef.ref('students').push(dataToSend)\n clearAddStudentFormInputs();\n showAlert(); // success alert\n closeAlert(); // auto closes on setInterval\n}", "function sendToServer_wantnext() {\r\n socket.emit('clientend', {\r\n 'room': ROOM_ID\r\n });\r\n}", "function join(idUser, idQuiz, token) {\n var dataJoin = {\n idUser : idUser,\n idQuiz : idQuiz,\n token : token\n };\n\n socket.emit(PROTOCOL_JOIN, dataJoin);\n}", "async onAdded() {\n this.log('new device added: ', this.getName(), this.getData().serialNumber);\n }", "approveStudent(join_request_param) {\n const { session, updateSession, socket } = this.props;\n const join_request = { ...join_request_param, status: 'approved' };\n const requestBody = {\n _id: session._id,\n join_request\n };\n axios\n .post('/api/updateJoinRequest', requestBody)\n .then(response => {\n if (response.data.success) {\n updateSession(\n response.data.session\n );\n socket.emit('tutor-approve', {\n session: response.data.session.eventId,\n student_id: join_request.student_id\n });\n } else {\n console.error(response.data.error);\n }\n })\n .catch(err => {\n console.error(err);\n });\n }", "addQueue (fbID, reqUser) {\n redis.getHash(reqUser)\n .then(list => {\n list.userQueue += `,${fbID}`;\n redis.setHash(reqUser , list);\n });\n }", "[types.ADDMESSAGEQUEUE](state, queue) {\n state.messageQueue.push(queue)\n }", "function addAsyncClient(x,y){\n console.log(\"[SC] triggering add\");\n addAsync(x,y, function(err, result){\n if (err){\n console.log(\"error occured..\", err);\n return;\n }\n console.log(\"[SC] result = \", result); \n });\n}", "addTest() {\n this.socket.emit('tests:add', this.state.selectedPipeline);\n this.closeAddTest();\n }", "on() {\n socket.emit('OUTPUT', { index: this.index, method: 'on' });\n }", "function sendTable() {\n var task = new Task(\"createTable\");\n task.owner_id = user.id;\n var jsonStringTask = JSON.stringify(task);\n webSocket.send(jsonStringTask);\n}", "function addingToQueue(response, id, bookedSeats, time, direction, date, human) {\r\n //Проверка ошибок\r\n //Проверка направления\r\n if (isNaN(direction) || direction < Var.directionMin || direction > Var.directionMax) {\r\n console.log(\"\\tunknown direction\");\r\n response.send(\"unknown direction\");\r\n return;\r\n }\r\n //Проверка Времени\r\n if (isNaN(time) || time < 0 || time > 8) {\r\n console.log(\"\\tincorrect number of time\");\r\n response.send(\"incorrect number of time\");\r\n return;\r\n }\r\n\r\n if (isNaN(bookedSeats) || bookedSeats < 0 || bookedSeats > 4) {\r\n console.log(\"\\tincorrect number of booked\");\r\n\t\tresponse.send(\"incorrect number of booked\");\r\n\t\treturn;\r\n }\r\n if (isNaN(date) || date < 0) {\r\n console.log(\"\\tincorrect number of date\");\r\n response.send(\"incorrect numberof date\");\r\n return;\r\n }\r\n\tsql.main(\"SELECT id FROM \" + human + \" WHERE id = \" + id + \";\", function(error, rows){\r\n\t\tif(rows[0] === undefined)\r\n\t\t{\r\n console.log(\"\\tno such user\", id);\r\n response.send(\"error 404: userID\");\r\n return;\r\n }\r\n var titleBookedSeats = human == 'driver' ? 'seats' : 'booked';\r\n var sqlQuery = 'INSERT INTO q' + human + '(id_' + human + ', id_time, id_direction, ' \r\n + titleBookedSeats + ', date) VALUES(' + id + ', ' + time + ', ' + direction + ', ' + \r\n bookedSeats + ', ' + date + ') ON DUPLICATE KEY UPDATE ' + titleBookedSeats + ' = VALUES(' + titleBookedSeats + ');';\r\n\r\n sql.main(sqlQuery, function (error, rows){\r\n if (error) {\r\n console.log(\"\\tDuplicate key? \\t\", error);\r\n response.send(\"error with adding \" + titleBookedSeats + \" to queue\");\r\n return;\r\n }\r\n response.send(\"success added to Queue\");\r\n console.log(\"\\tsuccess added\");\r\n });\r\n\t});\r\n}", "function publishArticle({ postId, article }) {\n //sync.queue({ postId, article });\n socket.emit('publishArticle', { postId, article }, () => { });\n}", "sendRegistObj(context, serverSocket, data) {\n console.log(\"regist obj\")\n serverSocket.emit('sendRegistObjToServer', data)\n console.log(\"디바이스추가완료\")\n }", "addItem(req, res) {\n //grab the new item and push it to the list\n const { addOn } = req.body;\n list.push(addOn);\n res.status(200).send(list);\n }", "addMember(student)\n {\n this._members.push(student);\n }", "function writting() {\n socket.emit('writting', pseudo);\n}", "function linkToStudent(studentId, ticketId) {\n return db('userTickets').insert({studentId: studentId, ticketId: ticketId, helperId: 0});\n}", "enqueue(item) {\n this.dataStore.push(item);\n }", "enqueue(item) {\n this.dataStore.push(item);\n }", "sending () {\n }", "addUser(user){\n // Default-Username setzen (u[n+1])\n if(user.Username === \"\") user.setUsername(\"u\"+this.counter);\n this.users.push(user);\n this.counter++; //counter hochzählen\n\n // aktuellen Raum ermitteln und neue Details an alle User versenden (damit diese auch wissen, dass es einen neuen hat)\n var room = this;\n room.sendDetails();\n\n // zusätzlich mittels Chat-Nachricht den user auch anzeigen\n var data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"Welcome \" + user.Username + \" joining the Room `\"+room.Roomname+\"`. Total connection: \" + this.users.length\n };\n this.sendAll(JSON.stringify(data));\n}", "createUser() {\n this.socket.emit('create-user', this.state.user);\n }", "function requestqueue() {\n\t\t// If the queue is already running, abort.\n\t\tif(requesting) return;\n\t\trequesting = true;\n\t\tlink.request({\n\t\t\turl: \"api/events\",\n\t\t\tmethod: \"POST\",\n\t\t\tparams: {\n\t\t\t\tsid: gSessionID\n\t\t\t},\n\t\t\tcallback: queuecallback\n\t\t});\n\t}", "function sendWriteRequest(){\n\tif(typeof(socket) != 'undefined' && writeBuffer.length > 0){\n\t\tsocket.emit('command', writeBuffer.shift());\n\t}\n}", "function syncWithServer(){\n\tvar route = '/getSync';\n\tvar event_data = '';\n\t//gets the stored event queue on the client\n\tlocal_events = get_local_events();\n\tif(local_events == null){\n\t\t//if the event queue is null create a new one\n\t\tevent_data = JSON.stringify(newEventQueue());\t\n\t}\n\telse{\n\t\t//stringify the event queue for sending\n\t\tvar event_data = JSON.stringify(local_events);\n\t}\t\n\t//emit the event queue to our listening socket server\n\tsocket.emit(route, event_data );\n}", "emitForm(Names, Job, City, Country, Animal, Objects, Movie, Food, Song ,room){\n socket.emit('update-form',{Names : Names,Job: Job, Country: Country, City : City,\n Animal: Animal, Objects: Objects, Movie: Movie, Food: Food, Song: Song, room :room})\n }", "async function addResource () {\n// const message2I = prompt(\"Ask a question/ or comment & we will get back to you\")\n Axios.post(\"/api/resources\", {\n // author: user.id,\n heading: myheading,\n catagory: mycatagory,\n subtitle: mysubtitle,\n body1: mybody1,\n body2: mybody2,\n rating: myrating,\n // link: mylink\n })\n .then(res => console.log(res))\n .then(alert(\"Saved Resource\"))\n .catch(err => alert(err));\n}", "_writeRegisters(addressToRead, dataToWrite, callback){\n\t\tthis.queue.place( () => {\n\t\t\tthis.i2c.send( new Buffer([addressToRead, dataToWrite]), (err, data) => {\n\t\t\t\tthis.queue.next();\n\t\t\t\tif( callback ){\n\t\t\t\t\tcallback(err, data);\n\t\t\t\t}\n\t\t\t})\n\t\t});\n\t}", "function buyEquipment(equipmentID) {\n socket.emit(\"buy\", equipmentID);\n}", "ask(question) { this.io.emit('questionAsked', question); }", "function onSubmit(payload) {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onSubmit\");\n client.subscribe(\"bath_orders\");\n message = new Paho.MQTT.Message(payload);\n message.destinationName = \"bath_orders\";\n client.send(message);\n}", "function addStation(newName, newId){\n console.log (\"Adding station \\n\");\n var query = connection.query(\"INSERT INTO station SET ?\",\n {\n name: newName,\n station_id: newId\n },\n function(err, res){\n console.log(\"Station added! \\n\");\n lastQuestion()\n }\n );\n}", "send(event, data) {\n\t\t// Don't bother sending anything if we're disconnected\n\t\tif (status.server.connected === false) {\n\t\t\t// log.msg('Server disconnected, cannot send message);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.intf === null) return;\n\n\t\tif (event !== 'bus-tx') return;\n\n\t\tlet dst = data.bus;\n\n\t\tlet message = {\n\t\t\thost : {\n\t\t\t\tname : status.system.host.short,\n\t\t\t\tintf : status.system.intf,\n\t\t\t},\n\n\t\t\tevent : event,\n\t\t\tdata : data,\n\t\t};\n\n\t\t// Encode object as AMP message\n\t\tlet amp_message = new amp();\n\t\tamp_message.push(message);\n\n\t\t// Send AMP message over zeroMQ\n\t\tthis.intf.send([ dst, app_intf + '-tx', amp_message.toBuffer() ]);\n\t}", "async broadcast(rawtx) {\n console.log('broadcasting')\n }", "sendItem(userId, name, description, cb) {\n const itemRef = firebase.database().ref(userId);\n const newItem = {\n name,\n description,\n completed: false\n }\n itemRef.push(newItem);\n cb(true)\n }", "enqueue(newItem) {\n this.q.push(newItem)\n }", "write(data) {\n console.info(\"[LFRC] TX \" + data);\n this.writeQueue.unshift(data); this.txTick();\n }", "add(element) { \n // adding element to the queue \n this.items.push(element); \n }", "function handleStudent(ev) {\n ev.preventDefault();\n\n try {\n var _ev$target$elements = ev.target.elements,\n name = _ev$target$elements.name,\n age = _ev$target$elements.age,\n studentID = _ev$target$elements.studentID,\n averageGrade = _ev$target$elements.averageGrade;\n name = name.value;\n age = age.valueAsNumber;\n studentID = studentID.valueAsNumber;\n averageGrade = averageGrade.valueAsNumber;\n axios.put(\"/addStudent\", {\n //POST! \n name: name,\n age: age,\n studentID: studentID,\n averageGrade: averageGrade\n }).then(function (_ref) {\n var data = _ref.data;\n console.log(data);\n });\n alert(\"Submitted Succesfuly!\"); //YS: Good\n\n ev.target.reset();\n } catch (e) {\n console.error(e);\n }\n}", "function Student(email,qTimer,qp_id,QA)\n{\n\tthis.email=email;\n\t\n\tthis.qTimer=qTimer;\n\tthis.qp_id=qp_id;\n\tthis.QA=QA;\n\n\t}", "function joinQueue(io, socket) {\n return (data) => {\n let queue = data[\"queue\"];\n let user = socket.user;\n\n join(user, queue).then((data) => {\n io.sockets.sockets[socket.id].emit('joined', {\n 'queue': queue\n });\n\n getQueue(queue).then((data) => {\n console.log(data);\n\n io.emit('update', {'waiting': data, 'queue': queue});\n });\n });\n };\n}", "enqueue(item) {\n this.queue.push(item);\n this.size += 1;\n }", "function newRoom() {\n socket.emit(\"newRoom\");\n}", "add_node (node) {\n this.socket.emit('add_node', {\n nodeId: node.nodeId,\n iport: node.iport\n });\n }", "function send (input) {\n socket.emit('sendMsg', { input, myName, type })\n}", "function ClientRequestAddActivityToLecture(received){\r\n var res = WebpageTools.newResponse();\r\n \r\n res.MessageNum = WebpageTools.SERVER_RESPONSE_ADDACTIVITY_TO_LECTURE;\r\n res.id = received.id;\r\n\r\n //DB insertion\r\n // -latte-lecture activity\r\n var query = \"insert into latte_lecture_activity (lectureNum, activityNum) select \"+ received.lectureNum +\",\" +received.activityNum\r\n +\" from latte_lecture_activity where not exists \" \r\n + \" (select * from latte_lecture_activity where lectureNum = \" + received.lectureNum + \" and activityNum = \" + received.activityNum + \") limit 1\";\r\n \r\n console.log(query);\r\n \r\n mysqlConn.query(query, function(err, rows) {\r\n if(err){\r\n console.log(\"mysql query err\");\r\n console.log(err);\r\n res.success = 0;\r\n }\r\n else{\r\n res.success = 1;\r\n }\r\n \r\n //send result to client\r\n socket.emit('data', res) ;\r\n \r\n });\r\n \r\n}", "function sendSeq(deviceName, commandID) {\n Scheduler.queue(\"sequence\", deviceName, commandID);\n}", "send (message, reactions, saveId) {\r\n console.log(`Sending '${message}'`);\r\n this.sendQueue.push({\r\n message: message,\r\n reactions: reactions,\r\n saveId: saveId\r\n });\r\n }", "function addSocket(socket){\n\n //al.info('adding Socket');\n //console.log(this);\n //var foo = handleQuickJoin.bind(this);\n //var bar = handleCancelQuickJoin.bind(this)\n //socket.removeAllListeners('quick-join');\n //socket.removeAllListeners('cancel-quick-join');\n //socket.on('cancel-quick-join', () => this.handleCancelQuickJoin(socket));\n\n socket.on('quick-join',(msg) => { this.handleQuickJoin(socket,msg)});\n\n}", "function buttonAddPerson(event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"addPerson\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at); // the timestamp of the event\n\n // the data we want to send to the clients\n let data = {\n message: evData, // just forward \"addPerson\"\n }\n // send data to all connected clients\n sendData(\"addPerson\", data, evDeviceId, evTimestamp );\n\n // helper variables that we need to build the message to be sent to the clients\n let sync = false;\n let msg = \"\";\n \n buttonAddPerson.timestamp = evTimestamp;\n buttonAddPerson.deviceId = evDeviceId;\n }", "function pushCourse(s, c) {\n port.postMessage({note: \"pushSingle\", \n semester: s,\n course: c});\n}", "add(item) {\n\t\tthis.queue.set(item, item);\n\t}", "function addCourse(event, template)\n{\n\tvar q = {\"userId\" : userid};\n\t$.ajax({\n\t type: 'POST',\n\t url: \turl +\"courses/\" + allCourses[addChoice].courseId + \"/join\",\n\t data: JSON.stringify(q),\n\t success: addCourseCallBack,\n\t error: addCourseCallBack,\n\t contentType: \"application/json\",\n\t dataType: 'json'\n\t});\n}", "handleAdd() {\n\t\tconsole.log(\"this.data1\", this.data);\n\t\tconsole.log(\"studentname\", studentName);\n\n\t\tvar studentName = $(this.elementConfig.nameInput).val();\n\t\tvar courseName = $(this.elementConfig.courseInput).val();\n\t\tvar gradeVal = $(this.elementConfig.gradeInput).val();\n\t\tvar studentID = null;\n\n\t\tthis.createStudent(studentName, courseName , gradeVal, studentID);\n\t\tthis.addStudentToServer(studentName, courseName , gradeVal);\n\t\tthis.clearInputs();\n\n\t\tconsole.log(\"this.data2\", this.data);\n\t\t\n\n\t}", "async function addStudent(req, res) {\n let { firstName, lastName, email, password, dateOfBirth, gender, mobile, note, courses } = req.body;\n const student = new Student({\n firstName,\n lastName,\n email,\n dateOfBirth,\n gender,\n mobile,\n note,\n });\n\n await student.save();\n\n if (!password) {\n password = generator.generate({\n length: 10,\n numbers: true\n });\n }\n\n const role = 'student';\n const user = new User({\n email,\n password,\n role\n });\n\n await user.hashPassword();\n await user.save();\n\n // add course code to new student\n if (courses) {\n const addedStudent = await Student.findOne({ email })\n\n async function asyncEachCourseCode(array) {\n for (let index = 0; index < array.length; index++) {\n const element = array[index];\n const course = await Course.findById({ _id: element });\n await addedStudent.courses.addToSet(course._id);\n await addedStudent.save();\n await course.studentId.addToSet(addedStudent._id);\n await course.save();\n };\n };\n addCourseCodes = async () => {\n await asyncEachCourseCode(courses);\n };\n await addCourseCodes();\n\n return res.json(addedStudent);\n }\n\n return res.json(student);\n}", "sendnewMessage() {\n this.socket.emit(\"newMessage\", this.refs.messageInput.value); //sent event to server\n }", "function sendSingleRoom(roomName) {\n sendDatabaseView();\n findItemsByRoomName(roomName).then(function(results){\n io.emit('receivedRoomItems',JSON.stringify(results[0].items), roomName) \n });\n}", "function add(response, postData) {\n console.log(\"Request handler 'add' was called.\");\n response.writeHead(200, {\n \"Content-Type\": \"text/plain\"\n });\n var student = {\n name: querystring.parse(postData).name,\n faculty: querystring.parse(postData).faculty,\n course: querystring.parse(postData).course,\n }\n student.hash = crypto.createHash('md5').update(student.name + student.faculty + student.course).digest('hex');\n \n response.write(\"Student: \" + student.name + \"\\n\" +\n \"Faculty: \" + student.faculty + \"\\n\" +\n \"Course: \" + student.course + \"\\n\" +\n \"Hash: \" + student.hash);\n response.end();\n /*\n Connect to base -> write document -> disconnect\n */\n MongoClient.connect(url, function (err, db) {\n\n if (err) {\n throw err;\n } else {\n console.log(\"Connected\");\n }\n students = db.collection('students');\n students.insert(student);\n students.findOne({name: \"123\"}, {}, function (err, doc) {\n if (err) {\n throw err;\n } else {\n console.log(\"Document add:\\n\", doc);\n }\n });\n db.close();\n\n });\n}", "enqueue(element) {\n // adding element to the queue \n this.items.push(element);\n }", "enqueue(element) {\n // adding element to the queue \n this.items.push(element);\n }", "enqueue(element) {\n // adding element to the queue \n this.items.push(element);\n }" ]
[ "0.61795473", "0.58577627", "0.5786658", "0.5741299", "0.570077", "0.5604715", "0.5521087", "0.55009866", "0.5495581", "0.5489731", "0.5484213", "0.545972", "0.54183316", "0.53658456", "0.5354781", "0.5344661", "0.5322557", "0.5321873", "0.53205395", "0.5311347", "0.53083426", "0.5307003", "0.5278456", "0.5275444", "0.52707535", "0.5268029", "0.52570015", "0.52227736", "0.5221078", "0.5219668", "0.52124476", "0.52118367", "0.5210968", "0.5210376", "0.5198056", "0.5192402", "0.5184866", "0.5181753", "0.51766926", "0.517221", "0.5168671", "0.5153926", "0.5150101", "0.51279587", "0.5125847", "0.5124741", "0.5123877", "0.5123246", "0.5116853", "0.51075584", "0.5103186", "0.5098609", "0.50903535", "0.508322", "0.5076008", "0.5075417", "0.5072396", "0.5072396", "0.5064619", "0.5048158", "0.50258225", "0.5020232", "0.50199926", "0.50190306", "0.50159293", "0.5014659", "0.501435", "0.5012352", "0.5008102", "0.5006593", "0.5004035", "0.5001662", "0.499572", "0.49898094", "0.49897087", "0.49882907", "0.49841464", "0.49760008", "0.49759302", "0.49749532", "0.49721465", "0.49692953", "0.49690703", "0.49684426", "0.49680087", "0.49613172", "0.49593505", "0.4957724", "0.4957563", "0.49560058", "0.49556163", "0.49531808", "0.4951317", "0.4949552", "0.49425843", "0.49418277", "0.4940269", "0.4939324", "0.4939324", "0.4939324" ]
0.78472954
0
Function to get the list of students who have requested the TA
function get_ta_queue(data){ var parser = document.createElement('a'); parser.href = window.location.href; var ta_net_id = parser.pathname.split('/')[2]; var mydiv = document.getElementById('ta_queue'); // Updates the Queue with students if (Object.keys(data).length > 0 ){ var html_data = "<h5>Queue</h5><br>"; var parser = document.createElement('a'); parser.href = window.location.href; var ta = parser.pathname.split('/')[2]; for (var i = 0; i< Object.keys(data).length; i++) { if(data[i]['ta'] == ta) { var student_net_id = data[i]["student"]; html_data = html_data.concat('<blockquote style = "float:left;"><a class="waves-effect waves-light btn blue darken-4" onclick = \"answer_student(this);\" id = \"'); html_data = html_data.concat(student_net_id); html_data = html_data.concat('\">Answer</a><text style = "font-size:18px; margin-left:15px;">'); html_data = html_data.concat(student_net_id); html_data = html_data.concat('</text></blockquote><br><br>'); } } // Updates HTML Div $(mydiv).html(""); $(mydiv).html(html_data); } else{ $(mydiv).html(""); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStudents () {\n\n }", "function getStudentList() {\n return studentList.requestCall().$promise;\n }", "getStudentByCourse(courseName) {\n let st = new Set()\n for (let s of this.stumap.values()) {\n s.courses.forEach(courses => {\n courses.forEach(name => {\n if (courseName == name) {\n st.add(s);\n }\n });\n });\n }\n return st\n }", "async function getStudents(teacherName, classToRead) {\n var students = [];\n await db.collection(\"classroom\").doc(teacherName).collection(\"classes\").doc(classToRead).collection(\"student_name\").get().then((s) => {\n s.forEach((student) => {\n students.push(student.id);\n });\n });\n return students;\n}", "async function get_all_students(id) {\n try {\n let res = await axios.get(`/get_students/${id}`, config);\n \n return res.data.data;\n \n } catch (err) {\n console.log('Error getting students '+ err);\n return [];\n }\n}", "function getSurveySubmmissionsByStudent(term, studentId, done) {\n // function getSurveySubmmissionsByStudent(termCode, studentId, done) {\n // const term = window.CST.terms.find( e => e.code === termCode);\n // const termModules = window.CST.courseModules[term.course_id];\n // const surveyModules = termModules.filter( e => e.has_survey);\n const surveyModules = term.modules.filter( e => e.has_survey);\n for (surveyModule of surveyModules) {\n const surveyItems = surveyModule.items.filter( e => e.type === 'Survey');\n for (surveyItem of surveyItems) {\n getQuizSubmissions(term.course_id, surveyItem.quiz_id, studentId, done);\n }\n }\n}", "function getStudentsInClass(classId) {\n //all students in thi class\n let classObject = studentClasses.filter(sc => sc.classId == classId);//can get ids(filter) of students(more than one student) who attend this class\n //console.log(classObject);use this studentId 's to call all students from student class\n let gtStudentIds = classObject.map(sc => sc.studentId);//gets all student ID's from StudentClass object Array for that clasId\n let allStudentsFromClassId = gtStudentIds.map(id => getStudentById(id));//gets each passes Id from Student objcet Array\n return allStudentsFromClassId;\n\n}", "examStudent(gid) {\n let s = this.getStudent(gid);\n let st = new Set()\n s.courses.forEach(course => {\n course.forEach(name => {\n for (let c of this.crseMap.values())\n if (c.name == name) st.add(c);\n });\n\n });\n\n return st\n\n }", "static async getStudents(teacher_username) {\n\t\tconst res = await db.query(\n\t\t\t`SELECT username, full_name, email\n\t\t\tFROM students \n\t\t\tWHERE teacher_username = $1 ORDER BY username`,\n\t\t\t[teacher_username]\n\t\t);\n\t\tif (!res.rows[0]) {\n\t\t\tthrow new ExpressError(`No students`, 404);\n\t\t}\n\t\tconst students = res.rows.map(s => new Student(s.username, s.full_name, s.email));\n\t\treturn students;\n\t}", "getList() {\n return this.students\n \n }", "function hasOnlyStudents() {}", "function getStudents() {\n $.ajax({\n method: 'GET',\n url,\n headers: {\n Authorization: authString\n },\n success: onGetStudentsSuccess,\n error: onError\n });\n}", "function getEnrolledStudents(req,res,next){\n\n artService.getEnrolledStudents(req.params.id).then(students => {console.log('# of Students sent:', students.length);\n res.json(students)}).catch(err => next(err));\n}", "function getall(req, res) {\n Student.find()\n \n .exec(function(err, user) {\n if (user) {\n res.json({ status: true, students: user });\n } else {\n res.json({ status: false, error: \"Students not found\" });\n }\n });\n}", "function suitableTeacher(){\n\tvar sid = $(\"select[name=sid] option:selected\").val();\n\t\n\tvar url = \"/uuplex/fitness/teacher/suitable\";\n\tvar method = \"GET\";\n\tvar params = \"sid=\" + sid; \n\tsendRequest(teacherSelect, url, method, params);\n}", "function getAndDisplayStudents() {\n getStudents(displayStudents);\n}", "function listTeachingYearFilters() {\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n Authorization: authHeader(),\n };\n\n const url = '/teaching_years/';\n return axios.get(`${apiUrl}${url}`, requestOptions)\n .then(response => response.data).then(teachingYearFilters => teachingYearFilters);\n}", "function getApprovedStudents() {\n setIsBusy(true);\n axios\n .get(`http://localhost:3001/getApprovedStudents`)\n .then((res) => {\n setStudents(res.data.students);\n })\n .then(() => {\n setIsBusy(false);\n });\n }", "function getStudentNames(students) {\n const mapped = students.map(function(item) {\n return item.name;\n })\n return mapped;\n}", "function task2() {\n return _.chain(data.students)\n .filter(function (student) {\n return 18 <= student.age && student.age <= 24\n })\n .map(function (student) {\n return {\n firstName: student.firstName,\n lastName: student.lastName\n }\n })\n .value();\n }", "function getStudents() {\n return db.query(\"SELECT * FROM students\").then((result) => result.rows);\n}", "function searchList(allStudents) {\n if (currentFilter.length === 0 || currentFilter === \"\" || currentFilter === null) {\n return allStudents;\n } else {\n const list = allStudents.filter((student) => {\n if (\n student.firstName.toLowerCase().includes(currentFilter.toLowerCase()) ||\n (student.middleName !== null && student.middleName.toLowerCase().includes(currentFilter.toLowerCase())) ||\n (student.nickName !== null && student.nickName.toLowerCase().includes(currentFilter.toLowerCase())) ||\n (student.lastName !== null && student.lastName.toLowerCase().includes(currentFilter.toLowerCase()))\n ) {\n return true;\n } else {\n return false;\n }\n });\n console.log(list);\n return list;\n }\n}", "function getAllSubmissionsByAllStudents(cid, aid) {\n return $http.get(\"/api/getAllStudentSubmissions/\" + cid + \"/\" + aid)\n .then(function (response) {\n return response.data;\n });\n }", "async function getStudentAnswers(teacherName, classToRead, studentName) {\n var listOfAnswers;\n await db.collection(\"classroom\").doc(teacherName).collection(\"classes\").doc(classToRead).collection(\"student_name\").doc(studentName).get().then((studentAnswers) => {\n listOfAnswers = studentAnswers.data();\n });\n return listOfAnswers[\"questions\"];\n}", "getStudentDetailByName(name) {\n let selectedStudent = studentsFullList.filter(student => student.name.toLowerCase().includes(name.toLowerCase()));\n if (selectedStudent.length == 0) {\n console.log(`No result found`);\n } \n return selectedStudent;\n }", "async getStudentsList(query) {\n return await this.repository.getByQuery(query);\n }", "function getEnrolledStudents(req,res,next){\n courseService.getEnrolledStudents(req.params.id).then(students => {\n res.json(students)}).catch(err => next(err));\n}", "function passingStudents (grades) {\n let studentGrades = finalLetterGrades(grades)\n return Object.keys(studentGrades).filter(function (student) {\n return studentGrades[student] !== 'F'\n })\n}", "async function getCommonStudents(req, res){\n // Make sure query contains 'teacher' param\n if ('teacher' in req.query === false)\n return res.status(400).send({message: \"'teacher' parameter not found in query parameters.\"});\n\n //Make sure teacher param is in array form. Cast it in array form if not.\n let params;\n\n if (Array.isArray(req.query.teacher)){\n params = req.query.teacher;\n } else if (typeof req.query.teacher === 'string'){\n params = [req.query.teacher];\n } else {\n return res.status(400).send({message: \"Unrecognized parameter type: Expecting 'string' or 'array'.\"})\n }\n\n // Check if queried teachers exist\n // If all queried teachers exist, returned results count should be exactly the same as number of queried teachers\n let results = await models.Teacher.findAndCountAll({\n where: {\n email: {\n [Op.in]: params,\n }\n }\n });\n\n if (results.count !== params.length)\n return res.status(400).send({message: \"One or more email addresses sent do not exist in records.\"});\n\n // Get students for each teacher, and find their intersection\n let studEmails = [];\n let firstPass = true;\n \n for (teacher of results.rows) {\n let students = await teacher.getStudents({\n attributes: ['email'],\n raw: true,\n });\n\n // Get array consisting of student emails\n let tempArr = students.map(x => x.email);\n\n if (firstPass){\n studEmails = tempArr;\n firstPass = false;\n } else {\n studEmails = studEmails.filter(x => tempArr.includes(x));\n }\n };\n res.status(200).send({students: studEmails})\n}", "function getStudentsInClass (classId){\n let classMatched = studentClasses.filter(classy => classy.classId == classId);\n let studentIdsInClass = classMatched.map(student => student.studentId);\n return studentIdsInClass.map(id => getStudentById(id));\n }", "function getStudentsNameList(mentorName){\n let studentNameList = [];\n fetch(url+`/get-mentor/${mentorName}`)\n .then((resp) => {\n return resp.json()\n })\n .then((data) => {\n studentNameList = data.result.studentList;\n })\n return studentNameList;\n}", "function task1() {\n return _.chain(data.students)\n .filter(function (student) {\n return student.firstName < student.lastName;\n })\n .map(function (student) {\n return student.firstName + ' ' + student.lastName;\n })\n .sort()\n .value();\n }", "getSubjects(predicate, object, graph) {\n const results = [];\n this.forSubjects(s => {\n results.push(s);\n }, predicate, object, graph);\n return results;\n }", "function getAllStudents(callback, params){\n\tall_students = [];\n var xmlHttpF = new XMLHttpRequest();\n xmlHttpF.onreadystatechange = function () {\n if (xmlHttpF.responseText && xmlHttpF.status == 200 && xmlHttpF.readyState == 4) {\n var obj = jQuery.parseJSON(xmlHttpF.responseText);\n var portfolioCurrent;\n $.each(obj, function () { \n if(this['accountType'] == \"Student\"){ \n all_students.push(this)\n }\n });\n callback(params, all_students)\n return all_students;\n }\n };\n xmlHttpF.open(\"GET\", \"https://mydesigncompany.herokuapp.com/users/\", true);\n xmlHttpF.send(null);\n}", "get getStudent() {\n return [\n check(\"id\").not().isEmpty().withMessage(\"Id is required.\"),\n ]\n }", "checkIfStudentInExamList(studentID){\n if(this.students_exams.length > 0){\n for (var i = 0; i < this.students_exams.length; i++) {\n if(this.students_exams[i].student_id == studentID){\n return [true, i];\n }\n }\n }\n return [false, -1]\n }", "function retrieveStudents() {\n return new Promise(\n (resolve, reject) => {\n $.getJSON(\"/get_students\", function(data) {\n var students = new Array();\n for (var i = 0; i < data.length; i++) {\n students.push(new Student(data[i].student_id, data[i].student_name));\n }\n resolve(students);\n });\n }\n );\n}", "function jsTeachers(){\n var teachers = [];\n for (var i = 0; i < instructors.length; i ++){\n if (instructors[i].teaches === \"JavaScript\"){\n teachers = teachers.concat(instructors[i].firstname);\n }\n }\n teachers.sort();\n return teachers;\n}", "getStudentCourse(gid) {\n let s = this.getStudent(gid);\n return s.courses;\n\n }", "async getUsersInCourse() {\n let usersInCourse = [];\n await firestore.collection('userInfo').get().then(snap => {\n for (let userDoc of snap.docs) {\n if (userDoc.data().courseIds.includes(this.id)) {\n usersInCourse.push(userDoc.data().name)\n }\n }\n }).catch(e => {\n console.log('error finding users in course')\n })\n return usersInCourse\n }", "getUsers() {\n return this.data.students;\n }", "getSubjects(predicate, object, graph) {\n var results = [];\n this.forSubjects(function (s) {\n results.push(s);\n }, predicate, object, graph);\n return results;\n }", "function getStudent(req, res) {\n User.find({ _id: req.body.id, role: \"parent\" })\n .populate(\"students\")\n .exec(function(err, user) {\n if (user) {\n res.json({ status: true, students: user });\n } else {\n res.json({ status: false, error: \"User not found\" });\n }\n });\n}", "function show_all_students_activity(){\n\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX BEGIN show_all_students_activity XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n\n // POPULATE DATA to RESULTS TABLE\n // var selected_course_id = checkLocalStorage('current_course');\n var selected_course_id = 2;\n\n // console.log('LOCAL STORAGE current_course ' +selected_course_id);\n \n // ajax URLs\n url_course_students = 'http://www.privacyvector.com/api/lumiousreports/students/'+selected_course_id;\n url_student_data = 'http://www.privacyvector.com/api/lumiousreports/studentdata/';\n\n // store results from these static URLs as objects to use with promises\n var students = $.getJSON(url_course_students);\n\n // declare variables for student object\n var student_id = null;\n var student_firstname = null;\n var student_lastname = null;\n var student_email = null;\n var student_username = null;\n var student_firstaccess = null;\n var student_lastaccess = null;\n\n // wait for student ajax request to complete before we proceed\n $.when(students).done(function(studentobject) {\n\n // dig down to the responseText object\n //var s = $.parseJSON(studentobject[1]);\n\n console.info(\"Student Data for Course \" + selected_course_id);\n console.info(studentobject);\n\n // loop through the student object\n jQuery.each(studentobject, function(i, sdata) {\n \n student_id = sdata.id;\n student_firstname = sdata.firstname;\n student_lastname = sdata.lastname;\n student_email = sdata.email;\n student_username = sdata.username;\n student_firstaccess = sdata.firstaccess;\n student_lastaccess = sdata.lastaccess;\n\n console.log(\"Checking data for Student ID: \" + student_id);\n\n var student_stress = 'not_set';\n var student_instructor_comments = 'not_set';\n var student_instructor_comments_trimmed = 'not_set';\n var firstaccess_dateVal = student_firstaccess;\n\n // Format Date\n if (firstaccess_dateVal == 0) {\n var firstaccess_formatted_date = 'Never';\n }else{\n var firstaccess_formatted_date = moment.unix(firstaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n }; \n var lastaccess_dateVal = student_lastaccess;\n if (lastaccess_dateVal == 0) {\n var lastaccess_formatted_date = 'Never';\n }else{\n var lastaccess_formatted_date = moment.unix(lastaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n\n // ajax call to get student data details\n var studentdata = $.getJSON(url_student_data + student_id);\n\n // Store Details in DNA table values\n sdata['ID'] = student_id;\n sdata['FIRSTNAME'] = student_firstname;\n sdata['LASTNAME'] = student_lastname;\n sdata['EMAIL'] = student_email;\n sdata['USERNAME'] = student_username;\n sdata['FIRSTACCESS'] = student_firstaccess;\n sdata['FIRSTACCESSFORMATTEDDATE'] = firstaccess_formatted_date;\n sdata['LASTACCESS'] = student_lastaccess;\n sdata['LASTACCESSFORMATTEDDATE'] = lastaccess_formatted_date;\n\n // when ajax call is done\n $.when(studentdata).done(function(studentdataobject) {\n\n console.log(\"student data details: \");\n console.log(studentdataobject);\n\n // Student Notes Content - get array values, manipulate to clean up and use as comments and stress level\n var student_posts = studentdataobject.user[\"posts\"];\n \n console.log(student_posts);\n\n // ensure the posts object contains usable data\n if(student_posts != undefined){\n $.each(student_posts, function (index, x) {\n console.log('comment content: ' +x.content + ' publishstate: ' + x.publishstate );\n student_instructor_comments = x.content;\n student_instructor_comments_trimmed = student_instructor_comments.trim(); // remove whitespace\n student_instructor_comments_trimmed = student_instructor_comments.substr(2); // remove first 2 digits for stress level\n student_stress = student_instructor_comments.substring(0, 2); // take first 2 digits, use as stress setting\n console.log('Stress content: ' +student_stress + ' student_instructor_comments_trimmed: ' + student_instructor_comments_trimmed );\n \n // Add Labels to stress levels\n if ( student_stress == '20' || student_stress == 'Be' || student_stress == 'Jo' ) {\n // If entry is a default entry then update the text \n sdata['STUDENTSTRESS'] = '<span class=\"content_not_available\">N/A</span>';\n sdata['STUDENTINSTRUCTORCOMMENTS'] = '<span class=\"content_not_available\">No Comment</span>';\n \n }else{\n // Pass the stress levels html to the data object for dna with the correct label wrapping\n if (student_stress >= 7) {student_stress = '<span class=\"student-stress danger label\">'+student_stress+'</span>';};\n if (student_stress < 7) {student_stress = '<span class=\"student-stress warning label\">'+student_stress+'</span>';};\n if (student_stress < 4) {student_stress = '<span class=\"student-stress success label\">'+student_stress+'</span>';};\n sdata['STUDENTSTRESS'] = student_stress;\n sdata['STUDENTINSTRUCTORCOMMENTS'] = student_instructor_comments_trimmed;\n }\n console.log(student_stress);\n console.log(student_instructor_comments_trimmed);\n });\n } // if(student_posts != undefined){\n \n\n var activity_log =[];\n activity_log = studentdataobject.user[\"logstore\"];;\n console.log(' ^^^^ activity_log ^^^^^^^');\n console.log(activity_log);\n\n var activity_array = [];\n \n // Pull Data from Multiple Activties Endpoint \n jQuery.each(activity_log, function(i, adata) {\n var a_row = '<tr>';\n var quizdata = [];\n var quizobject = [];\n \n\n console.log('activity_log DATA');\n activity_time = adata.timecreated;\n activity_moment = moment.unix(activity_time).format(\"YYYY/MM/DD hh:mm:ss\");\n activity_id = adata.id;\n activity_name = adata.action;\n activity_table = adata.objecttable;\n activity_id = adata.objectid;\n activity_course = adata.courseid;\n\n\n \n // @TODO - add catch for failed return - i.e. if no courese id exists\n // @TODO - add new base_url for privacyvector\n\n // EXAMPLE http://www.privacyvector.com/api/lumiousreports/courselookup/4\n \n // var course_url = base_url + 'lumiousreports/courselookup/'+activity_course;\n var course_url = 'http://www.privacyvector.com/api/lumiousreports/courselookup/'+activity_course;\n var coursedata = $.getJSON(course_url);\n\n $.when(coursedata).done(function(courseobject) {\n if (course_name = 'undefined') {\n course_name = '';\n };\n \n var course_name = null; \n course_name = courseobject[0];\n course_name = course_name.fullname;\n console.log('COURSE NAME: '+course_name);\n \n var quiz_name = null; \n if (adata.objecttable == 'quiz_attempts') {\n \n console.log('activity_table SWITCH: '+activity_table);\n var quiz_url = base_url + 'lumiousreports/quizlookup/'+adata.objectid;\n console.log('quiz_url '+quiz_url);\n\n var quizdata = $.getJSON(quiz_url);\n $.when(quizdata).done(function(quizobject) {\n console.log('DOING quizdata JSON call');\n console.log('quizobject');\n console.log(quizobject);\n var quiz_data = quizobject[0];\n console.log(quiz_data);\n var quiz_name = quiz_data.name;\n // quiz_name = quizobject.name;\n // console.log('QUIZ NAME: '+quiz_name);\n // wait for quiz name response before sending result\n a_row += '<th>'+adata.id+'</th>';\n a_row += '<th>'+student_firstname+' '+student_lastname+'</th>';\n a_row += '<th>'+adata.action+'</th>';\n a_row += '<th>'+adata.courseid+' '+course_name+'</th>';\n a_row += '<th>'+adata.objecttable+'</th>';\n a_row += '<th><span>(ID '+adata.objectid+')</span> '+quiz_name+'</th>';\n a_row += '<th><span class=\"hidden\">'+activity_time+'</span>'+activity_moment+'</th>';\n // add the readable data to the table rows \n $('#tbody_activity_result').append(a_row);\n }); // end $.when\n }\n else{\n a_row += '<th>'+adata.id+'</th>';\n a_row += '<th>'+student_result['firstname']+' '+student_result['lastname']+'</th>';\n a_row += '<th>'+adata.action+'</th>';\n a_row += '<th>'+adata.courseid+' '+course_name+'</th>';\n a_row += '<th>'+adata.objecttable+'</th>';\n a_row += '<th><span>(ID '+adata.objectid+')</span></th>';\n a_row += '<th><span class=\"hidden\">'+activity_time+'</span>'+activity_moment+'</th>';\n // add the readable data to the table rows \n $('#tbody_activity_result').append(a_row);\n } // end if\n \n }); // end $.when\n\n a_row += '</tr>';\n }); // end each.activity_log\n }); // END $.when(studentdata).d\n }); // jQuery.each(studentobject,\n // $('#loading_gif').hide();\n });\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX END show_all_students_activity XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n}", "function getTutorListing(req, res) {\n \tvar courseID = req.params.classID;\n\n // Only allow courses with length at least 3.\n if (!courseID || courseID.length < 3) {\n res.status(400).json({message: 'invalid course'});\n\n return;\n }\n\n \tTutorController.get(courseID.toUpperCase())\n \t\t.then((listings) => {\n \t\t\tif (listings) {\n \t\t\t\treturn res.json(listings);\n \t\t\t}\n\n \t\t\treturn res.status(400).json({message: 'invalid course'});\n \t\t});\n}", "function getStudents (node, start = 1, end = node.length){\n return fn => {\n for (let i = start - 1; i < end; i++){\n fn(node[i]);\n }\n }\n}", "function findStudent(studentName) {\n\treturn Array.from(document.querySelectorAll('li i'))\n\t\t.map(el => el.nextSibling.textContent)\n\t\t.filter(student => student.includes(studentName));\n}", "function whoIsPassing(arrayOfStudents){\n var passingResults = [];// set up of empty array\n\n for (var i = 0; i < arrayOfStudents; i++){\n\n if (arrayOfStudents[i].classAverage >= 60){\n //this means they are passing\n passingResults.push({\n name: arrayOfStudents[i].name,//pulling array of students\n passing: true,\n })\n } else {\n //this means student is failing\n passingResults.push({\n name: arrayOfStudents[i].name,\n passing: false,\n })\n }\n }\n return passingResults;\n}", "function allstudents(listStudents){\n var allStudentlist=''; //variable must be initialized, inner scope, this will be a string\nfor (var i = 0; i < listStudents.length; i += 1) {\n student = listStudents[i];\n allStudentlist += '<h2>Student: ' + student.name + '</h2>';\n allStudentlist += '<p>Track: ' + student.track + '</p>';\n allStudentlist += '<p>Points: ' + student.points + '</p>';\n allStudentlist += '<p>Achievements: ' + student.achievements + '</p>';\n }\n return allStudentlist;\n}", "function getResponseEntriesForStudent(){\n console.log(\"Getting all exercise response entries for \\\n teacher \" + teacherID +\", lesson \" + lessonID +\" and student \" + studentID);\n dbShellResponsesForStudent.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and student_id=? order by lesson_id,exercise_id\",[teacherID,studentID]\n ,renderResponseEntriesForStudent,dberrorhandlerForResponseForStudent);\n },dberrorhandlerForResponseForStudent);\n}", "getSubjects(data) {\n let subjects = [];\n for (const course of Object.values(data)) {\n if (subjects.indexOf(course.subject) === -1)\n subjects.push(course.subject);\n }\n return subjects;\n }", "getInstructors() {\n var instructorData = [{ name: \"Paul B\", id: \"1\" },\n { name: \"Jatin B\", id: \"2\" },\n { name: \"Andres B\", id: \"3\" },\n { name: \"Brian K\", id: \"4\" },\n { name: \"Jon S\", id: \"5\" },\n { name: \"Paul T\", id: \"6\" }];//get row data from ajax\n return instructorData;\n }", "list(req, res) {\n studentDAO.getStudents(db)\n .then(students => {\n res.status(200).json(students)\n })\n .catch(err => {\n console.error(err)\n res.sendStatus(404)\n })\n }", "getStudentCourses(studentid) {\n return Boekingen.find({$and:[{Student: studentid},{Academiejaar: currentAcademiejaar }]})\n }", "function getgencat(){\n var catname = company.student.filter((c)=>{\n return c.cat === \"gen\";\n })\n return catname;\n}", "async function getEnrolledStudents(id) {\n return await User.find({'courses': mongoose.Types.ObjectId(id), role:'Student'}).select('-hash -courses');\n}", "function whoIsPassing(arrayOfStudents){\n var passingResults = [];// set up of empty array\n\n for (var i = 0; i < arrayOfStudents; i++){\n\n var isCurrentStudentPassing = (arrayOfStudents[i].classAverage >= 60);// created a boolean variable vs what we did above\n\n passingResults.push(\n {\n name: arrayOfStudents[i].name,//pulling array of students\n passing: isCurrentStudentPassing,\n }\n )\n }\n return passingResults;\n}", "function getStudentsAttendanceStatus() {\n var data = {};\n data.lessonid = $stateParams[\"lessonId\"];\n server.requestPhp(data, \"GetStudentsAttendance\").then(function (data) {\n $scope.students = data;\n\t\t\t/*\n\t\t\t\t0 - attending\n\t\t\t\t1 - late\n\t\t\t\t2 - not attending\n\t\t\t\t3 - didn't report yet\n\t\t\t*/\n });\n }", "function whoIsPassing(arrayOfStudents){\n var passingResult = [];\n for (let i = 0; i < arrayOfStudents.length; i++) {\n if (arrayOfStudents[i].classAverage >= 60){\n //meaning this student avg grade is passing\n passingResult.push({\n name: arrayOfStudents[i].name,\n passing: true\n })\n } else {\n passingResult.push({\n name: arrayOfStudents[i].name,\n passing: false\n })\n }\n\n } return passingResult;\n}", "isTeaching(student){\n for(let a of this.klasses){\n if(a.isIn(student)){\n return true;\n }\n }\n return false;\n }", "getStudents(){\n return this.#fetchAdvanced(this.#getStudentsURL()).then((responseJSON) => {\n let studentBOs = StudentBO.fromJSON(responseJSON);\n // console.info(studentBOs);\n return new Promise(function (resolve) {\n resolve(studentBOs);\n })\n })\n\n }", "function getStudentsforCourse(id) {\n var list = \"<ul>\";\n for (var i = 0; i < courses.length; i++) {\n if (id == courses[i].Id) {\n for (var j = 0; j < courses[i].Students.length; j++) {\n list += \"<li>\" + courses[i].Students[j].Firstname + \" \" + courses[i].Students[j].Lastname + \"</li>\";\n }\n }\n }\n list += \"</ul>\";\n return list;\n}", "function getAllStudentsNotEnrolled(){\n\t\t\n\tvar getStudentsSettings={\n\t\t\t\"type\":\"GET\",\n\t\t\t\"async\": true,\n\t\t\t\"dataType\":\"json\",\n\t\t\t\"url\":\"api/student/enrollment?class=unenrolled\",\n\t\t\t\"headers\":{\n\t\t\t\t\"cache-control\":\"no-cache\"\n\t\t\t}\n\t\t};\n\t\t\n\t$.ajax(getStudentsSettings).success(function(response){\n\t\tconsole.log(JSON.stringify(response));\n\t\tif(response.status=='failed' || status=='failed'){\n\t\t\t\n\t\t\t$('.studentListnotEnrolled').html(\"\");\n\t\n\t\t\t$('.noUnenrolled').html(\"\");\n\t\t\tvar appendNotStu='<p class=\"alert alert-warning\">You have not added any students</p>';\n\t\t\t$('.noUnenrolled').append(appendNotStu);\n\t\t}\n\t\n\telse{\n\t\t$('.noUnenrolled').hide();\n\t\t$('.studentListnotEnrolled').html(\"\");\n\t\t//console.log(JSON.stringify(response));\n\t $.each(response, function(key, value){\n\t\t \n\t\t \t\n\t\t\tvar appendData='<tr>'+\n\t\t\t\t\t\t'<td>'+value.f_name+' '+value.l_name+'</td>'+\n\t\t\t\t\t\t'<td>'+value.username+'</td>'+\n\t\t\t\t\t\t'<td>'+value.dob+'</td>'+\n\t\t\t\t\t\t'<td><a data-sid=\"'+value.student_id+'\" class=\"btn btn-xs btn-light editStudent\" href=\"#\" data-target=\"#editStudent\" data-toggle=\"modal\">View</a></td>'+\n\t\t\t\t\t\t'<td><a data-sid=\"'+value.student_id+'\" class=\"btn btn-xs btn-light deleteStudent\" href=\"#\" data-target=\"#deleteStudent\" data-toggle=\"modal\"><i class=\"fa fa-times\"></i></a></td>'+\n\t\t\t\t\t\t'<td><input type=\"checkbox\" data-sid=\"'+value.f_name+' '+value.l_name+'\" value=\"'+value.student_id+'\" class=\"selectUnStudent\" /></td>'+\n\t\t\t\t\t'</tr>';\n\t\t\t$('.studentListnotEnrolled').append(appendData);\n\t\n\t\t\t\n\t\t});\n\t}\n\t\t\n\t\t\n\t\t//enroll student\n\t\t\t$('a.enrollBtn').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\tenrollStudent(student_id);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t//mutiple enroll\n\t\t$('button.enrollMultiple').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t\n\n\t\t\n\t\n\t\t\t$('.notification').hide();\n\t\t\tmultienrollStudent();\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\n\t\t\t//delete student\n\t\t\t\t$('a.deleteStudent').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\tvar elementRemove=$(this).parent().parent();\n\t\t\t\tremoveStudent(student_id, elementRemove);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t//veiw individual student details\n\t\t\t$('a.editStudent').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\t\n\t\t\t\tveiwDetails(student_id);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$('#selectAllChildren').click( function(){\n\t\t\t\t\t\n\t\t\t\t\t $('input.selectUnStudent:checkbox').not(this).prop('checked', this.checked);\n\t\t\t\t});\n });\n\t\t\n\t\n\n}", "function queryTrainers() {\n db.collection('trainers')\n .where('_userType', '==', 'trainers')\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n let trainerObj = {};\n trainerObj.value = doc.id;\n trainerObj.label =\n doc.data()._name.firstName +\n ' ' +\n doc.data()._name.lastName;\n trainerObj.profilePic = doc.data()._profilePic;\n allTrainers.push(trainerObj);\n setTrainersIsLoading(false);\n });\n return allTrainers;\n });\n }", "function getTalents(username) {\n return $http.get('/talent/get', { params: {username: username}});\n }", "getListByClass(classId) {\n let classList = this.students.filter((student) => {\n return student.classId === classId;\n });\n let listByClass = classList.map((student) => {\n const name = student.name;\n const classId = student.classId;\n return {\n name,\n classId\n };\n });\n return listByClass;\n }", "function getAthleteData() {\r\n //\r\n AthleteSvc.getAthlete(AccountSvc.studentId)\r\n .then(AccountSvc.saveAthleteData)\r\n .then(AccountSvc.getSnackLimits)\r\n .then(getCheckoutHistory)\r\n .then(AccountSvc.initializeHiddenCategories)\r\n .then(getAllChoices)\r\n .then(redirectToCart)\r\n .catch(IonicAlertSvc.error);\r\n }", "function getStudentCourses (req, res, next) {\n\n req.db.collection(\"courses\").aggregate([\n { \"$unwind\": \"$course_offerings\" },\n { $match: {\"course_offerings.students.student_id\": getMongoId(req.token.student_id, next)} },\n { $sort : { \"begin_data\" : 1 } }\n \n ]).toArray(sendJSON.bind(res));\n\n\n}", "async getAllByTeacher(req, res) {\n SubjectService.getByTeacher([req.params.teacherid])\n .then((result) => {\n res.status(result.status).send({\n status: result.status,\n message: result.message,\n Subjects: result.response.rows,\n });\n })\n .catch((err) => {\n res.status(400).send({\n message: err.message,\n });\n });\n }", "function performSearch(search){\n let result = [];\n for (var i = 0; i < data.length; i++) {\n if (data[i].name.first.toLowerCase().includes(search) || data[i].name.last.toLowerCase().includes(search))\n {\n result.push(data[i]);\n }\n }\n if (result.length > 0) {\n showPage(result, 1);\n addPagination(result);\n } else {\n let studentList = document.querySelector('.student-list');\n let linkList = document.querySelector('.link-list');\n studentList.innerHTML = \"<div>No results</div>\";\n linkList.innerHTML = \"\";\n }\n}", "function getAllTeachers(callback, params){\n all_teachers = [];\n var xmlHttpF = new XMLHttpRequest();\n xmlHttpF.onreadystatechange = function () {\n if (xmlHttpF.responseText && xmlHttpF.status == 200 && xmlHttpF.readyState == 4) {\n var obj = jQuery.parseJSON(xmlHttpF.responseText);\n var portfolioCurrent;\n $.each(obj, function () { \n if(this['accountType'] == \"Teacher\"){ \n all_teachers.push(this)\n }\n });\n callback(params, all_teachers)\n return all_teachers;\n }\n };\n xmlHttpF.open(\"GET\", \"https://mydesigncompany.herokuapp.com/users/\", true);\n xmlHttpF.send(null);\n}", "function getStudents(res, mysql, context, complete){\n mysql.pool.query(\n \"SELECT registration_id, reg_student_id, student_fname, student_lname FROM Registrations, Students WHERE reg_student_id=student_id\", \n function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.searchRegistrations = results;\n complete();\n });\n }", "function alphaInstructors (arr){\nvar jsInstructors = arr.filter(function(instructor){\n\treturn instructor['teaches'] === 'JavaScript';\n\t}).map(function(instructor){\n\t\treturn instructor.firstname;\n\t})\n\nreturn jsInstructors.sort();\n\n}", "function getStudentsForMentor() {\n let mentor = document.getElementById(\"mentorSelectForGettingStudents\").value;\n fetch(url+`/get-mentor/${mentor}`)\n .then((resp) => {\n return resp.json()\n })\n .then((data) => {\n console.log(\"result of studenLIst of a mentor is: \"+ data.result.studentList);\n let tbody = document.getElementById('tbody');\n tbody.innerHTML = '';\n data.result.studentList.forEach(name => {\n createTrTd(name);\n console.log(\"name of student inside for loop is: \"+ name);\n });\n document.getElementById('table').append(tbody);\n })\n\n return false;\n}", "getAssignedTrainers(trainers, courseId){\r\n var course = this.getCourse(courseId)\r\n var assigned = []\r\n course.trainers.forEach(id => {\r\n for(var i=0; i< trainers.length; i++){\r\n if (trainers[i].id === id){assigned.push(trainers[i])}\r\n }\r\n });\r\n return assigned\r\n }", "async getAllByClass(req, res) {\n StudentServices.getAllByClass([\n req.params.classid,\n moment(new Date()).year(),\n ])\n .then((students) => {\n res.status(students.status).send({\n status: students.status,\n message: students.message,\n students: students.students.rows,\n });\n })\n .catch((err) => {\n res.status(400).send({\n message: err.message,\n });\n });\n }", "function getStudents(containerElement, projectName, queryFlag) {\n const foundInfo = document.querySelector('.search-results');\n foundInfo.innerHTML = '';\n containerElement.removeAttribute('style');\n containerElement.innerHTML = '';\n containerElement.append(spinnerBox);\n\n\n\n let query = queryFlag === 'classmate' ?\n [\"slackName\", \">=\", search.value]:\n [\"currentProject\", \">=\", projectName];\n\n db.collection(\"Users\")\n .orderBy(queryFlag?'slackName':'currentProject').where(...query)\n .startAt(queryFlag?search.value:projectName)\n .endAt(queryFlag?search.value +\"\\uf8ff\":projectName)\n .get()\n .then(function(querySnapshot) {\n containerElement.innerHTML = '';\n if(queryFlag && search.value === '') return;\n if(querySnapshot.size){\n\n // lang filter\n const langFilter = document.createElement('select');\n langFilter.classList.add('language-filter');\n langFilter.innerHTML = \"<option value disabled selected>Filter by language</option>\";\n\n //filter event listener\n langFilter.addEventListener('change', function(evt){\n const studentsFilterList = containerElement.querySelectorAll('.student-card');\n // console.log(studentsFilterList)\n studentsFilterList.forEach(e => {\n let lang = e.querySelector('.user-language');\n if(e.lastChild.innerHTML.match(langFilter.value) ||\n lang.innerHTML.match(langFilter.value)) {\n if(e.classList.contains('hidden')){\n e.classList.remove('hidden');\n }\n }else{\n e.classList.add('hidden');\n }\n });\n const numOfItems = langFilter[langFilter.selectedIndex].innerHTML.match(/(\\d+)/i)[0];\n studentsCount.innerHTML = ('Filtered ' + numOfItems + \" record\" + (+numOfItems===1?\"\":\"s\"));\n const closeFilter = document.createElement(\"span\");\n closeFilter.classList.add(\"closeFilter\");\n closeFilter.innerHTML = \"clear filter\"\n studentsCount.appendChild(closeFilter);\n\n //close filter event\n closeFilter.addEventListener('click', ()=>{\n studentsFilterList.forEach(e => {\n e.classList.remove('hidden');\n \n });\n langFilter.selectedIndex = 0;\n studentsCount.innerHTML = \"Found \" + querySnapshot.size + \" record\" + (querySnapshot.size===1?\"\":\"s\");\n });\n });\n \n // add found results\n const infoBox = document.querySelector('.info-block');\n // const foundInfo = document.querySelector('.search-results');\n foundInfo.innerHTML = '';\n //foundInfo.classList.add(\"search-results\");\n const studentsCount = document.createElement(\"div\");\n studentsCount.classList.add(\"search-count\");\n studentsCount.innerHTML = \"Found \" + querySnapshot.size + \" record\" + (querySnapshot.size===1?\"\":\"s\");\n foundInfo.append(studentsCount);\n\n const langFilterObject = {};\n //containerElement.append(foundInfo);\n const retrievedStudents = {};\n querySnapshot.forEach(function(doc) { \n\n // extract languages\n const userLangs = doc.data().language.split(',');\n userLangs.forEach(lang => {\n langFilterObject[lang] = langFilterObject[lang]?langFilterObject[lang]+1:1;\n \n })\n\n const student = document.createElement(\"li\");\n student.className = \"student-card\";\n\n const data_contact = document.createElement(\"span\");\n data_contact.className = \"slack-link\";\n data_contact.innerHTML = `<img src=\"img/slack-black.svg\" alt=\"Slack Icon\" class=\"slack-icon\"><span>${doc.data().slackName}</span>`;\n\n const data_languages = document.createElement(\"p\");\n data_languages.className = \"user-language\"\n data_languages.innerHTML = `<i class=\"ion-ios-world-outline icon-language\"></i> ${doc.data().language.replace(',',', ')}`;\n\n\n\n student.appendChild(data_contact);\n student.appendChild(data_languages);\n if(queryFlag) {\n const workingProject = document.createElement(\"div\");\n workingProject.className = \"user-info\";\n workingProject.innerHTML = `<div class=\"user-track\"><i class=\"ion-ios-star-outline icon-track\"></i> ${doc.data().userTrack}</div>\n <div class=\"user-project\"><i class=\"ion-ios-copy-outline icon-project\"></i> ${doc.data().currentProject}</div>`;\n student.appendChild(workingProject);\n }\n\n \n retrievedStudents[doc.data().slackName] = student;\n \n \n });\n\n const sortedList = Object.keys(retrievedStudents);\n sortedList.sort((a,b)=>{\n return a.toLowerCase() > b.toLocaleLowerCase();\n });\n sortedList.forEach((e,i)=>{\n containerElement.appendChild(retrievedStudents[e]);\n });\n\n if(containerElement.offsetHeight > 420){\n containerElement.setAttribute('style', 'overflow-y:scroll; max-height: 660px');\n containerElement.scrollTop = 0;\n }\n \n optionFiedCreator(Object.keys(langFilterObject).sort(), langFilter);\n foundInfo.append(langFilter);\n\n const langContainer = document.querySelectorAll('.language-filter option');\n\n for(i = 1; i < langContainer.length; i++) {\n langContainer[i].innerText = langContainer[i].innerText + \" (\" + langFilterObject[langContainer[i].value] + \") \";\n }\n\n\n\n }else{\n const student = document.createElement(\"li\");\n student.className = \"student-card\";\n const notFound = document.createElement(\"li\");\n notFound.className = \"student-card notfound\";\n notFound.innerHTML = `It seems we could not find anything`;\n containerElement.appendChild(notFound);\n }\n\n })\n .catch(function(error) {\n console.log(\"Error getting documents: \", error);\n });\n}", "static async findList(req, res) {\n \n \n try{\n\n const { name } = req.query\n \n // get student list\n const students = await studentService.findList({keyword:name})\n \n // create response\n const response = {\n success: true,\n data: {\n total: students.count,\n students:students.rows\n }\n }\n res.send(response)\n } catch (e) {\n res.send(e)\n }\n }", "function getUsersListByAnything(attribute, getattribute, value) {\n let i = 0;\n let usersList = [];\n for (i = 0; i < Users.length; i++) {\n if (Users[i][attribute] == value) {\n usersList.push(Users[i][getattribute]);\n }\n }\n return usersList;\n}", "function getEventsFromStudent(student, callback) {\n console.log(\"eventsFromStudent\", student);\n Book.find(function(err, books) {\n if (err) {\n return callback(err);\n }\n var events = [];\n for (var i = 0; i < books.length; i++) {\n var book = books[i];\n book.isBook = true;\n book.onLoan = book.isOnLoan();\n book.loanClass = '';\n if (book.onLoan) {\n book.loanClass = 'on-loan';\n }\n for (var j = 0; j < book.loans.length; j++) {\n var loan = book.loans[j];\n console.log(loan.student);\n if (loan.student == student) {\n loan.isLoan = true;\n loan.book = book;\n events.push(loan);\n if (loan.returned) {\n events.push({\n isReturn: true,\n book: book,\n student: loan.student,\n created_formatted: loan.returned_formatted()\n });\n }\n }\n }\n }\n events.sort(function(a, b) {\n if (a.created > b.created) return -1;\n if (a.created < b.created) return 1;\n return 0;\n });\n callback(null, events);\n });\n}", "static getStudentByIndex(index, isPrint) {\n\t\tif (index === undefined || !Number.isInteger(index)) {\n\t\t\treturn console.log(new Error('The age Student is require and integer!'));\n\t\t}\n\n\t\tif (students[index] === undefined) {\n\t\t\treturn console.log('Not find Student in list!');\n\t\t}\n\n\t\tif (isPrint) {\n\t\t\tconsole.log(this.showDetailStudent(students[index], ''));\n\t\t} else {\n\t\t\treturn students[index];\n\t\t}\n\t}", "function getTeachers() {\n // get all the values you need from the table\n $.get(\"/api/teachers\", renderTeacherList)\n }", "function getDetails(staff) {\n var persons = [],\n i;\n\n var staffLenght = staff.length;\n\n for (i=0; i < staffLenght; i++) {\n var staffMember = staff[i];\n\n persons[i] = _.find(trainers, function(o) { return o._id.toString() === staffMember.toString(); });\n\n }\n\n return persons;\n}", "function makeStudentsReport(data){\n const studentArray=[];\n\n for(let i=0; i< data.length; i++){\n const item = data[i];\n studentArray.push(`${item.name}: ${item.grade}`);\n }\n\n return studentArray;\n}", "async getPatients(ctx) {\n\n let queryResults = await this.queryByObjectType(ctx, 'patient');\n return queryResults;\n\n }", "function getStudentYears(studentName) {\n /*\n * Filter the transcriptList for the specfied student\n */\n let transcriptList = database_data.getTranscripts();\n let findStudentTrans = transcriptList.filter(function (obj) {\n return (obj.studentName===studentName);\n });\n\n /*\n * Using the records in findStudentTrans, get distinct\n * semester, year values.\n */\n let years = findStudentTrans.reduce((acc, x) =>\n acc.concat(acc.find(y => y.year === x.year) ? [] : [x]), []);\n return years;\n}", "async function getStudents(studentFile) {\n let studentGitHubs = csvParse(fs.readFileSync(studentFile), {'columns':true, 'bom':true});\n let canvasIds = await getEnrollments();\n let students = canvasIds.map((student) => {\n console.log(student.uwnetid);\n let match = _.find(studentGitHubs, {'uwnetid': student.uwnetid});\n return _.merge(student,match);\n })\n students = _.sortBy(students, ['display_name']); //ordering\n\n let githubLess = students.filter((s)=> s.github === undefined);\n if(githubLess.length > 0){\n console.log(`${githubLess.length} enrolled students without a GitHub account:`)\n githubLess.forEach((s) => console.log(s.uwnetid));\n }\n\n return students;\n}", "function loadSubmissions() {\n\n function ajaxDone() {\n // There's just one ajax call when the page loads \n }\n\n // alert('Found ' + window.terms.length + ' terms for this faculty member.');\n for (term of window.CST.terms) {\n for (student of term.students) {\n getSubmissionsByStudent(term.course_id, term.course_section_id, student.id, ajaxDone);\n }\n }\n}", "async myStudentTeacherClasses(parent, args, ctx, info) {\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in\");\n }\n\n // query parameters where author is the current user\n return ctx.db.query.classes(\n {\n where: {\n OR: [\n {\n creator: {\n id: ctx.request.userId,\n },\n },\n {\n students_some: {\n id: ctx.request.userId,\n },\n },\n ],\n },\n },\n info\n );\n }", "function searchWithName() {\n\t\t//console.log('Search student...');\n\n\t\t// The request parameters\n\t\tvar url = './student';\n\t\tvar fullname = $('fullname').value;\n\t\tvar params = 'fullname=' + fullname;\n\t\tvar req = JSON.stringify({});\n\t\t//alert(params);\n\t\t// display loading message\n\t\t//showLoadingMessage('Searching for student' + fullname + '...'); \n\n\t\tajax('GET', url + '?' + params, req,\n\t\t\t\t// successful callback\n\t\t\t\tfunction (res) {\n\t\t\tvar students = JSON.parse(res);\n\t\t\t//alert(students);\n\t\t\tif (!students || students.length === 0) {\n\t\t\t\tshowWarningMessage('No student' + fullname + ' found.');\n\t\t\t} else {\n\t\t\t\tlistStudents(students);\n\t\t\t}\n\t\t},\n\t\t// failed callback\n\t\tfunction () {\n\t\t\tshowErrorMessage('Cannot load student ' + fullname + '.');\n\t\t}\n\t\t);\n\t}", "function getAllStudentData() {\n var studentData = {moduleStudentList, studentChanges};\n \n return studentData;\n}", "findStudent(username){\n // This method provided for convenience. It takes in a username and looks\n // for that username on student objec ts contained in the `this.students`\n // Array.\n let foundStudent = this.students.find(function(student, index){\n return student.username == username;\n });\n return foundStudent;\n }", "getListByClass(classNumber) {\n let classList = studentsFullList.filter(student => student.classId == classNumber);\n return classList.map(student => {\n let name = student.name;\n let classId = student.classId;\n return {\n name,\n classId\n };\n });\n }", "function quesIdentifiesStudent(ques) \n { \n if (ques.indexOf('first') != -1)\n {\n return true;\n }\n else if (ques.indexOf('last') != -1)\n {\n return true;\n }\n else if (ques.indexOf('name') != -1)\n {\n return true;\n }\n \n else if (ques == 'id')\n {\n return true;\n }\n \n var id_index = ques.indexOf('id');\n if (id_index != -1)\n {\n if (id_index > 0)\n {\n if (ques[id_index-1] == ' ')\n {\n // e.g. \"student id\"\n return true;\n }\n }\n } \n else if (ques.indexOf('id:') != -1)\n {\n // e.g. student id:\n return true;\n }\n else if (ques.indexOf('identity') != -1)\n {\n return true;\n }\n else if (ques.indexOf('identifier') != -1)\n {\n return true;\n }\n else if (ques.indexOf('class') != -1)\n {\n return true;\n }\n else if (ques.indexOf('section') != -1)\n {\n return true;\n }\n else if (ques.indexOf('period') != -1)\n {\n return true;\n }\n else if (ques.indexOf('room') != -1)\n {\n return true;\n }\n else if (ques.indexOf('student') != -1)\n {\n return true;\n }\n else if (ques.indexOf('teacher') != -1)\n {\n return true;\n }\n else if (ques.indexOf('email') != -1)\n {\n return true;\n }\n else if (ques.indexOf('e-mail') != -1)\n {\n return true;\n }\n \n // spanish\n else if (ques.indexOf('correo') != -1)\n {\n return true;\n }\n \n return false;\n }", "function angryProfessor(k, a) { \n /* Initialize variables.\n * 1. INTEGER threshold : threshold of mininum attendess.\n * 2. ARRAY INTEGER arrivalTimes : arrival time of each student.\n * 3. INTEGER onTimeStudent : amount of on time student.\n */\n const threshold = k;\n const arrivalTimes = a;\n var onTimeStudent = 0; \n \n /* Iterate through each student arrival time and count how many student are on time.\n * Check if threshold is fulfilled. Return \"YES if threshold fulfilled.\"\n */\n for (let i=0; i<arrivalTimes.length; i++) {\n if (arrivalTimes[i] <= 0) {\n onTimeStudent++;\n }\n if (onTimeStudent == threshold) {\n return \"NO\";\n }\n }\n return \"YES\";\n}", "function filterStudents(searchString) {\n let newData = [];\n for (let i = 0; i < data.length; i++) {\n const name = `${data[i].name.first} ${data[i].name.last}`\n if (name.toLowerCase().includes(searchString.value.toLowerCase())) {\n newData.push(data[i]);\n }\n }\n return newData;\n}", "async function getstudent(name) {\n let rawdata = await fetch(`https://kavin-mentor.herokuapp.com/students/${name}`);\n let studentdata = await rawdata.json();\n\n let ul = document.getElementById('students');\n ul.innerHTML = '';\n\n studentdata.forEach((student) => {\n let li = document.createElement('li');\n li.innerHTML = student.name;\n ul.append(li);\n });\n\n document.getElementById('studentdetailsdiv').style.display = (document.getElementById('studentdetailsdiv').style.display === 'block') ? 'none' : 'block';\n}", "async function getByYear() {\n let awards\n}", "function getFunding(students, teachers, averageGPA) {\n /* your code */\n}", "function getAuthorList(intent, session, response){\r\n\r\n\tvar author;\r\n\r\n\tsessionAttributes.listName = \"author_books\";\r\n\r\n\tif (typeof session.attributes.author === 'undefined' && typeof intent.slots.author.value === 'undefined'){//user did not provide an author name\r\n\r\n\t\tvar speechText = \"O.K. Tell me the name of the author you want to search for.\";\r\n\r\n\t\tvar speechOutput = {\r\n\t\t\tspeech: \"<speak>\" + speechText + \"</speak>\",\r\n\t\t\ttype: AlexaSkill.speechOutputType.SSML\r\n\t\t};\r\n\t\t\t\t\r\n\t\tresponse.ask(speechOutput);\t\r\n\t}else{//author name either provided by the user or is from the book detail response\r\n\r\n\t\tvar speech_preamble = \"\";\r\n\t\tif(typeof session.attributes.author !== 'undefined'){\r\n\t\t\tauthor = session.attributes.author; \r\n\t\t}else{\r\n\t\t\tauthor = intent.slots.author.value; \r\n\t\t\tspeech_preamble = \"I sometimes have a hard time understanding names. I think you said \" + intent.slots.author.value + \". \"\r\n\t\t}\r\n\r\n\t\t//call function to interact with API\r\n\t\tgetAuthorListJSON(author, function (list_of_books) {\r\n\r\n\t\t\tif (list_of_books.length === 0){\r\n\t\t\t\tvar speechOutput = {\r\n\t\t\t\t\tspeech: speech_preamble + \"I did not find any books by \" + author + \". Goodbye.\",\r\n\t\t\t\t\ttype: AlexaSkill.speechOutputType.PLAIN_TEXT\r\n\t\t\t\t};\r\n\t\t\t\tresponse.tell(speechOutput);\r\n\t\t\t}\r\n\r\n\t\t\tvar speech_addendum = \". \";\r\n\t\t\tvar title_addeendum = \"\";\r\n\t\t\tif (list_of_books.length > 5){\r\n\t\t\t\tspeech_addendum = \". Here are the first five. \"\r\n\t\t\t}\r\n\t\t\tif (list_of_books.length > 1){\r\n\t\t\t\ttitle_addeendum = \"s\";\r\n\t\t\t}\r\n\r\n\t\t\tvar speechText = speech_preamble + \"I've found \" + list_of_books.length + \" title\" + title_addeendum + \" by \" + author + speech_addendum; \r\n\t\t\tvar cardContent = \"\"\r\n\t\t\tvar start_list = 0;\r\n\t\t\tvar end_list = 5;\r\n\r\n\t\t\tfor (var i = start_list,length = list_of_books.length; i < length; i++ ) {\r\n\r\n\t\t\t\ttitle = list_of_books[i].title;\r\n\t\t\t\tauthor = list_of_books[i].author;\r\n\t\t\t\tcontributor = list_of_books[i].contributor;\r\n\r\n\t\t\t\tif (typeof list_of_books[i].contributor_alt !== 'undefined' ){\r\n\t\t\t\t\tcontributor = list_of_books[i].contributor_alt;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trank = list_of_books[i].rank;\r\n\r\n\t\t\t\tsessionAttributes.list_of_books = list_of_books;\r\n\t\t\t\tsessionAttributes.start_list= start_list;\r\n\t\t\t\tsessionAttributes.end_list= end_list;\r\n\t\t\t\tsession.attributes = sessionAttributes;\r\n\r\n\t\t\t\tif ( i<end_list ){\r\n\t\t\t\t\tspeechText = speechText + \"Number \" + rank + \", \" + title + \", \" + contributor + \". \";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//response formatting based on the number of items in the list\r\n\t\t\tif (list_of_books.length > 5){\r\n\t\t\t\tvar repromptText = \"To continue, say 'next'. To hear more about a book, tell me the number. To go back, say 'previous'.\";\r\n\t\t\t}else{\r\n\t\t\t\tvar repromptText = \"To hear more about a book, tell me the number.\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//formats the responses based on the number of times the user has interacted with the skill\r\n\t\t\thandleUserSessionCount(session,function (count){\r\n\r\n\t\t\t\tif (count < 5) {\r\n\t\t\t\t\tspeechText = speechText + '<p>' + repromptText + '</p>';\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar speechOutput = {\r\n\t\t\t\t\tspeech: \"<speak>\" + speechText + \"</speak>\",\r\n\t\t\t\t\ttype: AlexaSkill.speechOutputType.SSML\r\n\t\t\t\t};\r\n\t\t\t\tvar repromptOutput = {\r\n\t\t\t\t\tspeech: repromptText,\r\n\t\t\t\t\ttype: AlexaSkill.speechOutputType.PLAIN_TEXT\r\n\t\t\t\t};\r\n\r\n\t\t\t\tresponse.ask(speechOutput, repromptOutput);\t\r\n\r\n\t\t\t});\r\n\t\t});\t\t\t\t\r\n\r\n\t}\r\n\r\n}", "function getSantasNaughtyList(people, habit) {\n var newarr = []\n for(var i =0;i<students.length;i++){\n for(var j =0;j<students[i].habits.length;j++){\n if (students[i].habits[j]== habit){\n newarr.push(students[i].firstName + \" \" + students[i].lastName)\n }\n }\n }\n return newarr;\n }" ]
[ "0.63743", "0.60571116", "0.5973549", "0.5918051", "0.5905689", "0.5887439", "0.5831493", "0.5788952", "0.57851154", "0.5757927", "0.574433", "0.5693335", "0.55559397", "0.5550836", "0.55329716", "0.55142766", "0.55097264", "0.5503222", "0.548827", "0.54304487", "0.5419017", "0.5405681", "0.54021496", "0.5391632", "0.5385788", "0.53736615", "0.53689927", "0.53617394", "0.53366905", "0.5315114", "0.5295266", "0.5287189", "0.5284997", "0.5276704", "0.526566", "0.52596456", "0.5253967", "0.52475655", "0.5241121", "0.52303773", "0.5225982", "0.5225104", "0.52071464", "0.5206982", "0.5205634", "0.5202768", "0.51971483", "0.5187325", "0.51794255", "0.51760525", "0.5165365", "0.5161907", "0.5161551", "0.515219", "0.5135594", "0.5131595", "0.511578", "0.51156855", "0.5113891", "0.5112909", "0.5112161", "0.51083976", "0.5104065", "0.50936484", "0.5081534", "0.50790524", "0.5076885", "0.5072622", "0.5069587", "0.50610125", "0.5058289", "0.5049721", "0.5047898", "0.5043877", "0.5042132", "0.50392145", "0.5034782", "0.50342554", "0.50296485", "0.5029127", "0.50237614", "0.49928096", "0.4992665", "0.49921182", "0.49882272", "0.4984243", "0.49756333", "0.49736023", "0.49697036", "0.49664986", "0.4964669", "0.49589753", "0.49455783", "0.49427894", "0.49346077", "0.4928727", "0.49265045", "0.4924055", "0.49220097", "0.4921153", "0.4920003" ]
0.0
-1
On clicking to answer a particular student, student is removed from queue and a answer_student signal is emitted to the socket_io server
function answer_student(id) { var parser = document.createElement('a'); parser.href = window.location.href; var ta = parser.pathname.split('/')[2]; socket.emit('remove_student_answer', {net_id: id.id, ta:ta}); socket.emit('answer_student', {"net_id":id.id, "ta": ta}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_queue(id){\n socket.emit('remove_student', {\"net_id\":id.id});\n}", "function confusedStudent (name){\n\t\tsocket.emit('confusion', {\n\t\t\tlectureID: 'RECURSION',\n\t\t\tstudentID: name\n\t\t});\n\t\tconsole.log('I done got clicked.');\n\t}", "function add_queue(id){\n\n socket.emit('add_student', {\"net_id\":id.id});\n}", "function showAnswer(answer) {\n\t\tsocket.broadcast.emit('finish', answer)\n\t\t// console.log(answer)\n\t}", "listen(){\n this.namespace.on('connection', (socket)=>{\n socket.on('teacher start exit', (teacherSocketId, quiz) => {\n this.handleStartQuiz(teacherSocketId, quiz);\n });\n\n socket.on('student submit exit', (sessionId, firstname, answersInfo) =>{\n console.log(\"Student\" + firstname);\n console.log(\"Student responded \" + answersInfo);\n this.handleSubmitExit(sessionId,firstname,answersInfo);\n\n })\n });\n }", "function handleStudent(ev) {\n ev.preventDefault();\n\n try {\n var _ev$target$elements = ev.target.elements,\n name = _ev$target$elements.name,\n age = _ev$target$elements.age,\n studentID = _ev$target$elements.studentID,\n averageGrade = _ev$target$elements.averageGrade;\n name = name.value;\n age = age.valueAsNumber;\n studentID = studentID.valueAsNumber;\n averageGrade = averageGrade.valueAsNumber;\n axios.put(\"/addStudent\", {\n //POST! \n name: name,\n age: age,\n studentID: studentID,\n averageGrade: averageGrade\n }).then(function (_ref) {\n var data = _ref.data;\n console.log(data);\n });\n alert(\"Submitted Succesfuly!\"); //YS: Good\n\n ev.target.reset();\n } catch (e) {\n console.error(e);\n }\n}", "ask(question) { this.io.emit('questionAsked', question); }", "function exitClassroomStudent(id) {\n\t// server-side\n\t// remove client from classroom\n\tvar classroomid = clients[id].classroomid;\n\t// you can only remove the student from the classroom if the classroom exists\n\tif (classroomid && classrooms[classroomid]) {\n\t\tdelete classrooms[classroomid].students[id];\n\t}\n\t\n}", "function handleAnswer() {\r\n\tlet items = document.getElementById('answerList').children;\r\n\tlet answer = \"\";\r\n\t\r\n\tfor (let i = 0; i < items.length; i++) {\r\n\t\tlet radioBut = items[i].firstChild;\r\n\t\tif (radioBut.checked == true) {\r\n\t\t\tanswer = radioBut.value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif (answer.length == 0) {\r\n\t\talert(\"Must choose an answer, please try again.\");\r\n\t}\r\n\telse {\r\n\t\tsocket.emit('toAnswer', answer);\r\n\t}\r\n}", "function removeStudent(e) {\n e.preventDefault();\n // Find if the remove button was clicked\n const currentRow = e.target.parentElement.parentElement;\n const removingID = currentRow.firstChild.textContent;\n if (e.target.className === \"remove\") {\n // AJAX POST to remove the student from database\n $.ajax({\n type: \"delete\",\n url: \"/admin/remove/\" + removingID,\n // data: {id: removingID},\n success: function(response) {\n console.log(\"SUCCESS REMOVING A STUDENT\");\n window.location.href=\"/admin\";\n },\n error: function(response) {\n console.log(\"PROBLEM REMOVING A STUDENT\");\n }\n });\n }\n}", "function deleteStudent(student_id_to_delete) {\n return new Promise(\n (resolve, reject) => {\n $.post(\"/delete_student\", {student_id: student_id_to_delete}, function(data) {\n resolve();\n });\n }\n );\n}", "denyStudent(join_request_param) {\n const { session, updateSession, socket } = this.props;\n const deny = prompt(\n 'Are you sure you want to reject this join request? If so, please enter a reason. If not, please click Cancel.'\n );\n if (deny != null) {\n const join_request = {\n ...join_request_param,\n status: 'rejected',\n tutor_comment: deny\n };\n const requestBody = {\n _id: session._id,\n join_request\n };\n axios\n .post('/api/updateJoinRequest', requestBody)\n .then(response => {\n if (response.data.success) {\n updateSession(\n response.data.session\n );\n socket.emit('tutor-deny', {\n session: response.data.session.eventId,\n reason: deny,\n student_id: join_request.student_id\n });\n } else {\n console.error(response.data.error);\n }\n })\n .catch(err => {\n console.error(err);\n });\n }\n }", "function sendWithQID(Post) {\n console.log(\"----- sendWithQID -----\");\n console.log(\"qId = \" + currentQ);\n//*******************************************************************************************/\n// Build the HTML content to be develivered to subscribers\n//*******************************************************************************************/\n var contents = `<h5 class=\"mb-3\" id=\"currentPrompt\" data-id=\"${currentQ}\">${questionText.val()}</h5>\n <button class=\"btn btn-primary mt-2 mb-2\" id=\"promptB1\" data-id=\"${currentQ}\" value=${questionBtn1.val()}>${questionBtn1.val()}</button><br>\n <button class=\"btn btn-primary mt-2 mb-2\" id=\"promptB2\" data-id=\"${currentQ}\" value=${questionBtn2.val()}>${questionBtn2.val()}</button><br> \n <button class=\"btn btn-primary mt-2 mb-2\" id=\"passButton\" data-id=\"${currentQ}\" value=\"pass\">Pass on Question</button>`;\n//*******************************************************************************************/\n// Send the message contents using socket.io emit function\n//*******************************************************************************************/\n socket.emit(\"prompt\", {\n message: contents\n });\n console.log(\"Message sent to server for distribution.\");\n}", "'click .remove-student'(event, template){\n var newStudents = template.students.get().filter(function(student) {\n return student.username !== event.target.getAttribute('data-id');\n });\n template.students.set(newStudents);\n\t}", "function api_broadcast_quiz(current_quiz_id) {\n socket.emit('update_quiz_view', current_quiz_id);\n // socket.on('serverMessage', (serverResponse) => cb(null, serverResponse));\n}", "function logout(){\n if(conn_id !=null ){\n\n if(sharing_student == conn_id){//this student is being shared, need to notify teacher\n var student ={\n 'people_id':conn_id,\n 'status':'offline',\n 'file':'',\n 'content':''\n }\n\n sendToTeacherClient('!'+JSON.stringify(student))\n sharing_student = null;\n\n } \n \n student_conn.delete(conn_id)\n }\n }", "function onClickRemoveQuestion(){\n let question = $(this).parent().parent();\n let index = $(\".question\").index(question);\n question.remove();\n surveyChanged[\"questions\"].splice(index,1);\n}", "function answerChosen(event){\n let answer = event.target.getAttribute(\"name\");\n if (answer == correctAnswer){\n score += 1047;\n displayCorrectAlert();\n }\n else{\n quizTime -= 10;\n updateTimerDisplay();\n displayIncorrectAlert();\n }\n currentQuestion++;\n if (currentQuestion > 9){\n $answerBlock.removeEventListener(\"click\", answerChosen);\n quizFinishedScreen();\n }\n else {\n displayQuestion(currentQuestion); \n }\n }", "function onDisconnect(socket) {\n QQArtist.findOne({socket:socket.id},function(err,qqartist){\n if (qqartist){\n qqartist.removeAsync()\n qqartist.save(); \n }\n }) \n}", "handleRemoveStudent(e){\n e.preventDefault()\n const editCampusThunk = editStudentCampusThunk(this.state.removeStudentId, null, 'remove');\n store.dispatch(editCampusThunk)\n }", "function questionCorrect(qtype, qid){\n //send report to socket\n socket.emit('questioncorrect');\n \n //send report to server\n $.get(\"/rightanswer/\"+qtype+\"/\"+qid);\n}", "function clickAnswer(item) {\n let data = {};\n // gets random gif\n let imageNumber = Math.floor(Math.random() * (3));\n // sets points, celebration gif, answer state and points\n\n let newPoints = {};\n if (!quizText.answer || quizText.answer.length === 0) {\n //if no answer is set, assume the question is a poll\n newPoints[quizText.order] = quizText.points;\n setCelebration(imageNumber + 4);\n setAnswerState(\"Nice!\");//TODO: have better message\n }\n else if (item === quizText.answer) {\n newPoints[quizText.order] = quizText.points;\n setCelebration(imageNumber + 4);\n setAnswerState(\"Way To Go !!!\");\n // data[firebase.auth().currentUser.uid + \"_\" + studentID] = points.concat(quizText.points * multiplier);\n\n if (multiplier === 1) {\n dispatch({ type: 'incrementby1' });\n } else if (multiplier === 2) {\n dispatch({ type: 'incrementby2' });\n } else if (multiplier === 3) {\n dispatch({ type: 'incrementby3' });\n }\n } else {\n newPoints[quizText.order] = 0;\n setCelebration(imageNumber);\n setAnswerState(\"Sorry That's Not Right\")\n }\n\n\n // store the users answers in the firebase realtime database a an array in a node under\n // gaming/$(stream)/$(username)_$(studentNamae)\n firebase.database().ref(\"gaming/\" + stream.title + \"/\" + firebase.auth().currentUser.uid + \"_\" + studentID).update(newPoints);\n setResponseVisible(true);\n // displays the question for a certain amount of time\n setTimeout(() => {\n setResponseVisible(false)\n }, 5000);\n setDisabled(true);\n setQuizVisible(false);\n }", "function FrontAnswer(){\n let peer = InitPeer(\"notInit\");\n peer.on('signal', (data)=>{\n socket.emit('Answer',data);\n });\n\n peer.signal(offer);\n }", "async storeAnswer() {\n this.isDescriptionVisiable = true;\n this.isQuestionVisiable = false;\n clearInterval(this.countDownTimer);\n this.questionGroup.splice(this.indexByType, 1);\n if (this.questionGroup.length === 0) {\n this.$router.push({ name: \"answer-index\" });\n }\n await this.$store.dispatch(\"storeAnswer\", {\n userChoiceData: this.userChoice,\n userId: this.$store.state.user.id,\n });\n await this.$store.dispatch(\"updateUser\", {\n userId: this.$store.state.user.id,\n });\n }", "function submitSingleAnswer(e){\n\tvar itemId = symptomItems[0].id;\n\n\t// object to be passed to choregraphe\n\tvar symptomListToDiagnose = {};\n\n\t// set the current item id to whichever is pressed\n\tsymptomListToDiagnose[itemId] = $(this).val();\n\n\tsubmitDiagnosisToChoregraphe(symptomListToDiagnose);\n}", "function deleteQuestion(req, res) {\n try {\n var _a = req.params, qUuid = _a.qUuid, uuid = _a.uuid; // qUuid: question uuid; uuid: survey uuid\n var allSurveys = new surveys_1.Surveys();\n var surveyToUpdate = new surveys_1.Survey(allSurveys.surveys[allSurveys.findSurveyIndex(uuid)]);\n //Inside the questions of a specific Survey I will filter the question that I dont want\n var howManyQuestions = surveyToUpdate.deleteQuestion(qUuid);\n var disableAddQuestionBtn = false;\n var disableSubmitSurvey = false;\n if (howManyQuestions > 9)\n disableAddQuestionBtn = true;\n if (howManyQuestions === 0)\n disableSubmitSurvey = true;\n allSurveys.updateSurvey(surveyToUpdate);\n res.send({\n message: \"A question was deleted\",\n survey: surveyToUpdate,\n disableAddQuestionBtn: disableAddQuestionBtn,\n disableSubmitSurvey: disableSubmitSurvey\n });\n }\n catch (error) {\n console.error(error);\n res.status(500).send(error.message);\n }\n}", "function SignalAnswer(answer){\n client.gotAnswer = true\n let peer = client.peer\n peer.signal(answer)\n }", "function onDeleteStudent() {\n 'use strict';\n if (lastCheckedStudent === -1) {\n window.alert(\"Warning: No student selected !\");\n return;\n }\n\n var student = FirebaseStudentsModule.getStudent(lastCheckedStudent);\n txtStudentToDelete.value = student.firstname + ' ' + student.lastname;\n dialogDeleteStudent.showModal();\n }", "handleDeleteEvent( id ){\n\n let response = null\n const { students } = this.props;\n\n if( window.confirm('Are you sure you want to delete this student?') ){\n response = this.props._deleteStudent(id, students)\n if( response )\n this.forceUpdate()\n }\n }", "submitAnswer(buttonKey,buttonName){\n console.log(\"submit answer fired and here is the current state of props from redux for socketroom\", this.props.socketroom)\n \n this.setState({ selectedAnswer: buttonKey});\n \n const { current_quiz_id, quiz_id, question, correct_answer, false_1, false_2, false_3, broadcast_id } = this.props.socketroom.current_quiz\n const myScreenName = this.props.socketroom.myStudentID.screenName;\n const mySessionID = this.props.socketroom.myStudentID.sessionID;\n\n let responseObj = {\n selectedAnswer: buttonKey,\n selectedAnswerText: buttonName,\n response_timestamp: new Date().getTime(),\n broadcast_id: this.props.socketroom.current_quiz.broadcast_id,\n screen_name: myScreenName,\n user_session_id: mySessionID,\n user_id: '',\n stack_id: this.props.socketroom.stack_id,\n quiz_id: quiz_id,\n question: question,\n correct_answer: correct_answer,\n };\n console.log(\"here is the responseObj beign sent to axios in submit answer function \", responseObj)\n axios.post('/api/responses', {responseObj})\n .then( (response) => {\n console.log(\"here is the server response that comes back to submitAnswer\" ,response.data);\n api_emit_my_responses(response.data)\n this.setState({ quizIsVisible: false, chartIsVisible: true })\n })\n}", "function onClickEvent() {\n 'use strict';\n var sender = this.id;\n\n switch (sender) {\n case \"btnCreateStudent\":\n onCreateStudent();\n break;\n case \"btnModifyStudent\":\n onModifyStudent();\n break;\n case \"btnDeleteStudent\":\n onDeleteStudent();\n break;\n case \"btnRefreshStudents\":\n onUpdateStudent();\n break;\n }\n }", "function replyAssignment(e) {\n // firstly we get current person id\n var personId = currentActiveDiscussionId,\n // then we pull text from chat texarea\n messageText = $(chatEventsMainCont).find(simpleMsgInput).val();\n // and get \"send message\" btn\n var currentButton = e.target;\n // then we check whether user entered a text or not\n if (messageText.trim()) {\n // if yes we add progress class to pressed btn\n $(currentButton).addClass(\"in-progress\");\n // and send AJAX request to the server\n $.post('/jobs/' + jobId + '/reply', {\n message: {\n text: messageText,\n person_id: personId\n }\n // if server has successfully receive simple msg text\n }).success(function(response) {\n // we get desctop notification text from response\n var desktopNotification = response.notice;\n // get new event for updating view and mutating main data\n var chatEvent = response.event;\n // get subscriber of this assignment chat\n var chat_subscriber = response.chat_subscriber;\n // and get job from response\n // TODO: What is this job???\n var job = response.job;\n // then we show desctop notification for subscribed user\n websocketsInteractionModule.publish_desktop_notification(desktopNotification);\n // and send him happened event\n websocketsInteractionModule.chat_publisher(chatEvent, job, chat_subscriber);\n // then we mutate our main data\n saveNewData(chatEvent);\n // and remove progress state from send msg btn\n $(currentButton).removeClass(\"in-progress\");\n\n // if we get some error as a response\n }).error(function(response) {\n // we properly show this error to user\n var main_error = response.responseJSON.message;\n if (main_error) {\n showErrorsModule.showMessage([main_error], \"main-error\");\n }\n $(currentButton).removeClass(\"in-progress\");\n });\n\n // if user clicked send msg btn without text in textarea\n } else {\n // we simply make textarea empty\n $(chatEventsMainCont).find(simpleMsgInput).val(\"\");\n };\n }", "function handle_survey(source, id1, id2) {\n chrome.runtime.sendMessage({message: 'Update Similarity Score', article1: id1, article2: id2, src: source})\n //Display thank you for answering the question\n alert(\"Thank you for answering the survey\")\n document.querySelector('body').removeChild(modal)\n }", "function cancelAssignment(e){\n // we make a post request to server by AJAX\n $.post('/jobs/' + jobId + '/cancel', {\n\n // if server successfully hadle received data\n }).success(function(response){\n // we show main sucess message to the user\n showErrorsModule.showMessage(response.message, \"main-success\");\n // remove find interpreter block\n $(findInterListCont).remove();\n // notify people who was declined (all interpreters was declined)\n response.events.map(function(event) {\n websocketsInteractionModule.chat_publisher(event, response.job, event.person_id);\n // TODO: do we need this call after every websocket send???\n saveNewData(event);\n });\n //close modal\n // TODO: which modal we close if we haven't opened any???\n closeChatModal();\n // hide job cancelation btns cont\n $(cancelJobCont).addClass(\"is-hidden\");\n\n // if server handle our data with error\n }).error(function(response){\n // we show error to the user\n var main_error = response.responseJSON.message;\n if (main_error) {\n showErrorsModule.showMessage([main_error], \"main-error\");\n }\n });\n } // end of cancel an assignment handler", "function handleAnswer() {\n console.log('handleAnswer ran')\n $('body').on('submit', '#question-form', (e) => {\n e.preventDefault();\n\n const guess = e.target.options.value\n\n if (guess === store.questions[store.questionNumber].correctAnswer) {\n store.responseCorrect = true;\n store.score += 1;\n }\n else {\n store.responseCorrect = false;\n }\n \n store.view = \"feedback\";\n render();\n\n })\n \n}", "deleteStudentFromServer(id) {\n\t\t// if(this.data[id]){\n\t\t// \tdelete this.createStudent();\n\t\t// \t//return true;\n\t\t// }\n\t\t//return false;\n\n\t\tconsole.log('delete', id);\n\t\tconsole.log(this.data[id].data.id);\n\t\tconsole.log(this.data);\n\n\t\tvar ajaxConfigObject = {\n\t\t\tdataType: 'json',\n\t\t\turl: \"http://s-apis.learningfuze.com/sgt/delete\",\n\t\t\tmethod: \"post\",\n\t\t\tdata: {api_key: \"Ke3qZVF5U2\", \"student_id\": id},\n\n\t\t\tsuccess: this.handleSuccessDeleteStudentToServer,\n\n\t\t\terror: this.handleErrorDeleteStudentToServer,\n\t\t\n\t\t}\n\n\t\t$.ajax(ajaxConfigObject);\n\t\t\t\n\t}", "function submitGroupSingleAnswer(e){\n\tvar itemId = $(this).val();\n\n\t// object to be passed to choregraphe\n\tvar symptomListToDiagnose = {};\n\n\t// set default to absent\n\tsymptomItems.forEach(function(item){\n\t\tsymptomListToDiagnose[item.id] = 'absent';\n\t});\n\n\t// set the id of the pressed button to present\n\tsymptomListToDiagnose[itemId] = 'present';\n\n\tsubmitDiagnosisToChoregraphe(symptomListToDiagnose);\n}", "function updateSurvey(data){\n \n //console.log(' send receive status to server',data);\n data.action_flag = 'update'\n data.submitted = 1\n data.channel = 'ui'\n socket.emit('getsurveylist',data);\n }", "function gotMessage(message, sender, sendResponse) {\t\r\n\tif (message == \"on\") {\t\t\r\n\t\tfor (var i = 0; i < questions.length; ++i) {\r\n\t\t\t// adds hidden attribute to question node\r\n\t\t\tquestions[i].setAttribute(\"hidden\", false);\r\n\t\t\t\r\n\t\t\t// displays or hides answers when question clicked\r\n\t\t\tquestions[i].addEventListener(\"click\", display_function);\r\n\t\t\t\r\n\t\t\t// hides answers\r\n\t\t\thide_answers(questions[i], true);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tfor (var i = 0; i < questions.length; ++i) {\r\n\t\t\t// removes hidden attribute to question node\r\n\t\t\tquestions[i].removeAttribute(\"hidden\");\r\n\t\t\t\r\n\t\t\t// disables the displaying or hiding of answers when question clicked\r\n\t\t\tquestions[i].removeEventListener(\"click\", display_function);\r\n\t\t\t\r\n\t\t\t// shows answers\r\n\t\t\thide_answers(questions[i], false);\r\n\t\t}\t\r\n\t}\r\n}", "function dellStudent() {\n if (!confirm(\"Вы уверены?\"))\n return;\n var student = window.event.currentTarget;\n var studentId = student.id;\n student = student.parentElement;\n student = student.parentElement;\n\n var rootUrl = location.host;\n var url = location.protocol + \"//\" + rootUrl + \"/Admin/DellStudent\";\n\n jQuery.ajax({\n url: url,\n type: \"POST\",\n data: { studentId: studentId },\n success: function () {\n student.remove();\n }\n });\n}", "function removeHold(student) {\n let resultStudent = student\n resultStudent.student_hold = 0\n // modifies the student object by posting new object to server\n axios.post(props.url + \"/modify\", resultStudent).then((response) => {\n window.location.reload()\n });\n }", "function handleNextQuestion() {\n $('main').on('click', '.js-continue-button', (event) => {\n store.answer = '',\n renderQuizScreen();\n });\n}", "function questionWrong(qtype, qid){\n socket.emit('questionwrong');\n $.get(\"/wronganswer/\"+qtype+\"/\"+qid);\n}", "finishQuestion() {\n this.stoptimer();\n this.allowAnwsers = false;\n this.scorePlayers();\n //show results\n this.generateRoundup().then((state) => {\n this.masters.forEach((socket) => {\n socket.emit('roundup', state);\n });\n });\n\n //nextquestion\n if (this.timer === null) {\n this.timer = setTimeout(() => {\n this.nextQuestion();\n }, 10 * 1000); //after 10s\n }\n }", "submitAnswer(answer) {\n sendAjax(\n 'GET',\n `/getIsAnswerText?question=${this.props.index}&answer=${answer}`,\n { _csrf: this.props.csrf, }\n ).then((data) => {\n // Handles if the answer is correct or not.\n data.isCorrect ? this.props.onCorrectAnswer() : this.props.onWrongAnswer();\n });\n }", "function sendAnswer(optionNumber) {\n removeOnclickEventsOptions();\n var task = new Task(\"checkAnswer\");\n task.match_id = match.id;\n task.user_id = user.id;\n task.question_id = match.lastQuestionId;\n task.userAnswer = optionNumber;\n var jsonStringTask = JSON.stringify(task);\n webSocket.send(jsonStringTask);\n}", "function handleEndQuiz() {\n $('main').on('click', '.js-end-button', (event) => {\n store.score = 0;\n store.questionNumber = 0;\n store.quizStarted = false;\n renderQuizScreen();\n });\n}", "deletestudent(id){\n\n // const currentEnrollStudent = localStorage.getItem('currentEnrollStudent')\n axios({\n method : \"post\",\n url : \"http://localhost:5000/enroll/deleteStudent\",\n data:{\n _id : id\n }\n }).then((response) => {\n axios({\n method : \"get\",\n url : \"http://localhost:5000/enroll/getStudents\",\n }).then((response) => {\n console.log(response.data)\n this.setState({students:response.data})\n })\n\n })\n}", "saveQuestion(e) {\n\t\tlet formData = new FormData();\n\t\tformData.append('username', this.username);\n\t\tformData.append('test_id', this.test_id);\n\t\tformData.append('test_key', `${this.username}_${this.test_key}`);\n\t\tformData.append('question_id', this.question_id);\n\t\tformData.append('answer', this.answer);\n\n\t\tif(this.answer === undefined) {\n\t\t\tconsole.log('not selected');\n\t\t\te.preventDefault();\n\t\t\tthis.answerWarning.classList.add('warning');\n\t\t} else {\n\t\t\tthis.nextQuestion.style.display = 'none';\n\t\t\tthis.waitBtn.style.display = 'inline';\n\t\t\tfetch('inc/handlers/save_question_handler.php', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData\n\t\t\t});\n\t\t}\n\t}", "function submitQuestion() {\n\n $('body').on('click', '#answer-button', function (event) {\n event.preventDefault();\n let selectAns = $('input[name=answer]:checked', '.js-quiz-form').val();\n\n //If no answer is selected, prompt User\n if (!selectAns) {\n // console.log('selection is required');\n selectionRequired(selectAns);\n } else if (currentInd < 10) {\n answerChoice(selectAns);\n loadQuestion();\n }\n //After all questions have been asked, Final Score Page is loaded\n else {\n answerChoice(selectAns);\n if (currentScore === 10) {\n $('.close').click((event) => perfectScore())\n }\n finalScorePage();\n // console.log('Current index is higher than 10');\n }\n })\n\n let selectAns = ``;\n}", "async function showPeerEnableVote2() {\n // Log the justification from this student\n let mess = document.getElementById(\"messageText\").value;\n\n await logPeerEvent({\n sid: eBookConfig.username,\n div_id: currentQuestion,\n event: \"sendmessage\",\n act: `to:system:${mess}`,\n course: eBookConfig.course,\n });\n\n // send a request to get a peer response and display it.\n let data = {\n div_id: currentQuestion,\n course: eBookConfig.course,\n };\n let jsheaders = new Headers({\n \"Content-type\": \"application/json; charset=utf-8\",\n Accept: \"application/json\",\n });\n let request = new Request(\"/runestone/peer/get_async_explainer\", {\n method: \"POST\",\n headers: jsheaders,\n body: JSON.stringify(data),\n });\n let resp = await fetch(request);\n if (!resp.ok) {\n alert(`Error getting a justification ${resp.statusText}`);\n }\n let spec = await resp.json();\n let peerMess = spec.mess;\n let peerNameEl = document.getElementById(\"peerName\");\n // iterate over responses\n let res = \"\";\n for (let response in spec.responses) {\n res += `User ${response} answered ${answerToString(\n spec.responses[response]\n )} <br />`;\n }\n //peerNameEl.innerHTML = `User ${spec.user} answered ${answerToString(spec.answer)}`;\n peerNameEl.innerHTML = res;\n let peerEl = document.getElementById(\"peerJust\");\n peerEl.innerHTML = peerMess;\n let nextStep = document.getElementById(\"nextStep\");\n nextStep.innerHTML =\n \"Please Answer the question again. Even if you do not wish to change your answer. After answering click the button to go on to the next question.\";\n $(\".runestone [type=radio]\").prop(\"checked\", false);\n $(\".runestone [type=checkbox]\").prop(\"checked\", false);\n studentVoteCount += 1;\n studentSubmittedVote2 = false;\n let checkme = document.querySelector(\".runestone button\");\n if (checkme.innerHTML === \"Check Me\") {\n checkme.addEventListener(\"click\", function (event) {\n studentSubmittedVote2 = true;\n });\n }\n}", "function handleSubmit(event) {\n event.preventDefault();\n\n // check if input matches that of a random question\n // if yes, increment the number of random questions asked\n if (randomQuestions.includes(inputValue)) {\n setRandomQuestionsAsked(randomQuestionsAsked + 1);\n }\n\n // sends message via socket\n sendMessage(inputValue);\n\n setInputValue('');\n }", "function handleQuiz() {\n startQuiz();\n handleAnswers();\n nextQuestion();\n restartQuiz();\n}", "function sendEvent(message){\n socket.emit('chat', {\n student: student.name,\n message: message\n });\n}", "function _submitAnswer() {\n // checks if answer is correct\n if (vm.answerSelected == vm.questionSelected.Correct) {\n toastr.success(\"Correct!\");\n // add +1 to correct\n vm.answerScore.Correct++;\n } else {\n toastr.error(\"Wrong!\");\n // add +1 to incorrect\n vm.answerScore.Incorrect++;\n }\n // waits then runs _next question \n setTimeout(_nextQuestion, 1000);\n }", "function saveQuestion(){\n rightPane.innerHTML = templates.renderQuestionForm();\n var questionForm = document.getElementById(\"question-form\");\n questionForm.addEventListener('click', function(event){\n event.preventDefault();\n var target = event.target;\n var submit = document.querySelector(\"input.btn\");\n if (target === submit){\n var textArea = questionForm.querySelector('textarea').value;\n var nameInput = questionForm.querySelector('input[type=\"text\"]').value;\n var newEntry = {\n subject: nameInput, \n question: textArea,\n id: Math.random(),\n responses: []\n }\n var oldList = getStoredQuestions();\n oldList.push(newEntry);\n storeQuestions(oldList);\n var questionHtml = templates.renderQuestion({ \n questions: getStoredQuestions()\n });\n leftPane.innerHTML = questionHtml;\n questionForm.querySelector('textarea').value = \"\";\n questionForm.querySelector('input[type=\"text\"]').value = \"\"; \n addListeners();\n }\n });\n }", "function submitQuestionHandler(e) {\n e.preventDefault();\n\n let category = selectCategoryEl.value;\n let dropdown = selectQuestionEl.value;\n let question = removeEnter(e.target.question.value);\n let answer = removeEnter(e.target.answer.value);\n //if new question, add to array of questions, else edit selected\n if(dropdown === 'Add New' && category !== 'All Categories') {\n new Question(question, answer, category);\n console.log('new question submitted!');\n store('questionsKey', allQuestions);\n resetFormValues();\n populateForm();\n } else {\n if(questionFound) {\n allQuestions[questionFoundIndex].question = question;\n allQuestions[questionFoundIndex].answer = answer;\n console.log('question successfully edited');\n selectQuestionEl.value = 'Add New';\n store('questionsKey', allQuestions);\n resetFormValues();\n populateForm();\n }\n }\n\n if(showCards) {\n showAllCards();\n }\n}", "function deleteStudent(id) {\n axios.delete(`http://localhost:3456/users/${id}`)\n .then(() => {\n getStudentList();\n });\n }", "function answerClick(evt){\n if (evt.target.className == 'question' || \n evt.target.tagName == 'SECTION' ||\n evt.target.textContent == \"\" ||\n playerLost) {return;}\n pickedAnswer = evt.target.className;\n render();\n setTimeout(checkAnswer, 1500);\n}", "sendClick (x, y, page, selectedAnimal) {\n const data = {x, y, page, selectedAnimal}\n console.log(`sendClick ${data}`)\n this.socket.emit('studentClick', data)\n }", "function get_ta_queue(data){\n\n\n var parser = document.createElement('a');\n parser.href = window.location.href;\n var ta_net_id = parser.pathname.split('/')[2];\n var mydiv = document.getElementById('ta_queue');\n\n // Updates the Queue with students\n if (Object.keys(data).length > 0 ){\n var html_data = \"<h5>Queue</h5><br>\";\n var parser = document.createElement('a');\n parser.href = window.location.href;\n var ta = parser.pathname.split('/')[2];\n for (var i = 0; i< Object.keys(data).length; i++) {\n if(data[i]['ta'] == ta) {\n var student_net_id = data[i][\"student\"];\n html_data = html_data.concat('<blockquote style = \"float:left;\"><a class=\"waves-effect waves-light btn blue darken-4\" onclick = \\\"answer_student(this);\\\" id = \\\"');\n html_data = html_data.concat(student_net_id);\n html_data = html_data.concat('\\\">Answer</a><text style = \"font-size:18px; margin-left:15px;\">');\n html_data = html_data.concat(student_net_id);\n html_data = html_data.concat('</text></blockquote><br><br>');\n }\n }\n // Updates HTML Div\n $(mydiv).html(\"\");\n $(mydiv).html(html_data);\n }\n else{\n $(mydiv).html(\"\");\n\n }\n\n}", "function handleAnswer(agent) {\n const question_ctx = getPreviousQuestionCtx(agent);\n const labels = QUESTION_ANSWER_LABEL_MAP[question_ctx][agent.intent];\n labels.forEach(label => addLabelToContext(agent, label));\n const next_question_ctx = getNextQuestionCtx(agent);\n agent.context.delete(question_ctx);\n agent.context.set(next_question_ctx, 5);\n\n agent.setFollowupEvent('trigger-question');\n addDummyPayload(agent);\n}", "function removeStudent(studentId) {\n StudentsModel.deleteStudent(studentId);\n loadStudents();\n }", "function handleAnswerSubmitted() {\n $('main').on('submit', '#js-answer-form', (event) => {\n event.preventDefault();\n store.answer = $('input[name=\"answer\"]:checked').val();\n renderQuizScreen();\n });\n}", "function ansClick(e) {\n if(qIndex >= (questions.length - 1)) {\n postScore();\n } else {\n var currentQuestion = questions[qIndex];\n var ansClick = e.target.textContent;\n if(ansClick.toLowerCase() === currentQuestion.answer.toLowerCase()) {\n currentScore+= 5;\n } else {\n time -= 10;\n currentScore -= 5;\n }\n qIndex++;\n getQuestion();\n };\n}", "approveStudent(join_request_param) {\n const { session, updateSession, socket } = this.props;\n const join_request = { ...join_request_param, status: 'approved' };\n const requestBody = {\n _id: session._id,\n join_request\n };\n axios\n .post('/api/updateJoinRequest', requestBody)\n .then(response => {\n if (response.data.success) {\n updateSession(\n response.data.session\n );\n socket.emit('tutor-approve', {\n session: response.data.session.eventId,\n student_id: join_request.student_id\n });\n } else {\n console.error(response.data.error);\n }\n })\n .catch(err => {\n console.error(err);\n });\n }", "function deleteAnswerAddEvent(button){\n button.addEventListener('click', async e => {\n e.preventDefault();\n const answerId = e.currentTarget.dataset.answerid;\n \n\n const response = await fetch(`/answers/${answerId}`, {\n method: \"DELETE\",\n });\n\n const result = await response.json()\n const answer = document.querySelector(`div[answerid='${answerId}']`);\n answer.remove();\n \n return result;\n })\n \n}", "handleAnswerSelected(event) {\n console.log(event.currentTarget.value);\n if (this.state.questionId < this.state.quizQuestions.length) {\n setTimeout(() => this.setNextQuestion(), 300);\n } else {\n setTimeout(() => this.setResults(), 300);\n }\n }", "submitQuiz(event) {\n event.preventDefault();\n\n //Get user answer\n const userAnswer = document.getElementById(\"question-form\")[\"question-form\"].value;\n //Modify userAnswers object\n let userAnswers = this.state.userAnswers;\n userAnswers[this.state.currentQuestion] = userAnswer;\n\n //Run scoring\n this.scoreQuiz();\n }", "function handleQuestions() {\r\n $('body').on('click','#next-question', (event) => {\r\n STORE.currentQuestion === STORE.questions.length?displayResults() : renderAQuestion();\r\n });\r\n }", "function selectAnswer(e) {\n const selectedButton = e.target\n const correct = selectedButton.dataset.correct\n setStatusClass(document.body, correct)\n// if user answered correctly it will increase in score\n if (selectedButton.dataset = correct) {\n userScore++;\n keepingScore.innerText = 'score = ' + userScore\n}\n// else reduce timer with 5 sec\n else {\n timer = timer -5\n }\n// show the next question in the quiz list\ncurrentQuestionIndex++\n setNextQuestion()\n}", "function answerClick(event) {\n clearInterval(perQuestionInterval);\n clearInterval(feedbackInterval); // get rid of any outstanding intervals\n var elem = event.target;\n if (elem.matches(\"li\")) {\n if (elem.getAttribute(\"choice\") === questionsArray[questionCounter].answer) {\n //answerResult.textContent = \"Correct!\";\n showFeedback(\"Correct!\");\n if (perQuestionTimer >= 5) {\n playerScore += 20; // 20 points for answering correct within 10 seconds\n } else {\n playerScore += 5; // 5 points for answering correct but taking longer than 10 seconds\n }\n } else {\n // write incorrect and move on\n time = time - 15;\n\n showFeedback(\"Wrong!\");\n //answerResult.textContent = \"Wrong\";\n }\n questionCounter++;\n removeAllChildren(answerList);\n renderQuestion(questionCounter);\n }\n}", "function onclickSocket() {\n input_text = input.value\n socket.emit('frontend message', {data: input_text})\n /*\n console.log('hhhhh');\n shell.end(function (err, code, signal) {\n if (err) throw err;\n console.log('exit code: ', code);\n console.log('signal: ', signal);\n console.log('finished');\n });\n console.log('fffffin');\n */\n}", "function handleAnswer() {\n\t\tif(correctAnswer != null) {\n\t\t\ttimeSinceSelection--;\n\t\t\tif(timeSinceSelection <= 0) {\n\t\t\t\tcorrectAnswer = null;\n\t\t\t\tfor(var i in lanes) {\n\t\t\t\t\tlanes[i].reset();\n\t\t\t\t}\n\t\t\t\tgenerateNewQuestion();\n\t\t\t}\n\t\t}\n\t}", "removePerson(socketId) {\n /* Check patient from patient queue */\n const patientIndex = this.patientsQueue\n .getCollection()\n .findIndex((entry) => entry.socketid === socketId);\n /* Remove disconnected person from queue */\n if (patientIndex >= 0) {\n this.patientsQueue.getCollection().splice(patientIndex, 1);\n return;\n }\n /* Check counselor queue */\n const counselorIndex = this.patientsQueue\n .getCollection()\n .findIndex((entry) => entry.socketid === socketId);\n /* Remove disconnected person from queue */\n if (counselorIndex >= 0) {\n this.patientsQueue.getCollection().splice(counselorIndex, 1);\n return;\n }\n }", "function displayScore() {\n let socket = io.connect('http://localhost:3000');\n let score = $('<p>',{id: 'question'});\n\n let numCorrect = 0;\n for (let i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n\n score.append('You got ' + numCorrect + ' questions out of ' +\n questions.length + ' right!!!');\n\n\n socket.emit('send score', {id: currentUser, score: numCorrect});\n console.log('score sent');\n return score;\n }", "function handleAnswerClick(clickedAnswer) {\n clearInterval(timer);\n blurMoviePoster(0);\n\n if (answerSelected) {\n return;\n }\n\n //the tmpMovie is always assigned a class of 'correct'\n $(\".selections\").find(`li:contains(\"${movie.title}\")`).addClass(\"correct\");\n\n if(clickedAnswer === movie.title) {\n handleCorrectAnswer();\n } else {\n handleIncorrectAnswer(clickedAnswer);\n }\n\n answerSelected = true;\n\n //as long as score is not equivalent to 10 or strikes are not equivalent to 3, button reads 'next question'\n if (strikes !== 3 && score !== 10) {\n $('#start-btn').text('NEXT QUESTION');\n }\n}", "function handleClick() {\n console.log('clicked');\n\n let randomAnswer = answers[getRandom(answers.length)];\n // setAnswer(answers[randomIdx].msg); //\n // setColor(answers[randomIdx].color);\n setResp({msg: randomAnswer.msg, color: randomAnswer.color});\n }", "function removeStudent(studentId = null)\r\n{\r\n\tif(studentId) {\r\n\t\t$(\"#removeStudentBtn\").unbind('click').bind('click', function() {\r\n\t\t\t$.ajax({\r\n\t\t\t\turl: 'student/remove/'+studentId,\r\n\t\t\t\ttype: 'post',\r\n\t\t\t\tdataType: 'json',\r\n\t\t\t\tsuccess:function(response) {\r\n\t\t\t\t\tif(response.success == true) {\r\n\t\t\t\t\t\t$(\"#messages\").html('<div class=\"alert alert-success alert-dismissible\" role=\"alert\">'+\r\n\t\t\t\t\t\t \t'<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\r\n\t\t\t\t\t\t \tresponse.messages + \r\n\t\t\t\t\t\t'</div>');\r\n\r\n\t\t\t\t\t\tmanageStudentTable.ajax.reload(null, false);\r\n\r\n\t\t\t\t\t\t// refresh the section table \r\n\t\t\t\t\t\t$.each(studentSectionTable, function(index, value) {\r\n\t\t\t\t\t\t\tstudentSectionTable[index].ajax.reload(null, false);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t$(\"#removeStudentModal\").modal('hide');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$(\"#messages\").html('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">'+\r\n\t\t\t\t\t\t \t'<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\r\n\t\t\t\t\t\t \tresponse.messages + \r\n\t\t\t\t\t\t'</div>');\r\n\t\t\t\t\t}\r\n\t\t\t\t} // /success\r\n\t\t\t}); // /ajax\r\n\t\t}); // /remove student btn clicked\r\n\t} // /if\r\n}", "function removeEmployee(){\n // using inquirer to ask the user which employee they would like to delete\n inquirer.prompt([\n {\n name: \"firstName\",\n type: \"input\",\n message: \"What is the employee's first name that you would like to delete?\"\n },\n {\n name: \"lastName\",\n type: \"input\",\n message: \"What is the employee's last name that you would like to delete?\"\n },\n ]).then(answers => {\n // adding the mysql syntax to actually delete the identified employee from the database\n connection.query(\"DELETE FROM employee WHERE first_name = ? and last_name = ?\", [answers.firstName, answers.lastName], function (err) {\n console.log(err);\n\n console.log(`\\n ${answers.firstName} ${answers.lastName} has been deleted from the database! \\n`)\n startQuestions();\n })\n\n });\n}", "getAnswer(question) {\n var _this = this;\n this.question = question;\n this.feedbackGiven = false;\n fetch(`${this.config.serverUrl}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ \"query\": question, \"session_id\": this.session_id })\n })\n .then(res => res.json())\n .then(data => {\n console.info(\"Success::\", data);\n this.addMessage(data.reply, false);\n this.input_question = data.input_question;\n this.intent = data.intent;\n this.summ_answer = data.summ_answer;\n this.state = data.state;\n this.detail_answer = data.detail_answer;\n this.chatMessageContainer.appendChild(this.feedbackContainer);\n this.loadingIcon.remove();\n })\n .catch(error => {\n console.error(\"Failed to get response\", error);\n this.loadingIcon.remove();\n });\n }", "handleqtty(qtty ,event){\n console.log ('event del qtty ' + qtty)\n /*var qtty = 1\n if (event.target.id == '-'){\n qtty = 0\n }*/\n this.props.changeQtty(this.props.indice ,qtty)\n }", "function deleteRequestFriend(data, socket) {\n for (var i = 0; i < thongTinNguoiDung.length; i++) {\n if (thongTinNguoiDung[i].name === data.myName) {\n var array = thongTinNguoiDung[i].arrayFriendRequest;\n for (let index = 0; index < array.length; index++) {\n const element = array[index];\n if (element.data.user === data.friendName) {\n array.splice(index, 1);\n socket.emit(\n \"notify-request-friend\",\n thongTinNguoiDung[i].arrayFriendRequest\n );\n var addFriendAccept = getUser(data.friendName).arrayNotify;\n addFriendAccept.push({\n data: data,\n status: false,\n mess: \"Đã từ chối lời mời kết bạn\",\n });\n io.to(getIdUser(data.friendName)).emit(\n \"reject-request-friend\",\n addFriendAccept\n );\n return;\n }\n }\n }\n }\n}", "function squadAutoRemove(student) {\n document.querySelector(\n `#${student.firstname}_${student.house}`\n ).checked = false;\n\n let indexFound = findInSquad(student.firstname);\n if (indexFound > -1) {\n squadList.splice(indexFound, 1);\n console.log(squadList);\n }\n}", "function handleQuiz (){\n renderQuiz();\n handleBeginQuizSubmit();\n handleSubmitAnswer();\n handleNextQuestionSubmit();\n handleRestartQuizSubmit();\n handleSeeResultsSubmit();\n}", "function submitAnswer() {\n $(\"form\").on('submit', function(event) {\n alert('hello world');\n console.log('hello world');\n event.preventDefault();\n let selected = $(\"input[name=answer]:checked\").val();\n console.log(selected);\n $(this).closest(\".question\").remove();\n //note: needs to be able to not submit unless something checked\n giveFeedback(selected); \n }); \n}", "function handleDisconnect() {\r\n console.log(\"disconect received\", { socket });\r\n // Find corressponding object in usersArray\r\n const [user, index] = findUserObject(socket);\r\n\r\n // Emit to room\r\n io.to(user.room).emit(\"userLeave\", {\r\n name: user.name,\r\n });\r\n\r\n // Remove user object\r\n removeUserObject(socket);\r\n }", "function callPendingSurvey()\n {\n var userInfo = getUserInfo(false);\n userInfo.initial_flag = 1;\n userInfo.channel = 'ui';\n userInfo.uid = userInfo.emp_id;\n userInfo.context_type = 'all';\n socket.emit('getsurveylist',userInfo);\n }", "function selectAnswer(e){\n var selectedAnswerButton = e.target;\n var correctAnswer = selectedAnswerButton.dataset.correct;\n console.log(correctAnswer)\n showResult (correctAnswer);\n if (shuffledQuestions.length > questionIndex + 1) {\n nextButton.classList.remove('hide');\n } \n else {\n questionContainer.classList.add('hide');\n finalPage.classList.remove('hide');\n clearInterval(timeInterval);\n userScore.textContent = secondsLeft + \"!\"\n }\n \n}", "function manageStudent(event) {\n const action = event.target.id || null;\n if(!action) return;\n showPopup({\n head: `${action} student`,\n type: action,\n data: event.path[1].className,\n func: `${action}Student`\n })\n}", "function handleSubmitAnswer() {\n $('main').on('click' , '.submit-answer', (event) => {\n event.preventDefault();\n checkCorrectAnswer();\n renderQuiz();\n });\n}", "onAnswer(data) {\n console.log(\"onAnswer\")\n var self = this;\n var peer = self._peers[data.trackingNumber];\n // If there's no peer for this, return because you can't answer without offer\n if (!peer) {\n return;\n }\n // Update id. If this peer didn't already have an id, give it metadata\n if(peer.id) {\n peer.id = data.id\n } else {\n peer.id = data.id;\n peer.metadata = data.metadata;\n self.emit('peer', peer);\n }\n\n peer.signal(data.signal);\n }", "onClickUser(user){\n const eventId = this.props.match.params.eventId;\n const userId = user.id;\n\n axios\n \t.delete(`http://localhost:8080events/${eventId}/user/${userId}?auth_token=${this.props.user.token}`)\n .then(response => {\n this.setState({ submitted: true })\n })\n }", "function submitAnswer() {\n $('#question').on('click', '#subAns', function (event) {\n event.preventDefault();\n let selectedVal = $('input:checked');\n let answer = selectedVal.val();\n let correctSelect = STORE[qid].correctAnswer;\n if (answer === correctSelect) {\n $('#question').hide();\n $('#answer').show();\n correctAns();\n } else {\n $('#question').hide();\n $('#answer').show();\n incorrectAns();\n }\n });\n}", "submitAnswer() {\n // console.log('Answer submitted', data.target.value);\n // var answer = this.pickAnswer();\n var that = this;\n var option = {\n id: this.state.question.id,\n answer: this.state.answer,\n user: this.state.user\n }\n // console.log('option', option);\n $.ajax({\n method: 'POST',\n url: '/api/answer',\n data: option,\n success: function(data) {\n that.setState({answerCorrect: data.correct});\n if (data.correct) {\n that.setStatus('coding');\n }\n // console.log('Successfully posted');\n }\n });\n this.toggleModal();\n this.getQuestion(); // Will fetch the next question\n }", "function bindFollowRequestRejectClick () {\n\tsocket.emit(\"C2SrejectFollowRequest\", {requestRejectedFor: $(this).data(\"followRequestName\"), requestRejectedBy: userProfile.punName});\n\t$(this).closest(\"tr\").remove();\n\t$(\"#followRequestsCount\").text(Number($(\"#followRequestsCount\").text())-1);\n}", "function removeQuestion() {\r\n console.log(\"Removing question\");\r\n $.when(\r\n $(this)\r\n .parent()\r\n .parent()\r\n .remove()\r\n ).then(function() {\r\n // re-ID questions\r\n $(\"#builderQuizQuestions\")\r\n .children()\r\n .each(function(i) {\r\n // Store form inputs!\r\n let data = [];\r\n $(this)\r\n .find(\"input\")\r\n .each(function(j) {\r\n //console.log($(this).val());\r\n data.push($(this).val());\r\n });\r\n\r\n // Update question IDs\r\n let html = $(this).html();\r\n let split = html.split(\"_\");\r\n for (var j = 1; j < split.length; j++) {\r\n // update Question_id\r\n //console.log(split[j - 1]);\r\n //console.log(typeof split[j - 1]);\r\n if (\r\n typeof split[j - 1] === \"string\" &&\r\n split[j - 1].substr(-1 * \"Question\".length) == \"Question\"\r\n ) {\r\n split[j] = i;\r\n }\r\n }\r\n let joined = split.join(\"_\");\r\n //console.log(joined);\r\n split = joined.split(\" \");\r\n for (var j = 1; j < split.length; j++) {\r\n // update Question_id\r\n //console.log(split[j - 1]);\r\n //console.log(typeof split[j - 1]);\r\n if (\r\n typeof split[j - 1] === \"string\" &&\r\n split[j - 1].substr(-1 * \"Question\".length) == \"Question\" &&\r\n typeof split[j] === \"string\" &&\r\n split[j].substr(-1) == \":\"\r\n ) {\r\n split[j] = `${i + 1}:`;\r\n }\r\n }\r\n joined = split.join(\" \");\r\n $(this).html(joined);\r\n $(this).attr(\"id\", i);\r\n\r\n // restore data\r\n $(this)\r\n .find(\"input\")\r\n .each(function(j) {\r\n $(this).val(data[j]);\r\n });\r\n });\r\n refreshAll();\r\n });\r\n}", "function deleteSurvey(req, res) {\n try {\n var uuid = req.params.uuid;\n var allSurveys = new surveys_1.Surveys();\n allSurveys.deleteSurvey(uuid);\n res.send({ message: \"The survey was deleted\", userDetails: req.email });\n }\n catch (error) {\n console.error(error);\n res.status(500).send(error.message);\n }\n}", "function submit(userAnswer)\n\t{\n\t\tif(userAnswer==correctAnswer)\n\t\t{\n\t\t\tparent.PlaySound('clicked0.wav');\n\t\t\tparent.GetWorldEvent(\"Correct\");\n\t\t}\n\t\telse{\n\t\tparent.PlaySound('incorrect0.wav');\n\t\tparent.GetWorldEvent(\"Incorrect\");\n\t\t}\n\t\tLock();\n\t\t//$('.but').attr(\"disabled\", true);\n\t\t\n\t\t if(userAnswer==\"A\")\n\t\t {\n\t\t\t$(\"#answer1\").css({ \"background-color\":\"#ffff3a\"});\n\t\t\t$(\"#answer1\").css({ \"color\":\"black\"});\n\t\t }else if(userAnswer==\"B\")\n\t\t {\n\t\t\t$(\"#answer2\").css({\"background-color\":\"#ffff3a\"});\n\t\t\t$(\"#answer1\").css({ \"color\":\"black\"});\n\t\t }else if(userAnswer==\"C\")\n\t\t {\n\t\t\t$(\"#answer3\").css({ \"background-color\":\"#ffff3a\"});\n\t\t\t$(\"#answer1\").css({ \"color\":\"black\"});\n\t\t }\n\t}", "function DeleteQuestion(){\n\tvar id = Q[flag - 1][9];\n\tSimpleAjax(\"del_question.php\",\"POST\",\"username=\" + login + \"&id=\" + id,onSuccess,onFailure);\n\talert(\"Submitted successfully!\");\n}" ]
[ "0.67255735", "0.61885655", "0.59951884", "0.5993209", "0.5807907", "0.5644999", "0.56057674", "0.55827785", "0.5540802", "0.5437159", "0.53528893", "0.5333017", "0.53039205", "0.5303282", "0.53011197", "0.52789617", "0.52638525", "0.5257674", "0.524586", "0.52416897", "0.52187204", "0.5218542", "0.5212373", "0.5209073", "0.5207087", "0.520528", "0.52041596", "0.5200413", "0.51921195", "0.51845336", "0.51770705", "0.5176489", "0.5153947", "0.5146717", "0.5135505", "0.51345545", "0.51321405", "0.51251245", "0.510442", "0.5101257", "0.5100737", "0.50983673", "0.5077191", "0.5074636", "0.5074274", "0.5071948", "0.50537777", "0.50496966", "0.5049468", "0.50456536", "0.5029343", "0.50250334", "0.50243044", "0.50239563", "0.50151706", "0.5012176", "0.49977174", "0.49872604", "0.49691424", "0.4966042", "0.49602678", "0.49524856", "0.49524707", "0.4951718", "0.49501547", "0.49379322", "0.49295187", "0.49254364", "0.49199384", "0.49162263", "0.48972905", "0.4894084", "0.48938522", "0.48897067", "0.48880813", "0.4885473", "0.48830214", "0.48735386", "0.4870386", "0.48695815", "0.4864962", "0.4858203", "0.4855175", "0.48447463", "0.4843931", "0.48418194", "0.48356396", "0.48307765", "0.4827647", "0.48261163", "0.48242342", "0.4823379", "0.48223093", "0.48219565", "0.48219413", "0.48165205", "0.48117876", "0.48111695", "0.48092407", "0.48049304" ]
0.63670987
1
bencoding functions translated from original Bram's bencode.py
function python_int(s) { var n = parseInt(s,10); if (isNaN(n)) { throw Error('ValueError'); } return n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encodeB(string, startCode) {\n\t\tvar result = \"\";\n\t\tvar sum = 0;\n\n\t\tfor (var i = 0, j = string.length; i < j; i++) {\n\t\t\tresult += encodingByChar(string[i]);\n\t\t\tsum += weightByCharacter(string[i]) * (i + 1);\n\t\t}\n\t\treturn {\n\t\t\tresult: result,\n\t\t\tchecksum: (sum + startCode) % 103\n\t\t}\n\t}", "function _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n return forge.util.hexToBytes(hex);\n}", "function _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n return forge.util.hexToBytes(hex);\n}", "function rstr2binb(input){\r\n var output=Array(input.length >> 2);\r\n for(var i=0;i<output.length;i++) output[i]=0;\r\n for(var i=0;i<input.length*8;i +=8) output[i>>5] |= (input.charCodeAt(i/8) & 0xFF) << (24-i%32);\r\n return output;\r\n}", "function rstr2binb(input) {\n\t var i, l = input.length * 8,\n\t output = Array(input.length >> 2),\n\t lo = output.length;\n\t for (i = 0; i < lo; i += 1) {\n\t output[i] = 0;\n\t }\n\t for (i = 0; i < l; i += 8) {\n\t output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);\n\t }\n\t return output;\n\t }", "function rstr2binb(input) {\n var output = Array(input.length >> 2);\n for (var i = 0; i < output.length; i++) {\n output[i] = 0;\n }for (var i = 0; i < input.length * 8; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << 24 - i % 32;\n }return output;\n}", "function rstr2binb(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);\n return output;\n}", "function _bnToBytes(b) {\n\t // prepend 0x00 if first byte >= 0x80\n\t var hex = b.toString(16);\n\t if(hex[0] >= '8') {\n\t hex = '00' + hex;\n\t }\n\t var bytes = forge.util.hexToBytes(hex);\n\n\t // ensure integer is minimally-encoded\n\t if(bytes.length > 1 &&\n\t // leading 0x00 for positive integer\n\t ((bytes.charCodeAt(0) === 0 &&\n\t (bytes.charCodeAt(1) & 0x80) === 0) ||\n\t // leading 0xFF for negative integer\n\t (bytes.charCodeAt(0) === 0xFF &&\n\t (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n\t return bytes.substr(1);\n\t }\n\t return bytes;\n\t}", "function rstr2binb(input) {\r\n var output = Array(input.length >> 2);\r\n for (var i = 0; i < output.length; i++)\r\n output[i] = 0;\r\n for (var i = 0; i < input.length * 8; i += 8)\r\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);\r\n return output;\r\n}", "function encode(bin, s1, s2, pshift) {\n if (s1 === void 0) { s1 = 34; }\n if (s2 === void 0) { s2 = 92; }\n if (pshift === void 0) { pshift = DEFAULT_PSHIFT; }\n var encoded = [];\n bin.forEach(function (b) {\n b += pshift;\n if (b === s1 || b === s2) {\n b += 0x100;\n }\n if (b < 0x80) {\n encoded.push(b);\n }\n else {\n encoded.push((b >>> 6) | 0xc0, (b & 0x3f) | 0x80);\n }\n });\n return new Uint8Array(encoded);\n}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "_binb2b64(_binarray) {\n const _this = this;\n const _tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n let _str = '';\n let i;\n const _binLen = _binarray.length * 4;\n let _t1;\n let _t2;\n let _t3;\n let _triplet;\n let j;\n const _binLen32 = _binarray.length * 32;\n for (i = 0; i < _binLen; i += 3) {\n _t1 = (((_binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16);\n _t2 = (((_binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 );\n _t3 = ((_binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);\n _triplet = (_t1 | _t2 | _t3);\n for (j = 0; j < 4; j++){\n if (i * 8 + j * 6 > _binLen32) {\n _str += _this._b64pad;\n }\n else {\n _str += _tab.charAt((_triplet >> 6*(3-j)) & 0x3F);\n }\n }\n }\n return _str;\n }", "function rstr2binb(input) {\n var i, l = input.length * 8,\n output = Array(input.length >> 2),\n lo = output.length;\n for (i = 0; i < lo; i += 1) {\n output[i] = 0;\n }\n for (i = 0; i < l; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);\n }\n return output;\n}", "function encode(buffer, base) {\r\n /**<sum>Attempt to encode a byte buffer in a given base.</sum>\r\n \r\n <arg id=\"text\" type=\"str\">\r\n The string to be converted.\r\n </arg>\r\n <kwarg id=\"base\" type=\"int\">\r\n The base of the return value.\r\n </kwarg>\r\n \r\n <return>str</return>\r\n \r\n <except>Raises 'BaseUnsupported' if the base is unsupported.</except>\r\n **/\r\n \r\n var buf = buffer.map(function(byte) {\r\n return _to_base_x(byte, 2).zfill(8);\r\n }).join('');\r\n if (base == 32 || base == 64) {\r\n var n = Math.floor(Math.log(base, 2))\r\n var l = Math.floor(lcm(8, n) / n)\r\n \r\n buf = buf.match(new RegExp('.{1,'+n+'}', 'g'));\r\n buf[buf.length-1] = buf[buf.length-1].ljust(n,'0')\r\n buf = buf.map(function(chnk) {\r\n return convert(chnk, 2, base);\r\n }).join('');\r\n buf = buf.ljust(buf.length + ((-buf.length).mod(l)), '=');\r\n } else {\r\n buf = buffer.map(function(byte) {\r\n return _to_base_x(byte, base).zfill(Math.ceil(Math.log(256,base)));\r\n }).join('');\r\n }\r\n \r\n return buf.toString();\r\n }", "function _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n var bytes = forge.util.hexToBytes(hex);\n\n // ensure integer is minimally-encoded\n if(bytes.length > 1 &&\n // leading 0x00 for positive integer\n ((bytes.charCodeAt(0) === 0 &&\n (bytes.charCodeAt(1) & 0x80) === 0) ||\n // leading 0xFF for negative integer\n (bytes.charCodeAt(0) === 0xFF &&\n (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n return bytes.substr(1);\n }\n return bytes;\n}", "function _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n var bytes = forge.util.hexToBytes(hex);\n\n // ensure integer is minimally-encoded\n if(bytes.length > 1 &&\n // leading 0x00 for positive integer\n ((bytes.charCodeAt(0) === 0 &&\n (bytes.charCodeAt(1) & 0x80) === 0) ||\n // leading 0xFF for negative integer\n (bytes.charCodeAt(0) === 0xFF &&\n (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n return bytes.substr(1);\n }\n return bytes;\n}", "function _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n var bytes = forge.util.hexToBytes(hex);\n\n // ensure integer is minimally-encoded\n if(bytes.length > 1 &&\n // leading 0x00 for positive integer\n ((bytes.charCodeAt(0) === 0 &&\n (bytes.charCodeAt(1) & 0x80) === 0) ||\n // leading 0xFF for negative integer\n (bytes.charCodeAt(0) === 0xFF &&\n (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n return bytes.substr(1);\n }\n return bytes;\n}", "function _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n var bytes = forge.util.hexToBytes(hex);\n\n // ensure integer is minimally-encoded\n if(bytes.length > 1 &&\n // leading 0x00 for positive integer\n ((bytes.charCodeAt(0) === 0 &&\n (bytes.charCodeAt(1) & 0x80) === 0) ||\n // leading 0xFF for negative integer\n (bytes.charCodeAt(0) === 0xFF &&\n (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n return bytes.substr(1);\n }\n return bytes;\n}", "function _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n var bytes = forge.util.hexToBytes(hex);\n\n // ensure integer is minimally-encoded\n if(bytes.length > 1 &&\n // leading 0x00 for positive integer\n ((bytes.charCodeAt(0) === 0 &&\n (bytes.charCodeAt(1) & 0x80) === 0) ||\n // leading 0xFF for negative integer\n (bytes.charCodeAt(0) === 0xFF &&\n (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n return bytes.substr(1);\n }\n return bytes;\n}", "function _bnToBytes(b) {\n // prepend 0x00 if first byte >= 0x80\n var hex = b.toString(16);\n if(hex[0] >= '8') {\n hex = '00' + hex;\n }\n var bytes = forge.util.hexToBytes(hex);\n\n // ensure integer is minimally-encoded\n if(bytes.length > 1 &&\n // leading 0x00 for positive integer\n ((bytes.charCodeAt(0) === 0 &&\n (bytes.charCodeAt(1) & 0x80) === 0) ||\n // leading 0xFF for negative integer\n (bytes.charCodeAt(0) === 0xFF &&\n (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n return bytes.substr(1);\n }\n return bytes;\n}", "function Encoder(){}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array /** MODIFIED **/\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = (k==8)?String.fromCharCode(d):int2char(d); } /** MODIFIED **/\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += (k==8)?String.fromCharCode(d):int2char(d); /** MODIFIED **/\n }\n }\n return m?r:\"0\";\n}", "function binl2b64(binarray) \n{ \n var tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" \n var str = \"\" \n for(var i = 0; i < binarray.length * 32; i += 6) \n { \n str += tab.charAt(((binarray[i>>5] << (i%32)) & 0x3F) | \n ((binarray[i>>5+1] >> (32-i%32)) & 0x3F)) \n } \n return str \n}", "qb64b() {\n return Buffer.from(this.qb64(), 'utf-8');\n }", "function encodeMBI(number) {\r\n\t\tvar output = new Array(1);\r\n\t\tvar numBytes = 0;\r\n\r\n\t\tdo {\r\n\t\t\tvar digit = number % 128;\r\n\t\t\tnumber = number >> 7;\r\n\t\t\tif (number > 0) {\r\n\t\t\t\tdigit |= 0x80;\r\n\t\t\t}\r\n\t\t\toutput[numBytes++] = digit;\r\n\t\t} while ( (number > 0) && (numBytes<4) );\r\n\r\n\t\treturn output;\r\n\t}", "function rstr2binl(input) {\r\n\t\t var i,\r\n\t\t output = [];\r\n\t\t output[(input.length >> 2) - 1] = undefined;\r\n\t\t for (i = 0; i < output.length; i += 1) {\r\n\t\t output[i] = 0;\r\n\t\t }\r\n\t\t for (i = 0; i < input.length * 8; i += 8) {\r\n\t\t output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\r\n\t\t }\r\n\t\t return output;\r\n\t\t }", "function bnToByteArray() {\nvar i = this.t, r = new Array();\nr[0] = this.s;\nvar p = this.DB-(i*this.DB)%8, d, k = 0;\nif(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this.data[i]&((1<<p)-1))<<(8-p);\n d |= this.data[--i]>>(p+=this.DB-8);\n } else {\n d = (this.data[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n}\nreturn r;\n}", "function bnToByteArray() {\nvar i = this.t, r = new Array();\nr[0] = this.s;\nvar p = this.DB-(i*this.DB)%8, d, k = 0;\nif(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this.data[i]&((1<<p)-1))<<(8-p);\n d |= this.data[--i]>>(p+=this.DB-8);\n } else {\n d = (this.data[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n}\nreturn r;\n}" ]
[ "0.7016315", "0.65492195", "0.65492195", "0.6526923", "0.64819664", "0.641104", "0.6382256", "0.63691306", "0.6358403", "0.63233805", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.629638", "0.62926704", "0.626045", "0.624098", "0.6226643", "0.6226643", "0.6226643", "0.6226643", "0.6226643", "0.6226643", "0.6209316", "0.61828625", "0.61759865", "0.61191744", "0.60983396", "0.6095527", "0.60844564", "0.60844564" ]
0.0
-1
initial function to fill drop down menu and allow selecting id
function init() { d3.json("samples.json").then(bbData => { data = bbData; var options = bbData.names; var selection = d3.select("#selDataset"); options.forEach(value => { selection .append("option") .text(value) .attr("value", function() { return value }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LoadDropdown(result, id) {\n $(id).get(0).options.length = 0;\n if (id.attr('id') == 'ddlItemHead') {\n itmList = [];\n itmList = result;\n }\n var content = '<option value=\"-1\">-- Select --</option>';\n if (result != null) {\n $.each(result, function (i, obj) {\n content += '<option value=\"' + obj.Value + '\" >' + obj.DisplayName + '</option>';\n });\n }\n $(id).append(content);\n\n if (id.attr('class') == 'span12 SupplierID') {\n if (manId != '0') {\n $(id).val(manId).trigger('change');\n }\n }\n $(id).select2();\n}", "function _handleSelect(id) {\n selected(id);\n }", "function jewelSelect(id){\r\n if (ifFull()) {\r\n return;\r\n }\r\n insertToChioce(id);\r\n if (ifFull()){\r\n createSubmitButton();\r\n }\r\n\r\n}", "function getSetores(id) {\r\n\r\n if (id == \"null\") {\r\n $('#setor').children().remove().end().append('<option value=\"\" disable selected>Selecione o setor</option>');\r\n }\r\n \r\n //Load Json setor\r\n $.ajax({\r\n url: urlApi + \"setor\",\r\n type: 'GET',\r\n dataType: 'json',\r\n success: function (resp) {\r\n\r\n $.each(resp.data, function (key, value) {\r\n\r\n $('#setor').append(\r\n $(\"<option></option>\")\r\n .attr('value', value.id)\r\n .text(value.nome)\r\n );\r\n\r\n });\r\n\r\n if (id !== \"null\") {\r\n $('#setor').find('option[value=\"' + id + '\"]').prop('selected', true);\r\n }\r\n\r\n $('#setor').material_select();\r\n\r\n //Reload Material Form\r\n Materialize.updateTextFields();\r\n }\r\n });\r\n\r\n}", "function fnFillSelect(idSelect, message, data) {\n var select = jQuery('#' + idSelect);\n //empty current select values\n select.empty();\n //put an empty/message choice\n select.append('<option value=\"\" disabled=\"disabled\" selected=\"selected\">' + message + '</option>');\n //fill the select with new data \n jQuery.each(data, function(index, value) {\n select.append('<option value=\"'\n + value['id'] + '\">'\n + value['name']\n + '</option>');\n });\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function selectResourcePrompt()\n{\n createDropdown(resourceDropdown, \"Select a resource: \", \"dropdown2\", courseQuery); \n populateResourceDropdown(dropdown2);\n}", "function alt_select_loc() {\n\t var id = jQuery(\"#alt_select_id\").val();\n\t \n\t $.ajax({\n\t\t type: \"POST\",\n\t\t url: \"/advertiser_admin/form_actions/advert_alt_loc_frm.deal\",\n\t\t data: \"id=\"+id,\n\t\t success: function(msg){\n\t\t\t jQuery(\"#alt_loc_form_area\").html(msg);\n\t\t }\n\t });\n\t \n }", "select(id) { this._updateActiveId(id, false); }", "function seleccion(){\n\t\tvar seleccion = document.getElementById(\"cliente\");\n\t\tvar idCliente = seleccion.options[seleccion.selectedIndex].value;\n\t\tdocument.getElementById(\"idCliente\").value = idCliente;\n\t}", "function selectCoursePrompt()\n{\n createDropdown(courseDropdown, \"Select a course: \", \"dropdown1\", selectResourcePrompt);\n populateCourseDropdown(dropdown1);\n}", "function init(){\r\n\tgenDropDownList();\r\n}", "function SetDataWithSelectid(val) {\n try {\n controlid = val[0].split(\"|\")[0];\n selectedid = val[0].split(\"|\")[1];\n $(\"#\" + controlid).empty();\n if (currentLanguage == \"Arabic\") {\n $(\"#\" + controlid).append($(\"<option selected='selected'></option>\").val(\"0\").html(\"-- اختر -- \"));\n } else {\n $(\"#\" + controlid).append($(\"<option selected='selected'></option>\").val(\"0\").html(\"-- Select -- \"));\n }\n for (var i = 1; i <= val.length - 1; i++) {\n if (val[i].split(\"|\")[1] == selectedid) {\n $(\"#\" + controlid).append($(\"<option selected='selected'></option>\").val(val[i].split(\"|\")[1]).html(val[i].split(\"|\")[0]));\n }\n else {\n\n $(\"#\" + controlid).append($(\"<option></option>\").val(val[i].split(\"|\")[1]).html(val[i].split(\"|\")[0]));\n }\n }\n } catch (err) {\n alert(err);\n }\n}", "function vider_examenBio_selectionne(id) {\n\t$(\"#SelectExamenBio_\"+id+\" option[value='']\").attr('selected','selected');\n\t$(\"#noteExamenBio_\"+id+\" input\").val(\"\");\n}", "function showSelect() {\n var selid = $('#sresult').val();\n var csrfid = $(\"input#csrf_id_find\").val()\n if(typeof(finderValues[actTab]) !== 'undefined' && selid > 0) {\n var target = finderValues[actTab].target;\n var url = finderValues[actTab].targetUrl;\n $(target).load(url, {appid: selid, action: actTab, csrf_token: csrfid,\n flag: actTab == 'cancellation' ? searchFlag : ''});\n }\n }", "function getSetor(id, inputType) {\r\n // $('#setor-form').empty();\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n url: urlApi + \"setor/\" + id,\r\n dataType: \"json\",\r\n\r\n //if received a response from the server\r\n success: function (resp) {\r\n\r\n if (inputType == \"select\") {\r\n $(\"#setor\").append(\r\n $(\"<option></option>\")\r\n .attr('value', resp.data.id)\r\n .text(resp.data.nome)\r\n .prop('selected', true)\r\n\r\n );\r\n $(\"#setor\").material_select();\r\n\r\n } else {\r\n\r\n $(\"#id\").val(resp.data.id);\r\n $(\"#nome\").val(resp.data.nome);\r\n }\r\n //Reload Material Form\r\n Materialize.updateTextFields();\r\n\r\n },\r\n\r\n });\r\n\r\n}", "function select ( menuId ) {\r\n // self.selected = angular.isNumber(menuId) ? $scope.users[user] : user;\r\n self.toggleList();\r\n }", "function populateDropdowns() {\n}", "function update_entity_selection_id(id) {\n current_id = id;\n\n //setup the selected record\n var existing_record;\n if(current_id != undefined) {\n existing_record = Controller.get_record(current_id);\n Forms.set_scope_can_record(existing_record);\n }\n\n //only update the display, don't reinit the form\n update_edit_form_display();\n\n}", "function init() {\n listar();\n //cargamos los items al select cliente\n $.post(\"Controllers/Product.php?op=selectArticulo\", function (r) {\n $(\"#idarticulo\").html(r);\n //$(\"#idarticulo\").selectpicker(\"refresh\");\n });\n}", "function select(fc) {\r\n document.getElementById('dropdown').value = fc;\r\n change();\r\n}", "function d2Assistant(id){\n active_parent_id = id;\n\n // Device A\n html = ' <div class=\"form-group\">\\\n <label for=\"device_a\">Device</label>\\\n <select class=\"form-control\" id=\"device_a\" onChange=\"device_selected(\\'a\\')\">\\\n <option value=\"select\">Select a device</option>';\n devices.forEach((device, i) => {\n html += '<option value=\"' + device.id +'\">' + device.name.nicknames[0] +'</option>';\n });\n\n html += ' </select>\\\n </div>';\n\n // Param A\n html += ' <div class=\"form-group\">\\\n <label for=\"param_a\">Param</label>\\\n <select class=\"form-control\" id=\"param_a\" onChange=\"param_selected(\\'a\\')\">';\n\n html += ' </select>\\\n </div>';\n\n // Operator\n html += ' <div class=\"form-group\">\\\n <label for=\"operator\">Operator</label>\\\n <select class=\"form-control\" id=\"operator\">\\\n <option>=</option>\\\n <option><</option>\\\n <option>></option>\\\n <option><=</option>\\\n <option>>=</option>\\\n </select>\\\n </div>';\n\n\n document.getElementById('d2AssistantBody').innerHTML = html\n}", "function populateSelect(selectID, instruction) {\n // Get list of membranes\n $.ajax( {\n url: \"/membrane\",\n type: \"GET\"\n })\n .done( function(data) {\n var options = \"\"\n if (data.length == 0) {\n // There aren't any membranes in the database\n options = \"<option>There are no membranes in the database</option>\";\n } else {\n // We have a list of membranes in the database\n options = \"<option>\"+instruction+\"</option>\";\n for (var i=0; i<data.length; i++) {\n options += \"<option value='\"+data[i][0]+\"'>\"+data[i][1]+\"</option>\";\n }\n }\n $(selectID).html(options).selectmenu(\"refresh\");\n })\n .fail( function(data) {\n showError(\"Error\", \"Failed to obtain the list of membranes from the database. Are you still connected to HOF3?\");\n });\n return false; // Stops default handler from being called\n }", "function grups_selected(id,nombre)\n{\n $('#sucursal_list').empty();\n $('#sucursal_list').hide();\n $('#nom_sucursal').val(nombre);\n $('#nom_sucursal').attr('value',id);\n}", "function populateDropdown(id, data) {\n let select = document.getElementById(id)\n data.forEach(alt => {\n if (alt.commits.items.length == 0) return\n var opt = document.createElement(\"option\")\n opt.appendChild(document.createTextNode(alt.name))\n opt.value = alt.commits.items[0].referencedObject\n select.appendChild(opt)\n })\n isDropdownLoaded = true\n}", "function select() {\n /* Retrieving the index and the text of the selected option.\n https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_option_index\n */\n let index = document.getElementById(\"choice\").selectedIndex;\n\n let options = document.getElementById(\"choice\").options;\n\n let name = document.getElementById(\"dog\");\n name.innerHTML = options[index].value;\n\n /*\n To clear the timer from the previous slide show.\n */\n clearTimeout(timerID);\n\n /*\n Get the rest of the info through another Ajax, by passing the\n Id.\n */\n getInfo(options[index].id);\n }", "function pickSelect(id, description)\n{\n\tdocument.getElementById(idControl).value = id;\n\tdocument.getElementById(pickControl).value = description;\n\tif (document.getElementById(pickControl).onchange)\n\t\tdocument.getElementById(pickControl).onchange();\n}", "function renderMenu(){\n $.get(\"/api/masterPlants/\", function(mData){\n for (var i=0; i<mData.length; i++){\n var newOption = $(\"<option>\").text(mData[i].common_name).addClass(\"drop-down\");\n newOption.attr({\"value\":mData[i].id});\n $(\"#drop-down\").append(newOption);\n } \n })\n }", "function initEditContent(){\n\t\t\t\n\t\t\t\tif (idItem != '' && idItem != 'nuevo') {\n\t\t\t\t\t\t\n\t\t\t\t\t//CAMPOS DE EDICION\t\t\t\t\t\t\t\n\t\t\t\t\t $.ajax({\n\t\t\t\t\t\tdataType:'JSON',\n\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\turl: 'database/TipoIdentificacioneGet.php?action_type=edit&id='+idItem,\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t//INICIO DE PERSONALIZACION DE CAMPOS\n\t\t\t\t\t\t\t$('#tipo_identificacion').val(data.tipo_identificacion);\n\t\t\t\t\t\t\t$(\"#estado_tipo_identificacion\").val(data.estado_tipo_identificacion).change();\n\t\t\t\t\t\t\t//FIN DE PERSONALIZACION DE CAMPOS\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(xhr) { \n\t\t\t\t\t\t\tconsole.log(xhr.statusText + xhr.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t$(\"#estado_tipo_identificacion\").val(1).change().selectpicker('refresh');\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t}", "function init()\n{\n mostrarfrom(false);\n listado();\n\n $(\"#formulario1\").on(\"submit\",function(e)\n {\n guardaryeditar(e);\n });\n\n //Cargamos los items al select tipocodigo\n $.post(\"../../ajax/xips.php?op=selectarea\", function(r){\n $(\"#idarea\").html(r);\n // $('#idarea').selectpicker('refresh');\n });\n //Cargamos los items al select tipocodigo\n $.post(\"../../ajax/xips.php?op=selectpersona\", function(r){\n $(\"#idpersona\").html(r);\n // $('#idpersona').selectpicker('refresh');\n });\n //Cargamos los items al select tipocodigo\n $.post(\"../../ajax/xips.php?op=selectipoEquipo\", function(r){\n $(\"#IPtipoequipo\").html(r);\n // $('#idordenador').selectpicker('refresh');\n });\n\n $(\"select[name=IPtipoequipo]\").change(function () {\n \n var id = $('select[name=IPtipoequipo]').val(); \n $.post(\"../../ajax/xips.php?op=selecEquipos&id=\"+id, function(r){\n $(\"#idequipos\").html(r);\n // $('#idordenador').selectpicker('refresh');\n });\n //alert(id_aula)\n });\n //Cargamos los items al select tipocodigo\n // $.post(\"../../ajax/xips.php?op=selectlaptop\", function(r){\n // $(\"#idlaptop\").html(r);\n // $('#idlaptop').selectpicker('refresh');\n // });\n\n //Cargamos los items al select tipocodigo\n // $.post(\"../../ajax/xips.php?op=selectimpresora\", function(r){\n // $(\"#idimpresora\").html(r);\n // $('#idimpresora').selectpicker('refresh');\n // });\n}", "function set_dropdown(id, items, current_val){\n\tvar the_select = $(\"#\"+id);\n\tfor(var i = 0; i < items.length; i++){\n\t\tif(items[i][0]){\n\t\t\tvar text = items[i][0]\n\t\t\tvar val = items[i][1].toLowerCase()\n\t\t}\n\t\telse {\n\t\t\tvar text = items[i]\n\t\t\tvar val = items[i]\n\t\t}\n\t\tvar selected = \"\";\n\t\tif(val == current_val){\n\t\t\tselected = \"selected='selected'\"\n\t\t}\n\t\tthe_select.append(\"<option \"+selected+\" value='\"+val+\"'>\"+text+\"</option\")\n\t}\n}", "function set_dropdown_menu(object, id){\n\t\n\t\tvar menu = {values:[]}\n\t\t\n\t\tobject.forEach(function(item, index)\n\t\t{\t\n\t\t\t\n\t\t\t\tmenu.values.push(\n\t\t\t\t{\n\t\t\t\t\tname:item,\n\t\t\t\t\tvalue:item,\n\t\t\t\t\ttext:item,\n\t\t\t\t})\t\n\n\t\t\t\n\t});\n\t\t \n\t\n\t//Set the menu\n\t$(\"#chart3_year\")\n\t .dropdown('setup menu',menu)\n\t;\n\t\n\t//Select 2018 as the default year\n\t$(\"#chart3_year\")\n\t .dropdown('set selected','2018')\n\t;\n\t\n\n\n\t\n\t}", "function init_view_select(select_id, form_id, options_size, current_selected) {\r\n \tvar select = document.getElementById(select_id);\r\n \tvar form = document.getElementById(form_id);\r\n\t\tselect.onchange = function () { change_view(select,form,current_selected);};\r\n }", "function init(id) {\n $(\"#changeCg option[value='\"+id+\"']\").attr(\"selected\",\"selected\");\n var ul = document.getElementById(\"courseingroup\");\n var url = \"/admin/retrieveCgCourses/\" + id;\n $.get(url, function(data) {\n var coursesObj = eval(\"(\" + data + \")\");\n var courses = coursesObj.courses;\n for ( i = 0; i < courses.length; i++) {\n var li = document.createElement(\"li\");\n li.innerHTML = courses[i].prefix + courses[i].num + \" - \" + courses[i].title;\n ul.appendChild(li);\n }\n });\n}", "function populate_user_specialization_dropdown_by_query()\n{\n let select = document.getElementById(\"Select User Course Specialization\");\n let arr= Get(\"api/buttonsdynamically/get/specialization\");\n if(select===null)\n alert(\"empty object retrieved from DOM parse\");\n if( select.length>1) {\n //alert(\"Specialization already exist in under the domain button, no need to again add them\");\n return \"\";\n }\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement(\"OPTION\"), txt = document.createTextNode(arr[i]);\n option.appendChild(txt);\n option.setAttribute(\"value\", arr[i]);\n select.insertBefore(option, select.lastChild);\n }\n \n}", "function initPage(data) \n {\n var sel = $(\"#parent\");\n \n sel.empty();\n \n for (var i = 0; i < data.length; i++) {\n if(i === 0){\n sel.append('<option disabled selected>-- Choose Category --</option>');\n }\n \n sel.append('<option value=\"' + data[i].id + '\">' + data[i].title + '</option>');\n }\n }", "function selectOrgHandler() {\n var orgID;\n\n // reset the current form\n clearForm();\n\n // Get the selected org ID\n orgID = $(\"#cbOrg\").find('option:selected').val();\n // Check to see if the current org is valid\n if (orgID > 0)\n {\n // Get the organizaiton record for the current org selection\n currentOrg = getCurrentOrganization(orgID, Organizations);\n // Make sure a valid organizaiotn was found\n if (currentOrg != undefined) {\n\n loadFormData();\n }\n }\n else {\n refreshForm();\n\n }\n // Make sure the new controls are still not editable\n setEditMode(false,false);\n }", "function initializeIDPulldown() {\n let selPeriod = d3.select(PULLDOWNID);\n let option;\n \n option = selPeriod.append(\"option\");\n option.property(\"text\", \"Spring 2018\");\n option.property(\"value\", S2018);\n\n option = selPeriod.append(\"option\");\n option.property(\"text\", \"Fall 2018\");\n option.property(\"value\", F2018);\n\n option = selPeriod.append(\"option\");\n option.property(\"text\", \"Spring 2019\");\n option.property(\"value\", S2019);\n\n option = selPeriod.append(\"option\");\n option.property(\"text\", \"Fall 2019\");\n option.property(\"value\", F2019);\n}", "function loadDropdown() {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: 'survey_ids.php',\n\t\t\t\t\t dataType:'JSON',\n\t\t\t\t\t success:function(data){\n\t\t\t\t\t //clear the current content of the select\n\t\t\t\t\t $select.html('');\n\t\t\t\t\t //iterate over the data and append a select option\n\t\t\t\t\t $.each(data.surveyInfo, function(key, val){\n\t\t\t\t\t // $select.append('<option value=\"' + val.surveyID + '\">' + val.surveyName + '</option>');\n\t\t\t\t\t $select.append('<li><a href=\"' + val.surveyID + '\">' + val.surveyName + '</a></li>');\n\t\t\t\t\t \n\t\t\t\t\t })\n\t\t\t\t\t\t\tconsole.log(\"Survey menu created\");\n\t\t\t\t\t },\n\t\t\t\t\t error:function(){\n\t\t\t\t\t //if there is an error append a 'none available' option\n\t\t\t\t\t $select.html('<li><a href=\"#\">no surveys available</a></li>');\n\t\t\t\t\t\t\tconsole.log(\"No survey names loaded, menu not created\");\n\t\t\t\t\t }\n\t\t\t\t\t});\n\t\t\t\t}", "function selectChange(elemid, mode) {\r\n $(elemid).val(mode);\r\n $(elemid).selectmenu(\"refresh\");\r\n}", "function FillFormSelect() {\n //Categories\n let cat = [];\n for (let el of Categories.values()) {\n cat.push(el);\n }\n $(\"#formCategoryId\").empty();\n $(\"#formCategoryId\").append($('<option>', { value: -1, text: \"New Category\" }));\n cat.sort((a, b) => a.Name < b.Name);\n for (let category of cat) {\n $('<option>', { value: category.Id, text: category.Name }).appendTo(\"#formCategoryId\");\n }\n\n //Publishers\n let pub = [];\n for (let el of Publishers.values()) {\n pub.push(el);\n }\n pub.sort((a, b) => a.Name < b.Name);\n $(\"#formPublisherId\").empty();\n $(\"#formPublisherId\").append($('<option>', { value: -1, text: \"New Publisher\" }));\n for (let publisher of pub) {\n $('<option>', { value: publisher.Id, text: publisher.Name }).appendTo(\"#formPublisherId\");\n }\n\n //Languages\n let lan = [];\n for (let el of Languages.values()) {\n lan.push(el);\n }\n lan.sort((a, b) => a.Name < b.Name);\n $(\"#formLanguageId\").empty();\n $(\"#formLanguageId\").append($('<option>', { value: -1, text: \"New Language\" }));\n for (let language of lan) {\n $('<option>', { value: language.Id, text: language.Name }).appendTo(\"#formLanguageId\");\n }\n\n //Authors\n let auth = [];\n for (let el of Authors.values()) {\n auth.push(el);\n }\n auth.sort((a, b) => `${a.FirstName}${a.LastName}` < `${b.FirstName}${b.LastName}`);\n $(\"#formAuthorId\").empty();\n $(\"#formAuthorId\").append($('<option>', { value: -1, text: \"New Author\" }));\n for (let author of auth) {\n $('<option>', { value: author.Id, text: `${author.FirstName} ${author.LastName}` }).appendTo(\"#formAuthorId\");\n }\n }", "function load_dropdowns() {\n var province, region, variety;\n\n // reset dropdowns\n document.getElementById(\"province_dropfield\").innerHTML = \"\";\n document.getElementById(\"region_dropfield\").innerHTML = \"\";\n document.getElementById(\"variety_dropfield\").innerHTML = \"\";\n\n // get inputs if already set\n if(document.getElementById(\"prov_input\").value)\n province = document.getElementById(\"prov_input\").value;\n if(document.getElementById(\"reg_input\").value)\n region = document.getElementById(\"reg_input\").value;\n if(document.getElementById(\"var_input\").value)\n variety = document.getElementById(\"var_input\").value;\n\n if(this.id == \"prov_input\")\n set_prov_dropdown(region, variety);\n\n if(this.id == \"reg_input\")\n set_reg_dropdown(province, variety);\n\n if(this.id == \"var_input\")\n set_var_dropdown(province, region);\n}", "function autoSetPatient(elementId, name) {\r\n\tselectElement = $(elementId);\r\n\t\r\n\tif (selectElement.selectedIndex==0) {\r\n\t\tfor (iter = 0; iter < selectElement.options.length; iter++) {\r\n\t\t\tif (selectElement.options[iter].text.toLowerCase()==name.toLowerCase()) {\r\n\t\t\t\tselectElement.selectedIndex=iter;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function populateOptionValues(strObjectName,Url,Select_heading) {\n\n var cboObject = $('#' + strObjectName);\n var objGet = AJAX_Get(Url);\n var items = \"\";\n var iVal = \"\";\t\t\n if (objGet.DATA.DBStatus === 'OK') {\n var arrMyData = objGet.DATA.DBData;\n items += \"<option value='0'><column>\"+Select_heading+\"</column></option>\";\n $.each(arrMyData, function (index, item) {\n items += \"<option value='\" + item.id + \"'><column>\" + item.name + \"</column></option>\";\n });\n }\n cboObject.html(items);\n\tcboObject.val(\"0\").trigger(\"change\");\n}", "function change_selection(http_data, field_id){\n\n\t\tif (http_data != '' && field_id) {\n\t\t\tdocument.getElementById(field_id).options.length = 0;\n\n\t\t\tvar key;\n\t\t\tvar value;\n\t\t\tvar word = http_data.split(',');\n\t\t\t\n\t\t\tfor(i=0; i< word.length; i++){\n\t\t\t\tvalue = word[i]. split('=>');\n\t\t\t\tkey = value[0];\n\t\t\t\tif (value.length > 1) { /* got pass in the key */\n\t\t\t\t\tvalue = value[1];\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[0]; /* do not pass in the key */\n\t\t\t\t}\n\t\t\t\tdocument.getElementById(field_id).options[i] = new Option(value,key);\n\t\t\t\t//alert(key + '=' + value);\n\t\t\t}\n\t\t}\n\t}", "function cargarProyectoActivo(id) {\n $('.editar_Proyecto').prop('disabled', true);\n $.ajax({\n url: 'controlador/proyecto/selectProyectoActivo.php',\n dataType: 'json',\n type: 'GET',\n success: function(data){ \n $.each(data,function(key, registro) {\n $(\"#editar_Proyecto\").append('<option id=\"' + registro.id + '\" value=\"' + registro.id + '\">' + registro.Proyecto + '</option>');\n //console.log( dato );\n });\n\n $('.editar_Proyecto').selectpicker('refresh');\n //console.log( \"Proyecto cambiado \" );\n \n $('.editar_Proyecto').val(id).change(); \n //console.log( \"id del proyecto \"+id );\n \n },\n error: function(data) {\n alert('error');\n }\n });\n\n }", "function addSelCtgs() {\n // reset these properties couse after delete it is displayed 1st list\n optID = 0;\n slevel = 1;\n\n // if items in Root, shows 1st <select>, else, resets properties to initial value\n if(optHierarchy[0].length > 0) document.getElementById('n_sl'+slevel).innerHTML = getSelect(optHierarchy[0]);\n else {\n optHierarchy = {'0':[]};\n optData = {'0':{'value':'Root', 'content':'', 'parent':-1}};\n document.getElementById('n_sl'+slevel).innerHTML = '';\n }\n }", "function chooseIds( sLetter ) {\n\n Element.show( \"nlUpdateSpinner\" );\n $( \"domainSearchForm\" ).disable();\n \n new Ajax.Updater( \"idSelectionWrapper\",\n queryURI,\n {\n method: 'get',\n parameters: \"list=1&browse=\" + sLetter,\n onComplete: function () {\n Element.hide(\"nlUpdateSpinner\");\n $( \"domainSearchForm\" ).enable();\n }\n } );\n}", "function populate_faculty_dropdown_by_query()\n{\n let select = document.getElementById(\"Select Faculty\");\n let arr= Get(\"api/buttonsdynamically/get/faculty\");\n if(select===null)\n alert(\"empty object retrieved from DOM parse\");\n if( select.length>1) {\n //alert(\"faculty already exist in under the domain button, no need to again add them\");\n return \"\";\n }\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement(\"OPTION\"), txt = document.createTextNode(arr[i]);\n option.appendChild(txt);\n option.setAttribute(\"value\", arr[i]);\n select.insertBefore(option, select.lastChild);\n }\n}", "function GetDataWithSelectidForBuilding(Community, subCommunity,nextcontrolid, selectedval) {\n try {\n var data = Community + \"|\" + subCommunity + \"|\" + nextcontrolid +\"|\" +selectedval;\n LookupDdlBinder.GetDataWithSelectidForBuilding(data, SetDataWithSelectid);\n } catch (err) {\n alert(err);\n }\n}", "function admin_cabang_combobox(id)\n{\n app.request({\n method: \"POST\",\n url: \"http://192.168.0.15/myorder/riwayat/listresto.php\",\n\n success: function(data) {\n var obj = JSON.parse(data);\n $$('.cabang_combobox').html(\"\");\n\n $$('.cabang_combobox').append(\n '<option value=\"\">-- Pilih cabang --</option>'\n );\n\n for(var i =0; i < obj['data'].length; i++)\n {\n if(obj['data'][i]['store_id'] == id)\n {\n $$('.cabang_combobox').append(\n '<option selected value=\"'+ obj['data'][i]['store_id'] +'\">' + obj['data'][i]['store_name'] +\"</option>\"\n );\n }\n else\n {\n $$('.cabang_combobox').append(\n '<option value=\"'+ obj['data'][i]['store_id'] +'\">' + obj['data'][i]['store_name'] +\"</option>\"\n );\n } \n } \n } \n });\n}", "function init_product_select()\n {\n if ( $('select#groupedProducts').length > 0 ) {\n $('select#groupedProducts').change(function() {\n var goToUrl = $(this).val();\n window.location = '/' + goToUrl;\n });\n }\n }", "function selectDishSoap() {\n\n $(\"input[id='Description']\").val(\"Ultra Palmolive Original\");\n $(\"input[id='Price']\").val(\"1.83\");\n $(\"input[id='Purchase Date']\").val(getDateString());\n $(\"input[id='Amount']\").val(\"24\");\n $(\"input[id='Amount Type']\").val(\"Ounces\");\n $(\"select[name='Type of Product']\").val(\"Dish Soap\");\n }", "function make_selection()\n{\n\t$(\"#mysel\").val(3);\n}", "select_sensor(id) {\r\n $(\"#\"+id).attr(\"data-live-search\", \"true\")\r\n $(\"#\"+id).addClass(\"bootstrap-select\")\r\n $('#'+id).append('<option value=\"\"></option>')\r\n // initialize bootstrap select\r\n $('#'+id).selectpicker();\r\n }", "function fillDataModal(codigo, grado, seccion, nivel) {\n \n $(\"#modaltxtCodigo\").val(codigo);\n $(\"#modaltxtGrado\").val(grado);\n $(\"#modaltxtSeccion\").val(seccion);\n $(\"#modalnivel value=\"+0+\"selected\")=nivel;\n \n\n //if (nivel == \"Primaria\") {\n // $(\"#modalnivel option[value=\" + 1 + \"]\").attr(\"selected\", true);\n //}\n //else {\n // $(\"#modalnivel option[value=\" + 2 + \"]\").attr(\"selected\", true);\n //}\n \n}", "function onSelectAut1(event, ui){\n\t// Memorizes author id from the completer list in the hidden form field author1id\n\t$(\"#author1id\").val(ui.item ? ui.item.id : \"\");\n}", "function selectAirFryer() {\n\n $(\"input[id='Description']\").val(\"Farberware Oil-Less Fryer\");\n $(\"input[id='Price']\").val(\"79.99\");\n $(\"input[id='Purchase Date']\").val(getDateString());\n $(\"input[id='Material']\").val(\"Plastic and Metal\");\n $(\"input[id='Weight (in kg)']\").val(\"5\");\n $(\"select[name='Type of Product']\").val(\"Air Fryer\");\n }", "function populate_specialization_dropdown_by_query()\n{\n let select = document.getElementById(\"Select Specialization\");\n let arr= Get(\"api/buttonsdynamically/get/specialization\");\n if(select===null)\n alert(\"empty object retrieved from DOM parse\");\n if( select.length>1) {\n //alert(\"Specialization already exist in under the domain button, no need to again add them\");\n return \"\";\n }\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement(\"OPTION\"), txt = document.createTextNode(arr[i]);\n option.appendChild(txt);\n option.setAttribute(\"value\", arr[i]);\n select.insertBefore(option, select.lastChild);\n }\n}", "function load_personal() \r\n{\r\n $( \"#servidor, [name='servidor'], [name='servidor_edit']\" ).autocomplete({\r\n autoFocus:true,\r\n source: 'controller/puente.php?option=1',\r\n select: function( event, ui ){\r\n $('#servidor_id, [name=\"servidor_id\"], [name=\"servidor_id_edit\"]').val(ui.item.id);\r\n },\r\n delay:0\r\n });\r\n return false;\r\n}", "function changeSelect() {\n\t\t\ttrail_select.value = this._leaflet_id;\n\t\t\tvar event = new Event(\"change\");\n\t\t\ttrail_select.dispatchEvent(event);\n\t\t}", "function DatLisCiry(id, nombre) {\n return '<option value=\"' + id + '\">' + nombre + '</option>';\n}", "function selectAutista(){\n\tvar idaut = $(\"#ddtObject_ddt_idAutista\").val();\n\t\n\tif(typeof idaut !== 'undefined' \n\t\t|| idaut !== ''){\n\t\t$(\"#ddtObject_ddt_autista option[value='\"+idaut+\"']\").prop(\"selected\", true);\n\t}\n}", "function init() {\n listar();\n\n $.post(\"../ajax/venta.php?op=selectCliente\", function (r) {\n $(\"#idcliente\").html(r);\n $(\"#idcliente\").selectpicker('refresh');\n });\n}", "function refreshSelect() {\n if(selectedIndex == -1) {\n return;\n }\n\n if(selectFlag == \"ONE\") {\n selectUserFromList(userSelected.username, userSelected.contact_id, userSelected.id, \"CONTACT\");\n }\n else {\n selectGrpFromList(grpSelected.grpID, grpSelected.grpName);\n }\n}", "function fillSelect(idSelect, data) {\n\n var select = document.getElementById(idSelect);\n var numberSubstatus = data[0].length;\n\n emptySelect(idSelect)\n\n if (numberSubstatus > 0) {\n for (i = 0; i < numberSubstatus; i++) {\n var option = document.createElement('option');\n option.text = data[1][i];\n option.value = data[0][i];\n select.add(option, null);\n }\n }\n\n return numberSubstatus;\n}", "function showNewItemField(id, name){\r\n\r\n // leverage existing onchange() to remove red text formatting for selected option\r\n var selectClasses = document.getElementById(id).classList;\r\n selectClasses.remove('defaultGray');\r\n\r\n if (name in newAnimalItemIds) {\r\n if (id === \"animal\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Animal:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newAnimal\" id=\"newAnimal\" />';\r\n } else if (id === \"habitat\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Habitat:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newHabitat\" id=\"newHabitat\" />';\r\n } else if (id === \"menu\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Menu:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newMenu\" id=\"newMenu\" />';\r\n } else if (id === \"option\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Option:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newOption\" id=\"newOption\" />';\r\n }\r\n } else {\r\n if (id === \"animal\") {\r\n document.getElementById(newAnimalItemIds.key(0)).innerHTML = ''; // name is undefined so use index to access value\r\n } else if (id === \"habitat\") {\r\n document.getElementById(newAnimalItemIds.key(1)).innerHTML = '';\r\n } else if (id === \"menu\") {\r\n document.getElementById(newAnimalItemIds.key(2)).innerHTML = '';\r\n } else if (id === \"option\") {\r\n document.getElementById(newAnimalItemIds.key(3)).innerHTML = '';\r\n } else {\r\n console.log(\"No matches!\")\r\n }\r\n }\r\n}", "function fillSelect(idSelect, data) {\n\n var select = document.getElementById(idSelect);\n var numberSubstatus = data[0].length;\n\n emptySelect(idSelect)\n\n if (numberSubstatus > 0) {\n for (var i = 0; i < numberSubstatus; i++) {\n var option = document.createElement('option');\n option.text = data[1][i];\n option.value = data[0][i];\n select.add(option, null);\n }\n }\n\n return numberSubstatus;\n}", "function fillDropDown(table, number = -1) {\n\n\tvar command = \"command=getDropDown&table=\" + table + \"&number=\" + number;\n\t$.post(\"engine.php\", command, function(data) {\n\t\t//alert(data);\n\t\tvar dat = data.split(\"-=-\");\n\n if (dat[0] == \"ok\") {\n\t\t\t$(\"#\" + table + \"DropDown\").html(dat[1]);\n\t\t\t$(\".\" + table + \"Load\").click(function() {\n\t\t\t\tvar el = $(this);\n\n\t\t\t\t$(\"#\" + table + \"Load\").modal(\"hide\");\n\t\t\t\tif (el.attr(\"number\"))\n\t\t\t\t\teval(\"get\" + table + \"(\" + el.attr(table + \"ID\") + \", \" + el.attr(\"number\") + \");\");\n\t\t\t\telse\n\t\t\t\t\teval(\"get\" + table + \"(\" + el.attr(table + \"ID\") + \");\");\n\t\t\t});\n\t\t}\n\t\telse\n\t\t\talert(dat[1]);\n\t});\n\n} // fillDropDown", "function init(){\n //console.log($(\"#show_form_emergente .DepartamentoSelect\"));\n \n $(\"#show_form_emergente .DepartamentoSelect\").attr('disabled',true);\n $(\"#show_form_emergente .CiudadSelect\").attr('disabled',true);\n // Cuando se selecciona el departamento cambia la ciudad\n $(\"#show_form_emergente .DepartamentoSelect\").change(function(){\n // Partiendo del elemento actual obtengo el form al que petenecen\n form = $(this).parent().parent().parent();\n var idDepartamento=0;\n objMsjCarga.dialog('open');\n if($(form).find(\"select.DepartamentoSelect\").val() !== null){\n idDepartamento = $(form).find(\"select.DepartamentoSelect\").val();\n }\n var idCiudad=0;\n if($(form).find(\"select.CiudadSelect\").val() !== null){\n idCiudad = $(form).find(\"select.CiudadSelect\").val();\n }\n $.ajax({\n url: Routing.generate('sisciudad_findByIdDepartamento', { iddepartamento: idDepartamento,idciudad: idCiudad }),\n data: $(form).find(\"select.DepartamentoSelect\").val(),\n type: \"post\",\n success: function(json) { \n // $( \"#show_form\" ).html(json); \n //console.log(json);\n // alert($(\".PaisSelect\").val());\n $(form).find(\"select.CiudadSelect\").attr('disabled',false);\n $(form).find(\"select.CiudadSelect\").html(json);\n\n // init();\n objMsjCarga.dialog('close');\n },\n error:function (xhr, ajaxOptions, thrownError) {\n console.log(xhr);\n }\n }); \n // function(){alert($(\".PaisSelect\").val());}\n });\n\n $(\"#show_form_emergente .PaisSelect\").change(function(){\n // Partiendo del elemento actual obtengo el form al que petenecen\n form = $(this).parent().parent().parent();\n //console.log($(form).find(\"select.DepartamentoSelect\"));\n var idDepartamento=0;\n objMsjCarga.dialog('open');\n if($(form).find(\"select.DepartamentoSelect\").val() !== null){\n idDepartamento = $(form).find(\"select.DepartamentoSelect\").val();\n }\n $.ajax({\n url: Routing.generate('sisdepartamento_findByIdPais', { idpais: $(form).find(\"select.PaisSelect\").val(),iddepartamento: idDepartamento }),\n data: $(form).find(\"select.PaisSelect\").val(),\n type: \"post\",\n success: function(json) { \n // $( \"#show_form\" ).html(json); \n //console.log(json);\n // alert($(\".PaisSelect\").val());\n $(form).find(\"select.DepartamentoSelect\").attr('disabled',false);\n $(form).find(\"select.DepartamentoSelect\").html(json);\n //console.log($(\".DepartamentoSelect\").val());\n $(form).find(\"select.DepartamentoSelect\").trigger('change');\n // init();\n objMsjCarga.dialog('close');\n },\n error:function (xhr, ajaxOptions, thrownError) {\n console.log(xhr);\n }\n }); \n // function(){alert($(\".PaisSelect\").val());}\n });\n \n}", "function selection(){\n $('#selectionPraticien').ready(function(){\n $('#selectionPraticien').change(function(){\n optionSelected = $(this).find(\".choixPraticien:selected\");\n idPraticien = optionSelected.attr('id');\n nomPraticien = optionSelected.val();\n $('#form_nomPraticien').val(nomPraticien);\n $('#form_praticien').val(idPraticien);\n $('#selectionPraticien').remove();\n });\n });\n}", "function setSelectPrimaryKey(){\n let selectPrimaryKey = document.getElementById('primary-key')\n selectPrimaryKey.innerHTML = ''\n \n let optionIndex = document.createElement('option')\n optionIndex.innerHTML = '-- Primary Key --'\n optionIndex.setAttribute('value','')\n selectPrimaryKey.appendChild(optionIndex)\n\n let options = getInputColumsValuesArray()\n options.map(value => {\n option = document.createElement('option')\n option.setAttribute('value',value)\n option.innerHTML = value\n selectPrimaryKey.appendChild(option)\n })\n}", "function getCountryForVendorReg() {\n\t$('#countryid').empty();\n\t// alert(\"country function calling\")\n\t$(\"#countryid\").empty();\n\tgetCountry();\n\tvar selectfirst = \"<option value='0'>Please Select Country</option>\";\n\t$('#countryid').append(selectfirst);\n\t$.each(countryid, function(i, resData) {\n\t\tvar countryData = \"<option value=\" + resData.countryid + \">\"\n\t\t\t\t+ resData.countryName + \"</option>\";\n\t\t$(countryData).appendTo('#countryid');\n\t});\n\t$('#countryid').trigger(\"chosen:updated\");\n\t$('#countryid').chosen();\n}", "function SP_InsertBlank()\n{\t\n\t\n\tswitch(arguments.length)\n\t{\n\t\tcase 0:\n\t\t\t\n\t\t\tvar oAllCMB = document.getElementsByTagName('select');\n\t\t\tif(oAllCMB.length != 0)\n\t\t\t{\n\t\t\t\tfor(var x=0; x<oAllCMB.length; x++)\n\t\t\t\t{\n\t\t\t\t\tvar cmbID = oAllCMB[x].id;\n\t\t\t\t\tif(cmbID.indexOf('mastercontrol.role') != -1 && oAllCMB[x].type != \"select-multiple\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif (oAllCMB[x].selectedIndex != -1) {\n\t\t\t\t\t\t\tvar selectedOption = oAllCMB[x].options[oAllCMB[x].selectedIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSP_CheckAndAddOption(cmbID);\n\t\t\t\t\t\tif (oAllCMB[x].value !== '') {\n\t\t\t\t\t\t\tfor (var i=0; i<oAllCMB[x].options.length;i++) {\n\t\t\t\t\t\t\t\tif (selectedOption != undefined && oAllCMB[x].options[i].text == selectedOption.text) {\n\t\t\t\t\t\t\t\t\toAllCMB[x].selectedIndex = i;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\tcase 1:\n\t\t\tvar sel = document.getElementById(arguments[0]);\n\t\t\tif (sel.selectedIndex != -1) {\n\t\t\t\tvar selectedOption = sel.options[sel.selectedIndex];\n\t\t\t}\n\t\t\tSP_CheckAndAddOption(arguments[0]);\n\t\t\tif (sel.value !== '') {\n\t\t\t\tfor (var i=0; i<sel.options.length;i++) {\n\t\t\t\t\tif (selectedOption != undefined && sel.options[i].text == selectedOption.text) {\n\t\t\t\t\t\tsel.selectedIndex = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t}\n}", "function LoadDropdown(result, id) {\n $(id).get(0).options.length = 0;\n var content = '<option value=\"-1\">-- Select --</option>';\n if (result != null) {\n $.each(result, function (i, obj) {\n content += '<option value=\"' + obj.Value + '\" >' + obj.DisplayName + '</option>';\n });\n }\n $(id).append(content);\n $(id).select2();\n}", "static fulfilDropdown(id, itemsList)\n\t{\n\t\tif (Array.from(new Set(itemsList)).length > 1)\n\t\t{\n\t\t\titemsList = [...new Set(itemsList)];\n\t\t\tvar html = \"\";\n\t\t\tfor (var itemIndex = 0; itemIndex < itemsList.length; itemIndex++)\n\t\t\t{\n\t\t\t\thtml += '<option value=\"' + itemsList[itemIndex] + '\">' + itemsList[itemIndex] + '</option>';\n\t\t\t}\n\t\t\tdocument.getElementById(id).innerHTML += html;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById(id).style.display = \"none\";\n\t\t}\n\t}", "function populate(id, array) {\n let $dropdown = $(id);\n $.each(array, function() {\n $dropdown.append($(\"<option>\").val(this).text(this)).trigger('change');\n });\n}", "function initialize_new_edit_page(){ \n $('#insurance_billing_provider_rate_id').hide();\n if ($('#insurance_billing_provider_rate_id option').length > 0){\n\t$('#insurance_billing_provider_rate_id').slideDown();\n };\n $('#insurance_billing_provider_office_id').hide();\n if ($('#insurance_billing_provider_office_id option').length > 0){\n\t$('#insurance_billing_provider_office_id').slideDown();\n }; \n setup_select_group();\n setup_select_provider();\n setup_radio_provider();\n setup_radio_group();\n}", "function nombreEquipo(id){\n var nombreEquipoSeleccionado = $(\"#\" + id + \" option:selected\").text();\n document.getElementById('equipoCGnombre').value = nombreEquipoSeleccionado;\n }", "function annuaireSocietySelect(idsoc) {\n var id_society = idsoc.value;\n $.ajax({\n type: 'GET',\n url: './ajax/ajax_function_store.php',\n data: 'param1=4' + '&param2='+id_society,\n dataType: 'json',\n success: function(data) {\n $(\"#annuaire_form_mag_select\").prop('disabled', false);\n\n $(\"#annuaire_form_mag_select\").html('<option value=\"00\">Choix magasin...</option>');\n\n $.each(data, function(index, element) {\n $(\"#annuaire_form_mag_select\").append('<option value=\"'+ element.id +'\">'+ element.id +' - '+ element.name +'</option>');\n });\n\n $('#annuaire_form_mag_select').selectpicker('refresh');\n }\n\n });\n}", "function selectChange() {\n changeCouncil($(\"#selectCouncil option:selected\").val());\n}", "function _autoselect() {\n var use_idp;\n use_idp = $.jStorage.get('pyff.discovery.idp');\n if (use_idp) {\n with_entity_id(use_idp, function (elt) { // found entity - autoselect\n discovery_response(elt.entityID);\n }, function () { // failing - lets remove the selection and have the user re-select\n $.jStorage.remove('pyff.discovery.idp');\n });\n }\n }", "static updatePedidoSelector(data) {\n let select = document.getElementById(\"editPedidoSelect\");\n select.innerHTML = \"\";\n\n for (let i=0; i<data.length; i++) {\n var option = document.createElement(\"option\");\n option.text = data[i].id;\n option.setAttribute(\"pedId\",data[i].id)\n select.add(option);\n }\n }", "function populateDropdownByIdWithJson(element, json, selectValue, selectText, showId) {\r\n\telement.empty();\r\n\tvar option = \"\";\r\n\tif (selectValue && selectText){\r\n\t\toption += '<option value=' + selectValue + '>' + selectText + '</option>';\r\n\t}\r\n\tif ((json != null) && (json != \"\") && (json.length > 0)) {\r\n\t\t$.each(json, function(index, data) {\r\n\t\t\tif (showId && showId == true) {\r\n\t\t\t\toption += '<option value='+data.value+'>'+data.name+' ('+data.value+')</option>';\r\n\t\t\t} else {\r\n\t\t\t\toption += '<option value=' + data.value + '>' + data.name + '</option>';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\telement.html(option);\r\n\telement.change();\r\n\telement.trigger('update-select-list');\r\n}", "function search_tipo_bien(id, contenedor,tipo_ant)\r\n{\r\n\r\n var id;\r\n $.ajax({\r\n url: 'controller/puente.php',\r\n type: 'POST',\r\n dataType: 'json',\r\n data: {option: 8,grupo:id},\r\n async: false ,\r\n cache: false,\r\n })\r\n .done(function(data) {\r\n contenedor.empty();\r\n contenedor.append('<option value=\"\" >...</option>');\r\n $.each(data, function(i, val) {\r\n if (val.nombre == tipo_ant) \r\n {\r\n id = val.id;\r\n contenedor.append('<option value=\"'+val.id+'\" selected>'+val.nombre+'</option>');\r\n }\r\n else\r\n {\r\n contenedor.append('<option value=\"'+val.id+'\">'+val.nombre+'</option>');\r\n }\r\n \r\n });\r\n \r\n })\r\n .fail(function() {\r\n alert(\"Error en -> search_tipo_bien() \");\r\n });\r\n selected = id;\r\n return selected;\r\n}", "function getMesPackageId() {\n //clearSelectMesPkg();\n let factoryId = $(\"#selFactory\").val();\n let plnStartDate = $(\"#beginDate\").val().replace(/\\//g, \"\");\n\n let res = GetPkgByFacAndDate(factoryId, plnStartDate);\n if (res.length > 0) {\n displayListMesPackage(res);\n //$('#mesPkgId').append('<option value=\"\">---</option>');\n //res.forEach(function (val, ind) {\n // $('#mesPkgId').append(`<option value=\"${val.MxPackage}\">${val.MxPackage}</option>`);\n //});\n } else {\n var e = document.getElementById(\"selFactory\");\n var strText = e.options[e.selectedIndex].text;\n let mesTitle = 'Warning';\n let mesContent = 'Factory ' + strText + ' has no package on ' + $(\"#beginDate\").val() + '.<br />Please select other factory or other date';\n ShowMessage(mesTitle, mesContent, 'warning');\n resetGrid();\n }\n //Selection2(\"mesPkgId\");\n}", "function fillMakes (year) {\n if (new Number(year) > 1984) {\n var mySelect = document.getElementById('mnuMake');\n mySelect.options.length = 0;\n mySelect.options[0] = new Option (\"Select Make\", \"\");\n mySelect.options[0].selected=\"true\";\n\n $.getJSON('https://www.fueleconomy.gov/ws/rest/vehicle/menu/make?year='+year, function (data) {\n\n var mylen = data.menuItem.length;\n for(var i=0;i < mylen;i++) {\n\n $('#mnuMake').append($('<option>', { \n value: data.menuItem[i].value,\n text :data.menuItem[i].text\n }));\n }\n });\n } \n }", "function GetDataWithSelectid(Value, nextcontrolid, type, relatedtype, selectedval) {\n try {\n var data = Value + \"|\" + nextcontrolid + \"|\" + type + \"|\" + relatedtype + \"|\" + selectedval;\n LookupDdlBinder.GetDataWithSelectid(data, SetDataWithSelectid);\n } catch (err) {\n alert(err);\n }\n}", "function setDropDown() {\n KintoneConfigHelper.getFields(['SINGLE_LINE_TEXT', 'LINK', 'SPACER']).then(function(resp) {\n var $linkDropDown = $link;\n var $spaceDropDown = $space;\n\n resp.forEach(function(respField) {\n var $option = $('<option></option>');\n switch (respField.type) {\n case 'SINGLE_LINE_TEXT':\n case 'LINK':\n $option.attr('value', respField.code);\n $option.text(respField.label);\n $linkDropDown.append($option.clone());\n break;\n case 'SPACER':\n if (!respField.elementId) {\n break;\n }\n $option.attr('value', respField.elementId);\n $option.text(respField.elementId);\n $spaceDropDown.append($option.clone());\n break;\n default:\n break;\n }\n });\n\n // Set default values\n if (CONF.link) {\n $linkDropDown.val(CONF.link);\n }\n if (CONF.space) {\n $spaceDropDown.val(CONF.space);\n }\n }, function() {\n // Error\n return alert('There was an error retrieving the Link field information.');\n });\n }", "function cargarCliente(id) {\n $.get('/Localidad/mostrar/' + id, function(data) {\n $('select[name=Cliente]').find(':selected').attr('selected', false);\n $(\"select[name=Cliente] option[value='\" + data.CliId + \"']\").attr(\"selected\", true);\n\n cargarLocalidades(data.CliId, id);\n });\n }", "function locationSelectionFill(locations, lawsuitId)\n{\n var selection = \"<select class=\"+lawsuitId+\">\";\n $.each(locations, function(){\n if (this.id == $(\".lawsuitLocation\").children(\"option:selected\").val())\n {\n selection += \"<option value=\"+this.id+\" selected>\"+this.cityName+\"</option>\";\n }\n else\n {\n selection += \"<option value=\"+this.id+\">\"+this.cityName+\"</option>\";\n }\n });\n\n return selection;\n}", "function onchangeSelect() {\r\n\tvar hideSpec = document.getElementById('specialiteSel');\r\n\twhile (hideSpec.firstChild) {\r\n hideSpec.removeChild(hideSpec.firstChild);\r\n }\r\n\tvar codeEtablObj = document.getElementById('codeEtablissement');\r\n var specialiteObj = document.getElementById('specialite');\r\n var currentCode = codeEtablObj.value;\r\n if (currentCode == \"\") {\r\n specialiteObj.style.display = \"none\"; \r\n } else {\r\n var specialitelSelObj = document.getElementById('specialiteSel');\r\n \r\n var hospLen = tabHospitalisations.length; \r\n var selLen = specialitelSelObj.options.length;\r\n specialitelSelObj.options[0] = new Option (\"Choisissez specialite\");\r\n\t\tselLen ++;\r\n\t\tfor (var i=0; i < hospLen; i++) {\r\n var t = tabHospitalisations[i];\r\n\t\t\tvar e = tabEtablissements;\t\r\n\t\t\tif (currentCode == t.codeEtablissement && specialitelSelObj.options[selLen-1].value != t.specialite){\r\n\t\t\t\tspecialitelSelObj.options[selLen ++] = new Option(t.specialite);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t }\r\n specialiteObj.style.display = \"block\"; \r\n }\r\n}", "function orgSelectHandler(event) {\n var id;\n\n id = $(\"#formOrgList\").find('option:selected').val();\n\n currentOrg = new Organization();\n\n if (id > 0) {\n currentOrg = getCurrentOrganization(id);\n setFormMode(\"update\");\n }\n else if (id == -1) {\n setFormMode(\"new\");\n enableOrgControls(true);\n }\n else {\n clearDetailContent();\n // setFormMode(\"new\");\n enableOrgControls(false);\n }\n }", "async selectDropDown(ObjectRepo) {\n //Verifying the drop down text\n await Utility.clickOn(ObjectRepo.Register.typeOfMerchant);\n //Accepting the option\n await Utility.clickOn(ObjectRepo.Register.optionOfMerchant);\n }", "function populateDropDown() { \r\n \r\n // select the panel to put data\r\n var dropdown = d3.select('#selDataset');\r\n jsonData.names.forEach((name) => {\r\n dropdown.append('option').text(name).property('value', name);\r\n });\r\n \r\n // set 940 as place holder ID\r\n populatedemographics(jsonData.names[0]);\r\n visuals(jsonData.names[0]);\r\n }", "function setOccupationWithId(id, txElement, selectElement){\n\tif(allCountries.length == 0){\n\t\t$.get(\"/visitorsLog/get-occupations\", function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar occupations = JSON.parse(data);\n\t\t\t\t\t\t\t\t\t\t\t\t\toccupations.forEach(function(occpation){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(occpation[\"id\"] == id){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$(txElement).val(occpation[\"occupation\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$(selectElement).val(occpation[\"id\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\n\t}else{\n\t\tallOccupations.forEach(function(occupation){\n\t\t\tif(occupation[\"id\"] == id){\n\t\t\t\t$(txElement).val(occupation[\"occupation\"]);\n\t\t\t\t$(selectElement).val(occupation[\"occupation\"]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t}\n\t\n}", "function R_select(e){\n//填充数据\nfunction t(e,t){var i=null;$.each(t,function(t,n){n.id==e&&(i=n)});var n=i.name;c.html(n).css(\"color\",\"#000\").attr(\"data-id\",e)}var i=e.jqueryEle,n=e.clickFn,r=e.data,s=e.render,\n//默认选中项\na=e.selectId;i.html(\"\"),$('<div class=\"select-ipt\"><div class=\"select-tit select-click\"><span class=\"select-text\">请选择</span><i class=\"drop-down\"></i></div><div class=\"select-con select-option\"><ul class=\"select-ul clearfix\"></ul></div></div>').appendTo(i);var o=i.find(\".select-ul\");if(r&&r.length){var l=\"\";$.each(r,function(e,t){l+=s(e,t)}),$(l).appendTo(o)}var u=i.find(\".select-click\"),c=i.find(\".select-text\"),d=i.find(\".select-option\");//点击选项\nu.click(function(e){e.stopPropagation(),d.is(\":visible\")?d.slideUp():d.slideDown()}),$(document).click(function(e){d.is(e.target)||0!==d.has(e.target).length||d.is(\":visible\")&&d.slideUp()}),d.find(\"li\").click(function(){t($(this).attr(\"data-id\"),r),/*changeText.html($(this).find('span').html()).css(\"color\",\"#000\")\n .attr('data-id',$(this).attr('data-id'));*/\nd.slideToggle(),n&&n.call(this,{changeText:c,isSelected:\"请选择\"!=c.text()})}),\"undefined\"!=typeof a&&\"\"!=a&&null!=a&&t(a,r)}", "function createSelect(rawData, itemName) {\n console.log(\"itemName\", itemName);\n console.log(\"rawdata\", rawData);\n var myDiv = document.getElementById(\"select_\" + itemName);\n myDiv.innerHTML = \"\";\n\n\n if (itemName == \"username\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"user_name\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"user_name\"]).trim();\n myDiv.appendChild(option);\n }\n // var selected = $(\"#current-route\").val();\n // alert($scope.currentRoute);\n $(\"#select_username\").val($scope.currentRoute);\n }\n\n \n\n\n }", "function activateSubmittedByDropdown()\n{\n\t// get the member id from the member name field\n\tvar memberId = document.getElementById(\"member_name\").value;\n\t// send member id as get request to list_admin function in LettersController\n\t$.ajax({\n\t\turl: 'list_admin',\n\t\ttype: 'GET',\n\t\tdata: {\n\t\t\tmember_id : memberId\n\t\t},\n\t\terror: function(){\n\t\t\talert('Did not work');\n\t\t},\n\t\tsuccess: function(data){\n\t\t\t// populate submitter name menu with result\n\t\t\t$(\"#submitter_name\").html(data);\n\t\t}\n\t});\n}", "function MUD_FillOptionsBankname() {\n console.log(\"===== MUD_FillOptionsBankname ===== \");\n const selected_value = null;\n let item_text = \"\"\n for (let i = 0, value; value = bankname_rows[i]; i++){\n item_text += \"<option value=\\\"\" + value + \"\\\"\";\n if (selected_value && value === selected_value) {item_text += \" selected\" };\n item_text += \">\" + value + \"</option>\";\n };\n\n el_MUD_select_bankname.innerHTML = item_text;\n\n } // MUD_FillOptionsBankname" ]
[ "0.6895468", "0.6756443", "0.66494143", "0.6561827", "0.6535589", "0.65343916", "0.65343916", "0.65126604", "0.65086895", "0.64875376", "0.6465358", "0.6452348", "0.644516", "0.6441505", "0.64396673", "0.6436632", "0.6433997", "0.6426939", "0.6422995", "0.641178", "0.6391944", "0.63843226", "0.63821334", "0.6379689", "0.63786566", "0.63761103", "0.6356397", "0.6339874", "0.63298", "0.6328188", "0.6319836", "0.6319821", "0.6305458", "0.62933123", "0.6278771", "0.62734944", "0.6251442", "0.6250042", "0.6249977", "0.623429", "0.62340045", "0.6216169", "0.6216161", "0.6212141", "0.62045354", "0.6200249", "0.61934566", "0.6184565", "0.61823684", "0.61778444", "0.6176372", "0.616143", "0.61595035", "0.61531264", "0.61527044", "0.61517835", "0.61299807", "0.61261076", "0.6123206", "0.61189526", "0.6114129", "0.61098385", "0.61055994", "0.6103159", "0.6101457", "0.61004275", "0.6076997", "0.60747117", "0.60736275", "0.60672736", "0.604703", "0.603989", "0.60389155", "0.6029251", "0.6023527", "0.6022085", "0.60204214", "0.6019318", "0.6018957", "0.6014073", "0.6014058", "0.60103536", "0.60093284", "0.60080934", "0.60044235", "0.6002062", "0.5999", "0.59976286", "0.59962696", "0.59946084", "0.59842813", "0.5983105", "0.5983082", "0.598202", "0.59811467", "0.59805894", "0.59798926", "0.5977908", "0.59691286", "0.5967954", "0.5967712" ]
0.0
-1
create functions to return name and id of each bacteria
function bacName(name) { var baclist = [] for (var i = 0; i < name.length; i++) { var stringName = name[i].toString() var splitValue = stringName.split(";") if (splitValue.length > 1) { baclist.push(splitValue[splitValue.length - 1]) } else { baclist.push(splitValue[0]) } } return baclist }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function treatBacName(name) {\n var bacteriaList = [];\n\n for (var i = 0; i < name.length; i++) {\n var stringName = name[i].toString();\n var splitValue = stringName.split(\";\");\n if (splitValue.length > 1) {\n bacteriaList.push(splitValue[splitValue.length - 1]);\n } else {\n bacteriaList.push(splitValue[0]);\n }\n }\n return bacteriaList;\n}", "function getName(seed) {\n var nome;\n var profes;//corrisponde al tipo della carta\n var luogo;\n var colore;\n switch (seed%7) {\n case 0:\n nome=\"Alessio\";\n break;\n case 1:\n nome=\"Andrea\";\n break;\n case 2:\n nome=\"Federico\";\n break;\n case 3:\n nome=\"Daniel\";\n break;\n case 4:\n nome=\"Simon\";\n break;\n case 5:\n nome=\"Riccardo\";\n break;\n case 6:\n nome=\"Nicola\";\n break;\n }\n\n switch (seed%3) {\n case 0:\n profes=\"Cavaliere\";\n break;\n case 1:\n profes=\"Picchiere\";\n break;\n case 2:\n profes=\"Mago\";\n break;\n }\n\n switch (seed%11) {\n case 0:\n luogo=\"Deserto\";\n break;\n case 1:\n luogo=\"Ghiaccio\";\n break;\n case 2:\n luogo=\"Regno\";\n break;\n case 3:\n luogo=\"Concilio\";\n break;\n case 4:\n luogo=\"Palazzo\";\n break;\n case 5:\n luogo=\"Drago\";\n break;\n case 6:\n luogo=\"Vento\";\n break;\n case 7:\n luogo=\"Tuono\";\n break;\n case 8:\n luogo=\"Fuoco\";\n break;\n case 9:\n luogo=\"Monte\";\n break;\n case 10:\n luogo=\"Fiore\";\n break;\n }\n\n switch (seed%13) {\n case 0:\n colore=\"Nero\";\n break;\n case 1:\n colore=\"Blu\";\n break;\n case 2:\n colore=\"Rosso\";\n break;\n case 3:\n colore=\"Giallo\";\n break;\n case 4:\n colore=\"Verde\";\n break;\n case 5:\n colore=\"D'Oro\";\n break;\n case 6:\n colore=\"Oscuro\";\n break;\n case 7:\n colore=\"Luminoso\";\n break;\n case 8:\n colore=\"Degli Antichi\";\n break;\n case 9:\n colore=\"Policromo\";\n break;\n case 10:\n colore=\"Della Luna\";\n break;\n case 11:\n colore=\"Del Sole\";\n break;\n case 12:\n colore=\"Del Re\";\n break;\n }\n\n\n //restituzione del nome generato\n return nome.toString()+\" \"+profes.toString()+\" Del \"+luogo.toString()+\" \"+colore.toString();\n\n}", "GetIDsOfNames() {\n\n }", "GetIDsOfNames() {\n\n }", "function characterId(name) {\n return name + \"-character\";\n}", "get names() { return this._combatants.map((combatant) => combatant.name) }", "function listCharacters() {\n console.log(\"Characters:\");\n for(var obj in adventuringParty) {\n console.log(\" * \" + adventuringParty[obj].name);\n }\n}", "function getTerritorioNameById(id){\n var r = null;\n $.each(territorios, function(k, val){/*percorre lista de territorios*/\n if(id == k){\n r = val; /*retorna o nome do territorio*/\n } \n });\n return r;\n \n }", "function identify() {\r\n return this.name.toUpperCase();\r\n}", "function getHuman(id) {\n return humanData[id];\n}", "function generateCharacter()\n{\n\t//PHP code needed here to retrieve a specific character's name, image, stats, and description for all the characters\n\t//charName is retrieved from the table \"characters\"\n\t\n\tthis.name = charName;\n\tthis.nickname = \"\";\n\tthis.motto = \"\";\n\tthis.perk = \"\";\n\tthis.health = 0;\n\tthis.hunger = 0;\n\tthis.sanity = 0;\n\tthis.imageHidden = charName + \"_silho.png\";\n\tthis.image = charName + \".png\";\n\tthis.headSlot\n}", "print_actors_string(id){\r\n let actors_string = \"\";\r\n\r\n for (var i = 0; i < this.additional_infos.length; i++) {\r\n if(id == this.additional_infos[i].id){\r\n actors_string = this.additional_infos[i].main_actors.join(\", \");\r\n };\r\n };\r\n return actors_string;\r\n }", "names() {\n return Object.keys(this.name2Id);\n }", "born(x, y) {\n let l = createVector(x, y);\n let dna = new DNA();\n let name = this.makeid(8);\n console.log(name);\n this.creatures.push(new Creature(l, dna, name));\n }", "function appendCharacterElements(character, index) {\r\n $('#id-' + index).append(`<label class=\"id\">${character.id}</label>`);\r\n $('#name-' + index).append(`<label class=\"name\">${character.name}</label>`);\r\n $('#occupation-' + index).append(`<label class=\"occupation\">${character.occupation}</label>`);\r\n $('#debt-' + index).append(`<label class=\"debt\">${character.debt}</label>`);\r\n $('#weapon-' + index).append(`<label class=\"weapon\">${character.weapon}</label>`);\r\n}", "function myName() {\n return myName.serena;\n}", "function getStateName(id){\n for(var i = 0; i < dataOfStates.length; i++){\n if(dataOfStates[i].id === id){\n stateName = dataOfStates[i].name;\n stateAbbr = dataOfStates[i].abbreviation;\n }\n } \n}", "static OneCuaderno(req, res){ \n const { id } = req.params\n Cuadernos.findAll({\n where: {id: id}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((one) => {\n res.status(200).json(one);\n }); \n }", "function generateZombie(id, name, dna) {\n let dnaStr = String(dna)\n\n // pad DNA with leading zeroes if it's less than 16 characters\n while (dnaStr.length < 16)\n dnaStr = \"0\" + dnaStr\n\n let zombieDetails = {\n // first 2 digits make up the head. We have 7 possible heads, so % 7\n // to get a number 0 - 6, then add 1 to make it 1 - 7. Then we have 7\n // image files named \"head1.png\" through \"head7.png\" we load based on\n // this number:\n headChoice: dnaStr.substring(0, 2) % 7 + 1,\n\n // 2nd 2 digits make up the eyes, 11 variations:\n eyeChoice: dnaStr.substring(2, 4) % 11 + 1,\n\n // 6 variations of shirts:\n shirtChoice: dnaStr.substring(4, 6) % 6 + 1,\n\n // last 6 digits control color. Updated using CSS filter: hue-rotate\n // which has 360 degrees:\n skinColorChoice: parseInt(dnaStr.substring(6, 8) / 100 * 360),\n eyeColorChoice: parseInt(dnaStr.substring(8, 10) / 100 * 360),\n clothesColorChoice: parseInt(dnaStr.substring(10, 12) / 100 * 360),\n zombieName: name,\n zombieDescription: \"A Level 1 CryptoZombie\",\n }\n\n return zombieDetails\n}", "function celebrityIDCreator (theCelebrities) {\n var uniqueID = 100;\n for (let i = 0; i < theCelebrities.length; i++) {\n theCelebrities[i].id = function () {\n return uniqueID + i;\n }\n }\n \n return theCelebrities;\n}", "function printGenres(objectGeneri, id) {\r\n var source = $(\"#genere-template\").html();\r\n var template = Handlebars.compile(source);\r\n\r\n var dataId = $('.film[data-id=\"'+ id +'\"]');\r\n var arrayGenres = [];\r\n\r\n for (var i = 0; i < objectGeneri.length; i++) {\r\n var singleGenre = objectGeneri[i];\r\n var genre = singleGenre.name;\r\n arrayGenres.push(genre)\r\n }\r\n var context =\r\n {\r\n generi: arrayGenres\r\n };\r\n\r\n var html = template(context);\r\n dataId.find('.genere').append(html);\r\n}", "function grabEBI(id){ return tf_Id(id); }", "get caracteristicas() {\n return [];\n }", "static oneSala(req, res){\n var id = req.params.id;\n Salas.findAll({\n where: {especialidadID : id}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((data) => {\n res.status(200).json(data);\n });\n }", "function getCharacter(id) {\n // Returning a promise just to illustrate GraphQL.js's support.\n return Promise.resolve(humanData[id] || droidData[id]);\n}", "function imprimir(turma) {\n for (i = 0; i < turma.length; i++) {\n console.log(turma[i].name);\n }\n}", "function getCuponesPorIndustria(idIndustria){\n\t\n}", "function myName() {\n return myName.darius;\n}", "function listBankName() {\r\n\t\t return banks.map((banks) => banks.name);\r\n\t}", "function listBankName() {\r\n\t\t return banks.map((banks) => banks.name);\r\n\t}", "get getInfo() {\n return super.getInfo + `. ${super.getName} belongs to ${this.breed} breed!`;\n }", "function getName(id) {\n var name = data[id].name;\n return name;\n}", "static oneCita(req, res){ \n var id = req.params.id; \n Citas_Medicas.findAll({\n where: {codigo_p: id}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((Citas) => {\n res.status(200).json(Citas);\n }); \n }", "getPokemonNameById(pokemonId) {\n if (this.pokemon) {\n for (let i = 0; i < this.pokemon.length; i++){\n if (this.pokemon[i].id == [pokemonId]){\n return this.pokemon[i].name + (this.pokemon[i].form == 'alolan' ? '*' : '');\n }\n }\n }\n return null;\n }", "static CitasPaciente(req, res){ \n var id = req.params.id; \n Citas_Medicas.findAll({\n where: {id_Paciente: id}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((Citas) => {\n res.status(200).json(Citas);\n }); \n }", "function id_from_name(object_name) {\n switch(object_name) {\n case 'hop_box':\n return 'hop';\n case 'fermentable_box':\n return 'fermentable';\n case 'yeast_box':\n return 'yeast';\n case 'recipe_box':\n return 'recipe';\n default:\n console.log(object_name);\n return 'nothing found';\n }\n}", "function getIdUser(name) {\n for (let index = 0; index < thongTinNguoiDung.length; index++) {\n if (thongTinNguoiDung[index].name === name) {\n return thongTinNguoiDung[index].id;\n }\n }\n return \"\";\n}", "print_genres_string(id){\r\n let genres_string = \"\";\r\n\r\n for (var i = 0; i < this.additional_infos.length; i++) {\r\n if(id == this.additional_infos[i].id){\r\n genres_string = this.additional_infos[i].genres.join(\" / \");\r\n };\r\n };\r\n return genres_string;\r\n }", "translateSuitToEntityCode(){\nreturn this.suitObjects[`${this.randomSuitName0 }`];\n }", "translateSuitToEntityCode(){\nreturn this.suitObjects[`${this.randomSuitName0 }`];\n }", "getBone(b) {\nreturn this.bones[b];\n}", "function Id(a,b,c,d){var e={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return b?e[c][0]:e[c][1]}", "function Id(a,b,c,d){var e={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return b?e[c][0]:e[c][1]}", "function Id(a,b,c,d){var e={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return b?e[c][0]:e[c][1]}", "function Id(a,b,c,d){var e={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return b?e[c][0]:e[c][1]}", "function newObject(){\n var newFlavor = document.getElementById(\"flavor\").textContent;\n var newGlaze = customizeGlazeToObject();\n var newQuantity = customizeQuantityToObject();\n var newPrice = customizePriceToObject();\n //var newID = customizeIDToObject();\n var newBun = new bun (newFlavor, newGlaze, newQuantity, newPrice);\n return newBun;\n}", "function getIdBusquedaCaracteristicas(){\n\tvar tipo_formulario = jQuery('#tipoFormulario_hidden').val();\n\t\n\tvar param={};\n\tif (tipo_formulario==derecho_comercial){\n\t\tparam = {\n\t\t\t\tidDerechoComercial: jQuery(\"#idDerecho\").val()\n\t\t};\n\t} else if (tipo_formulario==derecho_cpi || \n\t\t\t tipo_formulario == derecho_trn || \n\t\t\t tipo_formulario == derecho_dis || \n\t\t\t tipo_formulario == derecho_int){\n\t\tparam = {\n\t\t\t\tidCaracteristica: jQuery(\"#idCaracteristica\").val()\n\t\t};\n\t} else if (tipo_formulario == plantillas){\n\t\tparam = {\n\t\t\t\tidPlantillaDerecho: jQuery(\"#idPlantillaDerecho\").val()\n\t\t};\n\t}\n\treturn param;\n}", "function getVardas() {\n var name = 'Tomas';\n return name;\n}", "get_reg( name ){ return this.items[ this.names.get( name ) ]; }", "function createSuperHero(name, alias, location){\n var mode = name\n return {\n name: name,\n alias: alias,\n location: location,\n findID: function(){ console.log(mode)},\n switchID: function(){\n if(mode == this.name){\n//what does \"this. do?\"\n mode = this.alias\n } else {\n mode = this.name\n }\n }\n }\n}", "async function getInformation() {\n try {\n const ids = await getRecipies();\n console.log(ids);\n const jor = await getRecipe(ids[0]);\n console.log(jor);\n const nextJor = await getAuthorRecipe(jor.author);\n console.log(nextJor);\n return nextJor.name;\n } catch (error) {\n console.log(\"Алдаа : \" + error);\n }\n}", "function generateName(row){\n\t\tvar name;\n\t\tif(row.gender == 'f' || row.gender == 'F'){\n\t\t\tname = girlNames[getRandomIndex(girlNames.length - 1)];\n\t\t}\n\t\telse{\n\t\t\tname = boyNames[getRandomIndex(boyNames.length - 1)];\t\n\t\t}\n\t\treturn name;\n\t}", "function celebrityIDCreator (theCelebrities) {\n var i;\n var uniqueID = 100;\n for (i = 0; i < theCelebrities.length; i++) {\n theCelebrities[i][\"id\"] = function () {\n return uniqueID + i;\n }\n }\n \n return theCelebrities;\n}", "function loadVillainCharacters(){\n let villain_template = ``;\n let get_villains = character_datas.filter((character)=> character.character_type === \"villain\");\n let random_data = get_villains[Math.floor(Math.random() * get_villains.length)];\n let selected_villains = get_villains.filter((villain) => villain.id != random_data.id);\n\n for(let villain_index = 0; villain_index < selected_villains.length - 1; villain_index++){\n villain_template += `<li class=\"character\">`;\n villain_template += ` <img src=${ selected_villains[villain_index].img }>`;\n villain_template += ` <h3>${ selected_villains[villain_index].name }</h3>`;\n villain_template += ` <button type=\"button\" class=\"fight_button\">FIGHT!</button>`;\n villain_template += `</li>`\n }\n\n $(\".villains\").html(villain_template);\n}", "function getVocaboli(ricerca) {\r\n for (i = 0; 0 < dizionario.length; i++) {\r\n if (dizionario[i].nome == ricerca) {\r\n return dizionario[i];\r\n }\r\n }\r\n\r\n}", "function getNama() {\n return nama;\n}", "function celebrityIDCreator (theCelebrities) {\n var i;\n var uniqueID = 100;\n for (i = 0; i < theCelebrities.length; i++) {\n theCelebrities[i][\"id\"] = function () {\n return uniqueID + i;\n }\n }\n\n return theCelebrities;\n}", "function idToHeroName (heroes, heroId) {\n for (let i = 0; i < heroes.length; i++) {\n if (heroes[i].id == heroId) {\n return heroes[i].localized_name;\n }\n }\n return 'Unknown';\n}", "generateSupportCharacter() {\r\n species = this.shuffle(species)\r\n let race = species[0]\r\n let gender = this.shuffle([\"Female\", \"Male\"])[0]\r\n let firstName = this.shuffle(race[gender])[0]\r\n let lastName = this.shuffle(race[\"Family\"])[0]\r\n\r\n let attributePool = this.shuffle([10, 10, 9, 9, 8, 7])\r\n let attributes = [\r\n \"Control (\" +\r\n (attributePool[0] +\r\n this.findAttribute(\"Control\", race.AttributeBonus)) +\r\n \")\",\r\n \"Fitness (\" +\r\n (attributePool[1] +\r\n this.findAttribute(\"Fitness\", race.AttributeBonus)) +\r\n \")\",\r\n \"Presence (\" +\r\n (attributePool[2] +\r\n this.findAttribute(\"Presence\", race.AttributeBonus)) +\r\n \")\",\r\n \"Daring (\" +\r\n (attributePool[3] + this.findAttribute(\"Daring\", race.AttributeBonus)) +\r\n \")\",\r\n \"Insight (\" +\r\n (attributePool[4] +\r\n this.findAttribute(\"Insight\", race.AttributeBonus)) +\r\n \")\",\r\n \"Reason (\" +\r\n (attributePool[5] + this.findAttribute(\"Reason\", race.AttributeBonus)) +\r\n \")\"\r\n ]\r\n\r\n let disciplinePool = this.shuffle([4, 3, 2, 2, 1, 1])\r\n let disciplines = [\r\n \"Command (\" + disciplinePool[0] + \")\",\r\n \"Conn (\" + disciplinePool[1] + \")\",\r\n \"Security (\" + disciplinePool[2] + \")\",\r\n \"Engineering (\" + disciplinePool[3] + \")\",\r\n \"Science (\" + disciplinePool[4] + \")\",\r\n \"Medicine (\" + disciplinePool[5] + \")\"\r\n ]\r\n\r\n let talent = this.shuffle(race.Talents)[0]\r\n\r\n return {\r\n title: firstName + \" \" + lastName,\r\n description: \"Generated support character\",\r\n fields: [\r\n {\r\n name: \"Race\",\r\n value: race.Name\r\n },\r\n {\r\n name: \"Gender\",\r\n value: gender\r\n },\r\n {\r\n name: \"Attributes\",\r\n value: attributes.join(\", \")\r\n },\r\n {\r\n name: \"Disciplines\",\r\n value: disciplines.join(\", \")\r\n },\r\n {\r\n name: \"Talent\",\r\n value: talent\r\n }\r\n ]\r\n }\r\n }", "function nameBaris(b){\n\tswitch(b){\n\t\tcase \"aritmetik\" : return \"Barisan Aritmetika biasa.\"; break;\n\t\tcase \"geometrik\" : return \"Barisan Geometri biasa.\"; break;\n\t\tcase \"aritgeo\" : return \"Pola bilangan dijumlah/dikurangi, kemudian dikali/dibagi\"; break;\n\t\tcase \"geoarit\" : return \"Pola bilangan dikali/dibagi, kemudian dijumlah/dikurangi\"; break;\n\t\tcase \"aritmetiksarang\": return \"Barisan aritmetika bertingkat.\"; break;\n\t\tcase \"geometriksarang\": return \"Barisan geometri bertingkat.\"; break;\n\t\tcase \"aritgeosarang\" : return \"Barisan aritmetika yang bedanya merupakan barisan geometri.\"; break;\n\t\tcase \"geoaritsarang\" : return \"Barisan geometri yang rasionya merupakan barisan aritmetika.\"; break;\n\t\tcase \"slangslingaa\" : return \"Pola selang-seling dua barisan aritmetika biasa.\"; break;\n\t\tcase \"slangslinggg\" : return \"Pola selang-seling dua barisan geometri biasa.\"; break;\n\t\tcase \"slangslingga\" : return \"Pola selang-seling barisan geometri biasa dan aritmetika biasa.\"; break;\n\t\tcase \"fibonacci\" : return \"Barisan Fibonacci biasa.\"; break;\n\t\tcase \"fibonaccix\" : return \"Seperti barisan Fibonacci, tapi berupa perkalian.\"; break;\n\t\tcase \"kuadrat\" : return \"Barisan bilangan kuadrat.\"; break;\n\t\tdefault\t\t\t\t : return \"Error. Barisan tak dikenali.\"; break;\n\t}\n}", "function getCharacter() {\n const charName = document.querySelector('.char-name');\n const charGender = document.querySelector('.char-gender');\n const charBirth = document.querySelector('.char-birth');\n const charSkin = document.querySelector('.char-skin');\n\n axios({ url: `${baseURL}/people/${generateRandomNumber(1, 25)}` })\n .then(\n (res) => (\n (charName.innerText = res.data.name),\n (charGender.innerText = res.data.gender),\n (charBirth.innerText = res.data.birth_year),\n (charSkin.innerText = res.data.skin_color)\n )\n )\n .catch((err) => {\n catchNotFoundError();\n console.log(err);\n });\n}", "function getRandomAnimal() {\n return {\n name: getRandomEntry(animals),\n color: getRandomEntry(colors)\n };\n }", "function generarClave() {\n var i = 0;\n var clave = '';\n while (i < 10) {\n clave += caracter[(Math.round(Math.random() * 35))];\n i++;\n }\n return clave;\n}", "static listOne(req, res){ \n var id = req.params.id; \n console.log(id + \" este es\");\n Especialidad.findAll({\n where: {id: id}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((one) => {\n res.status(200).json(one);\n }); \n }", "get_genres(genre_ids){\r\n // Esempio di genre_ids = [ 100 , 45 ]\r\n let genres = [];\r\n\r\n genre_ids.forEach(genre_id => {\r\n this.all_genres.forEach((genre, index) => {\r\n // Confronta ogni id del film con l array del genere\r\n if(genre_id == genre.id){\r\n // Quando trova corrispondenza aggiunge il nome del genre alla stringa\r\n genres.push(genre.name);\r\n };\r\n });\r\n });\r\n return genres;\r\n }", "function showUserFighter() {\n characters.forEach(function (index) {\n if (index.id === userCharacter) {\n userCharacter = index;\n $('.your-character').append(\n \"<div id='user'>\" +\n userCharacter.name +\n\n \"<img class='img-responsive img-circle col-xs-3 col-sm-3 col-md-3' src='\" + userCharacter.img + \"'/><div id='userHp'>\" + userCharacter.hp + \"</div></div></div>\"\n );\n }\n });\n\n console.log(userCharacter);\n }", "getOneRegister(id) {\n \n return this.axios\n .get(`/characters/${id}`)\n \n }", "getImageName(state){\n const images = state.fishesListe.map( fish => fish.file_id );\n return images;\n }", "function gizmo(id){\n\treturn{\n\t\ttoString: function(){\n\t\t\treturn \"gizmo\" + id;\n\t\t}\n\t};\n}", "function obtenerNombre(){\n return \"Dante\";\n}", "static get BoneName() {}", "chercheClef(recherche) {\n let blockRecherche = [];\n for (var j = 0; j < this.terrain.dimension.y; j++) {\n for (var i = 0; i < this.terrain.dimension.x; i++) {\n let id = this.terrain.geometrie[j][i];\n if (this.clefs[id].nom === recherche) {\n let info = {\n pos: {\n x: i,\n y: j\n }\n }\n blockRecherche.push(info);\n }\n }\n }\n return blockRecherche;\n }", "function buscarVoluntario()\r\n{ \r\n var personas = [\"Alejandro\", \"JuanCarlos\", \"Cristian\", \"Iñigo\", \"Erlantz\", \"Raul\", \"Joseba\", \"Endika\", \"ana\", \"maria\", \"mikel\", \"Aitor\", \"kiryl\", \"iker\"]; \r\n document.getElementById('nombre').innerHTML = (personas[Math.floor(Math.random() * personas.length)])\r\n}", "async getNames() {\n const data = await this.getData();\n\n // We are using map() to transform the array we get into another one\n return data.map((medewerkers) => {\n return { naam: medewerkers.naam };\n });\n }", "static oneSalaNombre(req, res){\n var especialidad = req.params.especialidad;\n Salas.findAll({\n where: {nombre : especialidad}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((data) => {\n res.status(200).json(data);\n });\n }", "function mostrarPokemon(id) {\n return pokemons[id] || {};\n}", "function imprimir_nombre_de_coleccion(personas){\n for (var i =0; i< personas.length; i = i +1){\n console.log(personas[i].nombre);\n }\n}", "function createCompleteOrcCharacter()\n{\n getOrcAge();\n getOrcBuild();\n getOrcAppearance();\n getOrcBackground();\n getOrcPersonality();\n}", "getGeneticColorName(){\n\n\t var tyr_allele_a = this.getCurrentAllele(\"Chromosome1A\", \"tyr_mouth\").value;\n\t var tyr_allele_b = this.getCurrentAllele(\"Chromosome1B\", \"tyr_mouth\").value;\n\n\t var trp_allele_a = this.getCurrentAllele(\"Chromosome1A\", \"trp_flower_01\").value;\n\t var trp_allele_b = this.getCurrentAllele(\"Chromosome1B\", \"trp_flower_01\").value;\n \n var motor_allele_a = this.getCurrentAllele(\"Chromosome2A\", \"myocin_grabber\").value;\n var motor_allele_b = this.getCurrentAllele(\"Chromosome2B\", \"myocin_grabber\").value;\n\n var gate_allele_a = this.getCurrentAllele(\"Chromosome0A\", \"gate_stopper_button\").value;\n var gate_allele_b = this.getCurrentAllele(\"Chromosome0B\", \"gate_stopper_button\").value;\n\n //not albino\n\t\tif(tyr_allele_a == true || tyr_allele_b == true){\n\t\t\t//shiny\n\t if(gate_allele_a === false || gate_allele_b === false){\n\t\t\t\t//deep\t \t\n\t \tif(motor_allele_a || motor_allele_b){\n\t \t\t//grey\n\t \t\tif(trp_allele_a || trp_allele_b){\n\t \t\t\treturn \"steel\";\n\t \t\t}\n\t \t\t//orange/yellow\n\t \t\telse{\n\t \t\t\treturn \"copper\";\n\t \t\t}\n\t \t}\n\t \t//faded\n\t \telse{\n\t \t\t//grey\n\t \t\tif(trp_allele_a || trp_allele_b){\n\t \t\t\treturn \"silver\";\n\t \t\t}\n\t \t\t//orange/yellow\n\t \t\telse{\n\t \t\t\treturn \"gold\";\n\t \t\t}\n\t \t}\n\t }\n\t //not shiny\n\t else{\n\t\t\t\t//deep\t \t\n\t \tif(motor_allele_a || motor_allele_b){\n\t \t\t//grey\n\t \t\tif(trp_allele_a || trp_allele_b){\n\t \t\t\treturn \"charcoal\";\n\t \t\t}\n\t \t\t//orange/yellow\n\t \t\telse{\n\t \t\t\treturn \"lava\";\n\t \t\t}\n\t \t}\n\t \t//faded\n\t \telse{\n\t \t\t//grey\n\t \t\tif(trp_allele_a || trp_allele_b){\n\t \t\t\treturn \"ash\";\n\t \t\t}\n\t \t\t//orange/yellow\n\t \t\telse{\n\t \t\t\treturn \"sand\";\n\t \t\t}\n\t \t}\n\t }\n\t\t}\n\n\t\t//albino\n\t\telse{\n\t\t\treturn \"frost\";\n\t\t}\n\n\n\t\treturn \"[no color found]\";\n\n\t}", "function generateHotel ()\n{\n new Hotel ( 'Hotel','L','south' );\n new Hotel ( 'Hotel','L','north' );\n new Hotel ( 'Hotel','L','middle' );\n\n new Hotel ( 'Hotel','M','south' );\n new Hotel ( 'Hotel','M','north' );\n new Hotel ( 'Hotel','M','middle' );\n\n new Hotel ( 'Hotel','G','south' );\n new Hotel ( 'Hotel','G','north' );\n new Hotel ( 'Hotel','G','middle' );\n\n console.log( Hotel.all );\n}", "function getFildName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "async function bringrootvalue(id) {\n let subname = []\n const response3 = await categories.findAll({ where: { parent_id: id } });\n if(response3.length>0)\n {\n for(let i = 0 ; i < response3.length;i++)\n {\n subname[i]= response3[i].name\n }\n }\n return subname\n }", "function getIcondsDb() {\n return [\n {\n name: \"cat\",\n prefix: \"fa-\",\n type: \"animal\",\n family: \"fas\",\n },\n {\n name: \"crow\",\n prefix: \"fa-\",\n type: \"animal\",\n family: \"fas\",\n },\n {\n name: \"dog\",\n prefix: \"fa-\",\n type: \"animal\",\n family: \"fas\",\n },\n {\n name: \"dove\",\n prefix: \"fa-\",\n type: \"animal\",\n family: \"fas\",\n },\n {\n name: \"dragon\",\n prefix: \"fa-\",\n type: \"animal\",\n family: \"fas\",\n },\n {\n name: \"horse\",\n prefix: \"fa-\",\n type: \"animal\",\n family: \"fas\",\n },\n {\n name: \"hippo\",\n prefix: \"fa-\",\n type: \"animal\",\n family: \"fas\",\n },\n {\n name: \"fish\",\n prefix: \"fa-\",\n type: \"animal\",\n family: \"fas\",\n },\n {\n name: \"carrot\",\n prefix: \"fa-\",\n type: \"vegetable\",\n family: \"fas\",\n },\n {\n name: \"apple-alt\",\n prefix: \"fa-\",\n type: \"vegetable\",\n family: \"fas\",\n },\n {\n name: \"lemon\",\n prefix: \"fa-\",\n type: \"vegetable\",\n family: \"fas\",\n },\n {\n name: \"pepper-hot\",\n prefix: \"fa-\",\n type: \"vegetable\",\n family: \"fas\",\n },\n {\n name: \"user-astronaut\",\n prefix: \"fa-\",\n type: \"user\",\n family: \"fas\",\n },\n {\n name: \"user-graduate\",\n prefix: \"fa-\",\n type: \"user\",\n family: \"fas\",\n },\n {\n name: \"user-ninja\",\n prefix: \"fa-\",\n type: \"user\",\n family: \"fas\",\n },\n {\n name: \"user-secret\",\n prefix: \"fa-\",\n type: \"user\",\n family: \"fas\",\n },\n ];\n\n}", "function myName() {\n return myName.eunice;\n }", "function getCharacter(id) {\n var _a;\n // Returning a promise just to illustrate that GraphQL.js supports it.\n return Promise.resolve((_a = Data_1.humanData[id]) !== null && _a !== void 0 ? _a : Data_1.droidData[id]);\n}", "static OnlyCita(req, res){ \n var id = req.params.id; \n Citas_Medicas.findAll({\n where: {id: id}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((Citas) => {\n res.status(200).json(Citas);\n }); \n }", "function getChampionIDs(){\n\n}", "getBio() {\n let bio = `${this.firstName} is ${this.age}.`;\n this.likes.forEach((like) => {\n bio += ` ${this.firstName} likes ${like}.`;\n });\n return bio;\n }", "function names(listers){\n listers.forEach((names)=>{\n const brand = document.createElement(\"h1\")\n const image = document.createElement(\"img\")\n const name = document.createElement(\"h3\")\n const price = document.createElement(\"p\")\n brand.textContent = names.brand\n image.setAttribute(\"src\", names.image_link)\n name.textContent = names.name\n price.textContent = names.price\n brand.append(image, price, name)\n products.append(brand)\n });\n}", "function getCharacter(id) {\n console.log('getCharacter called with id: ', id);\n // Returning a promise just to illustrate GraphQL.js's support.\n var humanData = Human.findOne({ 'id': id });\n var droidData = Droid.findOne({ 'id': id });\n return Promise.resolve(humanData || droidData);\n}", "function returnMethod(id) {\n\tswitch(id) {\n\t\tcase\"btl\":\n\t\t\treturn \"BTL/Tubes Tied\";\n\t\tcase\"ccap\":\n\t\t\treturn \"CCAP\";\n\t\tcase\"depo\":\n\t\t\treturn \"Depo\";\n\t\tcase\"nori\":\n\t\t\treturn \"Noristerat\";\n\t\tcase\"cyclomess\":\n\t\t\treturn \"Cyclofem and Messygna\";\n\t\tcase\"diaph\":\n\t\t\treturn \"Diaphram\";\n\t\tcase\"fam\":\n\t\t\treturn \"Fam\";\n\t\tcase\"fcondom\":\n\t\t\treturn \"Female Condom\";\n\t\tcase\"implanon\":\n\t\t\treturn \"Implant\";\n\t\tcase\"mcondom\":\n\t\t\treturn \"Male Condom\";\n\t\tcase\"mirena\":\n\t\t\treturn \"Mirena\";\n\t\tcase\"nuvaring\":\n\t\t\treturn \"Nuva Ring\";\n\t\tcase\"ocp\":\n\t\t\treturn \"Birth Control Pills\";\n\t\tcase\"ortho_evra\":\n\t\t\treturn \"Patch\";\n\t\tcase\"paragard\":\n\t\t\treturn \"Paragard\";\n\t\tcase\"pop\":\n\t\t\treturn \"Mini Pills\";\n\t\tcase\"sperm\":\n\t\t\treturn \"Spermicide\";\n\t\tcase\"sponge\":\n\t\t\treturn \"Sponge\";\n\t\tcase\"vas\":\n\t\t\treturn \"Vasectomy\";\n\t\tcase\"withd\":\n\t\t\treturn \"Withdrawal\";\n\t}\n}", "randomSuitName(){\n// Pointer to a random suit\nconst randomSuitIdx = Math.floor(Math.random()*this.remainingSuitNames.length);\n// suit key\nconst randomSuitName = this.remainingSuitNames[randomSuitIdx];\n// Preserve randomSuitName for future usage\n// this.randomBldgBlocks.randomSuitName = randomSuitName; \nreturn randomSuitName; //this.randomBldgBlocks.randomSuitName;\n }", "randomSuitName(){\n// Pointer to a random suit\nconst randomSuitIdx = Math.floor(Math.random()*this.remainingSuitNames.length);\n// suit key\nconst randomSuitName = this.remainingSuitNames[randomSuitIdx];\n// Preserve randomSuitName for future usage\n// this.randomBldgBlocks.randomSuitName = randomSuitName; \nreturn randomSuitName; //this.randomBldgBlocks.randomSuitName;\n }", "static One_Consulta_id(req, res){ \n var id = req.params.id_consulta; \n Consultas.findAll({\n where: {id: id}, \n //attributes: ['id', ['description', 'descripcion']]\n \n }).then((data) => {\n res.status(200).json(data);\n }); \n }", "function buscarRuido() { //esto es una funcion que escribes un animal y te devuelve el ruido.\n let nombreAnimal = document.getElementById(\"nombre\").value;\n for (let i = 0; i < animales.length; i++) {\n if (animales[i].nombre === nombreAnimal) {\n alert(animales[i].ruido);\n }\n }\n}", "function generateDorb()\n{\n let dorb = [\"\", \"\", 0, 0];\n // name, description, type index, personality index\n \n// NAME -----------------\n\n let name = RiTa.randomWord(\"nn\", 1) + RiTa.randomWord(\"nn\", 1); // two one-syllable random words as starter \n name = name.split('').sort(function(){return 0.5-Math.random()}).join(''); // scramble their order\n name = name.slice(0, name.length/2); // cut it in half\n dorb[0] = name[0].toUpperCase() + name.slice(1); // capitalize the first letter\n \n// DESCRIPTION ----------\n \n // description\n let descriptionGrammar = {\n \"<start>\" : [dorbDesc[Math.floor(Math.random() * 3)]],\n \"<adj1>\" : [\"fiesty\",\"spunky\",\"happy\",\"snarky\",\"adorable\"],\n \"<noun1>\" : [\"monster\",\"beast\",\"superstar\",\"legend\",\"rising star\",\"baby\"],\n \"<noun2>\" : [\"spunk\",\"snark\",\"moxie\",\"fight\",\"bite\"]\n }\n let grammar = new RiGrammar(descriptionGrammar);\n dorb[1] = grammar.expand();\n \n // type\n dorb[2] = randomNumber(dorb[0], 't');\n \n // personality\n dorb[3] = randomNumber(dorb[0], 'p');\n \n return dorb;\n}", "async function getChamberDuts() {\n let result = await client.query(\n \n 'SELECT ' +\n \n 'duts.id, ' +\n 'chambers.name ' +\n\n 'FROM chambers ' + \n\n 'INNER JOIN duts ON duts.id=chambers.dut_id'\n\n );\n\n return result.rows;\n}", "function createCompleteFerrenCharacter()\n {\n getFerrenAge();\n getFerrenBuild();\n getFerrenHumanAppearance();\n getFelineAppearance();\n getFerrenMannerism();\n getFerrenPersonality();\n getFerrenBackground();\n }", "getBone4cc(b) {\nreturn this.bone4cc[b];\n}", "function createtiles(letter,value,id){\nthis.name=letter;\nthis.value=value;\nthis.ID=id\n}", "function drawTableSpecies(specie){\n\t\tinfoSpecies = $('#tableContent').html();\n\t\tinfoSpecies += \"<tr>\"+\n\t\t\t\"<td><img src='/img/species/\"+ IgnoreSpecialCharactersFromString(specie.name)+ \".png' class='charactersIMG center-block'</td>\"+\n\t\t\t\"<td><b>Name: </b>\"+ specie.name+\"</td>\"+\n\t\t\t\"<td><b>Classification: </b>\"+ specie.classification+\"</td>\"+\n\t\t\t\"<td><b>Designation: </b>\"+ specie.designation+\"</td>\"+\n\t\t\t\"<td><b>Average Lifespan: </b>\"+ specie.average_lifespan+\" Years.</td>\"+\n\t\t\t\"<td><b>Language: </b>\"+ specie.language+\"</td>\"+\n\t\t\t\"<td><b>Skin Colors: </b>\"+ specie.skin_colors+\"</td>\"+\n\t\t\t\"<td><b>Homeworld: </b>\"+drawModal(specie.homeworld, specie.name+\"HomeworldSpecie\", 'planets')+\"</td>\"+\n\t\t\t\"<td><b>People: </b>\"+drawModal(specie.people, specie.name+\"PeopleSpecies\", 'people')+\"</td>\"+\n\t\t\t\"<td><b>Films: </b>\"+drawModal(specie.films, specie.name+\"FilmsSpecies\", 'films')+\"</td>\"+\n\t\t\t\"</tr>\";\n\n\t\t$table.html(infoSpecies);\n\t}" ]
[ "0.58329076", "0.5774267", "0.5766436", "0.5766436", "0.56945586", "0.5642876", "0.548231", "0.5467554", "0.5464553", "0.5456094", "0.5434128", "0.5378381", "0.537817", "0.5354723", "0.53507924", "0.5348313", "0.53237027", "0.5322983", "0.53094774", "0.52982455", "0.5289025", "0.5285581", "0.52573323", "0.5251812", "0.5243442", "0.523782", "0.5234315", "0.522791", "0.52248734", "0.52248734", "0.52223265", "0.5218335", "0.52160466", "0.51959187", "0.5195419", "0.51923174", "0.5177327", "0.5176954", "0.5164485", "0.5164485", "0.5164337", "0.5154509", "0.5154509", "0.5154509", "0.5154509", "0.51319504", "0.51225674", "0.51110333", "0.5110832", "0.5109353", "0.51090884", "0.5099003", "0.50941163", "0.50908107", "0.5089166", "0.5083399", "0.5080592", "0.5078418", "0.50728375", "0.5068764", "0.5068629", "0.5058435", "0.5056888", "0.5054076", "0.50426024", "0.5027342", "0.50267756", "0.50243914", "0.50224787", "0.5019191", "0.50158983", "0.50131214", "0.50070757", "0.49998835", "0.49990475", "0.49868405", "0.49775553", "0.4976447", "0.49758193", "0.4972365", "0.4971211", "0.49702948", "0.49661168", "0.49657458", "0.49634036", "0.4961148", "0.4956476", "0.49563462", "0.49496326", "0.4946336", "0.49457845", "0.49456024", "0.49456024", "0.49451816", "0.49429548", "0.4942787", "0.49399304", "0.49361065", "0.49209085", "0.49201438", "0.491965" ]
0.0
-1
create first plot function filling in demo panel
function demographics(selector) { var filter1 = data.metadata.filter(value => value.id == selector); var div = d3.select(".panel-body") div.html(""); div.append("p").text(`ID: ${filter1[0].id}`) div.append("p").text(`ETHNICITY: ${filter1[0].ethnicity}`) div.append("p").text(`GENDER: ${filter1[0].gender}`) div.append("p").text(`AGE: ${filter1[0].age}`) div.append("p").text(`LOCATION: ${filter1[0].location}`) div.append("p").text(`BELLY BUTTON TYPE: ${filter1[0].bbtype}`) div.append("p").text(`WASHING FREQUENCY: ${filter1[0].wfreq}`) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function plot() {\n\n}", "function plot() {\n \n }", "function render_panel() {\n\n elem.html(\"\");\n\n var el = elem[0];\n\n var parent_width = elem.parent().width(),\n height = parseInt(scope.panel.height),\n padding = 50,\n outerRadius = height / 2 - 30,\n innerRadius = outerRadius / 3;\n\n var margin = {\n top: 20,\n right: 20,\n bottom: 100,\n left: 50\n },\n width = parent_width - margin.left - margin.right;\n\n\n var plot, chartData;\n var colors = [];\n\n // IE doesn't work without this\n elem.css({height: scope.panel.height || scope.row.height});\n\n // Make a clone we can operate on.\n\n chartData = _.clone(scope.data);\n chartData = scope.panel.missing ? chartData :\n _.without(chartData, _.findWhere(chartData, {meta: 'missing'}));\n chartData = scope.panel.other ? chartData :\n _.without(chartData, _.findWhere(chartData, {meta: 'other'}));\n\n if (filterSrv.idsByTypeAndField('terms', scope.panel.field).length > 0) {\n colors.push(scope.panel.lastColor);\n } else {\n colors = scope.panel.chartColors;\n }\n\n var AP_1 = 0.0;\n var AP_2 = 0.0;\n var AP_n = 0.0;\n for (var i = 0; i < chartData.length; i++) {\n AP_n = AP_n + chartData[i].data[0][1];\n if (parseInt(chartData[i].label) <= scope.panel.threshold_first) {\n AP_1 += chartData[i].data[0][1];\n } else if (parseInt(chartData[i].label) < scope.panel.threshold_second && parseInt(chartData[i].label) > scope.panel.threshold_first) {\n AP_2 += chartData[i].data[0][1] * 0.5;\n }\n }\n var APdex = 100;\n if (AP_n != 0) {\n APdex = parseInt(100 * (AP_1 + AP_2) / AP_n);\n //APdex = (AP_1+AP_2)/AP_n;\n }\n\n\n var idd = scope.$id;\n require(['jquerymin', 'd3min', 'd3transform', 'extarray', 'misc', 'microobserver', 'microplugin', 'bubble', 'centralclick', 'lines'], function(){\n // Populate element\n try {\n\n var labelcolor = false;\n if (dashboard.current.style === 'dark') {\n labelcolor = true;\n }\n // Add plot to scope so we can build out own legend\n\n\n if (scope.panel.chart === 'd3text') {\n\n var bubbleChart = new d3.svg.BubbleChart({\n supportResponsive: true,\n //container: => use @default\n size: 600,\n //viewBoxSize: => use @default\n innerRadius: 600 / 3.5,\n //outerRadius: => use @default\n radiusMin: 50,\n //radiusMax: use @default\n //intersectDelta: use @default\n //intersectInc: use @default\n //circleColor: use @default\n data: {\n items: [\n {text: \"Java\", count: \"236\"},\n {text: \".Net\", count: \"382\"},\n {text: \"Php\", count: \"170\"},\n {text: \"Ruby\", count: \"123\"},\n {text: \"D\", count: \"12\"},\n {text: \"Python\", count: \"170\"},\n {text: \"C/C++\", count: \"382\"},\n {text: \"Pascal\", count: \"10\"},\n {text: \"Something\", count: \"170\"},\n ],\n eval: function (item) {\n return item.count;\n },\n classed: function (item) {\n return item.text.split(\" \").join(\"\");\n }\n },\n plugins: [\n {\n name: \"central-click\",\n options: {\n text: \"(See more detail)\",\n style: {\n \"font-size\": \"12px\",\n \"font-style\": \"italic\",\n \"font-family\": \"Source Sans Pro, sans-serif\",\n //\"font-weight\": \"700\",\n \"text-anchor\": \"middle\",\n \"fill\": \"white\"\n },\n attr: {dy: \"65px\"},\n centralClick: function () {\n alert(\"Here is more details!!\");\n }\n }\n },\n {\n name: \"lines\",\n options: {\n format: [\n {// Line #0\n textField: \"count\",\n classed: {count: true},\n style: {\n \"font-size\": \"28px\",\n \"font-family\": \"Source Sans Pro, sans-serif\",\n \"text-anchor\": \"middle\",\n fill: \"white\"\n },\n attr: {\n dy: \"0px\",\n x: function (d) {\n return d.cx;\n },\n y: function (d) {\n return d.cy;\n }\n }\n },\n {// Line #1\n textField: \"text\",\n classed: {text: true},\n style: {\n \"font-size\": \"14px\",\n \"font-family\": \"Source Sans Pro, sans-serif\",\n \"text-anchor\": \"middle\",\n fill: \"white\"\n },\n attr: {\n dy: \"20px\",\n x: function (d) {\n return d.cx;\n },\n y: function (d) {\n return d.cy;\n }\n }\n }\n ],\n centralFormat: [\n {// Line #0\n style: {\"font-size\": \"50px\"},\n attr: {}\n },\n {// Line #1\n style: {\"font-size\": \"30px\"},\n attr: {dy: \"40px\"}\n }\n ]\n }\n }]\n });\n }\n\n\n // Populate legend\n if (elem.is(\":visible\")) {\n setTimeout(function () {\n scope.legend = plot.getData();\n if (!scope.$$phase) {\n scope.$apply();\n }\n });\n }\n\n } catch (e) {\n elem.text(e);\n }\n });\n }", "function render_panel() {\n\n var scripts = $LAB.script(\"common/lib/panels/jquery.flot.js\").wait()\n .script(\"common/lib/panels/jquery.flot.pie.js\")\n\n // Populate element.\n scripts.wait(function(){\n // Populate element\n try {\n // Add plot to scope so we can build out own legend \n if(scope.panel.chart === 'bar')\n scope.plot = $.plot(elem, scope.data, {\n legend: { show: false },\n series: {\n lines: { show: false, },\n bars: { show: true, fill: 1, barWidth: 0.8, horizontal: false },\n shadowSize: 1\n },\n yaxis: { show: true, min: 0, color: \"#c8c8c8\" },\n xaxis: { show: false },\n grid: {\n backgroundColor: '#272b30',\n borderWidth: 0,\n borderColor: '#eee',\n color: \"#eee\",\n hoverable: true,\n },\n colors: ['#86B22D','#BF6730','#1D7373','#BFB930','#BF3030','#77207D']\n })\n if(scope.panel.chart === 'pie')\n scope.plot = $.plot(elem, scope.data, {\n legend: { show: false },\n series: {\n pie: {\n innerRadius: scope.panel.donut ? 0.4 : 0,\n tilt: scope.panel.tilt ? 0.45 : 1,\n radius: 1,\n show: true,\n combine: {\n color: '#999',\n label: 'The Rest'\n },\n stroke: {\n color: '#272b30',\n width: 0\n },\n label: { \n show: scope.panel.labels,\n radius: 2/3,\n formatter: function(label, series){\n return '<div ng-click=\"build_search(panel.query.field,\\''+label+'\\') \"style=\"font-size:8pt;text-align:center;padding:2px;color:white;\">'+\n label+'<br/>'+Math.round(series.percent)+'%</div>';\n },\n threshold: 0.1 \n }\n }\n },\n //grid: { hoverable: true, clickable: true },\n grid: { hoverable: true, clickable: true },\n colors: ['#86B22D','#BF6730','#1D7373','#BFB930','#BF3030','#77207D']\n });\n\n // Compensate for the height of the legend. Gross\n elem.height(\n (scope.panel.height || scope.row.height).replace('px','') - $(\"#\"+scope.$id+\"-legend\").height())\n\n // Work around for missing legend at initialization\n if(!scope.$$phase)\n scope.$apply()\n\n } catch(e) {\n elem.text(e)\n }\n })\n }", "function plot(func, atts) {\n if (atts==null) {\n return addCurve(board, func, {strokewidth:2});\n } else {\n return addCurve(board, func, atts);\n }\n }", "function render_panel() {\n if (shouldAbortRender()) {\n //return;\n }\n \n \n // this.seriesList = [];\n // this.data = [];\n\n var stack = panel.stack ? true : null;\n\n // Populate element\n var options = {\n hooks: {\n draw: [drawHook],\n processOffset: [processOffsetHook],\n },\n legend: { show: false },\n series: {\n stackpercent: panel.stack ? panel.percentage : false,\n stack: panel.percentage ? null : stack,\n bars: {\n show: true,\n fill: 0.9,\n barWidth: 1,\n zero: false,\n lineWidth: 0,\n align: 'center'\n },\n shadowSize: 0\n },\n yaxes: [],\n xaxis: {},\n grid: {\n minBorderMargin: 0,\n markings: [],\n backgroundColor: null,\n borderWidth: 0,\n hoverable: true,\n color: '#c8c8c8',\n margin: { left: 0, right: 0 },\n },\n selection: {\n mode: \"x\",\n color: '#666'\n },\n crosshair: {\n mode: panel.tooltip.shared || dashboard.sharedCrosshair ? \"x\" : null\n }\n };\n\n // var scopedVars = ctrl.panel.scopedVars;\n //// var bucketSize = !panel.bucketSize && panel.bucketSize !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.bucketSize.toString(), scopedVars));\n // var minValue = !panel.minValue && panel.minValue !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.minValue.toString(), scopedVars));\n // var maxValue = !panel.maxValue && panel.maxValue !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.maxValue.toString(), scopedVars));\nif(!isPng){\n\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n series.data = getFFT(series);\n \n options.series.bars.barWidth = ((series.data[series.data.length-1][0] + series.data[0][0])/series.data.length);//(elem.width()/series.data.length);\n\n // if hidden remove points and disable stack\n if (ctrl.hiddenSeries[series.alias]) {\n series.data = [];\n series.stack = false;\n }\n }\n\n // if (data.length && data[0].stats.timeStep) {\n //data[0].stats.timeStep / 1.5;\n // }\n} else {\n \n addAnnotations(options); \n}\n \n // panel.yaxes[1].show = true;\n configureAxisOptions(data, options);\n // addHistogramAxis(options);\n // options.selection = {};\n\n sortedSeries = _.sortBy(data, function(series) { return series.zindex; });\n\n function callPlot(incrementRenderCounter) {\n try {\n $.plot(elem, sortedSeries, options);\n } catch (e) {\n console.log('flotcharts error', e);\n }\n\n if (incrementRenderCounter) {\n ctrl.renderingCompleted();\n }\n }\n \n scope.isPng = isPng;\n \n \n scope.zoomPlot = function(start, end) {\n \n options.xaxis.min = start;\n options.xaxis.max = end;\n\n callPlot(true);\n };\n \n scope.zoomOut = function() {\n if(isPng){\n // this.ctrl.events.emit('zoom-out');\n this.ctrl.publishAppEvent('zoom-out',2);\n } else {\n options.xaxis.min = null;\n options.xaxis.max = null;\n callPlot(true);\n }\n \n };\n \n\n if (shouldDelayDraw(panel)) {\n // temp fix for legends on the side, need to render twice to get dimensions right\n callPlot(false);\n setTimeout(function() { callPlot(true); }, 50);\n legendSideLastValue = panel.legend.rightSide;\n }\n else {\n callPlot(true);\n }\n }", "function drawDynamicChart() {\n $(function() { \n var container = $(\"#flot-moving-line-chart\");\n\n var predata = new Array(300);\n\n for(var i = 0; i<300; i++)\n {\n predata[i] = power_watt[300-i-1]; \n }\n \n function getPowerData() {\n //push predata to res, just use 180 element\n var res = [];\n for (var i = 0; i < 300; i++) {\n res.push([i, predata[i]]);\n }\n \n return res; \n }\n\n series = [{\n data: getPowerData(),\n lines: {\n fill: true\n }\n }];\n\n //\n\n var plot = $.plot(container, series, {\n grid: {\n backgroundColor: \"#292D36\"\n },\n xaxis: {\n tickFormatter: function() {\n return \"\";\n },\n color: '#ffffff'\n\n },\n yaxis: {\n min: 0,\n color: '#ffffff',\n font: {size: 15, color: '#ffffff'},\n axisLabel: 'Watt',\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Verdana, Arial, Helvetica, Tahoma, sans-serif',\n axisLabelPadding: 5,\n axisLabelColour: '#ffffff'\n }\n });\n series[0].data = getPowerData();\n plot.setData(series); \n plot.draw();\n });\n}", "function FunctionPlotter(options) {\n let axisTickCounts,\n functions,\n gridBoolean,\n group,\n hasTransitioned,\n plotArea,\n plotter,\n range,\n width,\n where,\n x,\n y;\n\n plotter = this;\n\n init(options);\n\n return plotter;\n\n /* INITIALIZE */\n function init(options) {\n let curtain;\n\n _required(options);\n _defaults(options);\n\n\n curtain = addCurtain();\n plotter.scales = defineScales();\n plotter.axisTitles = {};\n group = addGroup();\n plotArea = addPlotArea();\n plotter.layers = addLayers();\n plotter.grid = addGrid();\n plotter.axes = addAxes();\n plotter.lines = addLines(functions);\n plotter.hotspot = addHotspot();\n\n plotter.hasTransitioned = false;\n\n // valueCircle = false;\n\n\n }\n\n /* PRIVATE METHODS */\n function _defaults(options) {\n\n axisTickCounts = options.axisTicks ? options.axisTicks : {\"x\":1,\"y\":1};\n functions = options.functions ? options.functions : [];\n plotter.height = options.height ? options.height : 400;\n plotter.width = options.width ? options.width : 800;\n plotter.domain = options.domain ? options.domain : [0,10];\n plotter.range = options.range ? options.range : [0,10];\n plotter.margins = options.margins ? options.margins : defaultMargins();\n //TODO: THIS IS SLOPPY. GRID SHOULD BE CLEARER\n gridBoolean = options.hideGrid ? false : true;\n x = options.x ? options.x : 0;\n y = options.y ? options.y : 0;\n plotter.coordinates = options.coordinates ? options.coordinates : {\"x\":x,\"y\":y};\n plotter.fontFamily = options.fontFamily ? options.fontFamily : \"\";\n\n }\n\n function _required(options) {\n\n hasTransitioned = false;\n where = options.where;\n\n }\n\n\n /* PRIVATE METHODS */\n function addAxes() {\n let axes;\n\n axes = {};\n\n axes.x = addXAxis();\n axes.y = addYAxis();\n\n return axes;\n }\n\n function addCurtain() {\n let clipPath,\n rect;\n\n clipPath = where\n .select(\"defs\")\n .append(\"clipPath\")\n .attr(\"id\",\"plotterClipPath\");\n\n rect = clipPath\n .append(\"rect\")\n .attr(\"x\",-1)\n .attr(\"y\",-1)\n .attr(\"width\",width - plotter.margins.left - plotter.margins.right + 1)\n .attr(\"height\",plotter.height - plotter.margins.top - plotter.margins.bottom + 1);\n\n return clipPath;\n }\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\"where\":options.where})\n .attr(\"transform\",\"translate(\"+plotter.coordinates.x+\",\"+plotter.coordinates.y+\")\");\n\n return group;\n }\n\n function addGrid() {\n let grid;\n\n if(gridBoolean) {\n grid = new FunctionPlotterGrid({\n \"axisTickCounts\":axisTickCounts,\n \"domain\":plotter.domain,\n \"range\":range,\n \"scales\":plotter.scales,\n \"where\":plotter.layers.grid,\n \"tickEvery\":1\n });\n }\n\n return grid;\n }\n\n function addHotspot() {\n let hotspot;\n\n hotspot = group\n .append(\"rect\")\n .attr(\"x\",plotter.margins.left)\n .attr(\"y\",plotter.margins.top)\n .attr(\"width\",plotter.width - plotter.margins.left - plotter.margins.right)\n .attr(\"height\",plotter.height - plotter.margins.top - plotter.margins.bottom)\n .attr(\"fill\",\"rgba(0,0,0,0)\");\n\n return hotspot;\n }\n\n function addPlotArea() {\n let plotGroup;\n\n plotGroup = explorableGroup({\n \"where\":group\n })\n .attr(\"transform\",\"translate(\"+plotter.margins.left+\",\"+plotter.margins.top+\")\");\n\n return plotGroup;\n }\n\n function addLayers() {\n let layers;\n\n layers = {};\n layers.plot = explorableGroup({\"where\":group})\n .attr(\"transform\",\"translate(\"+plotter.margins.left+\",\"+plotter.margins.top+\")\");\n\n layers.grid = explorableGroup({\"where\":layers.plot})\n .attr(\"clip-path\",\"url(#plotterClipPath)\");\n\n layers.axes = explorableGroup({\"where\":layers.plot});\n layers.lines = explorableGroup({\"where\":layers.plot});\n\n\n layers.indicators = explorableGroup({\"where\":group});\n layers.tooltip = explorableGroup({\"where\":group});\n\n return layers;\n }\n\n\n function addLines(functions) {\n let lines;\n\n if(functions.length == 0) {\n lines = [];\n\n return lines;\n }\n\n functions.forEach((aFunction) => {\n let line = new FunctionPlotterLine({\n \"function\":aFunction,\n \"where\":plotter.layers.lines,\n \"domain\":plotter.domain,\n \"scales\":plotter.scales,\n });\n\n lines.push(line);\n });\n\n return lines;\n }\n\n function addXAxis() {\n let axis;\n\n axis = new FunctionPlotterAxis({\n \"axisType\":\"bottom\",\n \"scales\":plotter.scales,\n \"tickCount\":axisTickCounts.x,\n \"where\":plotter.layers.axes\n });\n\n return axis;\n }\n\n function addYAxis() {\n let axis;\n\n axis = new FunctionPlotterAxis({\n \"axisType\":\"left\",\n \"scales\":plotter.scales,\n \"tickCount\":axisTickCounts.y,\n \"where\":plotter.layers.axes\n });\n\n return axis;\n }\n\n function defaultMargins() {\n return {\n \"left\":100,\n \"right\":10,\n \"top\":30,\n \"bottom\":50\n };\n }\n\n function defineScale(inputDomain,outputRange) {\n let scale;\n\n scale = d3.scaleLinear()\n .domain(inputDomain)\n .range(outputRange);\n\n return scale;\n }\n\n function defineScales() {\n let scales;\n\n scales = {};\n scales.x = defineScale(plotter.domain,[0,plotter.width - plotter.margins.right - plotter.margins.left]);\n scales.y = defineScale(plotter.range,[plotter.height - plotter.margins.bottom - plotter.margins.top,0]);\n\n return scales;\n }\n\n\n}", "function generate_plot(args){\n var cohort_ids = [];\n //create list of actual cohort models\n for(var i in args.cohorts){\n cohort_ids.push(args.cohorts[i].cohort_id);\n }\n var plotFactory = Object.create(plot_factory, {});\n\n var plot_element = $(\"[worksheet_id='\"+args.worksheet_id+\"']\").parent().parent().find(\".plot\");\n var plot_loader = plot_element.find('.plot-loader');\n var plot_area = plot_element.find('.plot-div');\n var plot_legend = plot_element.find('.legend');\n var pair_wise = plot_element.find('.pairwise-result');\n pair_wise.empty();\n plot_area.empty();\n plot_legend.empty();\n var plot_selector = '#' + plot_element.prop('id') + ' .plot-div';\n var legend_selector = '#' + plot_element.prop('id') + ' .legend';\n\n plot_loader.fadeIn();\n plot_element.find('.resubmit-button').hide();\n plotFactory.generate_plot({ plot_selector : plot_selector,\n legend_selector : legend_selector,\n pairwise_element : pair_wise,\n type : args.type,\n x : args.x,\n y : args.y,\n color_by : args.color_by,\n gene_label : args.gene_label,\n cohorts : cohort_ids,\n color_override : false}, function(result){\n if(result.error){\n plot_element.find('.resubmit-button').show();\n }\n\n plot_loader.fadeOut();\n });\n }", "function optionChanged (sample) {\ndemographic_panel(sample);\ncreate_charts(sample);\n}", "function plotFunction(functionText,functionDerivativeText,xbasis,ybasis,start,end,stepSize){\n var shapeLayer = app.project.activeItem.layers.addShape();\n var path = shapeLayer.content.addProperty(\"ADBE Vector Shape - Group\");\n var length = Math.floor((((end-start)*xbasis)/stepSize)+2);\n var k = (100/stepSize) * 3;\n var approx = 10000;\n var vertices=[];\n var inTangents=[];\n var outTangents=[];\n var shape = new Shape();\n var generator = new Function(\"x\",\"return \"+functionText+\";\");\n var generatorDeriv = new Function(\"x\",\"return \"+functionDerivativeText+\";\");\n\n for(var i =0;i<length;i++){\n x = ((stepSize * i) + start* xbasis);\n y = (-ybasis) * Math.round(approx*generator(((stepSize * i) + start* xbasis)/xbasis))/approx;\n y0 = (ybasis/k) * Math.round(approx*generatorDeriv(((stepSize * i) + start* xbasis)/xbasis))/approx;\n vertices.push([x,y]);\n inTangents.push([-100/k,y0]);\n outTangents.push([100/k,-y0]);\n }\n\n shape.vertices=vertices;\n shape.inTangents = inTangents;\n shape.outTangents = outTangents;\n shape.closed=false;\n\n path.path.setValue(shape);\n addStroke(shapeLayer,5);\n shapeLayer.name = functionText;\n shapeLayer.comment = functionText;\n shapeLayer.effect.addProperty(\"xAxis\");\n\n return shapeLayer;\n }", "function FunctionNumberLinePlotter(options) {\n let domain,\n highlightColor,\n plotter,\n where;\n\n plotter = this;\n\n init(options);\n\n return plotter;\n\n /* INITIALIZE */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n plotter.scale = defineScale();\n plotter.group = addGroup();\n plotter.layers = addLayers();\n plotter.highlightElements = [];\n\n\n }\n\n\n\n /* PRIVATE METHODS */\n function _defaults() {\n\n //TODO: COORDINATES RIGHT NOW ARE FOR convenience. SHOULD BE (0,0) !\n plotter.coordinates = options.coordinates ? options.coordinates : {\"x\":150,\"y\":125};\n domain = options.domain ? options.domain : [-2,12];\n highlightColor = options.color ? options.color : \"black\";\n\n plotter.margins = options.margins ? options.margins : {\"top\":30,\"bottom\":30};\n\n plotter.width = options.width ? options.width : 500;\n plotter.height = options.height ? options.height : 200;\n\n plotter.inputY = plotter.margins.top;\n plotter.outputY = plotter.height - plotter.margins.bottom;\n\n\n }\n\n function _required(options) {\n\n where = options.where;\n\n }\n\n\n function addLayers() {\n let layers;\n\n layers = {};\n\n layers.axes = explorableGroup({\n \"where\":plotter.group\n });\n\n layers.data = explorableGroup({\n \"where\":plotter.group\n });\n\n layers.highlights = explorableGroup({\n \"where\":plotter.group\n });\n\n return layers;\n }\n\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n })\n .attr(\"transform\",\"translate(\"+plotter.coordinates.x+\",\"+plotter.coordinates.y+\")\");\n\n return group;\n }\n\n\n function defineScale() {\n let scale;\n\n scale = d3.scaleLinear()\n .domain(domain)\n .range([0,plotter.width]);\n\n return scale;\n }\n\n\n}", "function FunctionNumberLinePlotter(options) {\n let domain,\n highlightColor,\n plotter,\n where;\n\n plotter = this;\n\n init(options);\n\n return plotter;\n\n /* INITIALIZE */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n plotter.scale = defineScale();\n plotter.group = addGroup();\n plotter.layers = addLayers();\n plotter.highlightElements = [];\n\n\n }\n\n\n\n /* PRIVATE METHODS */\n function _defaults() {\n\n //TODO: COORDINATES RIGHT NOW ARE FOR convenience. SHOULD BE (0,0) !\n plotter.coordinates = options.coordinates ? options.coordinates : {\"x\":150,\"y\":125};\n domain = options.domain ? options.domain : [-2,12];\n highlightColor = options.color ? options.color : \"black\";\n\n plotter.margins = options.margins ? options.margins : {\"top\":30,\"bottom\":30};\n\n plotter.width = options.width ? options.width : 500;\n plotter.height = options.height ? options.height : 200;\n\n plotter.inputY = plotter.margins.top;\n plotter.outputY = plotter.height - plotter.margins.bottom;\n\n\n }\n\n function _required(options) {\n\n where = options.where;\n\n }\n\n\n function addLayers() {\n let layers;\n\n layers = {};\n\n layers.axes = explorableGroup({\n \"where\":plotter.group\n });\n\n layers.data = explorableGroup({\n \"where\":plotter.group\n });\n\n layers.highlights = explorableGroup({\n \"where\":plotter.group\n });\n\n return layers;\n }\n\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n })\n .attr(\"transform\",\"translate(\"+plotter.coordinates.x+\",\"+plotter.coordinates.y+\")\");\n\n return group;\n }\n\n\n function defineScale() {\n let scale;\n\n scale = d3.scaleLinear()\n .domain(domain)\n .range([0,plotter.width]);\n\n return scale;\n }\n\n\n}", "function plotSeries() {\n if (series.length < 2)\n return;\n var placeholder = $(\"#placeholder\");\n var p = $.plot(placeholder, [series], options);\n}", "function SimplePlot( ) {\n\t\n\t//environment vars\n\t//placeholders\n\tthis.height = '467px';\n\tthis.width = '600px';\n\tthis.border = \"2px solid black\";\n\tthis.minX = '0px';\n this.minY = '0px';\n this.maxX = '0px';\n this.maxY = '0px';\n\n this.regLoc = [];\n this.path = \"\";\n this.scaleX = 5;\n this.scaleY = 5;\n this.ticks = 10;\n this.pipSize= 10;\n this.xlabel = \"x\";\n this.ylabel = \"y\";\n this.origin = [0, 0];\n this.title = \"\";\n this.series = []; //plotable series's x = ..[pos][i][0] y = ..[pos][i][0]\n\n}", "function salesHeatmap() {}", "function startPlot() {\n plotArea.stopWatch.Start();\n for (let i = 0; i < globalScope.Flag.length; i++) {\n globalScope.Flag[i].plotValues = [[0, globalScope.Flag[i].inp1.value]];\n globalScope.Flag[i].cachedIndex = 0;\n }\n // play();\n plotArea.scroll = 1;\n addPlot();\n}", "function makeVis() {\n ScatterPlot = new ScatterPlot(\"scatter_plot\", all_data, lottery_data, round_1_data, round_2_data);\n Slider = new Slider('slider', all_data);\n\n}", "plot() {\n if (this.plot === 'Cumulative frequency plot' ||\n this.plot === 'Dot plot') {\n this.createPlot();\n }\n }", "function initPlot() {\n var Us = calculateUs();\n if (deltaHapproach==\"briggs\"){\n var hprime = calculateSTdownwash();\n }\n else{\n var hprime = h;\n }\n //var deltaH = calculateDeltaH(Us);\n //var H = h + deltaH;\n\n make_plot( Us, hprime);\n \n}", "function CalculationStepPlot(options) {\n\n //TODO: DONT HARDCODE THESE VALUES\n const leftColumnPosition = 100;\n const middleColumnPosition = 100;\n\n let columns,\n color,\n stepPlot,\n domain,\n range,\n height,\n width,\n where,\n functionToPlot,\n lineTextColor;\n\n stepPlot = {};\n\n init(options);\n\n return stepPlot;\n\n /* INITIALIZE */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n stepPlot.group = addGroup();\n stepPlot.columns = addColumns();\n stepPlot.plot = addPlot();\n stepPlot.label = addLabel();\n\n }\n\n\n\n /* PRIVATE METHODS */\n function _required(options) {\n\n where = options.where;\n\n }\n\n function _defaults() {\n\n width = options.width ? options.width : 100;\n height = options.height ? options.height : 70;\n domain = options.domain ? options.domain : [0,10];\n range = options.range ? options.range : [0,10];\n color = options.color ? options.color : \"black\";\n lineTextColor = options.lineTextColor ? options.lineTextColor : \"black\";\n functionToPlot = options.function ? options.function : (x) => { return x; };\n\n }\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n });\n\n return group;\n }\n\n function addColumns() {\n let groupObject;\n\n groupObject = {};\n\n groupObject.left = explorableGroup({\n \"where\":stepPlot.group,\n }).attr(\"transform\",\"translate(\"+leftColumnPosition+\",0)\");\n\n\n groupObject.middle = explorableGroup({\n \"where\":stepPlot.group,\n }).attr(\"transform\",\"translate(\"+middleColumnPosition+\",0)\");\n\n\n return groupObject;\n }\n\n function addLabel() {\n let label;\n\n label = new ExplorableHintedText({\n \"where\":columns.left,\n \"textAnchor\":\"end\",\n \"foregroundColor\":lineTextColor,\n \"fontWeight\":\"bold\",\n \"fontSize\":\"10pt\"\n })\n .move({\n \"x\":-5,\n \"y\":height / 2\n })\n .update(\"ID =\");\n\n return label;\n }\n\n function addPlot() {\n let plot;\n\n plot = functionPlotter({\n \"where\":columns.middle,\n \"width\":width,\n \"height\":height,\n \"domain\":domain,\n \"range\":range,\n \"hideGrid\":true,\n \"margins\":{\n \"left\":0,\n \"top\":0,\n \"right\":0,\n \"bottom\":10\n },\n \"circleRadius\":2,\n \"axisTicks\":{\n \"x\":0,\n \"y\":0\n }\n })\n .addLine({\n \"function\":functionToPlot,\n \"stroke\":color,\n \"textColor\":lineTextColor,\n \"strokeWidth\":3,\n });\n\n return plot;\n }\n}", "function initCarte(type) {\n Plotly.purge(\"graph-holder\");\n let initX3 = initialPoint3[0];\n let initY3 = initialPoint3[0];\n\n\n let x3 = 1;\n let y3 = 1;//parseFloat(document.getElementById('y3Controller').value);\n Plotly.newPlot(\"graph-holder\", computeBasis(x3, y3), layout);\n}", "function drawVisualization() {\r\n var style = \"bar-color\";//document.getElementById(\"style\").value;\r\n var showPerspective = true;//document.getElementById(\"perspective\").checked;\r\n // var withValue = [\"bar-color\", \"bar-size\", \"dot-size\", \"dot-color\"].indexOf(style) != -1;\r\n\r\n // Create and populate a data table.\r\n data = [];\r\n\r\n var color = 0;\r\n var steps = 3; // number of datapoints will be steps*steps\r\n var axisMax = 8;\r\n var axisStep = axisMax / steps;\r\n for (var x = 0; x <= axisMax; x += axisStep+1) {\r\n for (var y = 0; y <= axisMax; y += axisStep) {\r\n var z = Math.random();\r\n if (true) {\r\n data.push({\r\n x: x,\r\n y: y,\r\n z: z,\r\n style: {\r\n fill: colors[color],\r\n stroke: colors[color+1]\r\n }\r\n });\r\n }\r\n else {\r\n data.push({ x: x, y: y, z: z });\r\n }\r\n }\r\n color+=1;\r\n }\r\n\r\nvar category = [\"A\",\"B\",\"C\",\"D\"];\r\nvar cat_count = 0;\r\n // specify options\r\n var options = {\r\n width:'100%',\r\n style: style,\r\n xBarWidth: 2,\r\n yBarWidth: 2,\r\n showPerspective: showPerspective,\r\n showShadow: false,\r\n keepAspectRatio: true,\r\n verticalRatio: 0.5,\r\n xCenter:'55%',\r\n yStep:2.5,\r\n xStep:3.5,\r\n animationAutoStart:true,\r\n animationPreload:true,\r\n showShadow:true,\r\n \r\n yLabel: \"Categories (of Abuse)\",\r\n xLabel: \"Groups\",\r\n zLabel: \"Reports\",\r\n yValueLabel: function (y) {\r\n if(y == 0){\r\n return \"Category \" + category[y];\r\n }else{\r\n return \"Category \" +category[Math.ceil(y/3)];\r\n }\r\n },\r\n \r\n xValueLabel: function(x) {\r\n if(x == 0){\r\n return \"Group 1\";\r\n }else{\r\n return \"Group \" + (Math.ceil(x/3));\r\n }\r\n },\r\n tooltip: function(data){\r\n var res = \"\";\r\n if(data.x == 0){\r\n res += \"<strong>Group 1</strong>\";\r\n }else{\r\n res += \"<strong>Group</strong> \" + (Math.ceil(data.x/3));\r\n }\r\n\r\n if(data.y == 0){\r\n res+= \"<br><strong>Category</strong> \" + category[data.y];\r\n }else{\r\n res+= \"<br><strong>Category</strong> \" +category[Math.ceil(data.y/3)];\r\n }\r\n\r\n res+= \"<br><strong>Reports</strong> \" + data.z;\r\n return res;\r\n }\r\n };\r\n\r\n\r\n var camera = graph ? graph.getCameraPosition() : null;\r\n\r\n // create our graph\r\n var container = document.getElementById(\"mygraph\");\r\n graph = new vis.Graph3d(container, data, options);\r\n\r\n if (camera) graph.setCameraPosition(camera); // restore camera position\r\n/*\r\n document.getElementById(\"style\").onchange = drawVisualization;\r\n document.getElementById(\"perspective\").onchange = drawVisualization;\r\n document.getElementById(\"xBarWidth\").onchange = drawVisualization;\r\n document.getElementById(\"yBarWidth\").onchange = drawVisualization;*/\r\n}", "function plot(input)\r\n{\r\n\tvar exp_arr = new Array();//array to store expectaion values\r\n\t\r\n\tvar sum_actual = 0;//sum of actual values of the data points \r\n\t\r\n\tvar sum_exp = 0;//sum of expectation values of data points\r\n\t\r\n\tvar max_x=0;//maximum value of x(to determine max range on x axis)\r\n\t\r\n\tvar max_val = 0;//maximum value of data points(to determine maximum range on y axis)\r\n\t\r\n\t\tfor(j=0;j<input[\"data\"] .length;j++)\r\n\t\t{\r\n\t\t\texp_arr[j] = new Array();\r\n\t\t\t\r\n\t\t\tif(j==0) sum_actual += input[\"data\"][j][1];\r\n\t\t\telse \r\n\t\t\t\tsum_actual += input[\"data\"][j-1][1] ;\r\n\r\n\t\t\tif(j==0) exp_arr [j][1] = sum_actual;\r\n\t\t\telse\r\n\t\t\t\texp_arr [j][1] = sum_actual * input[\"imp_f\"] / (j+1) ;\r\n\t\t\t\t\r\n\t\t\texp_arr [j][0] = input[\"data\"] [j][0] ;\r\n\t\t\t\t\r\n\t\t\tsum_exp += exp_arr [j][1];\r\n\t\t\t\r\n\t\t\tmax_val = input[\"data\"] [j][1]>max_val? input[\"data\"] [j][1] : max_val;\r\n\t\t\tmax_val = exp_arr [j][1]>max_val? exp_arr [j][1] : max_val;\r\n\t\t\tmax_x = input[\"data\"] [j][0]>max_x? input[\"data\"] [j][0] : max_x;\r\n\t\t}\r\n\t\tvar output = new Array();\r\n\t\toutput[\"si\"] = sum_actual / sum_exp;\r\n\r\n\t\tplots = $.jqplot(input[\"target_id\"] , [input[\"data\"] , exp_arr ], { \r\n\t\t\t\t title:input[\"title\"] , \r\n\t\t\t\t seriesDefaults: {showMarker:false}, \r\n\t\t\t\t series:[\r\n\t\t\t\t\t {},\r\n\t\t\t\t\t {yaxis:'y2axis'}, \r\n\t\t\t\t\t {yaxis:'y3axis'}\r\n\t\t\t\t ], \r\n\t\t\t\t highlighter: {\r\n\t\t\t\t\tshow: true,\r\n\t\t\t\t\tsizeAdjust: 7.5\r\n\t\t\t\t },\r\n\t\t\t\t cursor: {\r\n\t\t\t\t\tshow: false,\r\n\t\t\t\t }, \r\n\t\t\t\t axesDefaults:{useSeriesColor: true}, \r\n\t\t\t\t axes:{\r\n\t\t\t\t\t xaxis:{min:0, max:max_x, numberTicks:input[\"n_x\"] }, \r\n\t\t\t\t\t yaxis:{min:0, max:max_val, numberTicks:input[\"n_ticks\"] }, \r\n\t\t\t\t\t y2axis:{\r\n\t\t\t\t\t\t min:0, \r\n\t\t\t\t\t\t max:max_val, \r\n\t\t\t\t\t\t numberTicks:input[\"n_ticks\"] , \r\n\t\t\t\t\t\t tickOptions:{showGridline:false}\r\n\t\t\t\t\t }, \r\n\t\t\t\t\t y3axis:{}\r\n\t\t\t\t } \r\n\t\t\t\t \r\n\t\t\t });\r\n\t\t\t \r\n\toutput[\"sum\"] = sum_actual;\r\n\t\r\n\treturn output;\r\n}", "createInfoPanel() {\n var panel = d3.select(\"#panel\");\n\n // Close panel button\n panel.append(\"button\")\n .text(\"X\")\n .on(\"click\", function () {\n panel.style(\"display\", \"none\");\n LibrariesMap.libCirclesGroup.selectAll(\"circle\").classed(\"circle-selected\", false);\n });\n\n // Create the pie charts svg\n this.pieSvg = panel.append(\"svg\")\n .attr(\"id\", \"pie-svg\")\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"50%\")\n\n // Language Pie chart\n this.pieSvg.append(\"g\")\n .attr(\"id\", \"pieLg-group\")\n .attr(\"transform\", \"translate(\" + pieChartDim.left + \",\" + pieChartDim.top + \")\");\n // Public Pie chart\n this.pieSvg.append(\"g\")\n .attr(\"id\", \"piePub-group\")\n .attr(\"transform\", \"translate(\" + pieChartDim.left1 + \",\" + pieChartDim.top + \")\");\n // Format Pie chart\n this.pieSvg.append(\"g\")\n .attr(\"id\", \"pieForm-group\")\n .attr(\"transform\", \"translate(\" + pieChartDim.left2 + \",\" + pieChartDim.top + \")\");\n \n // Legend\n this.createLegend(8, LibrariesMap.pieLgColorScale, pieLgInfo.legendTexts);\n this.createLegend(pieChartDim.left1*0.75, LibrariesMap.piePubColorScale, piePubInfo.legendTexts);\n this.createLegend(pieChartDim.left2*0.8, LibrariesMap.pieFormColorScale, pieFormInfo.legendTexts);\n\n return panel;\n }", "function changePattern(val) {\n var type = val;\n var summaryArray3 =[];\n var drillDown3=[];\n if(yearGapFlag | monthGapFlag){\n summaryArray3 = summaryArray2;\n drillDown3 = drillDown2;\n }else{\n summaryArray3 = summaryArray;\n drillDown3 = drillDown;\n }\n\n // console.log(summaryArray3);\n if(type !== 'line'){\n var chart = new Highcharts.chart({\n chart: {\n defaultSeriesType: type,\n renderTo: 'graphDiv',\n events: {\n drilldown: function (e) {\n chart.setTitle({text: drilldownTitle + e.point.name});\n chart.setSubtitle(\"\");\n },\n drillup: function(e) {\n chart.setTitle({ text: defaultTitle });\n }\n }\n },\n title: {\n text: defaultTitle\n },\n subtitle: {\n text: 'Click the columns to view more details..'\n },\n xAxis: {\n type: 'category'\n },\n yAxis: {\n title: {\n text: 'Total patch count'\n }\n\n },\n legend: {\n enabled: false\n },\n plotOptions: {\n series: {\n borderWidth: 0,\n dataLabels: {\n enabled: true,\n format: '{point.y}'\n }\n }\n },\n\n tooltip: {\n headerFormat: '<span style=\"font-size:11px\">{series.name} Summary</span><br>',\n pointFormat: '<span style=\"color:{point.color}\">{point.name}</span>: <b>{point.y}</b> of Total<br/>'\n },\n\n series: [{\n name: 'Patch',\n colorByPoint: true,\n data: summaryArray3\n }],\n drilldown: {\n series: drillDown3\n }\n });\n }else{\n var chart = new Highcharts.chart({\n chart: {\n defaultSeriesType: type,\n renderTo: 'graphDiv',\n events: {\n drilldown: function (e) {\n chart.setTitle({text: drilldownTitle + e.point.name});\n chart.setSubtitle(\"\");\n },\n drillup: function(e) {\n chart.setTitle({ text: defaultTitle });\n }\n }\n },\n title: {\n text: defaultTitle\n },\n subtitle: {\n text: 'Click the columns to view more details..'\n },\n xAxis: {\n type: 'category'\n },\n yAxis: {\n title: {\n text: 'Total patch count'\n }\n\n },\n legend: {\n enabled: false\n },\n plotOptions: {\n series: {\n borderWidth: 0,\n dataLabels: {\n enabled: true,\n format: '{point.y}'\n }\n }\n },\n\n tooltip: {\n headerFormat: '<span style=\"font-size:11px\">{series.name} Summary</span><br>',\n pointFormat: '<span style=\"color:{point.color}\">{point.name}</span>: <b>{point.y}</b> of Total<br/>'\n },\n\n series: [{\n name: 'Patch',\n color:'Black',\n data: summaryArray3\n }],\n drilldown: {\n series: drillDown3\n }\n });\n }\n\n}", "function showLegend(){\n d3.select(\".panel\")\n .transition()\n .duration(500)\n .attr(\"transform\", \"translate(0,0)\")\n}", "function clearIt() {\n\tPlotly.newPlot(visDiv, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#00f' },\n\t\tname: 'Vis'\n\t}], { title: 'Visual Light' });\n\tPlotly.newPlot(irDiv, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#f00' },\n\t\tname: 'IR'\n\t}], { title: 'Infra red Light' });\n\n\tPlotly.newPlot(ps1Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#f00' },\n\t\tname: 'PS1'\n\t}], { title: 'Proximity 1' });\n\tPlotly.newPlot(ps2Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#0f0' },\n\t\tname: 'PS2'\n\t}], { title: 'Proximity 2' });\n\tPlotly.newPlot(ps3Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#00f' },\n\t\tname: 'PS3'\n\t}], { title: 'Proximity 3' });\n}", "function mainplotdrawn() {\n $scope.mainplotcomplete = true;\n }", "function FunctionPlotterLine(options) {\n let circleRadius,\n numberOfSamples,\n line,\n sampledPoints,\n stroke,\n strokeWidth,\n strokeDashArray,\n where,\n valueTextColor;\n\n line = this;\n\n init(options);\n\n return line;\n\n /* INTIALIZE */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n\n sampledPoints = samplePoints();\n line.lineGenerator = defineLineGenerator();\n line.path = addPath();\n line.valueCircle = addValueCircle();\n line.valueText = addValueText();\n\n line\n .updatePlot();\n\n }\n\n\n /* PRIVATE METHODS */\n\n function _defaults(options) {\n\n circleRadius = options.circleRadius ? options.circleRadius : 0;\n numberOfSamples = options.samples ? options.samples : 100;\n stroke = options.stroke ? options.stroke : \"black\";\n strokeWidth = options.strokeWidth ? options.strokeWidth : 1;\n strokeDashArray = options.strokeDashArray ? options.strokeDasharray : \"1,0\";\n valueTextColor = options.textColor ? options.textColor : stroke;\n\n }\n\n function _required(options) {\n\n where = options.where;\n line.functionToPlot = options.function;\n line.domain = options.domain;\n line.scales = options.scales;\n\n }\n\n function addPath() {\n let path,\n pathDefinition;\n\n pathDefinition = line.lineGenerator(sampledPoints);\n\n path = where\n .append(\"path\")\n .attr(\"stroke\",stroke)\n .attr(\"fill\",\"none\")\n .attr(\"stroke-width\",strokeWidth)\n .attr(\"stroke-dasharray\",strokeDashArray)\n .attr(\"d\",pathDefinition);\n\n\n return path;\n }\n\n function addValueCircle() {\n let circle;\n\n circle = where\n .append(\"circle\")\n .attr(\"r\",circleRadius)\n .attr(\"fill\",stroke);\n\n return circle;\n }\n\n function addValueText() {\n let text;\n\n text = new ExplorableHintedText({\n \"where\":where,\n \"fontSize\":\"22pt\",\n \"foregroundColor\":valueTextColor,\n \"fontWeight\":\"bold\"\n });\n\n return text;\n }\n\n function defineLineGenerator() {\n let generator;\n\n generator = d3.line()\n .x((d) => { return line.scales.x(d.x); })\n .y((d) => { return line.scales.y(d.y); });\n\n return generator;\n }\n\n function samplePoints() {\n let sampleStep,\n sampledData;\n\n sampleStep = (line.domain[1] - line.domain[0]) / numberOfSamples;\n sampledData = [];\n\n d3.range(line.domain[0],line.domain[1] + sampleStep,sampleStep).forEach((sample) => {\n if(isFinite(line.functionToPlot(sample))) {\n sampledData.push({\n \"x\":sample,\n \"y\":line.functionToPlot(sample),\n });\n }\n });\n\n return sampledData;\n }\n}", "function updateRandom() {\n series[0].data = getRandomData();\n console.log(series[0].data)\n plot.setData(series);\n plot.draw();\n }", "function plot(p) {\r\n var cell = d3.select(this);\r\n var format = d3.format(\".3\")\r\n\r\n x.domain(domainByPoint[p.i]);\r\n y.domain(domainByPoint[p.j]);\r\n\r\n // Prep data format\r\n var arrayXY = [\r\n _.map(data.plotData, function (value) { return value[p.i]; }),\r\n _.map(data.plotData, function (value) { return value[p.j]; })\r\n ];\r\n var zippedArrayXY = _.zip(arrayXY[0], arrayXY[1]);\r\n\r\n // Filter Outliers and override xy data\r\n if (p.i !== p.j && cfg.RemoveOutliers) {\r\n var distances = mahalanobis(zippedArrayXY);\r\n // multiplier between 1 - 2, flip values so that 2 becomes strong and 1 weak\r\n var criticalValue = _.mean(distances) * (3-cfg.FilterMultiplier);\r\n zippedArrayXY = _.filter(zippedArrayXY, function (row, i) {\r\n return distances[i] <= criticalValue;\r\n });\r\n arrayXY = [\r\n _.map(zippedArrayXY, function (value) { return value[0]; }),\r\n _.map(zippedArrayXY, function (value) { return value[1]; })\r\n ];\r\n }\r\n\r\n // Draw frame\r\n cell.append(\"rect\")\r\n .attr(\"class\", \"frame\")\r\n .attr(\"x\", padding / 2)\r\n .attr(\"y\", padding / 2)\r\n .attr(\"width\", size - padding)\r\n .attr(\"height\", size - padding)\r\n .style(\"stroke\",\"#aaa\")\r\n .style(\"fill\", \"none\")\r\n .style(\"shape-rendering\", \"crispEdges\");\r\n\r\n // Plot data, Correlation and regression for cells without domain text and data\r\n if (p.i !== p.j) {\r\n\r\n // Plot circles\r\n cell.selectAll(\"circle\")\r\n .data(zippedArrayXY)\r\n .enter()\r\n .append(\"circle\")\r\n .attr(\"cx\",\r\n function (d) {\r\n return x(d[0]);\r\n })\r\n .attr(\"cy\",\r\n function (d) {\r\n return y(d[1]);\r\n })\r\n .attr(\"r\", 4)\r\n .style(\"fill\",\r\n function (d) {\r\n return color((p.i + 1) * (p.j + 1));\r\n })\r\n .style(\"fill-opacity\", 0.7)\r\n .append(\"svg:title\")\r\n .text(function (d, i) {\r\n return p.x + \" : \" + format(d[0]) + \"\\n\" + p.y + \" : \" + format(d[1]);\r\n });\r\n\r\n // Calculate correlation\r\n var correlationPearson = format(jStat.corrcoeff(arrayXY[0], arrayXY[1]));\r\n var correlationSpearman = format(jStat.spearmancoeff(arrayXY[0], arrayXY[1]));\r\n if (cfg.ShowPearson && !cfg.ShowSpearman) {\r\n cell.append(\"text\")\r\n .attr(\"x\", padding)\r\n .attr(\"y\", padding)\r\n .attr(\"dy\", \"1em\")\r\n .text(\"\\u03B3 : \" + correlationPearson)\r\n .style(\"fill\", \"#fff\");\r\n }\r\n if (cfg.ShowSpearman && !cfg.ShowPearson) {\r\n cell.append(\"text\")\r\n .attr(\"x\", padding)\r\n .attr(\"y\", padding)\r\n .attr(\"dy\", \"1em\")\r\n .text(\"\\u03C1 : \" + correlationSpearman)\r\n .style(\"fill\", \"#fff\");\r\n }\r\n if (cfg.ShowSpearman && cfg.ShowPearson) {\r\n cell.append(\"text\")\r\n .attr(\"x\", padding)\r\n .attr(\"y\", padding)\r\n .attr(\"dy\", \"1em\")\r\n .text(\"\\u03B3 : \" + correlationPearson)\r\n .style(\"fill\", \"#fff\");\r\n cell.append(\"text\")\r\n .attr(\"x\", padding)\r\n .attr(\"y\", padding * 1.8)\r\n .attr(\"dy\", \"1em\")\r\n .text(\"\\u03C1 : \" + correlationSpearman)\r\n .style(\"fill\", \"#fff\");\r\n }\r\n\r\n if (cfg.ShowRegression) {\r\n // Calculate Regression\r\n var lr = linearRegression(arrayXY[1], arrayXY[0]);\r\n \r\n // Get y for x domain\r\n var xmin = x.domain()[0];\r\n var ymin = lr.fnx(xmin)\r\n // check y is ok\r\n if (ymin < y.domain()[0]) {\r\n xmin = lr.fny(y.domain()[0]);\r\n ymin = y.domain()[0];\r\n }\r\n if (ymin > y.domain()[1]) {\r\n xmin = lr.fny(y.domain()[1]);\r\n ymin = y.domain()[1];\r\n }\r\n var xmax = x.domain()[1];\r\n var ymax = lr.fnx(xmax)\r\n // check y is ok\r\n if (ymax < y.domain()[0]) {\r\n xmax = lr.fny(y.domain()[0]);\r\n ymax = y.domain()[0];\r\n }\r\n if (ymax > y.domain()[1]) {\r\n xmax = lr.fny(y.domain()[1]);\r\n ymax = y.domain()[1];\r\n }\r\n\r\n if (!isNaN(xmin) && !isNaN(xmax) && !isNaN(ymin) & !isNaN(ymax)) {\r\n // Regression line for cell without domain text\r\n cell.append(\"svg:line\")\r\n .attr(\"x1\", x(xmin))\r\n .attr(\"y1\", y(ymin))\r\n .attr(\"x2\", x(xmax))\r\n .attr(\"y2\", y(ymax))\r\n .style(\"stroke-width\", 2)\r\n .style(\"stroke\", \"white\")\r\n .append(\"svg:title\")\r\n .text(function () {\r\n if (lr.intercept >= 0) {\r\n return \"f(x) = \" + format(lr.slope) + \"x+\" + format(lr.intercept);\r\n } else {\r\n return \"f(x) = \" + format(lr.slope) + \"x\" + format(lr.intercept);\r\n }\r\n\r\n });\r\n }\r\n }\r\n }\r\n // Domain text and basic statistics for domain cells\r\n else {\r\n // Domain text for tiles on the diagonal.\r\n cell.append(\"text\")\r\n .attr(\"x\", padding)\r\n .attr(\"y\", padding)\r\n .attr(\"dy\", \"1em\")\r\n .text(p.x)\r\n .style(\"font-weight\", \"bold\")\r\n .style(\"text-transform\", \"capitalize\")\r\n .style(\"fill\", \"#fff\")\r\n .style(\"font-size\", 12)\r\n .append(\"svg:title\")\r\n .text(data.plotPaths[p.i]);\r\n\r\n\r\n if (cfg.ShowBasicStatistics) {\r\n // Calculate basic statistics\r\n\r\n var array = arrayXY[0];\r\n var stats = [\r\n { name: \"Mean\", value: jStat.mean(array) },\r\n { name: \"Median\", value: jStat.median(array) },\r\n { name: \"Range\", value: jStat.range(array) },\r\n { name: \"Standard Deviation\", value: jStat.stdev(array) },\r\n { name: \"Variance\", value: jStat.variance(array) },\r\n { name: \"Skewness\", value: jStat.skewness(array) },\r\n { name: \"Kurtosis\", value: jStat.kurtosis(array) }\r\n ];\r\n\r\n stats.forEach(function(data, index) {\r\n cell.append(\"text\")\r\n .attr(\"x\", padding)\r\n .attr(\"y\",\r\n function() {\r\n return padding * 0.6 * (index + 1);\r\n })\r\n .attr(\"dy\", \"3.5em\")\r\n .text(data.name + \" : \" + format(data.value))\r\n .style(\"fill\", \"#fff\");\r\n })\r\n }\r\n else {\r\n // Plot circles\r\n cell.selectAll(\"circle\")\r\n .data(zippedArrayXY)\r\n .enter()\r\n .append(\"circle\")\r\n .attr(\"cx\",\r\n function (d) {\r\n return x(d[0]);\r\n })\r\n .attr(\"cy\",\r\n function (d) {\r\n return y(d[1]);\r\n })\r\n .attr(\"r\", 4)\r\n .style(\"fill\", \"#fff\")\r\n .style(\"fill-opacity\", 0.7)\r\n .append(\"svg:title\")\r\n .text(function (d, i) {\r\n return p.x + \" : \" + format(d[0]) + \"\\n\" + p.y + \" : \" + format(d[1]);\r\n });\r\n }\r\n\r\n }\r\n }", "static show_1d_array(graphDiv=\"plot_id\", data, layout, config){\n Plotly.newPlot( graphDiv, \n [{ //no need to add x, plotly does it automatically 0 thru N.\n y: data }],\n layout,\n config //responsive to window size\n )\n }", "function init() {\n d3.select(\"#more_info\").node().value = \"\";\n buildPlot(data);\n}", "function simplePlot(status) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Functie genaamd \"simplePlot\" zorgt ervoor dat de simpePlot wel of niet getoond worden waar het hoort.\n\t\t\t\tvar simplePlot = document.querySelectorAll(\".simplePlot\"); \t\t\t\t\t\t// Pak alle elementen met de class simplePlot en zet deze in variabele\n\n\t\t\t\tfor (i = 0; i < simplePlot.length; i++) {\t\t\t\t\t\t\t\t\t\t// For loop gaat alle .simplePlot in de index.html langs\n\t\t\t\t\tif(status === \"add\") {\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Als het getoond moet worden moet de parameter 'status' gelijk zijn aan 'add'\n\t\t\t\t\t\tsimplePlot[i].classList.add(\"active\");\t\t\t\t\t\t\t\t\t// Geef ze CSS class active mee\n\t\t\t\t\t}\n\t\t\t\t\telse if(status === \"remove\") {\t\t\t\t\t\t\t\t\t\t\t\t// Als het niet getoond moet worden moet de parameter 'status' gelijk zijn aan 'remove'\n\t\t\t\t\t\tsimplePlot[i].classList.remove(\"active\");\t\t\t\t\t\t\t\t// Verwijder de CSS class active\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function plot_date(input)\r\n{\r\n\tvar exp_arr = new Array();//array to store expectaion values\r\n\t\r\n\tvar sum_actual = 0;//sum of actual values of the data points \r\n\t\r\n\tvar sum_exp = 0;//sum of expectation values of data points\r\n\t\r\n\tvar max_val = 0;//maximum value of data points(to determine maximum range on y axis)\r\n\t\r\n\t\tfor(j=0;j<input[\"data\"] .length;j++)\r\n\t\t{\r\n\t\t\texp_arr[j] = new Array();\r\n\t\t\t\r\n\t\t\tif(j==0) sum_actual += input[\"data\"][j][1];\r\n\t\t\telse \r\n\t\t\t\tsum_actual += input[\"data\"][j-1][1] ;\r\n\r\n\t\t\tif(j==0) exp_arr [j][1] = sum_actual;\r\n\t\t\telse\r\n\t\t\t\texp_arr [j][1] = sum_actual * input[\"imp_f\"] / (j+1) ;\r\n\t\t\t\t\r\n\t\t\texp_arr [j][0] = input[\"data\"] [j][0] ;\r\n\t\t\t\t\r\n\t\t\tsum_exp += exp_arr [j][1];\r\n\t\t\t\r\n\t\t\tmax_val = input[\"data\"] [j][1]>max_val? input[\"data\"] [j][1] : max_val;\r\n\t\t\tmax_val = exp_arr [j][1]>max_val? exp_arr [j][1] : max_val;\r\n\t\t}\r\n\t\tvar output = new Array();\r\n\t\toutput[\"si\"] = sum_actual / sum_exp;\r\n\t\tplots = $.jqplot(input[\"target_id\"] , [input[\"data\"] , exp_arr ], { \r\n\t\t\t\t title:input[\"title\"] , \r\n\t\t\t\t seriesDefaults: {showMarker:false}, \r\n\t\t\t\t series:[\r\n\t\t\t\t\t {},\r\n\t\t\t\t\t {yaxis:'y2axis'}, \r\n\t\t\t\t\t {yaxis:'y3axis'}\r\n\t\t\t\t ], \r\n\t\t\t\t highlighter: {\r\n\t\t\t\t\tshow: true,\r\n\t\t\t\t\tsizeAdjust: 7.5\r\n\t\t\t\t },\r\n\t\t\t\t cursor: {\r\n\t\t\t\t\tshow: false,\r\n\t\t\t\t }, \r\n\t\t\t\t axesDefaults:{useSeriesColor: true}, \r\n\t\t\t\t axes:{\r\n\t\t\t\t\t xaxis:{renderer:$.jqplot.DateAxisRenderer}, \r\n\t\t\t\t\t yaxis:{min:0, max:max_val, numberTicks:input[\"n_ticks\"] }, \r\n\t\t\t\t\t y2axis:{\r\n\t\t\t\t\t\t min:0, \r\n\t\t\t\t\t\t max:max_val, \r\n\t\t\t\t\t\t numberTicks:input[\"n_ticks\"] , \r\n\t\t\t\t\t\t tickOptions:{showGridline:false}\r\n\t\t\t\t\t }, \r\n\t\t\t\t\t y3axis:{}\r\n\t\t\t\t } \r\n\t\t\t\t \r\n\t\t\t });\r\n\t\t\t \r\n\toutput[\"sum\"] = sum_actual;\r\n\t\r\n\treturn output;\r\n}", "function outputPanelData(i, data) {\n console.log(data);\n\n dataBindings[i].outputData({\n title: panelParams[i].funnel[0].title || panelParams[i].funnel[0].kind || \"All\",\n subtitle: panelParams[i].funnel[0].property || \"\",\n text: \"\"\n });\n\n var chartData;\n if (Object.prototype.toString.call(data) == \"[object Array]\") {\n if (Object.keys(data[0]).includes(\"interval\")) {\n $(dataBindings[i]._el).find(\".content\")\n .html('<canvas id=\"chart' + i + '\" width=\"\" height=\"300\"></canvas>');\n // we know the \"interval\" key, find the other one\n var keys = Object.keys(data[0]).slice(); // copy don't mutate\n keys.splice(keys.indexOf(\"interval\"), 1);\n var key = keys[0];\n new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Line({\n labels: data.map(function(v) { return v.interval; }),\n datasets: [{\n label: key,\n fillColor: \"#FE9B08\",\n data: data.map(function(v) { return (v[key] * 1); })\n }]\n });\n }\n else {\n $(dataBindings[i]._el).find(\".content\")\n .html('<canvas id=\"chart' + i + '\" width=\"\" height=\"300\"></canvas>');\n var keys = Object.keys(data[0]).slice(); // copy don't mutate\n var key = keys[0];\n new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Line({\n labels: data.map(function() { return key; }),\n datasets: [{\n label: key,\n fillColor: \"#FE9B08\",\n data: data.map(function(v) { return (v[key] * 1); })\n }]\n });\n }\n }\n else if (Object.prototype.toString.call(data) == \"[object Object]\") {\n if (data.funnel) {\n if (data.funnel.length == 2) {\n dataBindings[i].outputData({ text: (+parseFloat(data.funnel[1].percent).toFixed(2)) + \"%\" });\n }\n else {\n $(dataBindings[i]._el).find(\".content\")\n .html('<canvas id=\"chart' + i + '\" height=\"300\"></canvas>');\n new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Bar({\n labels: data.funnel.map(function(v) { return v.label + \" (\" + v.value + \")\"; }),\n datasets: [{\n label: \"Funnel\",\n fillColor: \"#14A2FF\",\n data: data.funnel.map(function(v) { return v.percent; })\n }]\n });\n dataBindings[i].outputData({\n title: (data.funnel[0].label || \"All\") + \" - \" + (data.funnel[data.funnel.length - 1].label || \"All\"),\n subtitle: \"\"\n });\n }\n }\n else {\n // new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Bar({\n // labels: Object.keys(data),\n // datasets: [{\n // label: \"\",\n // fillColor: \"rgba(50, 100, 200, 0.6)\",\n // data: Object.keys(data).map(function (k) { return data[k]; })\n // }]\n // });\n $(dataBindings[i]._el).find(\".content\")\n .html('<canvas id=\"chart' + i + '\" height=\"300\"></canvas>');\n new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Doughnut(\n Object.keys(data).map(function (k) {\n return {\n label: k,\n value: data[k]\n };\n })\n );\n }\n }\n else { // Number\n dataBindings[i].outputData({ text: data });\n }\n}", "plot() {\n return \"Cute alien takes over the earth\";\n }", "function graph_pie_generate(data,dom,title,subtitle,name,color)\n{\n if (color != null) \n {\n $('#' + dom).highcharts({\n chart: {\n type: 'pie',\n options3d: {\n enabled: true,\n alpha: 45,\n beta: 0\n }\n },\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n tooltip: {\n pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\n },\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: 'pointer',\n depth: 35,\n dataLabels: {\n enabled: true,\n format: '{point.name}'\n }\n }\n },\n colors: color,\n series: [{\n name: name,\n data: data\n }]\n });\n }\n else\n {\n $('#' + dom).highcharts({\n chart: {\n type: 'pie',\n options3d: {\n enabled: true,\n alpha: 45,\n beta: 0\n }\n },\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n tooltip: {\n pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\n },\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: 'pointer',\n depth: 35,\n dataLabels: {\n enabled: true,\n format: '{point.name}'\n }\n }\n },\n series: [{\n name: name,\n data: data\n }]\n });\n }\n \n}", "reset(){\n super.reset();\n this.gOfX = FixedPoint._gX(plot.getFunction(), this.lambda);\n }", "function buildmixedPlot() {\n\n const url = \"/api/housing_data\";\n d3.json(url).then(function (myData) {\n\n var date = myData[0].Date;\n var rate = myData[0].Interest_Rate;\n var price = myData[0].Average_Home_Price;\n\n var options = {\n series: [{\n name: 'Average Home Price',\n type: 'column',\n data: price\n }, {\n name: 'Interest Rate',\n type: 'line',\n data: rate\n }],\n chart: {\n height: 400,\n type: 'line',\n },\n stroke: {\n width: [0, 4]\n },\n title: {\n text: 'History of Home price & Interest Rates'\n },\n dataLabels: {\n enabled: true,\n enabledOnSeries: [1]\n },\n labels: date,\n xaxis: {\n type: 'datetime'\n },\n yaxis: [{\n title: {\n text: 'Average Home Price',\n },\n\n }, {\n opposite: true,\n title: {\n text: 'Interest Rate'\n }\n }]\n };\n\n var chart = new ApexCharts(document.querySelector(\"#linecolumn\"), options);\n chart.render();\n });\n}", "function createFilledPlot(minValue, maxValue, steps, sel, colorScale)\n{\n let contourScale = d3.scaleLinear().domain([1, steps]).range([minValue, maxValue]);\n for (let i=steps; i>=1; --i) {\n currentContour = contourScale(i);\n sel.filter(includesFilledContour).append(\"path\")\n .attr(\"transform\", \"translate(0, 10) scale(1, -1)\") // ensures that positive y points up\n .attr(\"d\", generateFilledContour)\n .attr(\"fill\", function(d) { return colorScale(currentContour); });\n }\n}", "connectedCallback() {\n // split elements into those which need to be plotted before the axes\n // are drawn, and those to be plotted after.\n const PLOT_BEFORE_AXES = ['floodfill'];\n let [plot_before, plot_after] = Array.from(this.children).reduce(\n function([before, after], el) {\n //get the tag of each element, and remove leading \"math-plot-\"\n let tag = el.tagName.toLowerCase().substring(TAGNAME.length + 1);\n\n return PLOT_BEFORE_AXES.includes(tag) ?\n [[...before, el], after] :\n [before, [...after, el]];\n },\n [[], []]\n );\n\n plot_before.map(this._plotElement, this);\n\n this.drawAxes();\n\n plot_after.map(this._plotElement, this);\n }", "function graphPlotting(scope) {\n\tdataplotArray.length = 0;\n\tXnCalculation(copy_number_int, cycle_number_int, amplification_eff_int);\n\tchart.render();\n\tchain_reaction_stage.update();\n}", "function optionChanged(sample){\r\n \r\n buildplot(sample);\r\n \r\n \r\n }", "function missingLogicEvaluation(){\n $scope.logicEvaluation = dqFactory.completeness.numericalPlot.logicEvaluation;\n var data = [];\n $scope.nameX = dqFactory.completeness.numericalPlot.nameX;\n $scope.nameY = dqFactory.completeness.numericalPlot.nameY;\n\n var actualContent = dqFactory.getActualContent();\n\n $scope.optionPlot.chart.xDomain = getRange(actualContent, $scope.nameX);\n $scope.optionPlot.chart.yDomain = getRange(actualContent, $scope.nameY);\n // console.log(\"olit range: \", $scope.optionPlot.chart.xDomain);\n\n data.push({key: \"Present\", color: dqFactory.completeness.color.present, values: []});\n data.push({key: \"Missing\", color: dqFactory.completeness.color.missing, values: []});\n\n\n //checking variable.show\n var noneShow = 0;\n var show = [];\n angular.forEach(dqFactory.completeness.variables, function (variable) {\n if(variable.state.show) {\n noneShow +=1;\n show.push(variable.name);\n }\n });\n\n\n if(noneShow == 0){ //none is shown, plot only x, y (not missing) variable\n //console.log(\"No variable shown\");\n angular.forEach(actualContent, function (entry) {\n if (dqFactory.hasMeaningValue(entry[$scope.nameX]) //not null\n && dqFactory.hasMeaningValue(entry[$scope.nameY]) //not null\n ) {\n data[0].values.push({\n x: entry[$scope.nameX],\n y: entry[$scope.nameY],\n size: dqFactory.completeness.numericalPlot.sizeSinglePoint,\n shape: dqFactory.completeness.numericalPlot.marker.circle\n });\n }\n });\n }\n\n else if(noneShow == 1) {\n //console.log(\"Shown only one variable\");\n angular.forEach(actualContent, function (entry) {\n if (dqFactory.hasMeaningValue(entry[$scope.nameX]) //not null\n && dqFactory.hasMeaningValue(entry[$scope.nameY]) //not null\n ) {\n\n angular.forEach(dqFactory.completeness.variables, function (variable) {\n if (variable.state.selected\n && variable.state.show\n && variable.name != $scope.nameX\n && variable.name != $scope.nameY) {\n if (dqFactory.hasMeaningValue(entry[variable.name])) { //variable value is not null\n data[0].values.push({\n x: entry[$scope.nameX],\n y: entry[$scope.nameY],\n size: dqFactory.completeness.numericalPlot.sizeSinglePoint,\n shape: dqFactory.completeness.numericalPlot.marker.circle\n });\n }\n else{ //variable value is null\n data[1].values.push({\n x: entry[$scope.nameX],\n y: entry[$scope.nameY],\n size: dqFactory.completeness.numericalPlot.sizeSinglePoint,\n shape: dqFactory.completeness.numericalPlot.marker.circle\n });\n }\n }\n });\n }\n });\n }\n\n else { //more than one, we need to make AND/OR visualisation\n\n //console.log(\"show: \", show);\n\n angular.forEach($scope.variables, function(variable){\n if(variable.state.show){\n //console.log(\"else\");\n variable.optionSharingX.chart.xDomain = $scope.optionPlot.chart.xDomain;\n variable.optionSharingX.chart.width = $scope.optionPlot.chart.width;\n }\n });\n\n\n\n\n if($scope.logicEvaluation === \"AND\") {\n //console.log(\"Data in AND\");\n\n angular.forEach(actualContent, function (entry) {\n\n //calculate only if x an y are not missing\n if (dqFactory.hasMeaningValue(entry[$scope.nameX])\n && dqFactory.hasMeaningValue(entry[$scope.nameY])) {\n\n var inAnd = true;\n var control = true; //for breaking the loop: we need only one variable that is not true\n var controlIndex = 0;\n\n\n\n angular.forEach(show, function (variable) {\n //console.log(\"xDomain: \", $scope.optionPlot.chart.width);\n\n\n\n //console.log(variable);\n if (dqFactory.hasMeaningValue(entry[variable])) { // if not null break the check\n inAnd = false;\n control = false; //necessary to stop like break because if the last is true but in the middle we have a false we lost it\n }\n if (controlIndex == show.length) {\n //console.log(\"end forEach \", controlIndex);\n control = false;\n }\n controlIndex += 1;\n\n\n });\n\n\n\n if (inAnd) { // all values of shown variable are missing\n data[1].values.push({\n x: entry[$scope.nameX],\n y: entry[$scope.nameY],\n size: dqFactory.completeness.numericalPlot.sizeSinglePoint,\n shape: dqFactory.completeness.numericalPlot.marker.circle\n })\n }\n else { // at least one value is present\n data[0].values.push({\n x: entry[$scope.nameX],\n y: entry[$scope.nameY],\n size: dqFactory.completeness.numericalPlot.sizeSinglePoint,\n shape: dqFactory.completeness.numericalPlot.marker.circle\n })\n }\n }\n })\n }\n else if($scope.logicEvaluation === \"OR\") {\n //console.log(\"Data in OR\");\n angular.forEach(actualContent, function (entry) {\n\n //calculate only if x an y are not missing\n if (dqFactory.hasMeaningValue(entry[$scope.nameX])\n && dqFactory.hasMeaningValue(entry[$scope.nameY])) {\n\n var inOr = true;\n var control = true; //for breaking the loop: we need only one variable that is not true\n var controlIndex = 0;\n\n\n angular.forEach(show, function (variable) {\n //console.log(variable);\n if (!dqFactory.hasMeaningValue(entry[variable])) { // if not null break the check\n inOr = false;\n control = false; //necessary to stop like break because if the last is true but in the middle we have a false we lost it\n }\n if (controlIndex == show.length) {\n //console.log(\"end forEach\");\n control = false;\n }\n controlIndex += 1;\n });\n\n\n\n if (inOr) { // all values of shown variable are missing\n data[0].values.push({\n x: entry[$scope.nameX],\n y: entry[$scope.nameY],\n size: dqFactory.completeness.numericalPlot.sizeSinglePoint,\n shape: dqFactory.completeness.numericalPlot.marker.circle\n })\n }\n else { // at least one value is present\n data[1].values.push({\n x: entry[$scope.nameX],\n y: entry[$scope.nameY],\n size: dqFactory.completeness.numericalPlot.sizeSinglePoint,\n shape: dqFactory.completeness.numericalPlot.marker.circle\n })\n }\n }\n })\n }\n }\n\n\n //console.log(\"data missing/present: \", data);\n\n $scope.noneShow = noneShow;\n\n return data;\n }", "function update() {\n plot.setData([getRandomData()]);\n // Since the axes don't change, we don't need to call plot.setupGrid()\n plot.draw();\n setTimeout(update, updateInterval);\n }", "function genIterDiagram(f, xstar, axis) {\n\n var w = 900\n var h = 300\n var totalIters = 150\n var state_beta = 0.0\n var state_alpha = 0.001\n var num_contours = 15\n var onDrag = function() {}\n var w0 =[-1.21, 0.853]\n //var w0 = [0,0]\n\n function renderIterates(div) {\n\n // Render the other stuff\n var intDiv = div.style(\"width\", w + \"px\")\n .style(\"height\", h + \"px\")\n .style(\"box-shadow\",\"0px 3px 10px rgba(0, 0, 0, 0.4)\")\n .style(\"border\", \"solid black 1px\")\n\n // Render Contours \n var plotCon = contour_plot.ContourPlot(w,h)\n .f(function(x,y) { return f([x,y])[0] })\n .drawAxis(false)\n .xDomain(axis[0])\n .yDomain(axis[1])\n .contourCount(num_contours)\n .minima([{x:xstar[0], y:xstar[1]}]);\n\n var elements = plotCon(intDiv);\n\n var svg = intDiv.append(\"div\")\n .append(\"svg\")\n .style(\"position\", 'absolute')\n .style(\"left\", 0)\n .style(\"top\", 0)\n .style(\"width\", w)\n .style(\"height\", h)\n .style(\"z-index\", 2) \n\n\n // var X = d3.scaleLinear().domain([0,1]).range(axis[0])\n // var Y = d3.scaleLinear().domain([0,1]).range(axis[1])\n\n var X = d3.scaleLinear().domain(axis[0]).range([0, w])\n var Y = d3.scaleLinear().domain(axis[1]).range([0, h])\n \n // Rendeer Draggable dot\n var circ = svg.append(\"circle\")\n .attr(\"cx\", X(w0[0])) \n .attr(\"cy\", Y(w0[1]) )\n .attr(\"r\", 4)\n .style(\"cursor\", \"pointer\")\n .attr(\"fill\", colorbrewer.OrRd[3][1])\n .attr(\"opacity\", 0.8)\n .attr(\"stroke-width\", 1)\n .attr(\"stroke\", colorbrewer.OrRd[3][2])\n .call(d3.drag().on(\"drag\", function() {\n var pt = d3.mouse(this)\n var x = X.invert(pt[0])\n var y = Y.invert(pt[1])\n this.setAttribute(\"cx\", pt[0])\n this.setAttribute(\"cy\", pt[1])\n w0 = [x,y]\n onDrag(w0)\n iter(state_alpha, state_beta, w0);\n }))\n\n var iterColor = d3.scaleLinear().domain([0, totalIters]).range([\"black\", \"black\"])\n\n var update2D = plot2dGen(X, Y, iterColor)(svg)\n\n // Append x^star\n svg.append(\"path\")\n .attr(\"transform\", \"translate(\" + X(xstar[0]) + \",\" + Y(xstar[1]) + \")\")\n .attr(\"d\", \"M 0.000 2.000 L 2.939 4.045 L 1.902 0.618 L 4.755 -1.545 L 1.176 -1.618 L 0.000 -5.000 L -1.176 -1.618 L -4.755 -1.545 L -1.902 0.618 L -2.939 4.045 L 0.000 2.000\")\n .style(\"fill\", \"white\")\n .style(\"stroke-width\",1)\n\n \n function iter(alpha, beta, w0) {\n\n // Update Internal state of alpha and beta\n state_alpha = alpha\n state_beta = beta\n\n // Generate iterates \n var OW = runMomentum(f, w0, alpha, beta, totalIters)\n var W = OW[1]\n\n update2D(W)\n\n circ.attr(\"cx\", X(w0[0]) ).attr(\"cy\", Y(w0[1]) )\n circ.moveToFront()\n\n }\n\n iter(state_alpha, state_beta, w0);\n \n return { control:iter, \n w0:function() { return w0 }, \n alpha:function() { return state_alpha }, \n beta:function() {return state_beta} }\n\n }\n\n renderIterates.width = function (_) {\n w = _; return renderIterates;\n }\n\n renderIterates.height = function (_) {\n h = _; return renderIterates;\n }\n\n renderIterates.iters = function (_) {\n totalIters = _; return renderIterates;\n }\n\n renderIterates.drag = function (_) {\n onDrag = _; return renderIterates;\n }\n\n renderIterates.init = function (_) {\n w0 = _; return renderIterates;\n }\n\n renderIterates.alpha = function (_) {\n state_alpha = _; return renderIterates;\n }\n\n renderIterates.beta = function (_) {\n state_beta = _; return renderIterates;\n }\n\n return renderIterates\n\n}", "function updateLegend(event, plotitem, item, pos) {\n $(\"#tooltip\").remove();\n\n if (event.type == \"plothover\" && !cpanelOptions.hooverTooltips)\n return;\n\n if (event.type == \"plotclick\" && !cpanelOptions.clickTooltips)\n return;\n\n var axes = plotitem.getAxes();\n if (pos.x < axes.xaxis.min || pos.x > axes.xaxis.max ||\n pos.y < axes.yaxis.min || pos.y > axes.yaxis.max)\n return;\n\n var i, j, dataset = plotitem.getData();\n var d = new Date(pos.x);\n var contents = \"Date: \" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds() + \" \" + d.getDate() + \"/\" + d.getMonth() + \"<br>\";\n for (i = 0; i < dataset.length; ++i) {\n var series = dataset[i];\n\n // find the nearest points, x-wise\n for (j = 0; j < series.data.length; ++j)\n if (series.data[j][0] > pos.x)\n break;\n\n // now interpolate\n var y, p1 = series.data[j - 1], p2 = series.data[j];\n if (p1 == null)\n y = p2[1];\n else if (p2 == null)\n y = p1[1];\n else\n y = p1[1] + (p2[1] - p1[1]) * (pos.x - p1[0]) / (p2[0] - p1[0]);\n\n contents = contents + \"\" + series.label + \"= \" + (y*1).toFixed(1) + \"<br>\";\n }\n\n showTooltip(pos.pageX, pos.pageY, contents);\n}", "function make_richplot(plot){\n console.log(plot);\n\n $('div.jqplot-point-label', plot).each(function(){\n var elem = $(this);\n var text = elem.text();\n elem.attr('title', text);\n var width = elem.width();\n elem.text('');\n elem.width(width);\n elem.tipsy({gravity: 's', trigger: 'manual'});\n });\n\n plot.bind('jqplotDataHighlight', \n function (ev, seriesIndex, pointIndex, data) {\n var pointLabel = $('div.jqplot-point-label.jqplot-series-' + seriesIndex + '.jqplot-point-' + pointIndex, plot);\n pointLabel.tipsy(\"show\");\n pointLabel.hide();\n\n }\n );\n\n plot.bind('jqplotDataUnhighlight', \n function (ev, seriesIndex, pointIndex, data) {\n var pointLabel = $('div.jqplot-point-label', plot);\n $('div.jqplot-point-label', plot).each(function(){\n $(this).tipsy(\"hide\");\n $(this).show();\n });\n }\n );\n}", "#generateStateOverviewPlots () {\n const overviewMaternalHealthSelected = this.#controlPanel.overview.maternalHealthSelected;\n // enable the right plots\n this.#selectOverviewPlot(overviewMaternalHealthSelected);\n if (overviewMaternalHealthSelected == \"Maternal Deaths\" || overviewMaternalHealthSelected == \"Maternity Care Deserts\"){\n this.#generateMaternalDeathsPlot();\n }\n else {\n // set chart title\n document.getElementById(\"chart-title\").innerHTML = `${this.#controlPanel.getBroadbandSelected()} and ${this.#controlPanel.getMaternalHealthSelected()} by ${this.#capitalizeGeoLevel()}`;\n // If the identifier is not known, resort to a default value.\n const scatterLayout = {\n xaxis: {\n title: {\n text: this.broadbandTitlePart,\n },\n },\n yaxis: {\n title: {\n text: this.maternalHealthTitlePart,\n }\n },\n shapes: [\n {\n type: 'line',\n x0: this.cutoffs[1],\n y0: 0,\n x1: this.cutoffs[1],\n yref: 'paper',\n y1: 1,\n line: {\n color: 'grey',\n width: 1.5,\n dash: 'dot'\n }\n },\n {\n type: 'line',\n x0: 0,\n y0: this.cutoffs[0],\n x1: 1,\n xref: 'paper',\n y1: this.cutoffs[0],\n line: {\n color: 'grey',\n width: 1.5,\n dash: 'dot'\n }\n },\n ],\n legend: {\n bordercolor: '#B0BBD0',\n borderwidth: 1,\n orientation: 'h',\n yanchor: 'bottom',\n y: 1.02,\n xanchor: 'right',\n x: 0.75\n },\n };\n\n const boxLayout = {\n hovermode: false,\n xaxis: {\n title: {\n text: 'Categorizations',\n },\n },\n yaxis: {\n title: {\n text: this.maternalHealthTitlePart,\n }\n },\n legend: {\n bordercolor: '#B0BBD0',\n borderwidth: 1,\n orientation: 'h',\n yanchor: 'bottom',\n y: 1.02,\n xanchor: 'right',\n x: 0.75\n },\n boxmode: 'group',\n };\n\n // Initialize data structures for plots.\n const county_categorization_color_mapping_temp = [...county_categorization_color_mapping, county_categorization_color_mapping_unknowns[1], WITHHELD_COLOR];\n const county_categorization_color_mapping_light_temp = [...county_categorization_color_mapping_light, county_categorization_color_mapping_unknowns[1], WITHHELD_COLOR];\n const boxBorderColors = [\"#68247F\", \"#02304B\", \"#6E3C0C\", \"#274200\", \"#0F0F0F\", \"#474747\", WITHHELD_COLOR];\n this.chart_data = [];\n this.box_data = [];\n\n for (const [i, cat] of [\"Double Burden\", \"Opportunity\", \"Single Burden\", \"Milestone\", \"Unreliable\", WITHHELD_COLOR].entries()) {\n this.chart_data.push({\n x: [],\n y: [],\n mode: 'markers',\n type: 'scatter',\n name: cat,\n text: [],\n hovertemplate: '<i>Broadband</i>: %{x}' + '<br><i>Health</i>: %{y}<br>',\n marker: { color: county_categorization_color_mapping_temp[i], }\n });\n this.box_data.push({\n // https://github.com/plotly/plotly.js/issues/3830\n // Setting offsetgroup fixes issue where boxes become skinny.\n offsetgroup: '1',\n y: [],\n type: 'box',\n name: cat,\n fillcolor: county_categorization_color_mapping_temp[i],\n marker: { color: boxBorderColors[i], }\n });\n if (this.mapIsSplit) {\n this.chart_data.push({\n x: [],\n y: [],\n mode: 'markers',\n type: 'scatter',\n name: cat,\n text: [],\n hovertemplate: '<i>Broadband</i>: %{x}' + '<br><i>Health</i>: %{y}<br>',\n marker: {\n color: county_categorization_color_mapping_temp[i],\n symbol: \"circle-open\"\n }\n });\n this.box_data.push({\n offsetgroup: '2',\n y: [],\n type: 'box',\n name: cat,\n marker: {\n color: county_categorization_color_mapping_temp[i],\n },\n fillcolor: county_categorization_color_mapping_light_temp[i],\n line: {\n color: county_categorization_color_mapping_temp[i],\n }\n });\n }\n }\n\n // Load data into the plots.\n for (const el of this.data.state_data) {\n if (el[\"state_categorization\"] === undefined || el[\"state_categorization\"] === null || el[\"state_categorization\"] < 0) continue;\n let category = this.mapIsSplit ? 2 * (el[\"state_categorization\"] - 1) : el[\"state_categorization\"] - 1;\n if (el[\"health_status\"] == \"unreliable\") {\n category = this.mapIsSplit ? 8 : 4;\n } else if (this.#controlPanel.displayWithheld() && el[\"broadband\"] === -9999.0) {\n category = this.mapIsSplit ? 10 : 5;\n } else if (this.#controlPanel.getMaternalHealthSelected() == \"Mental Health Provider Shortage\"){\n if (el[\"health\"] < 0){\n continue;\n }\n }\n this.chart_data[category][\"x\"].push(Number(el[\"broadband\"]));\n this.chart_data[category][\"y\"].push(Number(el[\"health\"]));\n\n this.box_data[category][\"y\"].push(Number(el[\"health\"]));\n if (this.mapIsSplit) {\n // Populate the data for the second map with the same data as the first map. Eventually, this will change.\n category += 1;\n this.chart_data[category][\"x\"].push(Number(el[\"broadband\"]));\n this.chart_data[category][\"y\"].push(Number(el[\"health\"]));\n\n this.box_data[category][\"y\"].push(Number(el[\"health\"]));\n }\n }\n\n Plotly.newPlot(\"maternalHealthSecondPlot\", this.chart_data, scatterLayout,\n { displaylogo: false, responsive: true, displayModeBar: true });\n Plotly.newPlot(\"maternalHealthFirstPlot\", this.box_data, boxLayout,\n { displaylogo: false, responsive: true, displayModeBar: true });\n\n this.makePlotsAccessible();\n }\n }", "display(data){\n var plot = this.scrollVis();\n d3.select(\"#vis\")\n .datum(data)\n .call(plot)\n\n var scroll = this.scroller(this.refs.scrollWindow)\n .container(d3.select('#graphic'));\n\n scroll(d3.selectAll('.step'));\n\n scroll.on('active', function (index){\n d3.selectAll('.step')\n .style('opacity', function(d,i) {return i === index ? 1: 0.1;});\n\n plot.activate(index)\n })\n\n scroll.on('progress', function (index, progress) {\n plot.update(index, progress);\n })\n\n return(plot)\n\n}", "function updatePlot1(d, i) { // Add interactivity\n\n x.domain([0, 1.2]);\n y.domain([0, 1.2]);\n // Use D3 to select element, change color and size\n d3.select(this)\n .attr(\"fill\", \"crimson\")\n .call(function(d) {\n\n div.transition()\n .duration(200)\n .style(\"opacity\", 1.0);\n div.html(\"Hand #\" + i)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n });\n d3.selectAll(\".line\")\n .style(\"fill\", \"crimson\");\n d3.selectAll(\".legend1\")\n .transition()\n .duration(200)\n .style(\"fill\", \"crimson\");\n d3.selectAll(\".l1text\")\n .text(i);\n update(i);\n\n}", "function addPlot() {\n plotArea.ox = 0;\n plotArea.oy = 0;\n plotArea.count = 0;\n plotArea.unit = 1000;// parseInt(prompt(\"Enter unit of time(in milli seconds)\"));\n plotArea.specificTimeX = 0;\n}", "_loadData(data) {\n var self = this;\n var colorFactor = this.parent.opt.colorFactor;\n var colors = null;\n var ternOrder = this.parent.data.tern_order;\n var tooltip_order = this.parent.data.tooltip_order;\n var plotContainerId = this.parent.plotContainer;\n\n\n // Getting the color & color factor\n if (!this.parent.isFactorPresent(colorFactor)) {\n colorFactor = this.parent.getDefaultColour();\n }\n\n if (colorFactor != 'renderGroup') {\n colors = this.parent.factorColors[colorFactor];\n }\n\n\n // Rendering the circles \n var circles = ternaryPlotGroup.selectAll(\"circle\")\n .data(data);\n\n circles.exit().remove();\n\n circles\n .enter()\n .append(\"circle\")\n .attr(\"r\", 6)\n .attr(\"cx\", w / 2)\n .attr(\"cy\", h / 2)\n .merge(circles)\n .transition()\n .attr(\"cx\", function (dataElements) { return dataElements.get('cx'); })\n .attr(\"cy\", function (dataElements) { return dataElements.get('cy'); })\n .attr('id', function (dataElements) { return dataElements.get('id'); })\n .attr('display', function (dataElements) {\n if (dataElements.get('id') === 'centroid') {\n return 'none';\n } else {\n return 'block';\n }\n })\n .style(\"fill\", function (dataElements, i) {\n var ret = \"red\";\n if (colorFactor != 'renderGroup' && dataElements.get('id') !== 'centroid') {\n ret = colors[dataElements.get('factors')[colorFactor]];\n }\n return ret;\n })\n .style(\"stroke\", \"#222222\")\n .style(\"stroke-width\", 2);\n\n circles.on('mouseenter', function () {\n\n // This variable is used to determine the scroll amount to make the tooltip popup move\n initialScrollValue = $(`#${plotContainerId}`).scrollTop();\n\n var circle = d3.select(this);\n var toolTipText = \"\";\n var circleId = circle.attr('id');\n\n d3.select(`text#${circle.attr('id')}`).style('fill', 'red');\n self._indicateCircle(toolTipText, circle);\n\n });\n\n circles.on('mouseleave', function () {\n var circle = d3.select(this);\n d3.select(`text#${circle.attr('id')}`).style('fill', 'black');\n self._setDefaultStateCircle(circle);\n });\n\n\n // If a condition text has been hovered over\n $(`#conditions text`).on('mouseenter', function () {\n try {\n self.parent.selectionBox.attr('visibility', 'visible');\n self.parent.selectionBox.attr('width', self.parent.opt.labelWidth);\n var conditionHash = 'circle' + self._generateHash(this.innerHTML); // IMPORTANT: had to add a prefix (circle) to the hash to make it selectable by d3\n var thisCircle = d3.select(\"circle#\" + conditionHash);\n var toolTipText = \"\";\n $(\"#ternaryPlotGroup\").get(0).appendChild(thisCircle.node());\n\n self._indicateCircle(toolTipText, thisCircle);\n\n } catch (err) {\n console.warn(`${this.innerHTML} has no value`);\n }\n });\n\n // If a condition text has been left\n $(`#conditions text`).on('mouseleave', function () {\n self.parent.selectionBox.attr('visibility', 'hidden');\n var conditionHash = 'circle' + self._generateHash(this.innerHTML); // IMPORTANT: had to add a prefix (circle) to the hash to make it selectable by d3\n var thisCircle = d3.select(\"circle#\" + conditionHash);\n self._setDefaultStateCircle(thisCircle);\n });\n\n return this;\n }", "function FunctionPlotterGrid(options) {\n let domain,\n grid,\n range,\n scales,\n where,\n tickEvery;\n\n grid = this;\n\n init(options);\n\n return grid;\n\n /* INITIALIZE */\n function init(options) {\n _required(options);\n // _default(options);\n\n grid.xTicks = addXTicks();\n grid.yTicks = addYTicks();\n\n\n }\n\n /* PRIVATE METHODS */\n // function _default(options) {\n //\n //}\n\n function _required(options) {\n tickEvery = options.tickEvery;\n grid.scales = options.scales;\n where = options.where;\n grid.domain = options.domain;\n grid.range = options.range;\n }\n\n function addXTicks() {\n let data,\n group,\n lines;\n\n group = where\n .append(\"g\");\n\n data = d3.range(domain[0],domain[1] + 1,tickEvery);\n\n lines = group\n .selectAll(\"line\")\n .data(data)\n .enter()\n .append(\"line\")\n .attr(\"x1\",(d) => { return scales.x(d) ;})\n .attr(\"x2\",(d) =>{ return scales.x(d) ;})\n .attr(\"y1\",scales.y(range[0]))\n .attr(\"y2\",scales.y(range[1]))\n .attr(\"stroke\",\"#ddd\")\n .attr(\"stroke-width\",1)\n .attr(\"stroke-dasharray\",\"1,0\");\n\n return lines;\n }\n\n function addYTicks() {\n let data,\n group,\n lines;\n\n group = where\n .append(\"g\");\n\n data = d3.range(domain[0],domain[1],tickEvery);\n\n lines = group\n .selectAll(\"line\")\n .data(data)\n .enter()\n .append(\"line\")\n .attr(\"x1\",scales.x(domain[0]))\n .attr(\"x2\",scales.x(domain[1]))\n .attr(\"y1\",(d) => { return scales.y(d); })\n .attr(\"y2\",(d) => { return scales.y(d); })\n .attr(\"stroke\",\"#ddd\")\n .attr(\"stroke-width\",1)\n .attr(\"stroke-dasharray\",\"1,0\");\n\n return lines;\n }\n\n}", "function waffle_plot_ecm(svg_name,indicator,data,svg_area,svg_title){\n var data_ENIF2018 = get_data(data,indicator);\n var aux=\"\";\n if (data_ENIF2018.length==0){\n aux=\"Non available data for this filter.\";\n svg_name.append(\"text\")\n .attr(\"y\",aux_size*1.5*margin.top)\n .attr(\"x\",xScale(6))\n .attr(\"class\",\"legend\")\n .style(\"text-anchor\",\"middle\")\n .style(\"font-size\",\"14px\")\n .text(aux);\n }\n else{\n var total = get_total(data_ENIF2018);\n var squareSize = total/(columns*rows);\n var units = get_units(data_ENIF2018,indicator);\n var data_points = gen_points_data(rows,columns,squareSize,units);\n\n\n svg_name.selectAll(\"rect\")\n .data(data_points)\n .enter()\n .append(\"rect\")\n .append(\"title\")\n .text(function(d){\n var aux=\"\";\n if(d[5]==\"color_this\"){aux = \"Estimated inhabitants with the service: \"+numberWithCommas(units);}\n else {aux = \"Estimated inhabitants without the service: \"+numberWithCommas(total-units);};\n return aux;\n });\n\n svg_name.selectAll(\"rect\")\n .data(data_points)\n .attr(\"x\",function(d){return xScale(d[0]);})\n .attr(\"y\",function(d){return yScale(d[1]);})\n .transition()\n .ease(d3.easeElastic)\n .duration(1000)\n .delay(function(d,i) { return i*4;})\n .attr(\"x\",function(d){return xScale(d[0]);})\n .attr(\"y\",function(d){return yScale(d[1]);})\n .attr(\"class\",function(d){return d[5];})\n .attr(\"height\", (plotHeight-aux_size*margin.bottom)/(columns+1)-1)\n .attr(\"width\", (plotWidth-aux_size*margin.left)/(rows+1)-1);\n\n svg_name.append(\"text\")\n .attr(\"y\",1.05*plotHeight)\n .attr(\"x\",0.7*plotWidth)\n .attr(\"class\",\"legend\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"10px\")\n .text(\"1 square: \"+numberWithCommas(squareSize)+\" inhabitants\");\n\n svg_name.append(\"text\")\n .attr(\"y\",1.3*aux_size*margin.top)\n .attr(\"x\",xScale(6))\n .attr(\"class\",\"legend\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"12px\")\n .text(\"Percentage of population: \"+Math.round(units/total*10000)/100+\"%\");\n\n svg_name.append(\"text\")\n .attr(\"y\",aux_size*margin.top)\n .attr(\"x\",xScale(6))\n .attr(\"class\",\"legend\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"14px\")\n .text(svg_title);\n\n};\n\n}", "clearDosePlot () {\n // Clear dose plot\n this.axisElements['plot-dose'].selectAll('g.dose-contour').remove()\n }", "function nautilus_plot(div, index, mat, options) {\n\n // div : id of the div to plot, '#div_name'\n // index : id of the element to focus on, 'element_id'\n // mat : matrix of values, basically list of arrays with this similar structure as:\n // [{{index: 'a'}, {values: {b: 5}, {c: 3}, ...}}, {}, ...]\n // options : collection of parameters for configuration\n\n // initial options\n var cfg = {\n width: Math.min(1600, window.innerWidth - 20),\n height: Math.min(900, window.innerHeight - 10),\n margin: {top: 50, left: 50, right: 50, bottom: 50},\n inner_circle_radius: 20,\n outer_circle_radius: 2,\n ray_stroke_width: 2,\n center_position_x: 1/2,\n center_position_y: 1/2,\n center_title_height: 34,\n number_max_to_show: 30,\n select_scale: 10,\n number_format: '.2f',\n chart_color: 'black',\n text_color_blank: 'rgba(0, 0, 0, 0)',\n text_color: 'rgba(0, 0, 0, 1)',\n select_color: 'rgba(230, 0, 0, 1)',\n right_table_index: '#legend_container',\n right_table_cols: ['value', 'index'],\n left_table_index: '#control_container',\n tooltip_offset_x: 0,\n tooltip_offset_y: 550\n };\n\n // put all of the options into a variable called cfg\n\tif('undefined' !== typeof options){\n\t for(var p in options){\n\t\tif('undefined' !== typeof options[p]){ cfg[p] = options[p]; }\n\t }\n\t}\n\n\t// svg\n\tvar svg = d3.select(div).append('svg')\n .attr('width', cfg.width)\n .attr('height', cfg.height);\n\n // div for tooltip\n var tooltip_div = d3.select(div).append('div')\n .attr('class', 'tooltip')\n .style('opacity', 0);\n\n // select data\n var data = get_data(mat, index, cfg, cfg.number_max_to_show);\n\n // color\n var max_value = get_max_value(mat, 'value')\n var color = d3.scaleSequential(d3.interpolateRdYlGn)\n .domain([max_value, 0]);\n\n // center\n var center = svg.append('g')\n .datum(index)\n .attr('class', 'center')\n .on('mouseover', function(d) {\n tooltip_div.transition()\n .duration(0)\n .style('opacity', 1);\n tooltip_div.html('<b>' + d3.selectAll('.center').datum() + '</b> ')\n .style('left', cfg.tooltip_offset_x + 'px')\n .style('top', cfg.tooltip_offset_y + 'px');\n d3.select(this).style('cursor', 'pointer');})\n .on('mouseout', function(d) {\n tooltip_div.transition()\n .duration(500)\n .style('opacity', 0);\n d3.select(this).style('cursor', 'default');})\n .on('click', function(d) {\n console.log(d);\n retract(cfg);});\n // center circle\n center.append('circle')\n .attr('cx', cfg.width * cfg.center_position_x)\n .attr('cy', cfg.height * cfg.center_position_y)\n .attr('r', cfg.inner_circle_radius);\n // center title\n center.append('text')\n .attr('x', cfg.width * cfg.center_position_x)\n .attr('y', cfg.center_title_height)\n .style('font-size', function(d) {return cfg.center_title_height + 'px';})\n .style('fill', cfg.text_color)\n .style(\"text-anchor\", \"middle\")\n .text(function(d) { return d;});\n // shell\n var ray = svg.selectAll('.ray')\n .data(data)\n .enter().append('g')\n .attr('class', 'ray');\n // shell rays links\n ray.append('line')\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;})\n .style('stroke-width', cfg.ray_stroke_width)\n .style('stroke', function(d) { return color(d.value); })\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout)\n .on('click', function(d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n });\n // shell ray circles\n ray.append('circle')\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0)\n .style('fill', cfg.chart_color)\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout)\n .on('click', function(d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n });\n\n // simulation\n ray.selectAll('line').transition('starting')\n .duration(2000)\n .attr('x1', function(d) { return d.x1;})\n .attr('y1', function(d) { return d.y1;})\n .attr('x2', function(d) { return d.x2;})\n .attr('y2', function(d) { return d.y2;})\n ray.selectAll('circle').transition('starting')\n .duration(2000)\n .attr('cx', function(d) { return d.x2;})\n .attr('cy', function(d) { return d.y2;})\n .attr('r', cfg.outer_circle_radius);\n\n // left table - controls\n var left_table_control = create_control(cfg.left_table_index, mat, cfg, index);\n // left table - explanations\n var left_table_explanation = create_explanation(cfg.left_table_index);\n\n // right table - legend\n var right_table = tabulate(cfg.right_table_index, data, cfg.right_table_cols, cfg.number_format, cfg.width);\n\n //\n // local functions\n //\n\n function get_value(data, value) {\n return data.map(d => d.value)\n }\n\n function get_max_value(data, value) {\n var index_name = Object.keys(data);\n var arr_max = [];\n for (k = 0; k < index_name.length; ++k) {\n\n var arr = data[index_name[k]];\n var arr_value = get_value(arr, value)\n arr_max.push(Math.max(...arr_value))\n\n };\n return Math.max(...arr_max);\n }\n\n // mouse\n function on_mouseover(element) {\n\n d3.select('svg').selectAll('line')\n .select( function(d) { return d===element?this:null;})\n .style('stroke', cfg.select_color)\n d3.select('svg').selectAll('circle')\n .select( function(d) { return d===element?this:null;})\n .style('fill', cfg.select_color)\n .attr(\"r\", function(d) { return cfg.outer_circle_radius * cfg.select_scale; });\n d3.select(cfg.right_table_index).select('table').select('tbody').selectAll('tr')\n .select( function(d) { return d===element?this:null;})\n .style('color', cfg.select_color);\n\n tooltip_div.transition()\n .duration(0)\n .style('opacity', 1);\n tooltip_div.html(d3.selectAll('.center').datum() + ' --| <b>' + d3.format(cfg.number_format)(element.value) + '</b> |-- ' + element.index)\n .style('left', cfg.tooltip_offset_x + 'px')\n .style('top', cfg.tooltip_offset_y + 'px');\n\n d3.select(this).style('cursor', 'pointer');\n };\n function on_mousemove(element) {\n\n d3.select('svg').selectAll('line')\n .select( function(d) { return d===element?this:null;})\n .style('stroke', cfg.select_color)\n d3.select('svg').selectAll('circle')\n .select( function(d) { return d===element?this:null;})\n .style('fill', cfg.select_color)\n d3.select(cfg.right_table_index).select('table').select('tbody').selectAll('tr')\n .select( function(d) { return d===element?this:null;})\n .style('color', cfg.select_color);\n\n d3.select(this).style('cursor', 'pointer');\n };\n function on_mouseout(element) {\n\n d3.select('svg').selectAll('line')\n .select( function(d) { return d===element?this:null;})\n .transition('hide')\n .duration(200)\n .style('stroke', function(d) { return color(d.value); })\n d3.select('svg').selectAll('circle')\n .select( function(d) { return d===element?this:null;})\n .transition('hide')\n .duration(200)\n .style('fill', cfg.chart_color)\n .attr(\"r\", function(d) { return cfg.outer_circle_radius; });\n d3.select(cfg.right_table_index).select('table').select('tbody').selectAll('tr')\n .select( function(d) { return d===element?this:null;})\n .transition('hide')\n .duration(200)\n .style('color', cfg.text_color);\n\n tooltip_div.transition()\n .duration(500)\n .style('opacity', 0);\n\n d3.select(this).style('cursor', 'default');\n };\n\n // Thanks to http://bl.ocks.org/phil-pedruco/7557092 for the table code\n function tabulate(id, data, columns, number_format = '.2f', table_width) {\n\n var table = d3.select(id)\n .append('table')\n .attr('width', table_width),\n thead = table.append('thead'),\n tbody = table.append('tbody'),\n format = d3.format(number_format);\n\n // append the header row\n thead.append('tr')\n .selectAll('th')\n .data(columns)\n .enter()\n .append('th')\n .text(function(column) { return column;});\n\n // create a row for each object in the data\n var rows = tbody.selectAll('tr')\n .data(data)\n .enter()\n .append('tr')\n .on('click', function (d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n })\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout);\n\n // create a cell in each row for each column\n var cells = rows.selectAll('td')\n .data(function(row) {\n return columns.map(function(column) {\n return {column: column, value: row[column]};\n });\n })\n .enter()\n .append('td')\n .html(function(d) {\n if (isNaN(d.value)) {\n return d.value;\n } else {\n return '<b>' + format(d.value) + '</b>';\n };\n });\n\n return table;\n };\n\n // get data\n function get_data(mat, index, cfg, n) {\n // select data\n var data = mat[index];\n // sort by value\n data.sort(function (a, b) {\n return a.value - b.value;\n });\n // filter number max\n var data = get_first_n(data, n);\n\n // scales\n var max_value = data[data.length - 1].value;\n var scale = d3.scaleLinear()\n .domain([0, max_value])\n .range([0, (cfg.height / 2) - 2 * cfg.outer_circle_radius - cfg.inner_circle_radius - cfg.margin.top]);\n // add x and y position for nodes, depending on inner circle radius\n for (i = 0; i < data.length; ++i) {\n angle = (i / data.length) * 2 * Math.PI // 2*PI for complete circle\n starting_angle = angle - Math.PI / 2\n data[i]['x1_start'] = (cfg.inner_circle_radius) * Math.cos(starting_angle) + (cfg.width * cfg.center_position_x)\n data[i]['y1_start'] = (cfg.inner_circle_radius) * Math.sin(starting_angle) + (cfg.height * cfg.center_position_y)\n data[i]['x1'] = (cfg.inner_circle_radius) * Math.cos(angle) + (cfg.width * cfg.center_position_x)\n data[i]['y1'] = (cfg.inner_circle_radius) * Math.sin(angle) + (cfg.height * cfg.center_position_y)\n data[i]['x2'] = (scale(data[i].value) + cfg.inner_circle_radius) * Math.cos(angle) + (cfg.width * cfg.center_position_x)\n data[i]['y2'] = (scale(data[i].value) + cfg.inner_circle_radius) * Math.sin(angle) + (cfg.height * cfg.center_position_y)\n }\n return data;\n };\n\n // get first n data\n function get_first_n(obj, n) {\n return Object.keys(obj) // get the keys out\n .slice(0, n) // get the first N\n .reduce(function(memo, current) { // generate a new object out of them\n memo[current] = obj[current]\n return memo;\n }, [])\n };\n\n // redraw chart and table\n function redraw(mat, index, cfg, n) {\n\n var format = d3.format(cfg.number_format),\n new_data = get_data(mat, index, cfg, n),\n right_table = d3.select(cfg.right_table_index).select('tbody').selectAll('tr')\n .data(new_data),\n svg = d3.selectAll('svg'),\n new_center = svg.selectAll('.center')\n .datum(index),\n new_ray = svg.selectAll('.ray')\n .data(new_data);\n\n // enter\n var new_ray_enter = new_ray.enter().append('g')\n .attr('class', 'ray');\n new_ray_enter.append('line')\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;})\n .style(\"stroke-width\", cfg.ray_stroke_width)\n .style(\"stroke\", function(d) { return color(d.value); })\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout)\n .on('click', function(d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n });\n new_ray_enter.append('circle')\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0)\n .style('fill', cfg.chart_color)\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout)\n .on('click', function(d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n });\n var right_table_enter = right_table.enter().append('tr')\n .on('click', function (d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n })\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout);\n\n var new_cell = right_table_enter.selectAll('td')\n .data(function(row) {\n return cfg.right_table_cols.map(function(column) {\n return {column: column, value: row[column]};\n });\n })\n .enter()\n .append('td')\n .style('opacity', 0)\n .html(function(d) {\n if (isNaN(d.value)) {\n return d.value;\n } else {\n return '<b>' + format(d.value) + '</b>';\n };\n });\n\n // exit\n new_ray.exit().selectAll('line').transition('ending')\n .duration(1000)\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;});\n new_ray.exit().selectAll('circle').transition('ending')\n .duration(1000)\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0);\n new_ray.exit().transition().duration(1000).remove();\n right_table.exit().transition('ending')\n .duration(1000)\n .style('opacity', 0)\n .remove();\n\n // update\n new_center.select('text').transition('ending')\n .duration(1000)\n .style('opacity', 0)\n .transition('redrawing')\n .duration(2000)\n .text(function(d) {return d;})\n .style('opacity', 1);\n var new_ray = svg.selectAll('.ray'); // reselect to update all\n new_ray.select('line').transition('ending')\n .duration(1000)\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;})\n .transition('redrawing')\n .duration(2000)\n .attr('x1', function(d) { return d.x1;})\n .attr('y1', function(d) { return d.y1;})\n .attr('x2', function(d) { return d.x2;})\n .attr('y2', function(d) { return d.y2;})\n .style('stroke', function(d) { return color(d.value); });\n new_ray.select('circle').transition('ending')\n .duration(1000)\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0)\n .transition('redrawing')\n .duration(2000)\n .attr('cx', function(d) { return d.x2;})\n .attr('cy', function(d) { return d.y2;})\n .attr('r', cfg.outer_circle_radius);\n\n var right_table = d3.select(cfg.right_table_index).select('tbody').selectAll('tr');\n right_table.selectAll('td')\n .data(function(row) {\n return cfg.right_table_cols.map(function(column) {\n return {column: column, value: row[column]};\n });\n })\n .transition('ending')\n .duration(1000)\n .style('opacity', 0)\n .on('end', function() {\n d3.select(this)\n .html(function(d) {\n if (isNaN(d.value)) {\n return d.value;\n } else {\n return '<b>' + format(d.value) + '</b>';\n };\n })\n .transition('redrawing')\n .duration(2000)\n .style('opacity', 1);\n });\n d3.select('#dropdown_menu')\n .property('value', index)\n };\n\n // retract\n var retracted = false;\n function retract(cfg) {\n\n var svg = d3.selectAll('svg');\n var ray = svg.selectAll('.ray');\n\n if (retracted) {\n // open\n ray.select('line').transition('redrawing')\n .duration(2000)\n .attr('x1', function(d) { return d.x1;})\n .attr('y1', function(d) { return d.y1;})\n .attr('x2', function(d) { return d.x2;})\n .attr('y2', function(d) { return d.y2;});\n ray.select('circle').transition('redrawing')\n .duration(2000)\n .attr('cx', function(d) { return d.x2;})\n .attr('cy', function(d) { return d.y2;})\n .attr('r', cfg.outer_circle_radius);\n retracted = false;\n } else {\n // retract\n ray.select('line').transition('ending')\n .duration(1000)\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;});\n ray.select('circle').transition('ending')\n .duration(1000)\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0);\n retracted = true;\n }\n };\n\n function create_explanation(div) {\n\n var explanation_div = d3.select(div).append('div')\n .attr('class', 'explanation_div');\n\n explanation_div\n .attr('id', 'explanation')\n .html('This circular chart represents a distance matrix from a single element perspective.' +\n 'The weights linking the chosen element and its <i>N</i> closest neighbours are sorted from ' +\n 'smallest to largest distances, and are then dispatched in a circle around the center, thus ' +\n 'forming naturally a nautilus shell shape. <br><br>' +\n 'To explore the landscape further:<br>' + '<ul type=\"square\">' +\n '<li>Click on any neighbour nodes to focus it. </li>' +\n '<li>Navigate using drop down menu to focus on a specific element. </li>' +\n '<li>Change the number <i>N</i> to increase or decrease the maximum number of closest neighbours represented on the chart.</li></ul>')\n }\n\n function create_control(div, data, cfg, index) {\n\n var control_div = d3.select(div).append('div');\n\n var values = Object.keys(data).sort()\n\n // drop down\n control_div\n .append('div')\n .attr('class', 'control_div')\n .append('select')\n .attr('id', 'dropdown_menu')\n .on('mouseover', function() { d3.select(this).style('cursor', 'pointer');})\n .on('mousemove', function() { d3.select(this).style('cursor', 'pointer');})\n .on('mouseout', function() { d3.select(this).style('cursor', 'default');})\n .selectAll('option')\n .data(values)\n .enter()\n .append('option')\n .attr('value', function(d) {\n return d;\n })\n .text(function(d) {\n return d;\n });\n d3.select('#dropdown_menu')\n .property('value', index);\n // input box\n control_div\n .append('div')\n .attr('class', 'control_div')\n .append('input')\n .attr('id', 'input_box')\n .attr('type', 'number')\n .attr('value', cfg.number_max_to_show)\n .attr('min', 1)\n .attr('max', values.length);\n // redraw\n control_div\n .on('change', function() {\n var selected_value = d3.select(this)\n .select('select')\n .property('value');\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n console.log(selected_value);\n console.log(number_max_to_show);\n redraw(mat, selected_value, cfg, number_max_to_show);\n });\n };\n}", "function delayFigure() {\n\t\t\t\tsetTimeout(showFigure, Math.random() * 2000);\n\t\t\t\t\n\t\t\t}", "function plot(sel) {\n sel.each(_plot);\n }", "function plot(sel) {\n sel.each(_plot);\n }", "function fndrawGraph() {\r\n setOptionValue();\r\n\t\t\t\tlayout = new Layout(\"line\", options);\r\n//\t\t\t\talert(\"called.........fngraph............\");\r\n\t\t\t\tvar atempDataPopulation;\r\n\t\t\t\tvar atempPopulationlefive;\r\n\t\t\t\tvar atemparrPopulationbetFive;\r\n\t\t\t\tvar atemparrpopulationlabovefifteen; \r\n\t\t\t\t\r\n\t\t\t\tatempDataPopulation=arrDataPopulation;\r\n\t\t\t\tvar populationlen = atempDataPopulation.length; \r\n\t\t\t\t\r\n\t\t\t\t//arrPopulationleFive.push(populationlefive);\r\n\t\t\t\tatempPopulationlefive=arrPopulationleFive;\r\n\t\t\t\t\r\n\t\t\t\t//arrPopulationlbetFive.push(populationlbetfive);\r\n\t\t\t\tatemparrPopulationbetFive=arrPopulationlbetFive;\r\n\t\t\t\t\r\n\t\t\t\t//arrpopulationlabovefifteen.push(populationlabovefifteen);\r\n\t\t\t\tatemparrpopulationlabovefifteen=arrpopulationlabovefifteen;\r\n\t\t\t\t\r\n\t\t\t\t// Total Population \r\n\t\t\t\tvar tpBeforeInstruction=\"layout.addDataset('Totalpopulation',[\";\r\n\t\t\t\tvar tpInstruction=\"\";\r\n\t\t\t\t\r\n\r\n\t\t\t\t// less then five population \r\n\t\t\t\tvar tpltfiveBeforeInstruction=\"layout.addDataset('Populationltfive',[\";\r\n\t\t\t\tvar tpltfiveInstruction=\"\";\r\n\t\t\t\tvar populationltfivelen = atempPopulationlefive.length;\r\n\r\n \t\t\t\t// less then five to fourteen population \r\n\t\t\t\tvar tpbftofourtBeforeInstruction=\"layout.addDataset('PopulationAge5to14',[\";\r\n\t\t\t\tvar tpbftofourtInstruction=\"\";\r\n\t\t\t\tvar populationbetFivelen = atemparrPopulationbetFive.length;\r\n\t\t\t\t\r\n\t\t\t\t// above then fifteen population \r\n\t\t\t\tvar tpabfifteenBeforeInstruction=\"layout.addDataset('PopulationAge15plus',[\";\r\n\t\t\t\tvar tpabfifteenInstruction=\"\";\r\n\t\t\t\tvar populationabfifteenlen = atemparrpopulationlabovefifteen.length;\r\n\r\n\r\n\t\t\t\t// creating diffrent Dataset according Data \r\n\t\t\t\t\r\n\t\t\t\tfor (var i=0; i<populationlen; i++ )\r\n\t\t\t\t\t{\r\n\t\t\t\t\ttpInstruction=tpInstruction+ \"[\"+i+\", \"+atempDataPopulation[i]+\"]\";\t\r\n\t\t\t\t\ttpltfiveInstruction=tpltfiveInstruction+ \"[\"+i+\", \"+atempPopulationlefive[i]+\"]\";\t\r\n\t\t\t\t\ttpbftofourtInstruction=tpbftofourtInstruction+ \"[\"+i+\", \"+atemparrPopulationbetFive[i]+\"]\";\t\r\n\t\t\t\t\ttpabfifteenInstruction=tpabfifteenInstruction+ \"[\"+i+\", \"+atemparrpopulationlabovefifteen[i]+\"]\";\t\r\n\t\t\t\t\tif (i!=populationlen-1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\ttpInstruction=tpInstruction + \",\";\r\n\t\t\t\t\t\ttpltfiveInstruction=tpltfiveInstruction + \",\";\r\n\t\t\t\t\t\ttpbftofourtInstruction=tpbftofourtInstruction + \",\";\r\n\t\t\t\t\t\ttpabfifteenInstruction=tpabfifteenInstruction + \",\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttpInstruction=tpBeforeInstruction+tpInstruction +\"])\";\r\n\t\t\t\t\ttpltfiveInstruction=tpltfiveBeforeInstruction+tpltfiveInstruction+\"])\";\r\n\t\t\t\t\ttpbftofourtInstruction=tpbftofourtBeforeInstruction+tpbftofourtInstruction+\"])\";\r\n\t\t\t\t\ttpabfifteenInstruction=tpabfifteenBeforeInstruction+tpabfifteenInstruction+\"])\";\r\n\t\t\t\t\teval(tpInstruction);\r\n\t\t\t\t\teval(tpltfiveInstruction);\r\n\t\t\t\t\teval(tpbftofourtInstruction);\r\n\t\t\t\t\teval(tpabfifteenInstruction);\r\n\t\t\t\t\r\n\t\t\t\tlayout.evaluate();\r\n\t\t\t\t\t\r\n\t\t\t\tvar strTemp='';\r\n\t\t\t\tcanvas = MochiKit.DOM.getElement(\"graph\");\r\n\t\t\t\tplotter = new PlotKit.SweetCanvasRenderer(canvas, layout, options);\r\n\t\t\t\tplotter.render();\r\n\t\t}", "function onTick(e) {\r\n if (!firstTick) {\r\n // Color all shapes the same\r\n s.shapes\r\n .transition()\r\n .duration(frame / 2)\r\n .style(\"fill\", function (d) { return (d.y === e ? indicatorColor.fill : defaultColor.fill) })\r\n .style(\"stroke\", function (d) { return (d.y === e ? indicatorColor.stroke : defaultColor.stroke) });\r\n }\r\n firstTick = false;\r\n }", "function showPlot(fn) {\n var c = document.createElement('canvas');\n c.width = 600;\n c.height = 400;\n writeNode(\"normalOutput\", c);\n var ctx = c.getContext(\"2d\");\n\n var rawData = [], labels = [];\n for (var i = 0; i <= 100; i++) {\n var x = (i - 50) / 20;\n rawData[i] = fn(x);\n if (i % 10 == 0)\n labels[i] = x;\n else\n labels[i] = \"\";\n }\n\n var chart = new Chart(ctx).Line({\n labels: labels,\n datasets: [\n\t {\n\t\tfillColor : \"rgba(151,187,205,0.5)\",\n\t\tstrokeColor : \"rgba(151,187,205,1)\",\n\t\tdata : rawData\n }\n ]\n }, {\n bezierCurve: false,\n pointDot: false,\n animation: false\n });\n}", "init() {\n const bar = d3.select(this.element);\n // Called when the application knows all needed information to create plots.\n document.addEventListener('setupFinished', (e) => {\n bar.style('opacity', '1');\n });\n // Create PlotTool menu tile\n const plotTileID = 'plotTile';\n const plotTileElement = bar.append('div').attr('id', plotTileID).node();\n const zoomTile = new PlotToolsTile(plotTileElement, '#'+plotTileID, {});\n }", "function updateFigureBasicsJS()\n {\n var ctrlPts = dr.ctrlPts;\n //finds index of control point with maximum x:\n var max = numModel.ctrlPt_2_maxIx();\n var min = numModel.ctrlPt_2_minIx();\n var fb = dr.figureBasics;\n fb.minX = ctrlPts[min].x;\n fb.maxX = ctrlPts[max].x;\n \n if (ctrlPts[max].y > ctrlPts[min].y) {\n //// most right point has maximum ordinate\n\t fb.baseY = ctrlPts[max].y;\n\t fb.deltaOnLeft = true;\n\t dr.leftLabels.offset = -1;\n\t dr.righLabels.visOffset = 0;\n\t dr.curvLabels.visOffset = 0;\n\t dr.curvLabels.offset = 0;\n } else {\n\t fb.baseY = ctrlPts[min].y;\n\t fb.deltaOnLeft = false;\n\t dr.leftLabels.offset = 0;\n\t dr.righLabels.visOffset = 1;\n\t dr.curvLabels.visOffset = 1;\n\t dr.curvLabels.offset = 1;\n }\n\n //todm remove: experiment:\n //has( stdMod.rg, 'baseSlider' ) && ssF.pos2pointy( 'baseSlider' );\n }", "static initChartsFlot() {\n // Get the elements where we will attach the charts\n let flotLive = jQuery('.js-flot-live');\n let flotLines = jQuery('.js-flot-lines');\n let flotStacked = jQuery('.js-flot-stacked');\n let flotPie = jQuery('.js-flot-pie');\n let flotBars = jQuery('.js-flot-bars');\n\n // Demo Data\n let dataEarnings = [[1, 1500], [2, 1700], [3, 1400], [4, 1900], [5, 2500], [6, 2300], [7, 2700], [8, 3200], [9, 3500], [10, 3260], [11, 4100], [12, 4600]];\n let dataSales = [[1, 500], [2, 600], [3, 400], [4, 750], [5, 1150], [6, 950], [7, 1400], [8, 1700], [9, 1800], [10, 1300], [11, 1750], [12, 2900]];\n\n let dataSalesBefore = [[1, 500], [4, 600], [7, 1000], [10, 600], [13, 800], [16, 1200], [19, 1500], [22, 1600], [25, 2500], [28, 2700], [31, 3500], [34, 4500]];\n let dataSalesAfter = [[2, 900], [5, 1200], [8, 2000], [11, 1200], [14, 1600], [17, 2400], [20, 3000], [23, 3200], [26, 5000], [29, 5400], [32, 7000], [35, 9000]];\n\n let dataMonths = [[1, 'Jan'], [2, 'Feb'], [3, 'Mar'], [4, 'Apr'], [5, 'May'], [6, 'Jun'], [7, 'Jul'], [8, 'Aug'], [9, 'Sep'], [10, 'Oct'], [11, 'Nov'], [12, 'Dec']];\n let dataMonthsBars = [[2, 'Jan'], [5, 'Feb'], [8, 'Mar'], [11, 'Apr'], [14, 'May'], [17, 'Jun'], [20, 'Jul'], [23, 'Aug'], [26, 'Sep'], [29, 'Oct'], [32, 'Nov'], [35, 'Dec']];\n\n // Live Chart\n let dataLive = [], y = 0, chartLive;\n\n function getRandomData() { // Random data generator\n if (dataLive.length > 0)\n dataLive = dataLive.slice(1);\n\n while (dataLive.length < 300) {\n let prev = dataLive.length > 0 ? dataLive[dataLive.length - 1] : 50;\n let y = prev + Math.random() * 10 - 5;\n if (y < 0)\n y = 0;\n if (y > 100)\n y = 100;\n dataLive.push(y);\n }\n\n let res = [];\n for (let i = 0; i < dataLive.length; ++i) {\n res.push([i, dataLive[i]]);\n }\n\n jQuery('.js-flot-live-info').html(y.toFixed(0) + '%'); // Show live chart info\n\n return res;\n }\n\n function updateChartLive() { // Update live chart\n chartLive.setData([getRandomData()]);\n chartLive.draw();\n setTimeout(updateChartLive, 100);\n }\n\n if (flotLive.length) {\n chartLive = jQuery.plot(flotLive, // Init live chart\n [{ data: getRandomData() }],\n {\n series: {\n shadowSize: 0\n },\n lines: {\n show: true,\n lineWidth: 1,\n fill: true,\n fillColor: {\n colors: [{opacity: 1}, {opacity: .5}]\n }\n },\n colors: ['#42a5f5'],\n grid: {\n borderWidth: 0,\n color: '#cccccc'\n },\n yaxis: {\n show: true,\n min: 0,\n max: 100\n },\n xaxis: {\n show: false\n }\n }\n );\n\n updateChartLive(); // Start getting new data\n }\n\n // Init lines chart\n if (flotLines.length) {\n jQuery.plot(flotLines,\n [\n {\n label: 'Earnings',\n data: dataEarnings,\n lines: {\n show: true,\n fill: true,\n fillColor: {\n colors: [{opacity: .7}, {opacity: .7}]\n }\n },\n points: {\n show: true,\n radius: 5\n }\n },\n {\n label: 'Sales',\n data: dataSales,\n lines: {\n show: true,\n fill: true,\n fillColor: {\n colors: [{opacity: .5}, {opacity: .5}]\n }\n },\n points: {\n show: true,\n radius: 5\n }\n }\n ],\n {\n colors: ['#ffca28', '#555555'],\n legend: {\n show: true,\n position: 'nw',\n backgroundOpacity: 0\n },\n grid: {\n borderWidth: 0,\n hoverable: true,\n clickable: true\n },\n yaxis: {\n tickColor: '#ffffff',\n ticks: 3\n },\n xaxis: {\n ticks: dataMonths,\n tickColor: '#f5f5f5'\n }\n }\n );\n\n // Creating and attaching a tooltip to the classic chart\n let previousPoint = null, ttlabel = null;\n flotLines.bind('plothover', (event, pos, item) => {\n if (item) {\n if (previousPoint !== item.dataIndex) {\n previousPoint = item.dataIndex;\n\n jQuery('.js-flot-tooltip').remove();\n let x = item.datapoint[0], y = item.datapoint[1];\n\n if (item.seriesIndex === 0) {\n ttlabel = '$ <strong>' + y + '</strong>';\n } else if (item.seriesIndex === 1) {\n ttlabel = '<strong>' + y + '</strong> sales';\n } else {\n ttlabel = '<strong>' + y + '</strong> tickets';\n }\n\n jQuery('<div class=\"js-flot-tooltip flot-tooltip\">' + ttlabel + '</div>')\n .css({top: item.pageY - 45, left: item.pageX + 5}).appendTo(\"body\").show();\n }\n }\n else {\n jQuery('.js-flot-tooltip').remove();\n previousPoint = null;\n }\n });\n }\n\n // Stacked Chart\n if (flotStacked.length) {\n jQuery.plot(flotStacked,\n [\n {\n label: 'Sales',\n data: dataSales\n },\n {\n label: 'Earnings',\n data: dataEarnings\n }\n ],\n {\n colors: ['#555555', '#26c6da'],\n series: {\n stack: true,\n lines: {\n show: true,\n fill: true\n }\n },\n lines: {show: true,\n lineWidth: 0,\n fill: true,\n fillColor: {\n colors: [{opacity: 1}, {opacity: 1}]\n }\n },\n legend: {\n show: true,\n position: 'nw',\n sorted: true,\n backgroundOpacity: 0\n },\n grid: {\n borderWidth: 0\n },\n yaxis: {\n tickColor: '#ffffff',\n ticks: 3\n },\n xaxis: {\n ticks: dataMonths,\n tickColor: '#f5f5f5'\n }\n }\n );\n }\n\n // Bars Chart\n if (flotBars.length) {\n jQuery.plot(flotBars,\n [\n {\n label: 'Sales Before Release',\n data: dataSalesBefore,\n bars: {\n show: true,\n lineWidth: 0,\n fillColor: {\n colors: [{opacity: .75}, {opacity: .75}]\n }\n }\n },\n {\n label: 'Sales After Release',\n data: dataSalesAfter,\n bars: {\n show: true,\n lineWidth: 0,\n fillColor: {\n colors: [{opacity: .75}, {opacity: .75}]\n }\n }\n }\n ],\n {\n colors: ['#ef5350', '#9ccc65'],\n legend: {\n show: true,\n position: 'nw',\n backgroundOpacity: 0\n },\n grid: {\n borderWidth: 0\n },\n yaxis: {\n ticks: 3,\n tickColor: '#f5f5f5'\n },\n xaxis: {\n ticks: dataMonthsBars,\n tickColor: '#f5f5f5'\n }\n }\n );\n }\n\n // Pie Chart\n if (flotPie.length) {\n jQuery.plot(flotPie,\n [\n {\n label: 'Sales',\n data: 15\n },\n {\n label: 'Tickets',\n data: 12\n },\n {\n label: 'Earnings',\n data: 73\n }\n ],\n {\n colors: ['#26c6da', '#ffca28', '#9ccc65'],\n legend: {show: false},\n series: {\n pie: {\n show: true,\n radius: 1,\n label: {\n show: true,\n radius: 2/3,\n formatter: (label, pieSeries) => {\n return '<div class=\"flot-pie-label\">' + label + '<br>' + Math.round(pieSeries.percent) + '%</div>';\n },\n background: {\n opacity: .75,\n color: '#000000'\n }\n }\n }\n }\n }\n );\n }\n }", "createAxes () {\n }", "function plotChart(uberPrice,lyftPrice, uberPool, uberX, uberXL, black,\n\t\t\t\t\tlyft_line, lyft, lyft_plus, lyft_lux) {\n\tconsole.log(\"--jiayi----------\")\n\tconsole.log(uberPool, uberX, uberXL, black,\n\t\t\t\t\tlyft_line, lyft, lyft_plus, lyft_lux)\n\tdocument.getElementById('uberPool').value = uberPool;\n document.getElementById('uberX').value = uberX;\n document.getElementById('uberXL').value = uberXL;\n document.getElementById('black').value = black;\n document.getElementById('uberlower').value = Math.min(uberPool, uberX, uberXL, black);\n\n document.getElementById('lyft_line').value = lyft_line;\n document.getElementById('lyft').value = lyft;\n document.getElementById('lyft_plus').value = lyft_plus;\n document.getElementById('lyft_lux').value = lyft_lux;\n document.getElementById('lyftlower').value = Math.min(lyft_line, lyft, lyft_plus, lyft_lux);\n\n// $('#tripmap').show();\n//\t$('#rateChart').show();\n}", "function populatedemographics(id) {\r\n\r\n //filter data with id, select the demographic info with appropriate id\r\n \r\n var filterMetaData= jsonData.metadata.filter(meta => meta.id.toString() === id)[0];\r\n \r\n // select the panel to put data\r\n var demographicInfo = d3.select(\"#sample-metadata\");\r\n \r\n // empty the demographic info panel each time before getting new id info\r\n \r\n demographicInfo.html(\"\");\r\n\r\n // grab the necessary demographic data data for the id and append the info to the panel\r\n Object.entries(filterMetaData).forEach((key) => { \r\n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\");\r\n });\r\n }", "function plot(x1,y1,x2,y2,s){\n //1 = white\n //0 = black\n var scale = 1;\n var use = 1/(x1.length/2);\n var k = 0;\n var m = 0;\n\n for(i=0;i<x1.length;i++){\n if(k<x1.length/2){\n var put = use * m;\n m++\n //end should be 1\n }\n if(k>=x1.length/2){\n var put = use * m;\n m--\n //end should be 0\n }\n buffer += 'newbuffer' + '\\n';\n text += 'addvalue ' + finalCount + ' ' + x1[i] + ' ' + y1[i] + '\\n';\n text += 'addvalue ' + finalCount + ' ' + x2[i] + ' ' + y2[i] + '\\n';\n\n if(s == 's'){\n text += 'bcolor ' + .9 + ' ' + put + ' ' + put + ' ' + finalCount + '\\n'\n } else{\n text += 'bcolor ' + put + ' ' + put + ' ' + put + ' ' + finalCount + '\\n'\n }\n k++\n finalCount++\n }\n }", "addLegend () {\n \n }", "function init(value, id, label, demographics, maxW) {\n \n // responsive charts\n var config = {responsive: true}\n\n // bar chart\n var barData = [{\n type: 'bar',\n orientation: 'h',\n x: value.slice(0,10).reverse(),\n y: id.slice(0,10).reverse().map( i => 'OTU ' + i.toString() ),\n text: label.slice(0,10).reverse(),\n marker: { color: '#0090ff' }\n }];\n var barLayout = {\n xaxis: { title: 'Value'},\n yaxis: { title: 'Microbe'},\n plot_bgcolor: 'lightgrey',\n paper_bgcolor: 'lightgrey',\n bargap: 0.05,\n margin: { l: 100, r: 10, b: 60, t: 10, pad: 5 }\n };\n Plotly.newPlot('bar', barData, barLayout, config);\n \n // bubble chart\n var bubbleData = [{\n type: 'bubble',\n mode: 'markers',\n x: id,\n y: value,\n text: label,\n marker: { \n size: value, \n color: id,\n colorscale: 'Jet'\n }\n }];\n var bubbleLayout = {\n xaxis: { title: 'Microbe ID'},\n yaxis: { title: 'Value'},\n plot_bgcolor: 'lightgrey',\n paper_bgcolor: 'lightgrey',\n margin: { l: 50, r: 10, b: 50, t: 10, pad: 5 }\n };\n Plotly.newPlot('bubble', bubbleData, bubbleLayout, config);\n\n // info panel\n Object.entries(demographics).forEach( v => {\n d3.select('#sample-metadata')\n .append('text')\n .text(`${v[0]} : ${v[1]}`)\n .append('br');\n });\n\n // gauge\n var gaugeData = [{\n domain: { x:[0,1], y:[0,1]},\n value: demographics.wfreq,\n type: 'indicator',\n mode: 'gauge+number',\n title: { text: `Scrubs per Week | Participant: ${demographics.id}` },\n gauge: {\n axis: { range: [null, maxW] },\n bar: { color: 'black' },\n bordercolor: 'gray',\n steps: gaugeColor\n }\n }];\n var gaugeLayout = {\n plot_bgcolor: 'lightgrey',\n paper_bgcolor: 'lightgrey',\n // margin: { l: 80, r: 80, b: 0, t: 0, pad: 5 }\n };\n Plotly.newPlot('gauge', gaugeData, gaugeLayout, config);\n \n }", "function fillFunc(props) {\n const {hoveredFeature, selectedFeature, active_direction, interpolator} = props;\n const out = active_direction == \"out\";\n const activeFeature = selectedFeature || hoveredFeature;\n\n if(activeFeature) { // Something hovered or selected & viewing flows out\n return f => {\n if(!f) { return [0, 0, 0, 0];}\n\n if(activeFeature.properties.name == f.properties.name) { // This feature is the one hovered or selected\n return [0, 200, 50, 200]; \n }\n const scale = this.state.scale;\n \n const flows = f.properties[(out && \"outflows\") || \"inflows\"];\n if(flows && Object.keys(flows)) { // This feature has inflows, and view is outflows\n if(flows.hasOwnProperty(activeFeature.properties.name)) { // This feature has inflow from the active one\n var flow = flows[activeFeature.properties.name];\n if(flow > 15) { \n return scale(flow);\n }\n }\n }\n return [0, 0, 20, 200]; // Default colour\n }\n } else { //Nothing hovered or selected, viewing flows out\n return f => {\n if(!f) {return [0, 0, 0, 0];}\n\n const scale = this.state.scale;\n const flows = f.properties[(out && \"outflows\") || \"inflows\"];\n if (flows && Object.keys(flows)) { // View is outflows, this feature has outflows\n return scale(Object.keys(flows).reduce((prev, current) => prev + (+flows[current]), 0));\n }\n return [0, 0, 20, 200]; // Default colour\n }\n }\n }", "function plotEscala(faixa){\n $(\"#chart\").css('display','block');\n Highcharts.chart('chart', {\n chart:{\n type:'line'\n },\n title: {\n text: 'Magnitude calculada x Escala Richter'\n },\n xAxis: {\n plotBands:[{\n color:'#FCFFC5',\n from:magnitudeTable[faixa].de,\n to:magnitudeTable[faixa].ate\n }]\n },\n yAxis: {\n title: {\n text: 'Faixa de magnitude calculada'\n }\n },\n series:[{\n name: 'Escala Richter',\n data:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n }]\n }); \n }", "show(){\n fill(0)\n stroke(255)\n circle(this.x,this.y,this.d)\n }", "function plotParamData(){\n\n var newData =[];\n var minTickSize = Math.ceil((dsEnd - dsStart)/msecDay/7);\n\n if( height_check.checked ){\n newData.push({label: \"height (in)\",\n data: gaitData[0],\n color: pcolors[0], \n lines: { lineWidth: 3}\n });\n }\n else{\n // So that yaxis is always used...\n newData.push({label: \"height (in)\",\n data: gaitData[0],\n color: pcolors[0], \n lines: {lineWidth: 0} \n });\n }\n if( st_check.checked){\n\n newData.push({label: \"stride time (sec)\",\n data: gaitData[1],\n yaxis: 2,\n color: pcolors[1], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"st_95_ub (sec)\",\n data: gaitData[8],\n yaxis: 2,\n color: pcolors[1], lines: {lineWidth: 1}});\n\n newData.push({label: \"st_95_lb (sec)\",\n data: gaitData[9],\n yaxis: 2,\n color: pcolors[1], lines: {lineWidth: 1}});\n }\n }\n if( sl_check.checked){\n\n newData.push({label: \"stride length (cm)\",\n data: gaitData[2],\n color: pcolors[2], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"sl_95_ub (cm)\",\n data: gaitData[6],\n color: pcolors[2], lines: {lineWidth: 1}});\n\n newData.push({label: \"sl_95_lb (cm)\",\n data: gaitData[7],\n color: pcolors[2], lines: {lineWidth: 1}});\n }\n }\n if( as_check.checked){\n\n newData.push( {label: \"average speed (cm/sec)\",\n data: gaitData[3],\n color: pcolors[3], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"as_95_ub (cm/sec)\",\n data: gaitData[4],\n color: pcolors[3], lines: {lineWidth: 1}});\n\n newData.push({label: \"as_95_lb (cm/sec)\",\n data: gaitData[5],\n color: pcolors[3], lines: {lineWidth: 1}}); \n }\n }\n\n newData.push({label: \"system down time\",\n data: gaitData[10], \n lines: {lineWidth: 1, fill: true, fillColor: \"rgba(100, 100, 100, 0.4)\"} });\n\n if( alert_check.checked ){\n newData.push({\n data: alertsToPlot,\n color: \"rgb(0,0,0)\",\n yaxis: 1,\n lines: {show: false},\n points: {show: true, radius: 4} });\n }\n\n paramGraph = $.plot($(\"#flot1\"),\n newData,\n\n { \n grid: {\n color: \"#000\",\n borderWidth: 0,\n hoverable: true\n },\n\n xaxis: {\n mode: \"time\",\n timeformat: \"%m/%d/%y\",\n minTickSize: [minTickSize,\"day\"],\n ticks: 7,\n min: dsStart,\n max: dsEnd\n },\n yaxes: [{\n min:20, max: 100, position:\"left\", tickSize: 10 \n },\n {\n\n min:1, max: 2.4, position:\"right\", alignTicksWithAxis: 1\n }],\n legend: {\n show: false\n },\n hooks: { draw : [draw_alerts] }\n }\n );\n\n $.plot($(\"#smallgraph\"),\n newData,\n {\n xaxis: {\n mode: \"time\",\n show:false\n },\n yaxes: [{\n min:20, max: 100, position:\"left\", tickSize: 10, show: false \n },\n {\n\n min:1, max: 2.4, position:\"right\", alignTicksWithAxis: 1, show: false\n }],\n legend:{\n show:false \n },\n grid:{\n color: \"#666\",\n borderWidth: 2\n },\n rangeselection:{\n color: pcolors[4], //\"#feb\",\n start: dsStart,\n end: dsEnd,\n enabled: true,\n callback: rangeselectionCallback\n }\n }\n );\n\n}", "updateSingleArticlePlot(dom, data) {\n\n // Update x axis\n this.updateXAxis(dom);\n\n // Update y axis\n this.updateYAxis(data);\n\n // Update highlighted events\n this.updateHighlightedEvents();\n\n // Remove color legend\n d3.select(\"#color-legend\")\n .style(\"display\", \"none\");\n\n // Remove previous lines\n d3.selectAll(\".line\")\n .remove();\n\n // Generate new line\n let line = d3.line()\n .x(d => this.xScale(d.peak_date))\n .y(d => this.yScale(d.view_count))\n .curve(d3.curveMonotoneX);\n\n // Animate addition of new line\n const path = this.focus_area.append(\"path\")\n .attr(\"d\", line(data))\n .attr(\"class\", \"line\");\n\n const totalLength = path.node().getTotalLength();\n\n path.attr(\"stroke-dasharray\", totalLength + \" \" + totalLength)\n .attr(\"stroke-dashoffset\", totalLength)\n .transition()\n .duration(1000)\n .attr(\"stroke-dashoffset\", 0);\n\n\n // Update circles\n let circles = this.focus_area.selectAll(\"circle\")\n // Bind each svg circle to a\n // unique data element\n .data(data, d => d.article_id);\n\n // Update()\n circles.transition()\n .attr(\"cx\", d => this.xScale(d.peak_date))\n .attr(\"cy\", d => this.yScale(d.view_count));\n\n\n // Enter() \n circles.enter()\n .append(\"circle\")\n .attr(\"id\", d => \"article_\" + d.article_id)\n .attr(\"r\", 0)\n .attr(\"cx\", d => this.xScale(d.peak_date))\n .attr(\"cy\", d => this.yScale(d.view_count))\n .attr(\"fill\", \"#a50f15\")\n // Tooltip behaviour\n .on(\"mouseover\", this.onMouseOverCircle)\n .on(\"mouseout\", this.onMouseOutCircle)\n .transition()\n .attr(\"r\", 2);\n\n // Exit()\n circles.exit()\n .transition()\n .attr(\"r\", 0)\n .remove();\n }", "function onEachFeature(feature, layer) {\r\n layer.on({\r\n\t\t'mouseover': function (e) {\r\n\t\t\thighlight(e.target);\r\n\t\t },\r\n\t\t 'mouseout': function (e) {\r\n\t\t\tdehighlight(e.target);\r\n\t\t }, \r\n\t\t'click': function(e)\r\n\t\t\t{\r\n\t\t\t\t// enlever les interaction avec la carte sur une div \r\n\t\t\t\t$('#mySidepanel.sidepanel').mousedown( function() {\r\n\t\t\t\t\tmap2.dragging.disable();\r\n\t\t\t\t });\r\n\t\t\t\t $('html').mouseup( function() {\r\n\t\t\t\t\tmap2.dragging.enable();\r\n\t\t\t\t});\r\n\t\t\t\t// ouverture du panel \r\n\t\t\topenNav(e.target),\r\n\t\t\t// affichage des graphiques \r\n\t\t\tdocument.getElementById(\"myChart\").style.display='block';\r\n\t\t\tdocument.getElementById(\"myChart3\").style.display='none';\r\n\t\t\t// fermeture de la comparaison \r\n\t\t\t// selection des toits \r\n\t\t\tselect(e.target), \r\n\t\t\t// information dans le panel sur le toit sélectionné \r\n\t\t\tdocument.getElementById(\"5\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\" + \"<hr>\"\r\n// graphique sur l'influence des critères dans le roofpotentiel \r\n\t\t\tvar ctx1 = document.getElementById('myChart2').getContext('2d');\r\nvar chart1 = new Chart(ctx1, { \r\n // The type of chart we want to create\r\n type: 'horizontalBar',\r\n\r\n // The data for our dataset\r\n data: {\r\n labels: ['Pluviométrie', 'Surface', 'Ensoleillement', 'Solidité'],\r\n datasets: [{\r\n\t\t\tbackgroundColor: ['rgb(26, 196, 179)', \r\n\t\t\t'rgb(26, 196, 179)', \r\n\t\t\t'rgb(26, 196, 179)', 'rgb(26, 196, 179)'], \r\n borderColor: 'rgb(255, 99, 132)',\r\n data: [e.target.feature.properties.pluviok, e.target.feature.properties.surfacek, e.target.feature.properties.expok, e.target.feature.properties.solidek]\r\n }]\r\n },\r\n\r\n // Configuration options go here\r\n\toptions: {\r\n\t\t// animation: {\r\n // duration: 0 // general animation time\r\n // },\r\n\t\tevents: [], \r\n\t\tlegend: {\r\n\t\t\tdisplay: false}, \r\n\t\t\tscales: {\r\n\t\t\t\txAxes: [{\r\n\t\t\t\t\tticks: {\r\n\t\t\t\t\t\tmax: 5,\r\n\t\t\t\t\t\tmin: 0,\r\n\t\t\t\t\t\tstepSize: 1, \r\n\t\t\t\t\t\tdisplay: false\r\n\t\t\t\t\t}\r\n\t\t\t\t}]\r\n\t\t\t}\r\n\t}\r\n}); \r\n// graphique du roofpotentiel \r\nvar ctx2 = document.getElementById('myChart').getContext('2d');\r\n$('#PluvioInputId').val(1)\r\n$('#PluvioOutputId').val(1)\r\n$('#SurfaceInputId').val(1)\r\n$('#SurfaceOutputId').val(1)\r\n$('#ExpoInputId').val(1)\r\n$('#ExpoOutputId').val(1)\r\n$('#SoliInputId').val(1)\r\n$('#SoliOutputId').val(1)\r\n\tvar chart2 =new Chart(ctx2, {\r\n\t\t// The type of chart we want to create\r\n\t\ttype: 'horizontalBar',\r\n\t\r\n\t\t// The data for our dataset\r\n\t\tdata: {\r\n\t\t\tdatasets: [{\r\n\t\t\t\tbackgroundColor: function(feature){\r\n\t\r\n\t\t\t\t\tvar score = e.target.feature.properties.scoring;\r\n\t\t\t\t\tif (score > 90) {\r\n\t\t\t\t\t\treturn '#008080'; \r\n\t\t\t\t\t } \r\n\t\t\t\t\t else if (score > 80) {\r\n\t\t\t\t\t\treturn '#6EC6BA';\r\n\t\t\t\t\t } \r\n\t\t\t\t\t else if (score > 75) {\r\n\t\t\t\t\t\treturn '#A8E1CE';\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else if (score > 70) {\r\n\t\t\t\t\t\treturn ' #CCF1D2';\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else if (score >= 0) {\r\n\t\t\t\t\t\treturn '#EBF9ED';\r\n\t\t\t\t\t };\r\n\r\n\t\t\t\t},\r\n\t\t\t\tdata: [e.target.feature.properties.scoring],\r\n\t\t\t\tbarThickness: 2,\r\n\t\t\t}]\r\n\t\t},\r\n\t\t// Configuration options go here\r\n\t\toptions: {\r\n\t\t\tevents: [], \r\n\t\t\tlegend: {\r\n\t\t\t\tdisplay: false}, \r\n\t\t\t\tscales: {\r\n\t\t\t\t\txAxes: [{\r\n\t\t\t\t\t\tticks: {\r\n\t\t\t\t\t\t\tmax: 100,\r\n\t\t\t\t\t\t\tmin: 0,\r\n\t\t\t\t\t\t\tstepSize: 20\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}\r\n\t});\r\n\r\n//Fonction pour faire varier le poids des critéres et calculer à nouveau le scoring\r\n$('#valideform').click(function(event) {\r\n\tdocument.getElementById(\"myChart3\").style.display='block';\r\n\tdocument.getElementById(\"myChart\").style.display='none';\r\n\tvar ctx3 = document.getElementById('myChart3').getContext('2d');\r\n\tdocument.getElementById('mySidepanel').scroll({top:0,behavior:'smooth'});\r\n\tvar pluvio = $('#PluvioInputId').val()\r\n\tvar surface = $('#SurfaceInputId').val()\r\n\tvar ensoleillement = $('#ExpoInputId').val()\r\n\tvar solidite = $('#SoliInputId').val()\r\n\tvar somme = (100/((5*pluvio)+(5*surface)+(5*ensoleillement)+(5*solidite)))*(e.target.feature.properties.pluviok * pluvio + e.target.feature.properties.expok * ensoleillement + e.target.feature.properties.surfacek * surface + e.target.feature.properties.solidek * solidite)\r\n\t\tvar chart3 =new Chart(ctx3, {\r\n\t\t\t// The type of chart we want to create\r\n\t\t\ttype: 'horizontalBar',\r\n\t\t\r\n\t\t\t// The data for our dataset\r\n\t\t\tdata: {\r\n\t\t\t\tdatasets: [{\r\n\t\t\t\t\tbackgroundColor: function(feature){\r\n\t\t\r\n\t\t\t\t\t\tvar score = somme;\r\n\t\t\t\t\t\tif (score > 90) {\r\n\t\t\t\t\t\t\treturn '#008080'; \r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t\t else if (score > 80) {\r\n\t\t\t\t\t\t\treturn '#6EC6BA';\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t\t else if (score > 75) {\r\n\t\t\t\t\t\t\treturn '#A8E1CE';\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else if (score > 70) {\r\n\t\t\t\t\t\t\treturn ' #CCF1D2';\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else if (score >= 0) {\r\n\t\t\t\t\t\t\treturn '#EBF9ED';\r\n\t\t\t\t\t\t };\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdata: [somme],\r\n\t\t\t\t\tbarThickness: 2,\r\n\t\t\t\t}]\r\n\t\t\t},\r\n\t\t\r\n\t\t\r\n\t\t\t// Configuration options go here\r\n\t\t\toptions: {\r\n\t\t\t\tevents: [], \r\n\t\t\t\tlegend: {\r\n\t\t\t\t\tdisplay: false}, \r\n\t\t\t\t\tscales: {\r\n\t\t\t\t\t\txAxes: [{\r\n\t\t\t\t\t\t\tticks: {\r\n\t\t\t\t\t\t\t\tmax: 100,\r\n\t\t\t\t\t\t\t\tmin: 0,\r\n\t\t\t\t\t\t\t\tstepSize: 20\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}]\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\n//Fonction pour réinitialiser les critères par un bouton \r\n$('#renitform').click(function(event) {\r\n\tdocument.getElementById(\"myChart3\").style.display='none';\r\n\tdocument.getElementById(\"myChart\").style.display='block';\r\n\tdocument.getElementById('mySidepanel').scroll({top:0,behavior:'smooth'});\r\n\t$('#PluvioInputId').val(1)\t//replace le slider sur la valeur 1\r\n\t$('#PluvioOutputId').val(1)\r\n\t$('#SurfaceInputId').val(1)\r\n\t$('#SurfaceOutputId').val(1)\r\n\t$('#ExpoInputId').val(1)\r\n\t$('#ExpoOutputId').val(1)\r\n\t$('#SoliInputId').val(1)\r\n\t$('#SoliOutputId').val(1)\r\n})\r\n\r\n\r\n//Fonction pour ouvrir les fiches en fonction du scoring \r\nfunction showButton(){\r\n\tvar type = e.target.feature.properties.scoring\r\n\t if (type >= 90) {\r\n\t\treturn document.getElementById(\"fiche1\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche1body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche2\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche3\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne1\").innerHTML = ((feature.properties.shape_area)*3.5/127).toFixed(0); \r\n\t } \r\n\t else if (type >= 70) {\r\n\t\treturn document.getElementById(\"fiche2\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche2body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche1\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche3\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne2\").innerHTML = ((feature.properties.shape_area)*2.5/127).toFixed(0); \r\n\t } \r\n\t else {\r\n\t\treturn document.getElementById(\"fiche3\").style.display='block',\r\n\t\tdocument.getElementById(\"fiche3body\").innerHTML = \"<strong>Adresse : </strong>\" + feature.properties.addr_numer + feature.properties.addr_nom_1 + \"<br>\" + \"<strong>Type : </strong>\" + feature.properties.prop + \"<br>\" + \"<strong>Usage : </strong>\" + feature.properties.usage1 + \"<br>\" + \"<strong>Pluviométrie : </strong>\" + feature.properties.pluvio_max.toFixed(2) + \" mm/an\"+\"<br>\" + \"<strong>Surface : </strong>\" + feature.properties.shape_area.toFixed(2) + \" m²\" + \"<br>\" + \"<strong>Ensoleillement : </strong>\" + feature.properties.sr_mwh.toFixed(2) + \" KWh/m²\", \r\n\t\tdocument.getElementById(\"fiche1\").style.display='none', \r\n\t\tdocument.getElementById(\"fiche2\").style.display='none',\r\n\t\tdocument.getElementById(\"nbpersonne3\").innerHTML = ((feature.properties.shape_area)*1.5/127).toFixed(0); \r\n\t }\r\n }; \r\nshowButton(e.target); \r\n\r\n// destruction des graphiques a la fermeture du panel \r\n(function() { // self calling function replaces document.ready()\r\n\t//adding event listenr to button\r\ndocument.querySelector('#closesidepanel').addEventListener('click',function(){\r\n\t\tchart1.destroy();\r\n\t\tchart2.destroy(); \r\n\t\t});\r\n\t})();\r\n}\r\n})\r\n}", "addAxes () {\n }", "function addPlotFrame(plotTemplate, increment) {\n\n if (map == null) {\n alert(mapNotReady);\n return;\n }\n\n if (map.graphics == null) {\n alert(mapNotReady);\n return;\n }\n\n if (plotTemplate == \"\") {\n clearPlots();\n return;\n }\n\n\n\n var plotWidthMeters;\n var plotHeightMeters;\n\n // read plot definitions from array submitted by server\n for (var i in templateDimension) {\n var tInfo = templateDimension[i].split(\"|\");\n if (tInfo[0] == plotTemplate) {\n var plotWidthCentimeter = tInfo[1];\n plotWidthMeters = convertCentimetersToMeters(plotWidthCentimeter);\n var plotHeightCentimeter = tInfo[2];\n plotHeightMeters = convertCentimetersToMeters(plotHeightCentimeter);\n\n var polygonLimit = tInfo[3];\n var polygonCount = getDatashopPolyCount();\n if (polygonCount < polygonLimit) {\n polygonCenter = null;\n } else {\n showMessage(\"Your limit of plots has been reached.\");\n isMaxPolygon = true;\n return;\n }\n }\n }\n //get the center point of the map\n var mapDiv = document.getElementById(divMapId);\n var cenPixel = getDivCenter(mapDiv);\n var mapCenter = map.toMap(cenPixel);\n\n //get the polygon offset distances from the center point\n var offX = (plotWidthMeters) / 2;\n var offY = (plotHeightMeters) / 2;\n\n var polygonMap = new esri.geometry.Polygon();\n polygonMap.spatialReference = map.spatialReference;\n\n var anchorX = mapCenter.x - offX;\n var anchorY = mapCenter.y - offY;\n polygonMap.addRing([[anchorX, anchorY], [mapCenter.x - offX, mapCenter.y + offY], [mapCenter.x + offX, mapCenter.y + offY], [mapCenter.x + offX, mapCenter.y - offY], [mapCenter.x - offX, mapCenter.y - offY]]);\n\n var datashopPolygon = new DatashopPolygon(polygonMap);\n datashopPolygon.plotTemplate = plotTemplate;\n\n if (increment == true && getDatashopPolyCount() > 0) {\n frameNumber++;\n }\n\n datashopPolygon.id = frameNumber;\n\n datashopPolygon.centerAt(polygonCenter);\n\n //scale the polygon\n datashopPolygon.scale(plotScale);\n\n //rotate the polygon\n datashopPolygon.rotate(polygonAngle, datashopPolygon.getCenterPoint());\n\n // create text symbol\n var textSymbol = new esri.symbol.TextSymbol(datashopPolygon.id);\n textSymbol.setColor(new dojo.Color([0, 255, 0]));\n textSymbol.setAlign(esri.symbol.TextSymbol.ALIGN_MIDDLE);\n textSymbol.setFont(simpleTextFont);\n\n // create a text graphic for this datashop polygon\n datashopPolygon.textGraphic = new esri.Graphic(new esri.geometry.Point(0, 0, map.spatialReference), textSymbol);\n\n if (polygonGraphic != null && getDatashopPolyCount() > 0) {\n setDefaultSymbology(polygonGraphic);\n }\n polygonGraphic = new esri.Graphic(datashopPolygon, simpleFillSymbol);\n map.graphics.add(polygonGraphic);\n\n setActiveSymbology(polygonGraphic);\n\n // update the position of the text\n updateActivePolygonText(datashopPolygon);\n}", "function updatePlot() {\n let data = [];\n\n let x3 = 1;\n let y3 = 1;\n\n data = computeBasis(x3, y3);\n Plotly.animate(\n 'graph-holder',\n {data: data},\n {\n fromcurrent: true,\n transition: {duration: 0,},\n frame: {duration: 0, redraw: false,},\n mode: \"immediate\"\n }\n );\n }", "function reset() {\n\n // Plot distribution 1.\n g1.clear();\n for (var i = XMIN; i <= XMAX; i += STEP) {\n var y1 = (1/(controls.s1.value*Math.sqrt(2*Math.PI)))*Math.exp(-0.5*Math.pow(((i-controls.u1.value)/controls.s1.value),2));\n g1.addPoint(i, y1);\n }\n\n // Plot distribution 2.\n g2.clear();\n for (var i = XMIN; i <= XMAX; i += STEP) {\n var y2 = (1/(controls.s2.value*Math.sqrt(2*Math.PI)))*Math.exp(-0.5*Math.pow(((i-controls.u2.value)/controls.s2.value),2));\n g2.addPoint(i, y2);\n }\n\n}", "function insertRandomDatapoints() {\n\t let tmpData = {\n\t one: Math.floor(Math.random() * 35) + 10\n\t };\n\n\t chart1.series.addData(tmpData);\n\t chart1.render();\n\t}", "function endFunction(){\n count++;\n if(count==3){\n console.log(\"Start the Manipulation\");\n // console.log(stTotalFemales);\n // console.log(stTotalMales);\n firstPlot();// Function to create JSON for first plot\n secondPlot();// Function to create JSON for second plot\n }\n else{\n console.log(\"Not yet ready to start the Manipulation\");\n }\n}", "function drawExtraDecalsFn() {\n }", "function drawExtraDecalsFn() {\n }", "render_animation( caller )\n { // display(): Draw the selected group of axes arrows.\n if( this.groups[ this.selected_basis_id ] )\n for( let a of this.groups[ this.selected_basis_id ] )\n this.shapes.axes.draw( caller, this.uniforms, a, this.material );\n }", "function plot_nameConsole() {\n $('<div id=\"newDesk-add\">' +\n '<h3>Ajouter un nouveau bureau</h3>' +\n '<br><br><br>' +\n '<div class=\"inline left-labels\">' +\n '<label for=\"floor-name\">Etage (*) : </label><br /><br />' +\n '<label for=\"zone-name\">Zone : </label><br /><br />' +\n '<label for=\"numero-name\">Numéro : </label><br /><br />' +\n '</div>' +\n '<div class=\"inline\">' +\n '<input class=\"field\" type=\"text\" id=\"floor\" name=\"etage\" value=\"' + d3.select(\"#map-name h1\")[0][0].className + '\" readonly/><br />' +\n '<input class=\"field\" type=\"text\" id=\"zone\" name=\"zone\" placeholder=\"A-Z\" required/><br />' +\n '<input class=\"field\" type=\"text\" id=\"numero\" name=\"numero\" placeholder=\"01-99\" required/><br />' +\n '</div>' +\n '<div id=\"newDesk-button\">' +\n '<button id=\"add-office\">Valider</button>' +\n '<button id=\"office-cancel\">Annuler</button><br/>' +\n '<p id=\"wrong-exp\">Nom invalide</p>' +\n '</div>' +\n '</div>').insertAfter($('#navigation-bar'));\n\n $(\"#office-cancel\").click(function () {\n $(\"#newDesk-add\").remove();\n });\n}", "function resetZoom() {\n bioflot = $.plot(\"#placeholder\", organizedData,\n $.extend(true, {}, l_options, {\n xaxis: { min: -500, max: 800, ticks: 0 },\n yaxis: { min: -700, max: 500, ticks: 0 }\n })\n );\n}", "function fillFn(d) {\n return fill_color[deptPartido(d)];\n }", "function drawLinePlot(view_data){\n\t\n // finalise plot data \n var plot_data = view_data.plot_data;\n \n var flot_data = [];\n var count = 0;\n var markings = set_markings_to_array(view_data);\n min_x_axis = view_data.min_x_axis;\n max_x_axis = view_data.max_x_axis;\n \n // have to set this for the color\n \n var show_standard_deviation=\"on\";\n \n var countList = 0;\n var checkLabels = {};\n list_color_dict = {};\n\n // This is to show the day value when the labels are not shown (in summary xaxis label mode)\n var show_xaxis_labels_full = {};\n\n if (typeof view_data.xaxis_labels_original === \"undefined\") {\n view_data.xaxis_labels_original = view_data.xaxis_labels;\n }\n\n for (var list in view_data.xaxis_labels_original.full){\n label_name = view_data.xaxis_labels_original.full[list].name; \n xaxis_position = view_data.xaxis_labels_original.full[list].xaxis_position; \n show_xaxis_labels_full[xaxis_position] = label_name;\n }\n\n for (var list in plot_data){\n if (plot_data.hasOwnProperty(list) ){\n values_array = new Array();\n var base_count = 0;\n for (var item in plot_data[list]['values']){\n var standard_deviation = plot_data[list]['values'][item]['sd'];\n var average = plot_data[list]['values'][item]['average'];\n var xaxis = plot_data[list]['values'][item]['xaxis'];\n var extra_info = plot_data[list]['values'][item]['extra_info'];\n var color = plot_data[list]['color'];\n label = null;\n values_array[xaxis] = [xaxis,average];\n if (show_standard_deviation == 'on' && standard_deviation > 0){\n \n // tried setting it up in json but it kept picking this up as an Object and not an array when decoding json\n graph_data = new Array(); // had to make it an array otherwise it wouldn't get picked up \n graph_data[0] = new Array(); \n graph_data[1] = new Array(); \n graph_data[0][0] = xaxis;\n graph_data[0][1] = average + standard_deviation;\n graph_data[1][0] = xaxis;\n graph_data[1][1] = average - standard_deviation;\n flot_data[count] = {data: graph_data, label: null, color: color,lines: {show: true}, bandwidth: {show: true, lineWidth: 30, lineThickness: 3}, hoverable: false};\n count++;\n }\n }\n \n temp_label = list.split('|');\n new_label = temp_label[1] + ' - ' + temp_label[0];\n flot_data[count] = {data: values_array,color:color,hoverLabel: new_label + extra_info, label: label, points: { show: true }, lines: {show: true}, show_xaxis_labels_full: show_xaxis_labels_full};\n count++; \n }\n }\n view_data.options = set_options_bar_and_box(view_data);\n\n\n // this is checking total values of the original full xaxis labels. It's not perfect.\n if (view_data.expand_horizontally || Object.keys(view_data.xaxis_labels_original.full).length < 35 ){\n view_data.xaxis_labels = view_data.xaxis_labels_original['full'];\n } \n else {\n view_data.xaxis_labels = view_data.xaxis_labels_original['summary'];\n } \n view_data.flot_data = set_detection_threshold_and_median(view_data,flot_data,count);\n\n\n drawGraph(view_data);\n \n \n}", "function SVGPlotFunction(plot, name, fn, range, points, stroke, strokeWidth, settings) {\r\n\tif (typeof name != 'string') {\r\n\t settings = strokeWidth;\r\n\t strokeWidth = stroke;\r\n\t stroke = points;\r\n\t points = range;\r\n\t range = fn;\r\n\t fn = name;\r\n\t name = null;\r\n\t}\r\n\tif (!isArray(range)) {\r\n\t settings = strokeWidth;\r\n\t strokeWidth = stroke;\r\n\t stroke = points;\r\n\t points = range;\r\n\t range = null;\r\n\t}\r\n\tif (typeof points != 'number') {\r\n\t settings = strokeWidth;\r\n\t strokeWidth = stroke;\r\n\t stroke = points;\r\n\t points = null;\r\n\t}\r\n\tif (typeof stroke != 'string') {\r\n\t settings = strokeWidth;\r\n\t strokeWidth = stroke;\r\n\t stroke = null;\r\n\t}\r\n\tif (typeof strokeWidth != 'number') {\r\n\t settings = strokeWidth;\r\n\t strokeWidth = null;\r\n\t}\r\n\tthis._plot = plot; // The owning plot\r\n\tthis._name = name || ''; // Display name\r\n\tthis._fn = fn || identity; // The actual function: y = fn(x)\r\n\tthis._range = range; // The range of values plotted\r\n\tthis._points = points || 100; // The number of points plotted\r\n\tthis._stroke = stroke || 'black'; // The line colour\r\n\tthis._strokeWidth = strokeWidth || 1; // The line width\r\n\tthis._settings = settings || {}; // Any other settings\r\n }", "function graph_line_generate(category,text,data,dom,title,subtitle,color)\n{\n $('#' + dom).highcharts({\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n xAxis: {\n categories: category,\n crosshair: true\n },\n yAxis: {\n min: 0,\n title: {\n text: text\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle',\n borderWidth: 0\n },\n colors: color,\n series: [data]\n });\n}", "function populateGraph() {\n\n\t\t\t\t\tcolorClasses = Color.harmonious(data.numberOfSeries);\n\n\t\t\t\t\tvar paths = [];\n\t\t\t\t\tvar areaPoints = [];\n\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < data.numberOfSeries; seriesIndex++) {\n\t\t\t\t\t\tpaths.push([]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar dotElements = [];\n\n\t\t\t\t\tvar tracker;\n\t\t\t\t\tvar reversedKeys = data.keys.slice().reverse();\n\t\t\t\t\tvar reversedColorClasses = colorClasses.slice().reverse();\n\t\t\t\t\tif (data.numberOfSeries > 1) {\n\t\t\t\t\t\ttracker = generateXTracker(reversedColorClasses, reversedKeys);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar drawDots = (width / data.rows.length > Config.MINIMUM_SPACE_PER_DOT);\n\t\t\t\t\t\n\t\t\t\t\tdata.rows.forEach(function(dataItem, xValue) {\n\t\t\t\t\t\tvar alignedDots = [];\n\t\t\t\t\t\tvar xPixel = xScale.getPixel(xValue);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! dataItem.isFill) {\n\t\t\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < dataItem.ySeries.length; seriesIndex++) {\n\t\t\t\t\t\t\t\tif (dataItem.ySeries[seriesIndex] === null) continue;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar yPixel = yScale.getPixel(dataItem.ySeries[seriesIndex].runningTotal);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpaths[seriesIndex].push({\n\t\t\t\t\t\t\t\t\tx: xPixel,\n\t\t\t\t\t\t\t\t\ty: yPixel\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\tif (drawDots) {\n\t\t\t\t\t\t\t\t\tvar dot = drawDot(xPixel, yPixel)\n\t\t\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t\t\t.addClass('with-stroke')\n\t\t\t\t\t\t\t\t\t\t.addClass('fm-line-stroke');\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\tif (dataItem.ySeries[seriesIndex].annotation) {\n\t\t\t\t\t\t\t\t\tvar annotationPosition = yPixel - 20;\n\t\t\t\t\t\t\t\t\tvar\tannotationOrientation = 'top';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar tooltipObject = new Tooltip(paper, 'fm-stacked-area-tooltip fm-annotation', colorClasses[seriesIndex]);\n\t\t\t\t\t\t\t\t\tvar tooltip = tooltipObject.render(dataItem.xLabel, dataItem.ySeries[seriesIndex].annotation);\n\t\t\t\t\n\t\t\t\t\t\t\t\t\ttooltipObject.setPosition(xPixel, annotationPosition, annotationOrientation);\n\t\t\t\t\t\t\t\t\ttooltipObject.show();\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\tif (drawDots) {\n\t\t\t\t\t\t\t\t\tdotElements.push(dot);\n\t\t\t\t\t\t\t\t\talignedDots.push(dot);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\thoverAreas.append(drawHoverArea(dataItem, xValue, tracker, alignedDots)\n\t\t\t\t\t\t\t.attr({opacity: 0})\n\t\t\t\t\t\t\t.data('data', dataItem)\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tpaths.forEach(function(path, index) {\n\t\t\t\t\t\tvar closingPoints = [];\n\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\tclosingPoints.push({\n\t\t\t\t\t\t\t\tx: path[path.length - 1].x,\n\t\t\t\t\t\t\t\ty: yScale.end\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tclosingPoints.push({\n\t\t\t\t\t\t\t\tx: path[0].x,\n\t\t\t\t\t\t\t\ty: yScale.end\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (var pointIndex = paths[index - 1].length - 1; pointIndex >= 0; pointIndex--) {\n\t\t\t\t\t\t\t\tclosingPoints.push(paths[index - 1][pointIndex]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tareaPoints.push(path.concat(closingPoints));\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tvar lines = [];\n\t\t\t\t\tvar areas = [];\n\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < data.numberOfSeries; seriesIndex++) {\n\t\t\t\t\t\tlines.push(\n\t\t\t\t\t\t\tdrawLine(paths[seriesIndex], false)\n\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t.addClass('with-stroke')\n\t\t\t\t\t\t\t\t.addClass('fm-line-stroke')\n\t\t\t\t\t\t\t\t.addClass('no-fill')\n\t\t\t\t\t\t);\n\t\t\t\t\t\tareas.push(\n\t\t\t\t\t\t\tdrawLine(areaPoints[seriesIndex], false)\n\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t.attr({opacity: Config.AREA_OPACITY})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tareas.forEach(function(area) {\n\t\t\t\t\t\tgraphContent.append(area);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tlines.forEach(function(line) {\n\t\t\t\t\t\tgraphContent.append(line);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tdotElements.forEach(function(dot) {\n\t\t\t\t\t\tgraphContent.append(dot);\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\tif (tracker) {\n\t\t\t\t\t\tgraphContent.append(tracker.line);\n\t\t\t\t\t\tgraphContent.append(tracker.label);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.numberOfSeries > 1) {\n\t\t\t\t\t\tdrawKey(data.keys);\n\t\t\t\t\t}\n\t\t\t\t}", "function onAddNewPlotFrame() {\n\n if (map == null) {\n alert(mapNotReady);\n return;\n }\n\n if (map.graphics == null) {\n alert(mapNotReady);\n return;\n }\n var plotTemplateCbo = getPlotTemplateComboBox();\n var plotTemplate = plotTemplateCbo[plotTemplateCbo.selectedIndex].value;\n getPlotTemplateComboBox().disabled = true;\n getScaleComboBox().disabled = true;\n\n addPlotFrame(plotTemplate, true);\n\n updatePlotFrameButtons();\n onMovePlotFrame();\n}", "function makecharts() {\n dataprovider = [{\"time\":0,\"a\":50,\"b\":23,\"c\":23,\"d\":4,\"e\":4},{\"time\":1,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":2,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":3,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":11,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":22,\"a\":53,\"b\":43,\"c\":53,\"d\":4,\"e\":1},{\"time\":40,\"a\":50,\"b\":23,\"c\":23,\"d\":4,\"e\":4},{\"time\":41,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":42,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":43,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":51,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":52,\"a\":53,\"b\":43,\"c\":53,\"d\":4,\"e\":1}];\n variablel = [{\"name\":\"a\",\"axis\":0,\"description\":\"Somethinga\"},\n {\"name\":\"b\",\"axis\":0,\"description\":\"Somethingb\"},\n {\"name\":\"c\",\"axis\":1,\"description\":\"Somethingc\"},\n {\"name\":\"d\",\"axis\":0,\"description\":\"Somethingd\"}\n ]\n makechartswithdata(dataprovider,variablel); \n}", "function drawFunctionPoints(func) {\n \n var point_options = {\n style: 6,\n withLabel: false\n };\n \n var xvals = $.map(func.data, function(o,i) { return pointFilter(o)[0]; });\n var yvals = $.map(func.data, function(o,i) { return pointFilter(o)[1]; });\n var x_min = Math.min.apply(this, xvals);\n var x_max = Math.max.apply(this, xvals);\n \n // create and bind event handler for each point\n var points = $.map(func.data, function(o,i) {\n \n var p = optimalApp.board.create('point', pointFilter(o), point_options);\n \n // mousemove highlight of data table\n JXG.addEvent(p.rendNode, 'click', function(e) {\n //selectFunction(func);\n }, p);\n \n // display tooltip when mouse is over function\n JXG.addEvent(p.rendNode, 'mouseover', function(e) {\n if (optimalApp.copyMode === true) {\n setTooltip('Drag to copy and edit function');\n } else {\n setTooltip('Drag to edit');\n }\n }, p);\n \n // clear tooltip when mouse is not over function\n JXG.addEvent(p.rendNode, 'mouseout', function(e) {\n setTooltip();\n }, p);\n \n // handle copying of functions\n JXG.addEvent(p.rendNode, 'mousedown', function(e) {\n if (!optimalApp.copyMode) return;\n addFunction(deepcopy(func.data));\n }, p);\n \n // handle editing of functions\n JXG.addEvent(p.rendNode, 'mouseup', function(e) {\n var newpoint = [p.coords.usrCoords[1], p.coords.usrCoords[2]];\n func.dataTable.setDataAtCell(i, 0, pointInvFilter(newpoint)[0]);\n func.dataTable.setDataAtCell(i, 1, pointInvFilter(newpoint)[1]);\n func.data[i][0] = pointInvFilter(newpoint)[0];\n func.data[i][1] = pointInvFilter(newpoint)[1];\n }, p);\n \n return p;\n });\n \n return points;\n}", "function createNewFunctionView() {\n // json set\n var dataSet = pluto.loadedDataSet[pluto.selectedPlutoName];\n \n // gets the pluto\n var layer = pluto.loadedPluto[pluto.selectedPlutoName];\n // create layer.\n layer.loadFillLayer(thr, pluto.selectedFunctionName, dataSet);\n }" ]
[ "0.6249919", "0.62155414", "0.58387506", "0.5757968", "0.5735147", "0.5719106", "0.55970645", "0.5596848", "0.55888844", "0.55833197", "0.55628353", "0.5550831", "0.5550831", "0.5543863", "0.5539228", "0.55335075", "0.5516783", "0.5491746", "0.54781574", "0.5470076", "0.5463368", "0.54487914", "0.54469985", "0.5425977", "0.5419026", "0.5407784", "0.5379399", "0.53691417", "0.5365405", "0.53591067", "0.535613", "0.53275585", "0.5325976", "0.53205115", "0.5303822", "0.52637553", "0.5255558", "0.52539235", "0.5249363", "0.5247365", "0.52306384", "0.5229696", "0.5213717", "0.5211389", "0.5207045", "0.52004856", "0.5195481", "0.51929474", "0.51882887", "0.5185315", "0.5184702", "0.51810956", "0.5178934", "0.51702994", "0.5163127", "0.51591784", "0.5149127", "0.514844", "0.5140174", "0.5133848", "0.5131447", "0.5131447", "0.5128684", "0.5127077", "0.5126797", "0.51242584", "0.5117411", "0.5114854", "0.5112479", "0.5108721", "0.5107489", "0.5099779", "0.5096778", "0.50964606", "0.50939107", "0.5092736", "0.5081611", "0.5077961", "0.50710654", "0.50606465", "0.50559306", "0.50554645", "0.5045172", "0.50415444", "0.5039674", "0.50316995", "0.5030567", "0.5030567", "0.50304943", "0.5028899", "0.50246406", "0.5023298", "0.50210553", "0.5018135", "0.50153077", "0.5009897", "0.5003401", "0.50029606", "0.49976823", "0.49898" ]
0.5201949
45
create chart to show top 10 bacteria
function bacteria(selector) { var filter2 = data.samples.filter(value => value.id == selector) var otu_id = filter2.map(v => v.otu_ids) otu_id = otuNumber(otu_id[0].slice(0, 10)); var x_value = filter2.map(v => v.sample_values) x_value = x_value[0].slice(0, 10) var otu_label = filter2.map(v => v.otu_labels) var names = bacName(otu_label[0]).slice(0, 10) var trace1 = { x: x_value, y: otu_id, text: names, type: "bar", orientation: "h" }; var layout = { yaxis: { autorange: "reversed" } }; var bac_array = [trace1] Plotly.newPlot("bar", bac_array, layout) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function peopleWithMostBookings(){\n var data = google.visualization.arrayToDataTable(peopleWithMostBookings_arr);\n var height = 100 + 20*peopleWithMostBookings_arr.length;\n\n var options = {\n height: height,\n backgroundColor: \"#f9e7d5\",\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.peopleWithMostBookings_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-peopleWithMostBookings'));\n chart.draw(data, options);\n }", "function peopleWithMostBookedDays(){\n var data = google.visualization.arrayToDataTable(peopleWithMostBookedDays_arr);\n var height = 100 + 20*peopleWithMostBookedDays_arr.length;\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n height: height,\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.peopleWithMostBookedDays_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-peopleWithMostBookedDays'));\n chart.draw(data, options);\n }", "function buildCharts(sample){ \r\n \r\n \r\n d3.json(\"samples.json\").then((data) => {\r\n \r\n //prase data from json file\r\n var samples = data.samples;\r\n var filterSamples = samples.filter(kupaObj => kupaObj.id == sample);\r\n \r\n //prasing the arrays otu_ids, sample_values, otu_labels\r\n otuIds = filterSamples[0].otu_ids\r\n otuValues = filterSamples[0].sample_values\r\n otuLabels = filterSamples[0].otu_labels\r\n \r\n //creating empty lists that will be filled with items from otu_ids, sample_values, otu_labels\r\n //[(key) name: otu_itd, (value) count: sample_values, (value) labels: otu_labels] \r\n var bacteriaList = []\r\n var bacteriaLabel = []\r\n \r\n // forEach function used to extract items from otu_ids, sample_values, otu_labels and put them into empty lists \r\n otuIds.forEach((item,index) => {\r\n bacteriaList[index] = {name: item, count: otuValues[index], label: otuLabels[index] }\r\n })\r\n \r\n bacteriaListCopy = bacteriaList.slice()\r\n \r\n //checkup console print\r\n console.log(`unsorted list:`)\r\n console.log(bacteriaList[0])\r\n console.log(`unsorted bacteria set:`)\r\n console.log(bacteriaLabel[0])\r\n \r\n //sorting the data in descending order\r\n var sortedBacterialList = bacteriaListCopy.sort(function(a,b) {\r\n return parseFloat(b.count) - parseFloat(a.count)\r\n });\r\n \r\n //selecting top 10 items\r\n var sortedBacterialList = sortedBacterialList.slice(0,10)\r\n \r\n //creating bar chart\r\n var trace = {\r\n y: sortedBacterialList.map(row => `OTU ${row.name}`).reverse(),\r\n x: sortedBacterialList.map(row => `${row.count}`).reverse(),\r\n text: sortedBacterialList.map(row => `${row.label}`).reverse(), //here i will put information on bacteria\r\n name: \"Bar_Chart\",\r\n type: \"bar\",\r\n orientation: \"h\"\r\n };\r\n\r\n var sortedBacterialList = [trace]\r\n\r\n var layout = {\r\n title: \"Bacterial count\",\r\n margin: {\r\n l: 100,\r\n r: 100,\r\n t: 100,\r\n b: 100\r\n },\r\n xaxis: {\r\n title: {\r\n text: 'Bacteria Count',\r\n font: {\r\n family: 'Courier New, monospace',\r\n size: 14,\r\n color: '#7f7f7f'\r\n }\r\n }\r\n }\r\n };\r\n\r\n Plotly.newPlot(\"Bar_Chart\", sortedBacterialList,layout);\r\n\r\n //creating buble cahrt\r\n \r\n var xvalues = []\r\n var yvalues = []\r\n var labels = []\r\n \r\n bacteriaListCopy.forEach(function(row){\r\n xvalues.push(row.name)\r\n yvalues.push(row.count)\r\n labels.push(row.label)\r\n }); \r\n \r\n var trace1 = {\r\n x: xvalues,\r\n y: yvalues,\r\n text: labels,\r\n mode: 'markers',\r\n marker: {\r\n size: yvalues,\r\n color: xvalues,\r\n colorscale: 'Earth',\r\n sizeref: 3 \r\n }\r\n \r\n };\r\n \r\n var data = [trace1];\r\n \r\n var layout1 = {\r\n title: 'Bacterial distribution',\r\n showlegend: false,\r\n height: 500,\r\n width: 1100,\r\n plot_bgcolor:\"pearl\",\r\n paper_bgcolor:\"pearl\",\r\n xaxis: {\r\n title: {\r\n text: 'Bacteria ID',\r\n font: {\r\n family: 'Courier New, monospace',\r\n size: 14,\r\n color: '#7f7f7f'\r\n }\r\n },\r\n },\r\n yaxis: {\r\n title: {\r\n text: 'Bacteria Count',\r\n font: {\r\n family: 'Courier New, monospace',\r\n size: 14,\r\n color: '#7f7f7f'\r\n }\r\n }\r\n }\r\n \r\n \r\n };\r\n \r\n Plotly.newPlot('plot', data, layout1); \r\n\r\n\r\n });\r\n}", "function devicesWithMostBookedDays(){\n var data = google.visualization.arrayToDataTable(devicesWithMostBookedDays_arr);\n var height = 100 + 20*devicesWithMostBookedDays_arr.length;\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n height: height,\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.devicesWithMostBookedDays_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-devicesWithMostBookedDays'));\n chart.draw(data, options);\n }", "function generateGraphicsTopDeads(data) {\n\n var storedData = data;\n\n var colors = ['#7710AA', '#3920DE', '#208CDE', '#009688', '#20DBDE'];\n\n var bar1 = c3.generate({\n size: {\n height: 240,\n width: 480\n },\n bindto: '#bar1',\n data: {\n // Con esta opcion vamos a tratar de hacerlo dinámico\n json: storedData,\n keys: {\n x: 'name',\n value: [\"num_deaths\"]\n },\n type : 'bar',\n labels: true,\n // Descomentar esto para jugar con los colores\n color: function (color, d) {\n return colors[d.index];\n }\n },\n axis: {\n x: {\n type: 'category'\n },\n y: {\n label: 'Muertes'\n }\n },\n legend: {\n show:false\n }\n });\n}", "function devicesWithMostBookings(){\n var data = google.visualization.arrayToDataTable(devicesWithMostBookings_arr);\n var height = 100 + 20*devicesWithMostBookings_arr.length;\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n height: height,\n chartArea: {width: '65%'},\n isStacked: true,\n hAxis: {\n title: gon.devicesWithMostBookings_hAxis_title,\n minValue: 0,\n }\n };\n var chart = new google.visualization.BarChart(document.getElementById('g-chart-devicesWithMostBookings'));\n chart.draw(data, options);\n }", "function generateGraphicsTopContagions(data) {\n\n var storedData = data;\n\n var colors = ['#135802','#1EB241','#23D009', '#87D009', '#B0FDAE'];\n\n var bar2 = c3.generate({\n size: {\n height: 240,\n width: 480\n },\n bindto: '#bar2',\n data: {\n // Con esta opcion vamos a tratar de hacerlo dinámico\n json: storedData,\n keys: {\n x: 'name',\n value: [\"num_contagions\"]\n },\n type : 'bar',\n labels: true,\n // Descomentar esto para jugar con los colores\n color: function (color, d) {\n return colors[d.index];\n }\n },\n axis: {\n x: {\n type: 'category'\n },\n y: {\n label: 'Contagios'\n }\n },\n legend: {\n show:false\n }\n });\n /*// Con esta opcion vamos a tratar de hacerlo dinámico\n json: storedData,\n keys: {\n x: 'name',\n value: ['num_contagions']\n },\n type : 'bar',\n labels: true,\n // Descomentar esto para jugar con los colores\n color: function (color, d) {\n return colors[d.index];\n }\n },\n axis: {\n x: {\n type: 'category'\n },\n y: {\n label: 'Contagios'\n }\n },\n legend: {\n show:false\n }\n });*/\n}", "function barchart(DATA, topx){\n const topSlice = 10;\n let topDATA = [];\n let col = '';\n switch (topx){\n case 0: // Top Deficit\n let temp = DATA.sort((a, b) => a.Balance - b.Balance).slice(0,topSlice);\n for(let i=0; i<temp.length; i++){\n topDATA.push(Object.assign({}, temp[i]))\n }\n for(let i=0; i<topDATA.length; i++){\n topDATA[i].Balance *= -1\n }\n col = 'Balance';\n break\n case 1: // Top Surplus\n topDATA = DATA.sort((a, b) => b.Balance - a.Balance).slice(0,topSlice);\n col = 'Balance';\n break\n case 2: // Top Export\n topDATA = DATA.sort((a, b) => b.Export - a.Export).slice(0,topSlice);\n col = 'Export';\n break\n case 3: // Top Import\n topDATA = DATA.sort((a, b) => b.Import - a.Import).slice(0,topSlice);\n col = 'Import';\n break\n default: // Top Total\n topDATA= DATA.sort((a, b) => b.Total - a.Total).slice(0,topSlice);\n col = 'Total'\n }\n\n xLinearScale_Bar.domain(topDATA.map(d=>d.Country));\n yLinearScale_Bar.domain([d3.min(topDATA, d=>d[col]), d3.max(topDATA, d=>d[col])]);\n\n gButtomAxis_Bar.call(d3.axisBottom(xLinearScale_Bar))\n .selectAll(\"text\")\n .attr(\"transform\", \"translate(-10,0)rotate(-45)\")\n .style(\"text-anchor\", \"end\");\n gLeftAxis_Bar.call(d3.axisLeft(yLinearScale_Bar));\n\n var gBar = chartGroup_Bar.selectAll(\"rect\").data(topDATA)\n gBar\n .enter()\n .append(\"rect\")\n .merge(gBar)\n .transition().duration(1000)\n .attr(\"x\", d => xLinearScale_Bar(d.Country))\n .attr(\"y\", d => yLinearScale_Bar(d[col]))\n .attr(\"width\", xLinearScale_Bar.bandwidth())\n .attr(\"height\", d=>height_Bar-yLinearScale_Bar(d[col]))\n .attr(\"fill\", \"orange\")\n gBar.exit().remove()\n}", "function sortData() {\n\tattractions.sort((a,b) => a[\"Visitors\"] - b[\"Visitors\"]);\n\n\t// creates bar chart with the top five attractions\n\tlet data = attractions.slice(-5);\n\trenderBarChart(data);\n}", "function dibujar()\r\n {\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Hombres');\r\n data. addColumn('string','Mujeres');\r\n data.addRows(\r\n [\r\n ['Hombres',counterh],\r\n ['Mujeres',counterm]\r\n ]\r\n );\r\n var opciones = {'title':'Género',\r\n 'width':500,\r\n 'height':300};\r\n var grafica = new google.visualization.PieChart(document.getElementById('charts'));\r\n grafica.draw(data, opciones);\r\n }", "function totalCasesChart(ctx) {\n // eslint-disable-next-line\n new Chart(ctx, {\n type: \"bar\",\n data: {\n labels: counter.map(item => item.Genero),\n datasets: [\n {\n label: \"gold\",\n backgroundColor: \"yellow\",\n data: counter.map(item => item.Oro),\n },\n {\n label: \"silver\",\n backgroundColor: \"grey\",\n data: counter.map(item => item.Plata),\n },\n {\n label: \"bronce\",\n backgroundColor: \"brown\",\n data: counter.map(item => item.Bronce),\n },\n ]\n }\n });\n return totalCasesChart;\n}", "function drawChart() {\n const data = new google.visualization.DataTable();\n data.addColumn('string', 'Animal');\n data.addColumn('number', 'Count');\n data.addRows([\n ['2001', 23],\n ['2002', 22],\n ['2003', 23],\n ['2004', 23],\n ['2005', 28],\n ['2006', 28],\n ['2007', 25],\n ['2008', 28],\n ['2009', 27],\n ['2010', 6],\n ['2015', 18],\n ['2016', 18]\n ]);\n\n const options = {\n 'title': 'Distribution of BIONICLE sets per year (2001-2010; 2015-2016)',\n 'width':600,\n 'height':600\n };\n\n const chart = new google.visualization.PieChart(\n document.getElementById('chart-container'));\n chart.draw(data, options);\n}", "function visualizeTenEconomicalBowlers(topTenEconomicalBowler) {\n let seriesData = [];\n for (let player in topTenEconomicalBowler) {\n seriesData.push([player, topTenEconomicalBowler[player].economuRate]);\n }\n seriesData = seriesData.slice(0, 10);\n\n console.log(seriesData, \"economical player\");\n Highcharts.chart(\"Top-Ten-Economic-Bowlers\", {\n chart: {\n type: \"column\",\n },\n title: {\n text: \"Top Ten Economical Bowler\",\n },\n subtitle: {\n text:\n 'Source: <a href=\"https://www.kaggle.com/nowke9/ipldata/data\">IPL Dataset</a>',\n },\n xAxis: {\n type: \"category\",\n },\n yAxis: {\n min: 0,\n title: {\n text: \"Economic Rate\",\n },\n },\n series: [\n {\n name: \"Bowler\",\n data: seriesData,\n },\n ],\n });\n}", "function makeResultsBarChart(countries) {\n var chart = ui.Chart.feature.byFeature(countries, 'Name');\n chart.setChartType('BarChart');\n chart.setOptions({\n title: 'Population Comparison',\n vAxis: {title: null},\n hAxis: {title: 'Approximate 2015 Population', minValue: 0}\n });\n chart.style().set({stretch: 'both'});\n return chart;\n}", "function generals() {\n doubleBarGraph('tablita.csv', 'Deaths in various corridors across the border.');\n}", "function top10VAChart(group) {\n\tvar dataArray = [];\n\tvar vaArray = roleCountOfVA();\n\tfor(var i = 10*(group-1); i < 10*group; i++) {\n\t\tdataArray.push(vaArray[0].dataPoints[i]);\n\t}\n\t//console.log(dataArray);\n\tvar chart = new CanvasJS.Chart(\"chart_div\", {\n\t\tbackgroundColor: \"#FFD90F\",\n\t\t//theme: \"theme3\",\n\t\ttitle: {\n\t\t\ttext: \"The Simpsons VA\",\n\t\t\tfontSize: 30\n\t\t},\n\t\taxisX: {\n\t\t\ttitle: \"Voice Actors\",\n\t\t\ttitleFontColor: \"black\",\n\t\t\ttitleFontSize: 24,\n\t\t\tlabelAutoFit: true,\n\t\t\tlabelFontSize: 14.5,\n\t\t\tlabelFontColor: \"black\",\n\t\t\tinterval: 1,\n\t\t\tmargin: 0,\n\t\t\tgridColor: \"gray\",\n\t\t\ttickColor: \"gray\"\n\t\t},\n\t\taxisY: {\n\t\t\ttitle: \"Roles Played\",\n\t\t\ttitleFontSize: 24,\n\t\t\ttitleFontColor: \"black\",\n\t\t\tlabelFontColor: \"black\",\n\t\t\tgridColor: \"gray\",\n\t\t\ttickColor: \"gray\"\n\t\t},\n\t\tlegend: {\n\t\t\tfontFamily: \"sans-serif\",\n\t\t\tverticalAlign: \"bottom\",\n\t\t\thorizontalAlign: \"center\",\n\t\t\tcursor: \"pointer\",\n\t\t\t//itemclick: function\n\t\t},\n\t\tcreditText: \"\",\n\t\tdata: [\n\t\t\t{\n\t\t\t\ttype: \"column\",\n\t\t\t\tdataPoints: dataArray,\n\t\t\t}\n\t\t],\n\t});\n\tchart.render();\n}", "function genChart(){ \n var cols = [ {\n id : \"t\",\n label : \"host\",\n type : \"string\"\n } ];\n angular.forEach(data.hit, function(v, index) {\n cols.push({\n id : \"R\" + index,\n label : v.hostname,\n type : \"number\"\n });\n });\n var rows = [];\n angular.forEach(data.hit, function(q, i) {\n var d = [ {\n v : q.name\n } ];\n angular.forEach(data.hit, function(r, i2) {\n d.push({\n v : r.runtime\n });\n });\n rows.push({\n c : d\n });\n });\n var options={\n title:'Compare: ' + data.suite + \" \" + data.query,\n vAxis: {title: 'Time (sec)'}\n ,hAxis: {title: 'System'}\n // ,legend: 'none'\n };\n return {\n type : \"ColumnChart\",\n options : options,\n data : {\n \"cols\" : cols,\n \"rows\" : rows\n }\n };\n }", "static renderTopCountriesChart(ids) {\n\t\tGen.query({\n\t\t\t'ids': ids,\n\t\t\t'dimensions': 'ga:country',\n\t\t\t'metrics': 'ga:sessions',\n\t\t\t'sort': '-ga:sessions',\n\t\t\t'max-results': 5\n\t\t})\n\t\t\t.then(function (response) {\n\n\t\t\t\tvar data = [];\n\t\t\t\tvar colors = ['#4D5360', '#949FB1', '#D4CCC5', '#E2EAE9', '#F7464A'];\n\n\t\t\t\tif(response.rows){\n\n\t\t\t\t\tresponse.rows.forEach(function (row, i) {\n\t\t\t\t\t\tdata.push({\n\t\t\t\t\t\t\tlabel: row[0],\n\t\t\t\t\t\t\tvalue: +row[1],\n\t\t\t\t\t\t\tcolor: colors[i]\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tnew Chart(Gen.makeCanvas('chart-4-container')).Doughnut(data);\n\t\t\t\t\tGen.generateLegend('legend-4-container', data);\n\t\t\t\t}\n\t\t\t});\n\t}", "function renderTopCountriesChart(ids) {\n\t query({\n\t 'ids': ids,\n\t 'dimensions': 'ga:country',\n\t 'metrics': 'ga:sessions',\n\t 'sort': '-ga:sessions',\n\t 'max-results': 5\n\t })\n\t .then(function(response) {\n\n\t var data = [];\n\t var colors = ['#4D5360','#949FB1','#D4CCC5','#E2EAE9','#F7464A'];\n\n\t response.rows.forEach(function(row, i) {\n\t data.push({\n\t label: row[0],\n\t value: +row[1],\n\t color: colors[i]\n\t });\n\t });\n\n\t new Chart(makeCanvas('chart-4-container')).Doughnut(data);\n\t generateLegend('legend-4-container', data);\n\t });\n\t }", "function displayResults() {\n var names = [];\n for (var i = 0; i < allProducts.length; i++) {\n names.push(allProducts[i].name);\n }\n\n var votes = [];\n for (var j = 0; j < allProducts.length; j++) {\n votes.push(allProducts[j].votes);\n }\n\n var colors = [];\n for (var k = 0; k < allProducts.length; k++) {\n colors.push(allProducts[k].bgColor);\n }\n\n var chartConfig = {\n type: 'bar',\n data: {\n labels: names,\n datasets: [{\n label: '# of Votes',\n data: votes,\n backgroundColor: colors,\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n };\n\n return new Chart(ctx, chartConfig);\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(rendergrafica);\n\n // Set chart options\n var options = {\n 'title': 'Cantidad de laboratorios por categoria',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function createBarChart(debits_by_councilman) {\n var data = [];\n var labels = [];\n var backgroundcolor = [];\n var bordercolor = [];\n\n $.each(debits_by_councilman, function (key, val) {\n data.push(val.toFixed(2));\n labels.push(key);\n backgroundcolor.push(get_rgb_randon())\n bordercolor.push(get_rgb_randon_border())\n });\n\n var ctx = document.getElementById(\"barChart\");\n var stackedBar = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: 'R$ ',\n data: data,\n backgroundColor: backgroundcolor,\n borderColor: bordercolor,\n borderWidth: 1\n }],\n },\n options:[]\n });\n}", "function barchart(personId) {\n //create a variable for the sample data--this will be a lot like the metaData one above then my following variables will be based on this\n var sampleData = jsonData.samples.filter(obj => obj.id.toString() === personId)[0];\n //create a variable for the top ten OTUs: this is where I will need to slice\n var topTenOtu = sampleData.otu_ids.slice(0, 13).reverse();\n var otuIDs = topTenOtu.map(x => \"OTU \" + x);\n // get my sample values and sample labels\n var sampVals = sampleData.sample_values.slice(0, 10).reverse();\n var sampLabels = sampleData.otu_labels.slice(0, 10).reverse();\n //build a trace for my bar chart\n var trace = {\n type: \"bar\",\n x: sampVals,\n y: otuIDs,\n text: sampLabels,\n orientation: 'h'\n };\n //create my layout for the barchart. \n var layout = {\n title: \"<b>Top 10 OTUs found\",\n xaxis: {\n title: \"Sample Values\"\n },\n yaxis: {\n title: \"OTU IDs\"\n }\n }\n //create my bar data variable for the trace\n var barData = [trace];\n //plot it\n Plotly.newPlot('bar', barData, layout)\n}", "function calcularTop10() {\n if (0 >= list ) {\n const resultSalarios = document.getElementById(\"ResultSalarios\");\n resultSalarios.innerHTML = \"Por favor introdusca un valor\";\n } else {\n const salarioCol = list.map((persona) => {\n return persona.salary;\n });\n \n const salariosColSorted = salarioCol.sort((salarioA, salarioB) => {\n return salarioA - salarioB;\n });\n const spliceStart = (salariosColSorted.length * 90) / 100;\n const spliceCount = salariosColSorted.length - spliceStart;\n const salariosColTop10 = salariosColSorted.splice(spliceStart, spliceCount);\n const medianaTop10Col = medianaSalarios(salariosColTop10);\n const resultSalarios = document.getElementById(\"ResultSalarios\");\n resultSalarios.innerHTML = `La mediana del top 10 es: ${medianaTop10Col}`;\n }\n\n}", "function buildCharts(sample) {\n // 2. Use d3.json to load and retrieve the samples.json file \n d3.json(\"samples.json\").then((data) => {\n // 3. Create a variable that holds the samples array. \n var samples = data.samples;\n\n // 4. Create a variable that filters the samples for the object with the desired sample number.\n var results = samples.filter(sampleObj=>sampleObj.id == sample);\n // 5. Create a variable that holds the first sample in the array.\n var result = results[0];\n \n // 6. Create variables that hold the otu_ids, otu_labels, and sample_values.\n var otu_ids = result.otu_ids;\n var otu_labels = result.otu_labels;\n var sample_values = result.sample_values;\n // 7. Create the yticks for the bar chart.\n // Hint: Get the the top 10 otu_ids and map them in descending order \n // so the otu_ids with the most bacteria are last. \n\n var objs = otu_ids.map((v,i)=>{return {id:v,label:otu_labels[i],value:sample_values[i]}})\n .sort((a,b)=>a.value - b.value)\n //.slice(-10)\n\n var yticks = objs.slice(-10).map(o=>`OTU ${o.id}`)\n\n\n // 8. Create the trace for the bar chart. \n var barData = [\n {\n x: objs.slice(-10).map(o=>o.value),\n y: yticks,\n type: \"bar\",\n name: \"greek\",\n text: objs.slice(-10).map(o=>o.label),\n orientation: \"h\"\n }\n ];\n // 9. Create the layout for the bar chart. \n var barLayout = {\n title: \"Top 10 Becteria Cultures Found\"\n };\n // 10. Use Plotly to plot the data with the layout. \n Plotly.newPlot(\"bar\", barData, barLayout)\n\n // 1. Create the trace for the bubble chart.\n var bubbleData = [\n {\n x: objs.map(o=>o.id),\n y: objs.map(o=>o.value),\n //hoverinfo: \"x+y\",\n text: objs.map((o,i)=>o.label),\n mode: \"markers\",\n marker: {\n size: objs.map(o=>o.value/1.2),\n color: objs.map(o=>o.id) //sample_values.map(v=>`hsl(${v}, 100, 50)`)\n }\n }\n ];\n \n // 2. Create the layout for the bubble chart.\n var bubbleLayout = {\n title: \"Becteria Cultures Per Sample\",\n xaxis: {title: \"OUT ID\"},\n hovermode: \"closest\",\n yaxis: {\n autotick: false,\n tick0: 0,\n dtick: 50\n }\n };\n\n // 3. Use Plotly to plot the data with the layout.\n Plotly.newPlot(\"bubble\", bubbleData, bubbleLayout);\n \n });\n}", "function setTopTen(ByYear_CountryCsv){\r\n //add the div\r\n var topTenDiv = d3.select(\".topTenContainer\")\r\n .append(\"div\")\r\n .attr(\"class\",\"topTenDiv\");\r\n \r\n var topTenTitle = topTenDiv.append(\"h1\")\r\n .attr(\"class\",\"topTenTitle\")\r\n .text('Top 10 Most Terrorized Countries in:');\r\n \r\n var topTenSubtitle = topTenDiv.append(\"div\")\r\n .attr(\"class\",\"topTenSubtitle\")\r\n .append(\"h2\")\r\n .attr(\"class\",\"topTenSubtitleText\")\r\n .text(expressed.slice(2));\r\n \r\n var topTenList = topTenDiv.append(\"ol\")\r\n .attr(\"class\",\"topTenList\");\r\n \r\n updateTopTen(ByYear_CountryCsv, expressed);\r\n}", "function drawChart() {\n\n// Create the data table.\nvar data = new google.visualization.DataTable();\ndata.addColumn('string', 'Topping');\ndata.addColumn('number', 'Slices');\ndata.addRows([\n ['A, 5', 5],\n ['B, 3', 3],\n ['C, 6', 6],\n ['D, 9', 9],\n ['E, 2', 2],\n ['F, 2', 2],\n ['G, 1', 1]\n]);\n\n// Set chart options\nvar options = {'title':'Portafolio total',\n\t\t\t 'width':260,\n\t\t\t 'height':200};\n\n// Instantiate and draw our chart, passing in some options.\nvar chart = new google.visualization.PieChart(document.getElementById('graph'));\nchart.draw(data, options);\n}", "function drawSarahChart() {\n\n//DA NOMBRES A LAS VARIABLES GRAFICO BARRA\n var data = google.visualization.arrayToDataTable([\n ['Ítem','Porcentaje',{role:'style'}], \n ['Quiz1', 50, 'orange'],//da parametro a variable\n ['ReQuiz', 90,'orange'],\n ['Reto', 60,'orange'],\n ['P. Final', 70,'orange'],\n ['Total Ev.Tec.', 70,'orange']\n ]);\n\n// tamaño contenedor grafico barra\n var options = {title:'% de Alumnas que logran el 70% en Evaluaciones Técnicas',\n width:500,\n height:300\n };\n\n // Instantiate and draw the chart for Sarah's pizza.\n var chart = new google.visualization.BarChart(document.getElementById('Sarah_chart_div'));\n chart.draw(data, options);\n}", "function drawRegimesBarChart(el, valueKey) {\n const dim = {h: 500, w: 400, left: 40, bottom: 10, right: 0, top: 10};\n dim.bline = dim.h - dim.bottom;\n const rows = Object.keys(data.rotw)\n .map(ccode => ({\n ccode,\n size: +data[valueKey][ccode] / (valueKey === \"population\"? 1e9 : 1e6),\n regime: data.rotw[ccode],\n }));\n rows.sort((a, b) => b.size - a.size);\n console.log(rows);\n let maxCumulativeSize = 0;\n for (let rc = 0; rc <= 3; rc++) {\n let cumulativeSize = 0;\n const regimeRows = rows.filter(r => r.regime === rc);\n regimeRows.map( o => {\n o.sizeStart = cumulativeSize;\n cumulativeSize += o.size;\n o.sizeEnd = cumulativeSize;\n });\n if (cumulativeSize > maxCumulativeSize)\n maxCumulativeSize = cumulativeSize;\n }\n const xScale = d3.scaleBand([0, 1, 2, 3], [dim.w - dim.left, dim.left, dim.left, dim.left]);\n const hScale = d3.scaleLinear([0, maxCumulativeSize], [0, dim.h - dim.top - dim.bottom]);\n const yScale = d3.scaleLinear([0, maxCumulativeSize], [dim.h - dim.top - dim.bottom, 0]);\n const xAxis = d3.axisBottom(xScale).tickFormat(d => data.labels[\"R\"+d]);\n const yAxis = d3.axisLeft(yScale);\n const svg = d3.select(el).append(\"svg\")\n .attr(\"viewBox\", `0 0 ${dim.w + dim.left + dim.right} ${dim.h + dim.top + dim.bottom}`)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\");\n const g = svg.append(\"g\")\n .attr(\"transform\", `translate(${dim.left}, ${dim.top})`);\n g.selectAll(\"rect\").data(rows).enter()\n .append(\"rect\")\n .attr(\"class\", d => `R${d.regime} ${d.ccode}`)\n .attr(\"x\", d => xScale(d.regime) + 3)\n .attr(\"y\", d => yScale(d.sizeEnd) + 1)\n .attr(\"width\", xScale.bandwidth() - 6)\n .attr(\"height\", d => Math.max(1, hScale(d.size) - 2))\n .append(\"title\").text(d => `${data.longCName[d.ccode]}: ${d.size.toFixed(2)}`);\n g.selectAll(\"text.clabel\")\n .data(rows.filter(d => hScale(d.size) > 14))\n .enter().append(\"text\").attr(\"class\", \"clabel\")\n .attr(\"x\", d => xScale(d.regime) + xScale.bandwidth()/2)\n .attr(\"y\", d => yScale(d.sizeEnd) + hScale(d.size)/2)\n .text(d => data.countryName[d.ccode]);\n g.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", `translate(0, ${dim.bline})`)\n .call(xAxis);\n g.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", `translate(${dim.left}, 0)`)\n .call(yAxis);\n g.append(\"text\")\n .attr(\"class\", \"y axis label\")\n .attr(\"transform\", `translate(${dim.left/4} ${dim.h/2}) rotate(-90)`)\n .text(data.labels[valueKey]);\n}", "tableMostLoyalLeastEngaged() {\n function mostArray(array, property) {\n let orderedArrayDos = array.filter(arr => arr[property] > 0)\n .sort((a, b) => {\n if (a[property] > b[property]) {\n return -1\n } else if (a[property] < b[property]) {\n return 1\n }\n return 0\n })\n tenPercent = Math.round(orderedArrayDos.length * 10 / 100)\n\n return orderedArrayDos\n }\n this.statistics.mostLoyal = mostArray(this.members, \"votes_with_party_pct\").slice(0, (tenPercent))\n // los que tienen mas missed votes - los que no votaron mas veces(menos comprometidos)\n this.statistics.leastEngaged = mostArray(this.members, \"missed_votes_pct\").slice(0, (tenPercent))\n\n \n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(rendergrafica);\n\n // Set chart options\n var options = {\n 'title': 'cantidad de pruebas por laboratorio',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function bar_create(index) {\n d3.json(\"samples.json\").then(function(dataset) {\n\n var id_sample = dataset.samples[index]\n var sort_list = [];\n var x_list = [];\n var y_list = [];\n var label_list = [];\n \n// to sort values by sample_values\n for (var j = 0; j < id_sample.sample_values.length; j++) \n sort_list.push({'sample_values': id_sample.sample_values[j], 'otu_ids': \"OTU\" + String(id_sample.otu_ids[j]), 'otu_labels':id_sample.otu_labels[j]});\n \n \n sort_list.sort(function(a, b) { \n return ((b.sample_values - a.sample_values));\n });\n\n if (id_sample.sample_values.length >= 10){\n\n for (var k = 0; k < 10; k++) {\n x_list.push(sort_list[k].sample_values);\n y_list.push(sort_list[k].otu_ids);\n label_list.push(sort_list[k].otu_labels);\n\n\n\n };\n };\n\n// If the data lenght is less than 10, show not top ten but everything\n if (id_sample.sample_values.length < 10){\n\n for (var k = 0; k <id_sample.sample_values.length ; k++) {\n x_list.push(sort_list[k].sample_values);\n y_list.push(sort_list[k].otu_ids);\n label_list.push(sort_list[k].otu_labels);\n \n };\n };\n\n \n\n var x_value = x_list;\n var y_value = y_list;\n\n var data = [{\n type: 'bar',\n x: x_value,\n y: y_value,\n text: label_list, \n orientation: 'h'\n }];\n\n var layout = {\n yaxis:{\n autorange:'reversed'\n }\n }\n \n Plotly.newPlot('bar', data, layout)})}", "function render_barTekortSchieten() {\n var plotBar = hgiBar().mapping(['name', 'value']).errorMapping('sd').freqMapping('frequency').xDomain([0, 100]).addError(true).addFrequencies(true).xLabel('Ik heb het gevoel tekort te schieten');\n d3.select('#barTekortSchieten').datum(data_tekort_schieten).call(plotBar);\n}", "function section5TopChart( placeholder )\n {\n placeholder.text = 'cannot find data for chart';\n placeholder.fontSize = 7;\n return;\n\n // //\\\\ config\n compCol =\n {\n \"SMALL CAP\": \"#eeaa44\",\n \"MID CAP\": \"#ccaa33\",\n \"LARGE CAP\": \"#bb6600\",\n \"DEBT & CASH\": \"#ffbb99\"\n }\n // \\\\// config\n\n\n placeholder.stack = fmethods.initTopPaneCell( \"Credit Rating Breakup\" );\n //placeholder.margin = [0,0,0,0]; //todm no dice ... chart is too low ...\n\n var JSONrecord = nheap.content_data\n [ \"Page 5\" ]\n [ \"EquityMarketCap&DebtCreditRatingBreakup.txt\" ]\n [ \"EquityMarketCap\" ][0];\n\n //------------------\n // //\\\\ chart legend\n //------------------\n //var seriesData = Object.keys( JSONrecord ).map( prop => [ prop, JSONrecord[ prop ]] );\n var chartData = Object.keys( JSONrecord ).map( prop => ({ name:prop, y:JSONrecord[ prop ] }) );\n var colors = chartData.map( serie => compCol[ serie.name ] );\n var tBody = [];\n chartData.forEach( (row,rix) => {\n var ix = rix%2;\n var iy = ( rix - ix ) /2;\n tBody[iy] = tBody[iy] || [];\n\n //----------------------------------------\n // //\\\\ tedious alignments of legend cells\n //----------------------------------------\n tBody[iy][2*ix] = { image:methods.getLabelImage({\n shape:'bar', color:compCol[ row.name ]\n }),\n fit:[8,8],\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?6:6, 0, 0]\n };\n tBody[iy][2*ix+1] = [\n { text:row.y.toFixed(2)+'%', fontSize:11, color:'black', bold:true,\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?0:0, 0, 0],\n lineHeight:1\n },\n { text:row.name.substring(0,14), color:'#666', alignment:'left', margin:[0,0,0,0], \n lineHeight:1\n }\n ];\n //----------------------------------------\n // \\\\// tedious alignments of legend cells\n //----------------------------------------\n\n });\n //------------------\n // \\\\// chart legend\n //------------------\n\n\n\n //==============================\n // //\\\\ chart\n //==============================\n var chartPlaceholder = {\n //image: will come from export \n fit:[110,110],\n margin: [25,0,0,0]\n };\n\n placeholder.stack[1] = fmethods.layt({\n margin : [0,0,0,0],\n widths : [ '100%', '100%' ],\n pads : { left:0, top:20, right:0, bottom:0 },\n rows : 2,\n body : [\n ////layout is vertical: one column\n //.first column\n [ chartPlaceholder ],\n //.second column\n [\n fmethods.layt({\n margin : [20,0,0,0],\n widths: [ '10%', '30%', '10%', '40%' ],\n cols : 4,\n rows : 2,\n fontSize: 9,\n bordCol : '#fff',\n body : tBody\n }).tbl\n ]\n ]\n }).tbl;\n\n contCharts.push({ \n ddContRack : chartPlaceholder,\n //---------------------------\n // //\\\\ chart options\n //---------------------------\n options :\n {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false,\n type: 'pie'\n ,width: 460\n ,height: 460\n },\n\n \"exporting\": {\n \"enabled\": false\n },\n \"credits\": {\n \"enabled\": false\n },\n \n legend: {\n enabled: false,\n },\n\n title: {\n text: ''\n },\n plotOptions: {\n pie: {\n dataLabels: {\n enabled: false\n },\n colors : colors,\n showInLegend: true\n },\n series: {\n animation: false\n }\n },\n series: [{\n colorByPoint: true,\n type: 'pie',\n innerSize: '83%',\n data: chartData\n }]\n }\n //---------------------------\n // \\\\// chart options\n //---------------------------\n });\n //==============================\n // \\\\// chart\n //==============================\n\n\n\n return placeholder;\n }", "function drawChart() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(Object.entries(ar_chart));\n\n // Set chart options\n var options = {'title':'Percentage of file size',\n 'width':500,\n 'height':200};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function gerarGraficoEstoque(json) {\r\n let vetorNome = [], vetorQuantidade = [];\r\n\r\n for (let item of json.data) {\r\n vetorNome.push(corrigirTamanhoString(10, item.name))\r\n vetorQuantidade.push(item.stock)\r\n }\r\n\r\n Highcharts.chart('grafico', {\r\n chart: {\r\n type: 'bar'\r\n },\r\n title: {\r\n text: 'Gráfico Estoque'\r\n },\r\n xAxis: {\r\n categories: vetorNome\r\n },\r\n yAxis: {\r\n title: 'Quantidade'\r\n },\r\n series: [{\r\n name: 'Quantidade',\r\n data: vetorQuantidade\r\n }]\r\n });\r\n}", "function makeTotalChart(inData, nbd) {\n\n //console.log(inData)\n\n var categs = [],\n data = [];\n\n _.each(inData, function(d) {\n categs.push(d.key);\n data.push(d.values.length);\n });\n\n $(function () {\n $('#total-graph').highcharts({\n chart: {\n type: 'column'\n },\n title: {\n text: 'Top 5 reasons for evictions in ' + nbd \n },\n subtitle: {\n text: 'Source: San Francisco Rent Board',\n x: -20\n },\n xAxis: {\n categories: categs\n },\n yAxis: {\n min: 0,\n title: {\n text: 'Number of eviction notices',\n align: 'high'\n },\n labels: {\n overflow: 'justify'\n },\n },\n\n plotOptions: {\n column: {\n dataLabels: {\n enabled: true\n }\n }\n },\n credits: {\n enabled: false\n },\n series: [{\n name: 'Evictions in ' + nbd,\n data: data\n }]\n });\n }); \n}", "function show_chart() {\n outer_chart=[]\n inner_chart={}\n for(i=0;i<random_passenger_data.length;i++) {\n if(random_passenger_data[i].name.includes('sibsp') || random_passenger_data[i].name.includes('parch') || random_passenger_data[i].name.includes('fare')) {\n inner_chart['name'] = random_passenger_data[i].name\n inner_chart['value'] = random_passenger_data[i].value\n outer_chart.push(inner_chart)\n inner_chart={}\n }\n }\nreturn(outer_chart)\n}", "function bellyChart() {\n d3.event.preventDefault();\n var currentId = d3.select(\"#selDataset\").node().value;\n console.log(currentId);\n \n\n // Horizontal Bar Chart\n \n // Array for selected id\n var selectId = [];\n var currentSam = data.samples.filter(l => l.id === currentId)[0];\n console.log(currentSam);\n\n // Loop samples data to create array\n for (var i = 0; i < currentSam.otu_ids.length; i++) {\n var otu = {};\n otu.otuID = currentSam.otu_ids[i];\n otu.otuLabel = currentSam.otu_labels[i];\n otu.sampleValue = currentSam.sample_values[i];\n selectId.push(otu);\n }\n console.log(selectId);\n\n // Sort and split samples data to get top 10 otu\n var topOtu = selectId.sort(function topFunction(one, two) {\n return two.sampleValue - one.sampleValue;\n });\n\n topOtu = topOtu.slice(0,10);\n console.log(topOtu);\n console.log(topOtu[0].otuID);\n\n var horBar = {\n x: topOtu.map(otu => otu.sampleValue),\n y: topOtu.map(otu => `OTU ${otu.otuID}`),\n type: \"bar\",\n orientation: \"h\",\n text: topOtu.map(otu => otu.otuLabel)\n };\n\n var horData = [horBar];\n \n var horLayout = {\n title: \"Top 10 Bacteria Cultures Found\",\n yaxis: {autorange: \"reversed\"}\n };\n\n Plotly.newPlot(\"bar\", horData, horLayout);\n\n \n // Bubble Chart\n\n var bubSize = 13;\n \n var traceBub = {\n x : selectId.map(otu => otu.otuID),\n y : selectId.map(otu => otu.sampleValue),\n mode: \"markers\",\n text: selectId.map(otu => otu.otuLabel),\n marker: {\n size: selectId.map(otu => otu.sampleValue),\n color: selectId.map(otu => otu.otuID),\n sizeref: 2.0 * Math.max(...selectId.map(otu => otu.sampleValue)) / (bubSize**2),\n }\n };\n \n var bubLayout = {\n title: `Bacteria Cultures Per Sample for ID ${currentId}`,\n xaxis: {title: \"OTU ID\"}\n };\n\n var bubData = [traceBub];\n\n // Create bubble chart\n Plotly.newPlot(\"bubble\", bubData, bubLayout);\n\n}", "topFive (data) {\n data.sort((previous, current) => {\n return current.properties.mag - previous.properties.mag;\n });\n return data.slice(0, 5);\n }", "function plotdata(chartdata) {\n let chartformat = {};\n chartformat.type = 'bar';\n chartformat.data = chartdata;\n chartdata.datasets[0].label = 'Total games';\n\n let options = chartformat.options = {}; \n options.title = {};\n options.title.display = true;\n options.title.text = 'Total produced games between 1980 - 2015';\n options.title.fontSize = 24;\n options.title.fontColor = '#ff0000'\n\n new Chart($('#barChart'), chartformat, options );\n}", "function renderTopBrowsersChart(ids) {\n\n\t query({\n\t 'ids': ids,\n\t 'dimensions': 'ga:browser',\n\t 'metrics': 'ga:pageviews',\n\t 'sort': '-ga:pageviews',\n\t 'max-results': 5\n\t })\n\t .then(function(response) {\n\n\t var data = [];\n\t var colors = ['#4D5360','#949FB1','#D4CCC5','#E2EAE9','#F7464A'];\n\n\t response.rows.forEach(function(row, i) {\n\t data.push({ value: +row[1], color: colors[i], label: row[0] });\n\t });\n\n\t new Chart(makeCanvas('chart-3-container')).Doughnut(data);\n\t generateLegend('legend-3-container', data);\n\t });\n\t }", "function defaultTopNChart() {\n\t \texitForceGraph();\n\t \texitTopNChart();''\n\t \tenterTopNChart(\"QB\", 10);\n\t }", "function drawBargraph (sampleId) {\n console.log(`drawBargraph(${sampleId})`);\n\n // read in the data \n d3.json(\"data/samples.json\").then(data => {\n //console.log(data);\n\n var samples = data.samples;\n var resultArray = samples.filter(s => s.id == sampleId);\n\n var result = resultArray[0];\n\n\n // use otu_ids as the labels for the bar chart\n var otu_ids = result.otu_ids;\n\n // use otu_labels as the hovertext for the chart\n var otu_labels = result.otu_labels;\n \n // use sample_values as the values for the barchart\n var sample_values = result.sample_values;\n\n // .slice is used per the instructions display the top 10 OTUs for the individual\n yticks = otu_ids.slice(0, 10).map(otuId => `OTU ${otuId}`).reverse(); //TBD\n\n var barData = {\n x: sample_values.slice(0,10).reverse(), // tbd\n y: yticks,\n type: \"bar\",\n text: otu_labels.slice(0,10).reverse(), //tbd\n orientation: \"h\"\n }\n\n var barArray = [barData];\n var barLayout = {\n title: \"Top 10 Bacteria Cultures Found\",\n margin: {t: 30, l: 150}\n }\n\n Plotly.newPlot(\"bar\", barArray, barLayout);\n\n });\n\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['activos', 5],\n ['inactivos', 5.8],\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Estado de las alumnas',\n 'width': 450,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "function loadCrimesPerCategory() {\n var categoryStatsUrl = \"?$select=COUNT(category),category&$group=category&$order=COUNT(category) DESC\";\n $.getJSON(apiUrl + categoryStatsUrl, function(data) {\n\n // Total up categories\n var totalCategories = 0;\n for (var i = 0; i < data.length; i++) {\n var item = data[i];\n totalCategories += parseInt(item.count_category);\n }\n\n // Create chart and add data\n var categoryChart = new Chart(document.getElementById(\"stats-category-canvas\").getContext(\"2d\")).Pie(null, {\n segmentShowStroke: false\n });\n for (var i = 0; i < data.length; i++) {\n var item = data[i];\n var pct = parseFloat(((parseInt(item.count_category) / totalCategories) * 100).toFixed(2));\n\n var randomColor = getRandomColor();\n var lightRandomColor = getLightenedColor(randomColor, 0.2); \n\n categoryChart.addData({\n\tvalue: pct,\n\tcolor: randomColor,\n\thighlight: lightRandomColor,\n\tlabel: item.category\n });\n }\n\n loadCrimesPerHour(0, 0, [], []);\n\n });\n}", "function drawChart2() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Street');\n data.addColumn('number', 'Number of Meters');\n data.addRows(\n topmetersPerStreet(10)\n );\n\n // Set chart options\n var options = {\n 'title': 'Meters Per Street',\n 'width': 600,\n 'height': 400\n };\n\n // Instantiate and draw our chart, passing in some options.\n // var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n var chart = new google.visualization.ColumnChart(document.getElementById('chart_div2'));\n chart.draw(data, options);\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(render);\n\n // Set chart options\n var options = {\n 'title': 'Cantidad de laboratorios por sede',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function chartplot() {\n d3.json(\"http://127.0.0.1:5000/data\").then((data) => {\n var meanvalues_array = data.meanvalues;\n var samples = meanvalues_array;\n samples.sort(function (a, b) {\n return a.happiness_score - b.happiness_score;\n });\n console.log(samples);\n sample_countries = [];\n sample_happiness_score = [];\n for (let i = 0; i < samples.length; i++) {\n if(samples[i].happiness_score > 7.2) {sample_countries.push(samples[i].country), sample_happiness_score.push(samples[i].happiness_score)}\n else if(samples[i].happiness_score < 3.84) {sample_countries.push(samples[i].country), sample_happiness_score.push(samples[i].happiness_score)\n };\n console.log(sample_countries);\n console.log(sample_happiness_score);\n let chart = new frappe.Chart( \"#bar-chart\", { // or DOM element\n data: {\n labels: sample_countries,\n datasets: [\n {\n name: \"Mean Happiness Score by Country 2015-2019\", chartType: 'bar',\n values: sample_happiness_score,\n }],\n },\n title: \"Mean Happiness Score by Country 2015-2019\",\n type: 'bar', // or 'bar', 'line', 'pie', 'percentage'\n height: 300,\n colors: ['#F8F8FF'],\n isNavigable: true,\n tooltipOptions: {\n formatTooltipX: d => (d + '').toUpperCase(),\n formatTooltipY: d => d + ' pts',\n }\n });\n //chart.export();\n }})}", "function buildPercBars() {\n\n\treturn [\n\t {value: .45, index: .5, init:0},\n\t\t{value: .23, index: .4, init:0},\n\t];\n\t\n}", "function drawChart(data,selector,padding){\n var max = Math.max.apply(Math, data);\n var chart = document.querySelector(selector);\n var barwidth = ((chart.offsetWidth-(values.length-1)*padding-(data.length)*10)/data.length);\n var sum = data.reduce(function(pv, cv) { return pv + cv; }, 0);\n var left = 0;\n for (var i in data){\n var newbar = document.createElement('div');\n newbar.setAttribute(\"class\", \"bar\");\n newbar.style.width=barwidth+\"px\";\n newbar.style.height=((data[i]/max)*100)+\"%\";\n newbar.style.left=left+\"px\";\n chart.appendChild(newbar);\n left += (barwidth+padding+10);\n }\n}", "function draw_charta(){\n ctx.beginPath();\n \n ctx.moveTo(count_block(5),count_block(40));\n ctx.clearRect(0,0,1000,500);\n draw_axis(ctx);\n let i,j,p;\n \n for(i=0;i<data.length-1;i++){\n p=i;\n for(j=i+1;j<data.length;j++){\n \n if(data[p] > data[j]) {\n p=j;\n }\n }\n if(p!=i){\n \n let temp = data[i];\n data[i] = data[p];\n data[p] = temp;\n break;\n \n }\n \n }\n \n var xplot = 10;\n for(let j=0; j < data.length; j++){\n var data_in_blocks = data[j]/100; \n\n ctx.strokeText(data[j].toString(), count_block(xplot), count_block(40-data_in_blocks)-10);\n ctx.lineTo(count_block(xplot), count_block(40-data_in_blocks));\n ctx.arc(count_block(xplot), count_block(40-data_in_blocks), 3,0, Math.PI*2, true);\n xplot+=5; \n \n \n }\n ctx.stroke();\n}", "function buildCharts(sample) {\r\n // 2. Use d3.json to load and retrieve the samples.json file \r\n d3.json(\"samples.json\").then((sampledata) => {\r\n // 3. Create a variable that holds the samples array. \r\n var samplesArray = sampledata.samples;\r\n //console.log(sampledata);\r\n \r\n // 4. Create a variable that filters the samples for the object with the desired sample number.\r\n var samples = samplesArray.filter(sampleObj => sampleObj.id == sample);\r\n //console.log(samples)\r\n // 5. Create a variable that holds the first sample in the array.\r\n \r\n // 6. Create variables that hold the otu_ids, otu_labels, and sample_values.\r\n var sampleOTU_array = samples[0];\r\n var sampleOTU_ids = sampleOTU_array.otu_ids;\r\n //console.log(sampleOTU_ids);\r\n var sampleOTU_labels = sampleOTU_array.otu_labels;\r\n //console.log(sampleOTU_labels);\r\n var sampleSample_values = sampleOTU_array.sample_values;\r\n //console.log(sampleSample_values);\r\n \r\n // 7. Create the yticks for the bar chart.\r\n // Hint: Get the the top 10 otu_ids and map them in descending order \r\n // so the otu_ids with the most bacteria are last. \r\n var bacteriaAll = samples.sort((a ,b) => a.sample_values - b.sample_values).reverse();\r\n //console.log(bacteriaAll);\r\n var allBacteria = bacteriaAll[0];\r\n console.log(allBacteria)\r\n var OTU_ids_Ten = allBacteria.otu_ids.slice(0,10);\r\n var OTULabels_Ten = allBacteria.otu_labels.slice(0,10).reverse();\r\n var sampleValues_Ten = allBacteria.sample_values.slice(0, 10).reverse();\r\n \r\n \r\n var yticks = OTU_ids_Ten.map(num => \"OTU\" + num).reverse();\r\n console.log(yticks);\r\n console.log(sampleValues_Ten);\r\n console.log(OTULabels_Ten);\r\n //sampleValues_Ten.map(num => parseInt(num))\r\n //console.log(yticks);\r\n // 8. Create the trace for the bar chart. \r\n \r\n var trace = {\r\n x: sampleValues_Ten,\r\n y: yticks,\r\n text: OTULabels_Ten,\r\n type: 'bar',\r\n orientation: 'h'\r\n };\r\n \r\n //var barData = [trace];\r\n // 9. Create the layout for the bar chart. \r\n var barLayout = {\r\n title: {text: \"<b>Top Ten Bacteria Found</b>\"},\r\n font: {family: \"monospace\"},\r\n height: 420,\r\n width: 480\r\n };\r\n \r\n // 10. Use Plotly to plot the data with the layout. \r\n Plotly.newPlot('bar', [trace], barLayout);\r\n \r\n \r\n // ----- challenge part 2 ------//\r\n // 1. Create the trace for the bubble chart.\r\n var trace2 ={\r\n x: sampleOTU_ids,\r\n y: sampleSample_values,\r\n text: sampleOTU_labels,\r\n hoverformat: '<br><b>x</b>: %{x}<br>'+\r\n '<br><b>y</b>: %{y}<br>'+\r\n '<b>%{text}</b>',\r\n mode: 'markers',\r\n marker:{\r\n size: sampleSample_values,\r\n color: sampleOTU_ids,\r\n }\r\n };\r\n var bubbleData = [trace2];\r\n \r\n // 2. Create the layout for the bubble chart.\r\n var bubbleLayout = {\r\n title: {text:\"<b>Bacteria Cultures Per Sample</b>\"},\r\n showlegend: 'true',\r\n hovermode: 'closest',\r\n zeroline: false,\r\n xaxis: {\r\n title:\"<b>Sample OTU IDs</b>\"},\r\n height: 600, \r\n width: 1150,\r\n font: {family: \"monospace\"},\r\n };\r\n \r\n // 3. Use Plotly to plot the data with the layout.\r\n Plotly.newPlot('bubble', bubbleData, bubbleLayout);\r\n \r\n \r\n // --------- Challenge Part 3 -------- //\r\n // D3: 1-3. Use Plotly to plot the data with the layout.\r\n var metaData_All = sampledata.metadata\r\n //console.log(metaData_All)\r\n var SampleMetaData = metaData_All.filter(sampleObj => sampleObj.id == sample);\r\n //console.log(SampleMetaData)\r\n //console.log(sampledata)\r\n // convert wash freq to floating point number\r\n sampleMetaData = SampleMetaData[0];\r\n wfreq = parseFloat(sampleMetaData.wfreq);\r\n console.log(wfreq);\r\n \r\n // 4. Create the trace for the gauge chart.\r\n var gaugeData = [\r\n {\r\n domain: {x:[0, 10], y:[0, 10]},\r\n value: wfreq,\r\n title: {text: \"<b>Belly Button Washing Frequency</b><br>Scrubs Per Week\"},\r\n type: \"indicator\",\r\n mode: \"gauge+number\",\r\n gauge: {\r\n axis: {range: [0, 10], tickcolor: \"black\"},\r\n bar: {color: \"black\"},\r\n steps: [\r\n {range: [0, 2], color: \"red\" },\r\n {range: [2, 4], color: \"orange\" },\r\n {range: [4, 6], color: \"yellow\" },\r\n {range: [6, 8], color: \"green\" },\r\n {range: [8, 10], color: \"darkgreen\" }\r\n ],\r\n threshold: {\r\n line: {color: \"black\", width: 4 },\r\n thickness: 0.75,\r\n value: wfreq\r\n }\r\n }\r\n }\r\n \r\n ];\r\n \r\n // 5. Create the layout for the gauge chart.\r\n var gaugeLayout = { \r\n width: 480, height: 420, margin: { t: 10, b: 10, r: 5, l: 5},\r\n font: {family: \"monospace\"}\r\n };\r\n \r\n // 6. Use Plotly to plot the gauge data and layout.\r\n \r\n Plotly.newPlot('gauge', gaugeData, gaugeLayout);\r\n \r\n });\r\n }", "function buildTable(){\n var imgTitle = [];\n var graphData = [];\n for (var i = 0; i < imgDir.length; i++){\n imgTitle.push(imgDir[i]);\n }\n console.log('bar name:', imgTitle);\n\n for (var j = 0; j < imgObjArr.length; j++){\n graphData.push(imgObjArr[j].numClicks);\n }\n console.log('bar data:', graphData);\n\n var canvas = document.getElementById('chart');\n var ctx = canvas.getContext('2d');\n\n var myPieChart = new Chart(ctx,{\n type: 'pie',\n data: {\n labels: imgTitle,\n datasets: [{\n label: 'Total Number of Clicks',\n data: graphData,\n backgroundColor: ['#f6b6c6', '#e59c50', '#32fd33', '#b5c569', '#6d2c4d', '#604c0c', '#661930', '#89b6c2', '#f0c64b', '#4a4cdf', '#ae292d', '#a196c7', '#c7a0a2', '#3962b5', '#55adee', '#c11068', '#59794a', '#ea5c6c', '#ed84f5']\n }],\n },\n options: {}\n\n });\n}", "function genChart(){\n var colors=[\"#3366cc\",\"#dc3912\",\"#ff9900\",\"#109618\",\"#990099\",\"#0099c6\",\"#dd4477\",\"#66aa00\",\"#b82e2e\",\"#316395\",\"#994499\",\"#22aa99\",\"#aaaa11\",\"#6633cc\",\"#e67300\",\"#8b0707\",\"#651067\",\"#329262\",\"#5574a6\",\"#3b3eac\",\"#b77322\",\"#16d620\",\"#b91383\",\"#f4359e\",\"#9c5935\",\"#a9c413\",\"#2a778d\",\"#668d1c\",\"#bea413\",\"#0c5922\",\"#743411\"];\n var states=_.map($scope.data.states,function(runs,state){return state;});\n\n var session=_.map($scope.data.queries,\n function(v,key){return {\n \"name\":key,\n \"runs\":_.sortBy(v,state)\n }\n ;});\n var c=[];\n if(session.length){\n c=_.map(session[0].runs,function(run,index){\n var state=run.mode + run.factor;\n var pos=states.indexOf(state);\n // console.log(\"��\",state,pos);\n return colors[pos];\n });\n c=_.flatten(c);\n };\n var options={\n title:'BenchX: ' + $scope.benchmark.suite + \" \" + $scope.benchmark.meta.description,\n vAxis: {title: 'Time (sec)'}\n ,hAxis: {title: 'Query'}\n // ,legend: 'none'\n ,colors: c\n };\n return utils.gchart(session,options);\n\n }", "static renderTopBrowsersChart(ids) {\n\n\t\tGen.query({\n\t\t\t'ids': ids,\n\t\t\t'dimensions': 'ga:browser',\n\t\t\t'metrics': 'ga:pageviews',\n\t\t\t'sort': '-ga:pageviews',\n\t\t\t'max-results': 5\n\t\t})\n\t\t\t.then(function (response) {\n\n\t\t\t\tvar data = [];\n\t\t\t\tvar colors = ['#4D5360', '#949FB1', '#D4CCC5', '#E2EAE9', '#F7464A'];\n\n\t\t\t\tif(response.rows) {\n\t\t\t\t\tresponse.rows.forEach(function (row, i) {\n\t\t\t\t\t\tdata.push({ value: +row[1], color: colors[i], label: row[0] });\n\t\t\t\t\t});\n\n\t\t\t\t\tnew Chart(Gen.makeCanvas('chart-3-container')).Doughnut(data);\n\t\t\t\t\tGen.generateLegend('legend-3-container', data);\n\n\t\t\t\t}\n\t\t\t});\n\t}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Tricipital', parseInt(document.getElementById('tricipital').value, 10)],\n ['subescapular', parseInt(document.getElementById('subescapular').value, 10)],\n ['suprailiaca', parseInt(document.getElementById('suprailiaca').value, 10)],\n ['abdominal', parseInt(document.getElementById('abdominal').value, 10)],\n ['quadriceps', parseInt(document.getElementById('quadriceps').value, 10)]\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Percentual de dobras cutâneas em mm³',\n 'margin': 0,\n 'padding': 0,\n 'width': 450,\n 'height': 350\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function highchart_data_taux(sums) {\n var gueris = [], decess =[], abandons = [], weeks=[];\n $.each(sums, function (index, obj) {\n var somme_taux = obj.gueri + obj.deces + obj.abandon;\n var taux_guerison=(obj.gueri/somme_taux*100), taux_deces=(obj.deces/somme_taux*100), taux_abandon=(obj.abandon/somme_taux*100);\n gueris.push(Math.round(taux_guerison));\n decess.push(Math.round(taux_deces));\n abandons.push(Math.round(taux_abandon));\n weeks.push(index);\n });\n var donnees = [{data: gueris, name: \"Taux de guerison\"}, {data: decess,name: \"Taux de deces\"}, {data: abandons, name: \"Taux d'abandons\"}];\n return [donnees, weeks];\n}", "function generateGraphs() {\n return [{\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BZDVkZmI0YzAtNzdjYi00ZjhhLWE1ODEtMWMzMWMzNDA0NmQ4XkEyXkFqcGdeQXVyNzYzODM3Mzg@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"It\",\n \"type\": \"column\",\n \"valueField\": \"It\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BNDAxMTZmZGItZmM2NC00M2E1LWI1NmEtZjhhODM2MGU0ZmJlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Hangover\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.5,\n \"valueField\": \"The Hangover\"\n }, {\n \"balloonText\": \"<img src='https://ia.media-imdb.com/images/M/MV5BMTk3OTM5Njg5M15BMl5BanBnXkFtZTYwMzA0ODI3._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Notebook\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.45,\n \"valueField\": \"The Notebook\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BYzE5MjY1ZDgtMTkyNC00MTMyLThhMjAtZGI5OTE1NzFlZGJjXkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Deadpool\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.4,\n \"valueField\": \"Deadpool\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMGE1ZTQ0ZTEtZTEwZS00NWE0LTlmMDUtMTE1ZWJiZTYzZTQ2XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Bad Boys\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.35,\n \"valueField\": \"Bad Boys\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BY2I1NWE2NzctNzNkYS00Nzg5LWEwZTQtN2I3Nzk3MTQwMDY2XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Caddyshack\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.3,\n \"valueField\": \"Caddyshack\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMzNmY2IwYzAtNDQ1NC00MmI4LThkOTgtZmVhYmExOTVhMWRkXkEyXkFqcGdeQXVyMTk5NDA3Nw@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Die Hard\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.25,\n \"valueField\": \"Die Hard\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMTg1MTY2MjYzNV5BMl5BanBnXkFtZTgwMTc4NTMwNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Black Panther\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.2,\n \"valueField\": \"Black Panther\"\n }];\n }", "function populateRankingList() {\n // Clear the old data in the container\n divs.rank_list.innerHTML = '';\n // Sort the records by value\n info.ranking_list = info.ranking_list.sort(function(a, b){ return b.value - a.value; });\n // Create a paragraph for the top 15 gamers\n if(info.ranking_list.length > 0){\n if(info.ranking_list.length <= 15){\n var tmp = 1;\n for(const rec of info.ranking_list) {\n var node = document.createElement(\"P\");\n var textnode = document.createTextNode(tmp + \". \" + rec.key + \" - Score: \" + rec.value);\n node.appendChild(textnode);\n divs.rank_list.appendChild(node);\n tmp++;\n }\n }\n else {\n for(var i = 0; i < 15; i++) {\n var node = document.createElement(\"P\");\n var textnode = document.createTextNode(i+1 + \". \" + info.ranking_list[i].key + \": \" + info.ranking_list[i].value );\n node.appendChild(textnode);\n divs.rank_list.appendChild(node);\n }\n }\n }\n}", "function buildChart(sample) {\n d3.json(\"samples.json\").then(function(data){\n var samples = data.samples;\n var resultsArray = samples.filter(function(data){\n return data.id === sample;\n })\n var result = resultsArray[0];\n \n // Grabbing the bacterial species id number, name, and quantity\n var otu_ids = result[\"otu_ids\"];\n var otu_labels = result[\"otu_labels\"];\n var sample_values = result[\"sample_values\"];\n\n console.log(otu_ids);\n console.log(otu_labels);\n console.log(sample_values);\n\n // Building the bubble chart\n var bubbleLayout = {\n title: \"Bacterial Cultures Per Sample\",\n hovermode: \"closest\",\n xaxis: { title: \"OTU ID\"},\n margin: {t: 30}\n }\n var bubbleData = [\n {\n x: otu_ids,\n y: sample_values,\n text: otu_labels,\n mode: \"markers\",\n marker: {\n size: sample_values,\n color: otu_ids,\n colorscale: \"sunset\"\n }\n }\n ];\n\n Plotly.newPlot(\"bubble\", bubbleData, bubbleLayout);\n \n // First 10 OTU IDs for Horizontal Bar Chart\n var yticks = otu_ids.slice(0,10)\n .map(function(otuID) {\n return `OTU ${otuID}`;\n }).reverse();\n \n var barData = [\n {\n y: yticks,\n x: sample_values.slice(0,10).reverse(),\n text: otu_labels.slice(0,10).reverse(),\n type: \"bar\",\n orientation: \"h\"\n }\n ];\n\n var barLayout = {\n title: \"Top 10 Most Common Bacteria\",\n margin: {t: 30, l: 150}\n };\n\n Plotly.newPlot(\"bar\", barData, barLayout);\n\n })\n}", "function buildbarcharts(data){\n \n // Now Defining all our variables which will contain the sorted data elements\n // 1)Happiness/Sadness, 2)Health 3)Family 4)Freedom 5)Economy 6)Trust\n var sortedByHappiness = [];\n var sortedByHealth = [];\n var sortedByFamily = [];\n var sortedByFreedom =[];\n var sortedByEconomy = [];\n var sortedByTrust = [];\n \n // Now Defining all our variables which will contain top 10 and bottom 10 countries for each of the 6 categories below\n // 1)Happiness and Sadness, 2)Health 3)Family 4)Freedom 5)Economy 6)Trust \n var happiness_list = [];\n var sadness_list = [];\n var top_health_list = [];\n var bottom_health_list = [];\n var top_family_list = [];\n var bottom_family_list = [];\n var top_freedom_list = [];\n var bottom_freedom_list = [];\n var top_economy_list = [];\n var bottom_economy_list = [];\n var top_trust_list = [];\n var bottom_trust_list = [];\n \n // Displaying original data - unsorted data from the input SQLite database - countries are ranked by happiness\n // console.table(data);\n \n sortedByHappiness = sortBy(data, 'happiness_score', 'DESC');\n // console.log(\"Happiness Data\")\n // console.table(sortedByHappiness); \n for (i=0;i < 10; i++){\n happiness_list.push(sortedByHappiness[i]['country']); // loading top 10 countries based on happiness rank\n }\n global_happiness_list = happiness_list;\n \n for (i=sortedByHappiness.length-1;i >= sortedByHappiness.length-10; i--){ // loading bottom 10 countries based on happiness rank\n sadness_list.push(data[i]['country']);\n }\n global_sadness_list = sadness_list;\n\n //------------------------------------------------------------------------------------ \n sortedByHealth = sortBy(data, 'life_expectancy', 'DESC'); \n // console.log(\"Health Data\");\n // console.table(sortedByHealth);\n for (i=0;i < 10; i++){\n top_health_list.push(sortedByHealth[i]['country']); // loading top 10 countries based on health rank\n }\n global_top_health_list = top_health_list;\n\n for (i=sortedByHealth.length-1;i >= sortedByHealth.length-10; i--){ // loading bottom 10 countries based on health rank\n bottom_health_list.push(data[i]['country']);\n }\n global_bottom_health_list = bottom_health_list;\n\n //------------------------------------------------------------------------------------ \n sortedByFamily = sortBy(data, 'Family', 'DESC');\n // console.log(\"Family Data\");\n // console.table(sortedByFamily);\n for (i=0;i < 10; i++){\n top_family_list.push(sortedByFamily[i]['country']); // loading top 10 countries based on family rank\n }\n global_top_family_list = top_family_list;\n\n for (i=sortedByFamily.length-1;i >= sortedByFamily.length-10; i--){ // loading bottom 10 countries based on family rank\n bottom_family_list.push(data[i]['country']);\n }\n global_bottom_family_list = bottom_family_list;\n\n //------------------------------------------------------------------------------------ \n sortedByFreedom = sortBy(data, 'freedom', 'DESC');\n // console.log(\"Freedom Data\");\n // console.table(sortedByFreedom); \n for (i=0;i < 10; i++){\n top_freedom_list.push(sortedByFreedom[i]['country']); // loading top 10 countries based on freedom rank\n }\n global_top_freedom_list = top_freedom_list;\n \n for (i=sortedByFreedom.length-1;i >= sortedByFreedom.length-10; i--){ // loading bottom 10 countries based on freedom rank\n bottom_freedom_list.push(data[i]['country']);\n }\n global_bottom_freedom_list = bottom_freedom_list;\n\n //------------------------------------------------------------------------------------ \n sortedByEconomy = sortBy(data, \"GDP\", 'DESC');\n // console.log(\"Economy Data\");\n // console.table(sortedByEconomy);\n for (i=0;i < 10; i++){\n top_economy_list.push(sortedByEconomy[i]['country']); // loading top 10 countries based on economy rank\n }\n global_top_economy_list = top_economy_list;\n \n for (i=sortedByEconomy.length-1;i >= sortedByEconomy.length-10; i--){ // loading bottom 10 countries based on economy rank\n bottom_economy_list.push(data[i]['country']);\n } \n global_bottom_economy_list = bottom_economy_list;\n\n //------------------------------------------------------------------------------------ \n sortedByTrust = sortBy(data,\"trust\",'DESC');\n // console.log(\"Trust Data\");\n // console.table(sortedByTrust);\n for (i=0;i < 10; i++){\n top_trust_list.push(sortedByTrust[i]['country']); // loading top 10 countries based on trust rank\n }\n global_top_trust_list = top_trust_list;\n\n for (i=sortedByTrust.length-1;i >= sortedByTrust.length-10; i--){ // loading bottom 10 countries based on trust rank\n bottom_trust_list.push(data[i]['country']);\n } \n global_bottom_trust_list = bottom_trust_list;\n //------------------------------------------------------------------------------------ \n // Printing all the Top 10 Country Outputs for the below lists\n // 1)Happiness and Sadness, 2)Health 3)Family 4)Freedom 5)Economy 6)Trust \n \n console.log(\"Happiness List: \\n\" + happiness_list);\n console.log(\"Sadness List: \\n\" + sadness_list);\n console.log(\"Top 10 Health List: \\n\" + top_health_list);\n console.log(\"Top 10 Family List: \\n\" + top_family_list);\n console.log(\"Top 10 Freedom List: \\n\" + top_freedom_list);\n console.log(\"Top 10 Economy List: \\n\" + top_economy_list);\n console.log(\"Top 10 Trust List: \\n\" + top_trust_list);\n console.log(\"Bottom 10 Health List: \\n\" + bottom_health_list);\n console.log(\"Bottom 10 Family List: \\n\" + bottom_family_list);\n console.log(\"Bottom 10 Freedom List: \\n\" + bottom_freedom_list);\n console.log(\"Bottom 10 Economy List: \\n\" + bottom_economy_list);\n console.log(\"Bottom 10 Trust List: \\n\" + bottom_trust_list);\n \n var chart_data = [{\n x: happiness_list,\n y: [10, 9, 8, 7, 6, 5, 4, 3, 2, 1],\n type: \"bar\",\n marker: {\n color: 'rgb(59, 18, 18)'\n }\n }];\n var layout = {\n title: \"Happiness Report 😀\",\n xaxis: { title: \"Countries\"},\n yaxis: { title: \"Score (Normalized 1-10)\"}\n };\n Plotly.plot(\"plot\", chart_data, layout);\n }", "function setAllFoodsChart(data, valArray, currentMax){\n chart2.selectAll(\"rect\").remove();\n chart2.selectAll(\"text\").remove();\n \n //create an array of sums of each food's \"column-total\"\n \n var yScale = d3.scaleLinear()\n .range([0, 235])\n .domain([0, (100168.65)]);\n \n var foodcolor = d3.scaleQuantile()\n .domain(d3.range(0, 110300))\n .range(d3.schemePurples[7]); \n \n var chartBackground = chart2.append(\"rect3\")\n .attr(\"class\", \"chart2Background\")\n .attr(\"width\", (((chartInnerWidth * 2)+ 4)/3) )\n .attr(\"height\", (chartInnerHeight/2) )\n .attr(\"transform\", translate);\n \n var chartTitle = chart2.append(\"text\")\n .attr(\"x\", 10)\n .attr(\"y\", 20)\n .attr(\"class\", \"chartTitle\")\n .style('fill', 'white')\n .text(\"World Foods CO2 Ranking\");\n \n // iterate through valArray, sum the columns, make a bar graph of those sums.\n var bars = chart2.selectAll(\".bars\")\n .data(data3)\n .enter()\n .append(\"rect\")\n .sort(function(a, b){\n return a.Value-b.Value\n })\n .attr(\"class\", function(d){\n return d.Food;\n })\n .attr(\"width\", ( (((width * 2)+ 4)/3) / data3.length - 1))\n .attr(\"x\", function(d, i){\n return i * ( (((width * 2)+ 4)/3) / data3.length);\n })\n .attr(\"height\", function(d){\n return yScale(parseFloat(d.Value));\n })\n .attr(\"y\", function(d){\n return (chartHeight/2) - yScale(parseFloat(d.Value));;\n })\n .style(\"fill\", function(d){ \n return foodcolor(d.Value);\n })\n .on(\"mouseover\", function(d) { \n tooltip.transition() \n .duration(200) \n .style(\"opacity\", .9)\n .style(\"stroke-opacity\", 1.0); \n tooltip.html(d.Food + \"<br/>\" + d.Value + \" total\" + \"<br/>\" + \"yearly per capita CO2 emissions\")\n .style(\"left\", (d3.event.pageX) + \"px\") \n .style(\"top\", (d3.event.pageY - 28) + \"px\")\n .style(\"stroke\", \"green !important\")\n .style(\"stroke-width\", \"2\")\n }) \n .on(\"mouseout\", function(d) {\n tooltip.transition() \n .duration(500) \n .style(\"opacity\", 0)\n .style(\"stroke-opacity\", 0); \n })\n\n }", "function sketchLineGroupageDays(datos, ctx){\n var ageGroupsMonth = ageGroups(datos);\n // console.log(ageGroupsMonth)\n\n\n var listGroups = [];\n for (var i =1; i<3; i++){\n var oneEntry = {\n \"key\" : ageGroupsMonth[i].key,\n \"values\" : groupedBy(\"Date\", ageGroupsMonth[i].values)\n }\n listGroups.push(oneEntry);\n }\n // console.log(listGroups[0]);\n\n for (var i=0; i<listGroups.length; i++){\n listGroups[i].values.sort(function(a,b){\n // console.log(a)\n one = new Date(a.key)\n two = new Date(b.key)\n return one.getDate()- two.getDate()})\n }\n\n \n var colores = ['gray', 'orange','yellow', 'blue', 'red', 'purple', 'orange'];\n var datasets = [];\n for (i in listGroups){\n var entry = {\n data : listGroups[i].values.map(entrada => entrada.values.length),\n label : listGroups[i].key,\n backgroundColor : colores[i],\n lineTension : 0,\n fill : false, \n radius : 1\n }\n datasets.push(entry);\n }\n \n var chartReturn = new Chart(ctx,{\n type : 'bar',\n data : {\n labels : listGroups[0].values.map(entry => entry.key),\n datasets : datasets\n },\n options : {\n responsive : true,\n title : {\n display : true,\n position : \"top\",\n text: `Number of deaths sorted by age group`,\n fontSize : 18\n },\n legend : {\n display: true,\n position: \"bottom\"\n }} \n })\n return chartReturn; \n\n}", "function ChartsBarchart() {\n}", "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Country');\r\n data.addColumn('number', 'Population');\r\n data.addColumn('number', 'Area');\r\n data.addColumn('number', 'Occupancy');\r\n data.addRows([\r\n [cdata.name, cdata.population,cdata.area,(cdata.area/cdata.population)]\r\n \r\n \r\n ]);\r\n\r\n // Set chart options\r\n var options = {'title':'Population Area Ratio of '+cdata.name,\r\n 'width':250,\r\n 'height':300};\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.BarChart(document.getElementById('bc1'));\r\n chart.draw(data, options);\r\n }", "function damageChart() {\r\n var pokemon_type = ['bug', 'dark', 'dragon', 'electric', 'fairy', 'fighting', 'fire', 'flying', 'ghost', 'grass', 'ground', 'ice',\r\n 'normal', 'poison', 'psychic', 'rock', 'steel', 'water'];\r\n\r\n\r\n readJSON();\r\n\r\n $('.container-fluid').append($('<div/>', { id: 'chart' }));\r\n for (var i = 1; i < 19; i++) {\r\n $('#chart').append($('<div/>', { id: i, 'class': 'box' }));\r\n }\r\n\r\n fill_the_chart(pokemon_type);\r\n}", "function barchart(id){\n d3.json(\"samples.json\").then(function(data){\n //getting the values from the data\n var samples=data.samples;\n var resultArray=samples.filter(function(data){\n return data.id === id\n })\n var result=resultArray[0];\n\n //using an if else since certain sample values length are less than 10\n\n if(result.sample_values.length<10){\n let y_data=result.sample_values.reverse();\n let x_slice_id=result.otu_ids.reverse();\n let text_slice_labels=result.otu_labels.reverse();\n x_slice_id_list=[]\n x_slice_id.forEach(item=>{\n item=`OTU ${item}`\n x_slice_id_list.push(item);\n })\n Plotly.restyle(\"bar\", \"y\", [x_slice_id_list]);\n Plotly.restyle(\"bar\", \"x\", [y_data]);\n Plotly.restyle(\"bar\", \"text\", [text_slice_labels]);\n }\n else{\n let y_data=result.sample_values.slice(0,10).reverse();\n let x_slice_id=result.otu_ids.slice(0,10).reverse();\n let text_slice_labels=result.otu_labels.slice(0,10).reverse();\n x_slice_id_list=[]\n x_slice_id.forEach(item=>{\n item=`OTU ${item}`\n x_slice_id_list.push(item);\n })\n Plotly.restyle(\"bar\", \"y\", [x_slice_id_list]);\n Plotly.restyle(\"bar\", \"x\", [y_data]);\n Plotly.restyle(\"bar\", \"text\", [text_slice_labels]);\n }\n })\n}", "drawTopRanks(smallchartdiv, topRanks, data) {\n // console.log(data.length)\n // draw a rectangle element for each result\n // for (var i = 0; i < topRanks.length; i++) {\n // // create the svg for country row\n // var smallsvg = smallchartdiv\n // .append('svg')\n // .attr('width', 1200)\n // .attr('height', 460)\n // .attr(\"fill\", \"Black\");\n // // we will create 1 g for each small multiple graph\n // var g = smallsvg.append(\"g\");\n // g.append(\"text\")\n // .attr(\"x\", 0)\n // .attr(\"y\", 30 + 110)\n // .style(\"fill\", \"Black\")\n // .text(data[i].Name);\n // g.append(\"rect\")\n // .attr(\"x\", 300)\n // .attr(\"width\", 300)\n // .attr(\"height\", 300)\n // .style(\"fill\", \"White\");\n // g.append(\"rect\")\n // .attr(\"x\", 600)\n // .attr(\"width\", 300)\n // .attr(\"height\", 300)\n // .style(\"fill\", \"Green\");\n // g.append(\"rect\")\n // .attr(\"x\", 900)\n // .attr(\"width\", 300)\n // .attr(\"height\", 300)\n // .style(\"fill\", \"Blue\");\n // }\n }", "function graphResults(){\n //store properties that will be graphed.\nvar productName = [];\nvar productVotes = [];\nvar displayTimes = [];\n//loop for adding each property to be graphed to their array\n for (var i=0; i<productArray.length; i++){\n productName.push(productArray[i].title);\n productVotes.push(productArray[i].clicks);\n displayTimes.push(productArray[i].displayCount);\n }\n //get parent element\nvar ctx = document.getElementById('myChart').getContext('2d');\nvar myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: productName,\n datasets: [{\n label: '# of Votes',\n data: productVotes,\n backgroundColor: [\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(153, 102, 255, 0.2)', \n ],\n borderColor: [\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(153, 102, 255, 1)',\n ],\n borderWidth: 1,},\n {label: '# times shown',\n data: displayTimes,\n backgroundColor: [\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n \n ],\n borderColor: [\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(75, 192, 192, 1)',\n ],\n borderWidth: 1\n }]\n \n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n});\n}", "function chart() {\n\n var data = [];\n var labels = [];\n\n for (var i = 0; i < imgArray.length; i++) {\n data[i] = imgArray[i].votes;\n labels[i] = imgArray[i].name;\n }\n\n //this is the name for each product\n var colors = ['red', 'blue', 'yellow', 'hotpink', 'purple', 'orange' , 'white' , 'cyan' , 'magenta' , 'salmon', 'gold' , 'greenyellow' , 'magenta' , 'silver' , 'black' , 'skyblue' , 'maroon' , 'pink' , 'limegreen' , 'violet'];\n\n var ctx = document.getElementById('chart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: '# of Votes',\n data: data,\n backgroundColor: colors,\n borderColor: 'black',\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "function dataDepartmentChart9(myObj, parent, thang) {\n let data = myObj.filter(e => {\n return e.parent == parent && e.thang == thang && (e.tuy_chon == 'viec-cho-duyet-qua-3-ngay' || e.tuy_chon == 'tong_so_viec_cho_duyet_trong_thang')\n })\n data = groupBy(data, 'ten_don_vi');\n let rs = [];\n Object.values(data).forEach(e => {\n let ty_le = Math.round(findChiSoByTuyChon(e, 'viec-cho-duyet-qua-3-ngay') / findChiSoByTuyChon(e, 'tong_so_viec_cho_duyet_trong_thang') * 100)\n if (e[0].hasChild == 1) {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: e[0].parent + '-' + e[0].ten_don_vi + '-' + thang,\n })\n } else {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: true\n })\n }\n })\n return rs;\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'FIO');\n data.addColumn('number', 'Count');\n i = 0; \n\n names = document.querySelectorAll('.DName');\n values = document.querySelectorAll('.DCount');\n\n while (i + 1 <= names.length) {\n data.addRows([\n [names[i].innerText, +values[i].innerText]\n ]);\n i++;\n }\n\n // Set chart options\n var options = {\n 'title': 'Кругова діаграма',\n 'width': 500,\n 'height': 500\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "makeChart(name) {\n let data = [];\n let datadict = {};\n const keys = CSRankings.topTierAreas;\n const uname = unescape(name);\n for (let key in keys) { // i = 0; i < keys.length; i++) {\n //\t let key = keys[i];\n if (!(uname in this.authorAreas)) {\n // Defensive programming.\n // This should only happen if we have an error in the aliases file.\n return;\n }\n //\t if (key in CSRankings.nextTier) {\n //\t\tcontinue;\n //\t }\n let value = this.authorAreas[uname][key];\n // Use adjusted count if this is for a department.\n /*\n DISABLED so department charts are invariant.\n \n if (uname in this.stats) {\n value = this.areaDeptAdjustedCount[key+uname] + 1;\n if (value == 1) {\n value = 0;\n }\n }\n */\n // Round it to the nearest 0.1.\n value = Math.round(value * 10) / 10;\n if (value > 0) {\n if (key in CSRankings.parentMap) {\n key = CSRankings.parentMap[key];\n }\n if (!(key in datadict)) {\n datadict[key] = 0;\n }\n datadict[key] += value;\n }\n }\n for (let key in datadict) {\n let newSlice = {\n \"label\": this.areaDict[key],\n \"value\": Math.round(datadict[key] * 10) / 10,\n \"color\": this.color[CSRankings.parentIndex[key]]\n };\n data.push(newSlice);\n }\n new d3pie(name + \"-chart\", {\n \"header\": {\n \"title\": {\n \"text\": uname,\n \"fontSize\": 24,\n \"font\": \"open sans\"\n },\n \"subtitle\": {\n \"text\": \"Publication Profile\",\n \"color\": \"#999999\",\n \"fontSize\": 14,\n \"font\": \"open sans\"\n },\n \"titleSubtitlePadding\": 9\n },\n \"size\": {\n \"canvasHeight\": 500,\n \"canvasWidth\": 500,\n \"pieInnerRadius\": \"38%\",\n \"pieOuterRadius\": \"83%\"\n },\n \"data\": {\n \"content\": data,\n \"smallSegmentGrouping\": {\n \"enabled\": true,\n \"value\": 1\n },\n },\n \"labels\": {\n \"outer\": {\n \"pieDistance\": 32\n },\n \"inner\": {\n //\"format\": \"percentage\", // \"value\",\n //\"hideWhenLessThanPercentage\": 0 // 2 // 100 // 2\n \"format\": \"value\",\n \"hideWhenLessThanPercentage\": 5 // 100 // 2\n },\n \"mainLabel\": {\n \"fontSize\": 10.5\n },\n \"percentage\": {\n \"color\": \"#ffffff\",\n \"decimalPlaces\": 0\n },\n \"value\": {\n \"color\": \"#ffffff\",\n \"fontSize\": 10\n },\n \"lines\": {\n \"enabled\": true\n },\n \"truncation\": {\n \"enabled\": true\n }\n },\n \"effects\": {\n \"load\": {\n \"effect\": \"none\"\n },\n \"pullOutSegmentOnClick\": {\n \"effect\": \"linear\",\n \"speed\": 400,\n \"size\": 8\n }\n },\n \"misc\": {\n \"gradient\": {\n \"enabled\": true,\n \"percentage\": 100\n }\n }\n });\n }", "function dataDepartmentChart6(myObj, parent, thang) {\n let data = myObj.filter(e => {\n return e.parent == parent && e.thang == thang && (e.tuy_chon == 'viec-con-lai-cua-cac-thang-truoc-duoc-hoan-thanh-trong-thang' || e.tuy_chon == 'viec-con-lai-cua-cac-thang-truoc')\n })\n data = groupBy(data, 'ten_don_vi');\n let rs = [];\n Object.values(data).forEach(e => {\n let ty_le = Math.round(findChiSoByTuyChon(e, 'viec-con-lai-cua-cac-thang-truoc-duoc-hoan-thanh-trong-thang') / findChiSoByTuyChon(e, 'viec-con-lai-cua-cac-thang-truoc') * 100)\n if (e[0].hasChild == 1) {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: e[0].parent + '-' + e[0].ten_don_vi + '-' + thang,\n })\n } else {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: true\n })\n }\n })\n return rs;\n}", "function drawVisualization() {\r\n var style = \"bar-color\";//document.getElementById(\"style\").value;\r\n var showPerspective = true;//document.getElementById(\"perspective\").checked;\r\n // var withValue = [\"bar-color\", \"bar-size\", \"dot-size\", \"dot-color\"].indexOf(style) != -1;\r\n\r\n // Create and populate a data table.\r\n data = [];\r\n\r\n var color = 0;\r\n var steps = 3; // number of datapoints will be steps*steps\r\n var axisMax = 8;\r\n var axisStep = axisMax / steps;\r\n for (var x = 0; x <= axisMax; x += axisStep+1) {\r\n for (var y = 0; y <= axisMax; y += axisStep) {\r\n var z = Math.random();\r\n if (true) {\r\n data.push({\r\n x: x,\r\n y: y,\r\n z: z,\r\n style: {\r\n fill: colors[color],\r\n stroke: colors[color+1]\r\n }\r\n });\r\n }\r\n else {\r\n data.push({ x: x, y: y, z: z });\r\n }\r\n }\r\n color+=1;\r\n }\r\n\r\nvar category = [\"A\",\"B\",\"C\",\"D\"];\r\nvar cat_count = 0;\r\n // specify options\r\n var options = {\r\n width:'100%',\r\n style: style,\r\n xBarWidth: 2,\r\n yBarWidth: 2,\r\n showPerspective: showPerspective,\r\n showShadow: false,\r\n keepAspectRatio: true,\r\n verticalRatio: 0.5,\r\n xCenter:'55%',\r\n yStep:2.5,\r\n xStep:3.5,\r\n animationAutoStart:true,\r\n animationPreload:true,\r\n showShadow:true,\r\n \r\n yLabel: \"Categories (of Abuse)\",\r\n xLabel: \"Groups\",\r\n zLabel: \"Reports\",\r\n yValueLabel: function (y) {\r\n if(y == 0){\r\n return \"Category \" + category[y];\r\n }else{\r\n return \"Category \" +category[Math.ceil(y/3)];\r\n }\r\n },\r\n \r\n xValueLabel: function(x) {\r\n if(x == 0){\r\n return \"Group 1\";\r\n }else{\r\n return \"Group \" + (Math.ceil(x/3));\r\n }\r\n },\r\n tooltip: function(data){\r\n var res = \"\";\r\n if(data.x == 0){\r\n res += \"<strong>Group 1</strong>\";\r\n }else{\r\n res += \"<strong>Group</strong> \" + (Math.ceil(data.x/3));\r\n }\r\n\r\n if(data.y == 0){\r\n res+= \"<br><strong>Category</strong> \" + category[data.y];\r\n }else{\r\n res+= \"<br><strong>Category</strong> \" +category[Math.ceil(data.y/3)];\r\n }\r\n\r\n res+= \"<br><strong>Reports</strong> \" + data.z;\r\n return res;\r\n }\r\n };\r\n\r\n\r\n var camera = graph ? graph.getCameraPosition() : null;\r\n\r\n // create our graph\r\n var container = document.getElementById(\"mygraph\");\r\n graph = new vis.Graph3d(container, data, options);\r\n\r\n if (camera) graph.setCameraPosition(camera); // restore camera position\r\n/*\r\n document.getElementById(\"style\").onchange = drawVisualization;\r\n document.getElementById(\"perspective\").onchange = drawVisualization;\r\n document.getElementById(\"xBarWidth\").onchange = drawVisualization;\r\n document.getElementById(\"yBarWidth\").onchange = drawVisualization;*/\r\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {'title':'How Much Pizza I Ate Last Night'};\n\n // Instantiate and draw our chart, passing in some options.\n var piechart = new google.visualization.PieChart(elements.piechart);\n var linechart = new google.charts.Line(elements.linechart);\n var barchart = new google.charts.Bar(elements.barchart);\n piechart.draw(data, options);\n linechart.draw(data, options);\n barchart.draw(data,options);\n }", "function sortChart () {\n // Ascending or descending data\n if (this.dataset.status >= 0) {\n this.dataset.status = -1\n data.sort(function (a, b) {\n return a.value - b.value\n })\n } else {\n this.dataset.status = 1\n data.sort(function (a, b) {\n return b.value - a.value\n })\n }\n\n plot.call(svg, data, {\n w: w,\n h: h\n }, {\n top: topOffset,\n right: rightOffset,\n bottom: bottomOffset,\n left: leftOffset\n }, {\n y: 'Units sold',\n x: 'Donut type'\n })\n }", "function topTenTitles() {\nconst newData = [...data];\nnewData.sort((a, b) => b.imdb_score - a.imdb_score);\n return newData.splice(0,9);\n}", "function HBarChart(metaId){\n d3.json(sdata).then((data) => {\n // Grab values from the json to build the plots. Using the \"samples\" key\n var datasamples = data.samples;\n // I like having the letter z in my for statements as an excuse to use the first letter in my last name. \n // Capture the id. \n var sid = datasamples.map(z=>z.id).indexOf(metaId);\n // Get the values of the sample and their otu_id\n var Samplevalues = datasamples.map(z =>z.sample_values);\n var OtuId = datasamples.map(z=>z.otu_ids);\n // Slice the above values to get the top 10\n var top10values = Samplevalues[sid].slice(0,10);\n var top10Id = OtuId[sid].slice(0,10).map(z => `UTO ${z}` );\n // Type UTO because without it you will only get the numbers\n\n\n// Create the trace to make the bar chart\n\nvar Htrace = {\n // Putting the top10 values in the x axis. And reversing\n x: top10values.reverse(),\n // Puttting the top 10 id\n y: top10Id,\n // I wanted a red bar chart instead of the default blue\n marker: {color: \"red\"},\n type: \"bar\",\n // Without orientation it will only be a regular bar chart\n orientation: \"h\"\n\n};\n\n// Create a layout for the bar chart\n\nvar hlayout = {\n title: \"Top 10 UTO ID\",\n xaxis: { title: 'OTU Values'},\n yaxis: { title: 'OTU IDs'},\n\n};\n\n// Plot the chart\nPlotly.newPlot(\"bar\", [Htrace], hlayout);\n\n});\n}", "function drawChartProfs() {\n\tvar data = google.visualization.arrayToDataTable([\n\t [\"Profession\", \"Percentage\", { role: \"style\" } ],\n\t [\"Mesmer\", 10, \"color: #A5A5A5\"],\n\t [\"Engineer\", 10, \"color: #AB8585\"],\n\t [\"Necromancer\", 12, \"color: #AC4F4F\"],\n\t [\"Guardian\", 12, \"color: #A83333\"],\n\t [\"Thief\", 13, \"color: #A40000\"],\n\t [\"Elementalist\", 13, \"color: #A83333\"],\n\t [\"Ranger\", 14, \"color: #AC4F4F\"],\n\t [\"Warrior\", 16, \"color: #AB8585\"],\n\t]);\n\n\tvar view = new google.visualization.DataView(data);\n\n\n\tvar options = {\n\t title: \"Player breakdown by profession (percentage)\",\n\t bar: {groupWidth: \"60%\"},\n\t legend: { position: \"none\" },\n\t backgroundColor: \"transparent\",\n\t chartArea:{left:0,width:\"100%\",height:\"80%\"}\n\t};\n\t\n\tvar chart = new google.visualization.ColumnChart(document.getElementById(\"columnchart_values\"));\n\tchart.draw(view, options);\n}", "function displayMoneyCategories(mydata,mycolors,mylabels) {\nvar ctx = document.getElementById(\"myChartB\");\nvar myDoughnutChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: mylabels,\n datasets: [{\n label: 'DH ',\n data: mydata,\n backgroundColor: mycolors\n }]\n },\n options: {\n title: {\n display: true,\n text: 'Les ventes'\n }\n }\n});\n}", "function dataDepartmentChart5(myObj, parent, thang) {\n let data = myObj.filter(e => {\n return e.parent == parent && e.thang == thang && (e.tuy_chon == 'viec-hoan-thanh-khong-dung-han-co-due-date-trong-thang' || e.tuy_chon == 'viec-cham-chua-hoan-thanh-co-due-date-trong-thang' || e.tuy_chon == 'viec-co-due-date-trong-thang')\n })\n data = groupBy(data, 'ten_don_vi');\n let rs = [];\n Object.values(data).forEach(e => {\n let ty_le = Math.round((findChiSoByTuyChon(e, 'viec-hoan-thanh-khong-dung-han-co-due-date-trong-thang') + findChiSoByTuyChon(e, 'viec-cham-chua-hoan-thanh-co-due-date-trong-thang')) / findChiSoByTuyChon(e, 'viec-co-due-date-trong-thang') * 100)\n if (e[0].hasChild == 1) {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: e[0].parent + '-' + e[0].ten_don_vi + '-' + thang,\n })\n } else {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: true\n })\n }\n })\n return rs;\n}", "function buildCharts(sample) {\n // 2. Use d3.json to load and retrieve the samples.json file \n d3.json(\"samples.json\").then((data) => {\n console.log(data);\n // 3. Create a variable that holds the samples array.\n var samples= data.samples;\n // 4. Create a variable that filters the samples for the object with the desired sample number.\n var resultsArray = samples.filter(obj => obj.id == sample);\n // 5. Create a variable that holds the first sample in the array.\n var results = resultsArray[0];\n\n // 6. Create variables that hold the otu_ids, otu_labels, and sample_values.\n var ids = results.otu_ids;\n var labels = results.otu_labels;\n var values = results.sample_values;\n var metadata = data.metadata;\n var resultArray = metadata.filter(sampleObj => sampleObj.id == sample);\n var result = resultArray[0];\n var washFreq = parseInt(result.wfreq);\n\n // 7. Create the yticks for the bar chart.\n // Hint: Get the the top 10 otu_ids and map them in descending order \n // so the otu_ids with the most bacteria are last. \n const topIds = ids .slice(0, 10) .map(val => \"OTU\"+val) .reverse();\n\n var xticks = values.slice(0,10).reverse();\n var barlabels = labels.slice(0,10).reverse();\n \n\n // 8. Create the trace for the bar chart. \n var barData ={\n x: xticks,\n y: topIds,\n type: \"bar\",\n orientation: \"h\",\n text: barlabels\n };\n // 9. Create the layout for the bar chart. \n var barLayout = {\n title: \"Top 10 Bacteria Cultures Found\",\n \n \n \n };\n // 10. Use Plotly to plot the data with the layout. \n Plotly.newPlot(\"bar\", [barData], barLayout);\n\n // 1. Create the trace for the bubble chart.\n var bubbleData = {\n x: ids,\n y: values,\n text: labels,\n mode: \"markers\",\n marker:{\n size: values,\n color: ['rgb(128,0,38)', 'rgb(160,237,204)', 'rgb(255,237,160)', 'rgb(254,217,118)', 'rgb(254,178,76)', 'rgb(253,141,60)', 'rgb(252,78,42)', 'rgb(227,26,28)', 'rgb(189,0,38)', 'rgb(153,204,255)', 'rgb(0,0,255)', 'rgb(51,153,255)', 'rgb(204,204,255)', 'rgb(255,255,255)', 'rgb(255,204,255)', 'rgb(255,102,102)', 'rgb(255,102,204)', 'rgb(150,0,90)', 'rgb(0,0,200)', 'rgb(0,25,255)', 'rgb(0,152,255)', 'rgb(44,255,150)', 'rgb(151,255,0)'] \n }\n };\n\n // 2. Create the layout for the bubble chart.\n var bubbleLayout = {\n title: \"Bacteria Cultures Per Sample\",\n xaxis: {title: \"OTU ID\"},\n showlegend: false,\n height: 300,\n width: 1000\n\n \n };\n\n // 3. Use Plotly to plot the data with the layout.\n Plotly.newPlot(\"bubble\", [bubbleData], bubbleLayout); \n\n // 4. Create the trace for the gauge chart.\n var gaugeData = {\n value: washFreq,\n type: \"indicator\",\n title: {text: \"Belly Button Washing Frequency<br>Scrubs per Week\"},\n mode: \"gauge+number\",\n gauge:{\n axis: {range: [0, 10]},\n steps:[\n {range: [0,2], color: 'rgb(128,0,38)'},\n {range: [2,4], color: 'rgb(255,0,0)'},\n {range: [4,6], color: 'rgb(255,111,0)'},\n {range: [6,8], color: 'rgb(255,234,0)'},\n {range: [8,10], color: 'rgb(151,255,0)'}\n ]\n }\n \n };\n \n // 5. Create the layout for the gauge chart.\n var gaugeLayout = {\n width: 600,\n height: 400,\n margin: {t:0, b:0}\n };\n \n // 6. Use Plotly to plot the gauge data and layout.\n Plotly.newPlot(\"gauge\", [gaugeData], gaugeLayout);\n });\n}", "function drawChart6() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Hour Range');\n data.addColumn('number', 'Number of Meters');\n data.addRows(\n topFreeRangePerStreet(5)\n );\n\n // Set chart options\n var options = {\n 'title': 'Counts of Common Hour Ranges - Free Parking',\n 'width': 300,\n 'height': 200\n };\n\n // Instantiate and draw our chart, passing in some options.\n // var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n var chart = new google.visualization.BarChart(document.getElementById('chart_div6'));\n chart.draw(data, options);\n}", "function getAllThugBrand() {\n let rezultatasBrand = \"\";\n let highestCount = 0;\n for (let gamintojas in pazeidimaiPagalMarke) {\n let count = pazeidimaiPagalMarke[gamintojas];\n if (count > highestCount) {\n highestCount = count;\n rezultatasBrand = gamintojas;\n }\n }\n\n return{\n gamintojas: rezultatasBrand,\n baudos: highestCount\n };\n}", "async function getChart(parameter) {\n let database = await db.collection('hamsters').get();\n let allHamsters = [] ;\n\n await database.forEach(element => {\n allHamsters.push(element.data())\n })\n\n try {\n if (parameter === 'top') {\n let chart = await allHamsters.sort(function (a, b) { //Sort array in descending order from most winning hamster\n return b.wins - a.wins;\n });\n \n let winners = chart.splice(0, 5); //Get the five top in the array\n \n return winners;\n\n } else if (parameter === 'bottom') {\n let chart = await allHamsters.sort(function (a, b) { //Sort array in descending order from most losing hamster\n return b.defeats - a.defeats;\n });\n \n let losers = chart.splice(0, 5); //Get the five top in the array\n \n return losers;\n\n }\n\n } catch (err) {\n console.error(err)\n }\n\n}", "function CreateTimeSeries(labels, values) {\n var ctx = document.getElementById('myBestChart').getContext('2d');\n const config = {\n type: 'bar',\n data: {\n labels: labels,\n datasets: [{\n label: \"Number of Incidents\",\n data: values,\n backgroundColor: 'rgba(0, 188, 242, 0.5)',\n borderColor: 'rgba(0, 158, 73, .75)',\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n },\n plugins: {\n title: {\n display: true,\n text: 'Police Use of Force Incidents by Year'\n }\n }\n }\n }\n \n return new Chart(ctx, config);\n\n}", "function drawChart() {\n \n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n \n // Set chart options\n var options = {'title':'How Much Pizza I Ate Last Night'};\n \n // Instantiate and draw our chart, passing in some options.\n var piechart = new google.visualization.PieChart(elements.piechart);\n var linechart = new google.charts.Line(elements.linechart);\n var barchart = new google.charts.Bar(elements.barchart);\n piechart.draw(data, options);\n linechart.draw(data, options);\n barchart.draw(data,options);\n }", "function drawIterationChart(data){\r\n var table = $('<table class=\"board-efforts\" style=\"width: 100%;\"></table>');\r\n table.append($('<tr><th colspan=\"2\" style=\"width: 25%;\">User</th><th style=\"width: 75%;\">Total Effort</th></tr>'));\r\n $.each(data.users, function(k,user) {\r\n \tuser.Items.sort(Numsort);\r\n var tr = $('<tr class=\"hoverHi\"></tr>');\r\n tr.append($('<td class=\"more\"></td>').click(function() {\r\n /* this should open the user details (iterations) */\r\n $(this).toggleClass('less');\r\n $(this).parent().next().slideToggle('slow');\r\n }));\r\n tr.append(\"<td>{0}, {1} <em>({2})</em></td>\".f(user.FirstName, user.LastName, user.DefaultRole));\r\n var width = (user.TotalEffort / data.overallEffort) * 100;\r\n var innerWidth = (user.TotalToDo / user.TotalEffort) * 100;\r\n console.log(innerWidth);\r\n var innerBar = $('<div></div>').addClass('innerBar').css('width', innerWidth+\"%\").html(user.TotalEffort);\r\n tr.append($('<td></td>').addClass('bar').css('width', width+\"%\").append(innerBar));\r\n table.append(tr);\r\n /* we need a single td for the open / close button */\r\n var iterTr = $('<tr class=\"innerData\"></tr>');\r\n var iter = $('<td></td>').attr('colspan','3');\r\n /* table for all iterations */\r\n var iterTable = $('<table class=\"board-iterations-inner\"></table>');\r\n /* iterate through all iterations :) */\r\n iterTable.append($('<tr><th style=\"width: 20;\"></th><th>Iteration</th><th>StartDate</th><th>EndDate</th><th>Total Effort</th><th>Total Time Spent</th><th>Total Remaining</th></tr>'));\r\n\t\tfor (var ia = 0; ia < user.Items.length; ia++) {\r\n var iteration = user.Iterations[user.Items[ia]]\r\n tr = $('<tr class=\"hoverHi\"></tr>');\r\n tr.append($('<td class=\"more\"></td>').click(function() {\r\n /* this should open the iteration details (entity states including all assignables */\r\n $(this).toggleClass('less');\r\n $(this).parent().next().slideToggle('slow');\r\n }));\r\n tr.append(\"<td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td>{5}</td></tr>\".f(iteration.Name, getDateString(iteration.StartDate), getDateString(iteration.EndDate), iteration.TotalEffort, iteration.TotalTimeSpt, iteration.TotalTimeRem));\r\n iterTable.append(tr);\r\n\r\n /* table for all states */\r\n var stateTr = $('<tr class=\"innerData\"></tr>');\r\n var stateTd = $('<td></td>').attr('colspan','7');\r\n var stateTable = $('<table class=\"board-states-inner\"></table>');\r\n for (var id in iteration.States){\r\n var state = iteration.States[id];\r\n tr = $('<tr></tr>');\r\n tr.append(\"<td></td><td colspan='6'>State: {0}</td>\".f(state.Name));\r\n stateTable.append(tr);\r\n\r\n\t\t tr = $('<tr></tr>');\r\n var inner = $('<td></td>').attr('colspan','7');\r\n var innerTable = $('<table class=\"board-efforts-inner\"></table>');\r\n innerTable.append($('<tr><th style=\"width: 33%;\" colspan=\"2\">Assignable</th><th style=\"width: 10%\">State</th><th style=\"width: 10%\">Role</th><th>Effort</th><th>Time Spent</th><th>Remaining</th></tr>'));\r\n $.each(state.Items, function(k,item) {\r\n innerTable.append('<tr><td><img src=\"{0}/img/{1}.gif\"></td><td><a href=\"{8}\">#{9} {2}</a></td><td>{3}</td><td>{4}</td><td>{5}</td><td>{6}</td><td>{7}</td>'.f(appHostAndPath, item.EntityType, item.Name, item.EntityState, item.Role, item.Effort, item.TimeSpent, item.TimeRemain, getTypeLink(item.EntityType,item.EntityId), item.EntityId));\r\n });\r\n innerTable.append('<tr style=\"border-top: 1px solid #66666;\"><th colspan=\"4\" style=\"text-align: right;\">Totals:</td><td>{0}</td><td>{1}</td><td>{2}</td></tr>'.f(state.TotalEffort, state.TotalTimeSpt, state.TotalTimeRem));\r\n inner.append(innerTable);\r\n tr.append(inner);\r\n stateTable.append(tr);\r\n };\r\n stateTd.append(stateTable);\r\n stateTr.append(stateTd);\r\n iterTable.append(stateTr);\r\n };\r\n iter.append(iterTable);\r\n iterTr.append(iter);\r\n table.append(iterTr);\r\n });\r\n $('div#assigned-effort-report').html('').append(table);\r\n }", "function drawChart(data) {\n\n var dataAll = data.val();\n var scouterList = Object.values(dataAll);\n\n var submitFreq = {};\n\n for (var i = 0; i < scouterList.length; i ++) {\n var scouter = scouterList[i];\n if (submitFreq[scouter] == null) {\n submitFreq[scouter] = 1;\n } else {\n submitFreq[scouter] += 1;\n }\n }\n\n console.log(sortProperties(submitFreq));\n var submitFreqArray = sortProperties(submitFreq);\n submitFreqArray.unshift(['Scouter', 'Submissions'])\n\n var x = google.visualization.arrayToDataTable(submitFreqArray);\n\n // Optional; add a title and set the width and height of the chart\n var options = {'title':'Scouter Submissions', 'width':550, 'height':400};\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(x, options);\n}", "function displayWordCount(result){\n\tvar ctx = document.getElementById(\"myChart\").getContext(\"2d\");\n\tctx.canvas.width = 600;\n\tctx.canvas.height = 600;\n\tvar options = { responsive: true };\n\tvar labels = Array.from(keys(result));\n\tvar data = Array.from(values(result));\n\tvar myChart = new Chart(ctx, {\n\t type: 'bar',\n\t data: {\n\t labels: labels,\n\t datasets: [{\n\t label: 'Word Frequency',\n\t data: data,\n\t backgroundColor: [\n\t 'rgba(255, 99, 132, 0.2)',\n\t 'rgba(54, 162, 235, 0.2)',\n\t 'rgba(255, 206, 86, 0.2)',\n\t 'rgba(75, 192, 192, 0.2)',\n\t 'rgba(153, 102, 255, 0.2)',\n\t 'rgba(255, 159, 64, 0.2)',\n\t 'rgba(255, 99, 132, 0.2)',\n\t 'rgba(54, 162, 235, 0.2)',\n\t 'rgba(255, 206, 86, 0.2)',\n\t 'rgba(75, 192, 192, 0.2)',\n\t 'rgba(153, 102, 255, 0.2)',\n\t 'rgba(255, 159, 64, 0.2)',\n\t 'rgba(255, 99, 132, 0.2)'\n\t ],\n\t borderColor: [\n\t 'rgba(255,99,132,1)',\n\t 'rgba(54, 162, 235, 1)',\n\t 'rgba(255, 206, 86, 1)',\n\t 'rgba(75, 192, 192, 1)',\n\t 'rgba(153, 102, 255, 1)',\n\t 'rgba(255, 159, 64, 1)',\n\t 'rgba(255,99,132,1)',\n\t 'rgba(54, 162, 235, 1)',\n\t 'rgba(255, 206, 86, 1)',\n\t 'rgba(75, 192, 192, 1)',\n\t 'rgba(153, 102, 255, 1)',\n\t 'rgba(255, 159, 64, 1)',\n\t 'rgba(255,99,132,1)'\n\t ],\n\t borderWidth: 1\n\t }]\n\t },\n\t options: options\n\t});\n}", "function viewAllTraffickingM() {\n var color = d3.scale.linear()\n .range([\"#fee5d9\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#99000d\"]);\n\n var val1 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesTotal, b.value.malesTotal); })\n // take the first option\n [0];\n\n var val2 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesTotal, b.value.malesTotal); })\n // take the first option\n [5];\n\n var val3 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesTotal, b.value.malesTotal); })\n // take the first option\n [22];\n\n var val4 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesTotal, b.value.malesTotal); })\n // take the first option\n [37];\n\n var val5 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesTotal, b.value.malesTotal); })\n // take the first option\n [48];\n\n var val6 = d3.entries(data)\n // sort by value descending\n .sort(function(a, b) { return d3.ascending(a.value.malesTotal, b.value.malesTotal); })\n // take the first option\n [50];\n\n color.domain([\n val1.value.malesTotal,\n val2.value.malesTotal,\n val3.value.malesTotal,\n val4.value.malesTotal,\n val5.value.malesTotal,\n val6.value.malesTotal\n ]);\n\n var keys = Object.keys(data);\n /* Interpolate color according to the numbers of tracking crime reported*/\n keys.forEach(function(d){\n data[d].color = color(data[d].malesTotal);\n /*data[d].color = d3.interpolate(\"#fee5d9\", \"#99000d\")((data[d].totalCrimes)/30);\n console.log(data[d].color);*/\n });\n /* draw states on id #statesvg */\n var svg = uStates.draw(\"#statesvg\", data, tooltipHtml, \"malesTotal\");\n}", "function dataDepartmentChart8(myObj, parent, thang) {\n let data = myObj.filter(e => {\n return e.parent == parent && e.thang == thang && (e.tuy_chon == 'viec-chuyen-sang-dang-thuc-hien-nho-hon-2-ngay' || e.tuy_chon == 'viec-co-due-date-trong-thang')\n })\n data = groupBy(data, 'ten_don_vi');\n let rs = [];\n Object.values(data).forEach(e => {\n let ty_le = Math.round(findChiSoByTuyChon(e, 'viec-chuyen-sang-dang-thuc-hien-nho-hon-2-ngay') / findChiSoByTuyChon(e, 'viec-co-due-date-trong-thang') * 100)\n if (!isNaN(ty_le)) {\n if (e[0].hasChild == 1) {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: e[0].parent + '-' + e[0].ten_don_vi + '-' + thang,\n })\n } else {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: true\n })\n }\n }\n })\n return rs;\n}", "function generateChartData() {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 100);\n firstDate.setHours(0, 0, 0, 0);\n/// starting number\n var visits = 7.6;\n var hits = 13.4;\n var views = 7;\n\n var myData = {\n Zelenski: [7.6, 9.4, 8, 8.8, 9, 9.4, 10.8, 10.9, 11.9, 14.9, 15.2, 16.4, 17.5, 19.6, 19.9, 20.3, 23.1],\n Timoshenko: [13.4, 14.7, 14, 14.8, 14.2, 14.4, 13.4, 15.5, 15.1, 12.9, 9.6, 11.5, 13.5, 13.8, 13.9, 14],\n Poroshenko: [7, 6.2, 8, 8.1, 8.6, 10.8, 7.7, 8.2, 10.4, 10.1, 10.8, 13.1, 13.1, 13.4, 13.1, 12.4]\n }\n var mynewuselessvar;\n for (var i = 0; i < myData.candidate1.length; i++) {\n chartData.push({\n date: [\"1st Nov\", \"22nd Nov\", \"3rd Dec\",\"14th Dec\", \"18th Dec\", \"29th Dec\", \"3rd Jan\", \"15th Jan\", \"25th Jan\", \"4th Feb\", \"20th Feb\", \"27th Feb\", \"4th March\", \"7th March\", \"14th March\"],\n visits: myData.Zelenski[i],\n hits: myData.Timoshenko[i],\n views: myData.Poroshenko[i]\n });\n }\n\n\n // for (var i = 0; i < 15; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n // var newDate = new Date(firstDate);\n // newDate.setDate(newDate.getDate() + i);\n //\n // visits =\n // hits = Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n // views = Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n\n\n // }\n return chartData;\n}", "function dataDepartmentChart7(myObj, parent, thang) {\n let data = myObj.filter(e => {\n return e.parent == parent && e.thang == thang && (e.tuy_chon == 'viec-hoan-thanh-dung-han-co-due-date-trong-thang' || e.tuy_chon == 'viec-hoan-thanh-khong-dung-han-co-due-date-trong-thang' || e.tuy_chon == 'viec-con-lai-cua-cac-thang-truoc-duoc-hoan-thanh-trong-thang')\n })\n data = groupBy(data, 'ten_don_vi');\n let rs = [];\n Object.values(data).forEach(e => {\n let ty_le = Math.round((findChiSoByTuyChon(e, 'viec-hoan-thanh-dung-han-co-due-date-trong-thang') + findChiSoByTuyChon(e, 'viec-hoan-thanh-khong-dung-han-co-due-date-trong-thang') + findChiSoByTuyChon(e, 'viec-con-lai-cua-cac-thang-truoc-duoc-hoan-thanh-trong-thang')) / e[0].count_user)\n if (e[0].hasChild == 1) {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: e[0].parent + '-' + e[0].ten_don_vi + '-' + thang,\n })\n } else {\n rs.push({\n name: e[0].ten_don_vi,\n y: ty_le,\n drilldown: true\n })\n }\n })\n return rs;\n}", "function showResults() {\n pChart.hidden = false;\n\n let timesClicked = [];\n let ctx = document.getElementById(\"productChart\").getContext(\"2d\");\n\n for (let i = 0; i < allProducts.length; i++) {\n timesClicked.push(allProducts[i].clicks);\n }\n\n let productChart = new Chart(ctx, {\n type: \"bar\",\n\n data: {\n labels: productNames,\n\n datasets: [{\n label: \"# of Clicks\",\n data: timesClicked,\n backgroundColor: \"#a7cab1\",\n borderColor: \"#310A31\",\n borderWidth: 1\n }]\n },\n\n options: {\n scales: {\n xAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n }", "function topOTUBar(subject){\n\n // Go through Samples.json data as importedData\n d3.json(\"data/samples.json\").then((data) => {\n var selectData;\n\n // Filter data to subject\n for (var i = 0; i < data.samples.length; i++){\n if(data.samples[i].id == subject){\n selectData = data.samples[i]\n console.log(selectData)\n }\n }\n\n // Slice and Reverse for top 10 OTU\n var sampValues = selectData.sample_values.slice(0,10).reverse();\n var otuID = selectData.otu_ids.slice(0,10).reverse();\n var otuLabels = selectData.otu_labels.slice(0,10).reverse();\n var formatLabels = otuID.map(d => \"OTU \" + d)\n\n console.log(sampValues)\n console.log(otuID)\n console.log(otuLabels)\n\n\n var trace1 = {\n x: sampValues,\n y: formatLabels,\n text: otuLabels,\n name: \"TopOTU\",\n type: \"bar\",\n orientation: \"h\"\n };\n\n var chartData = [trace1];\n\n var layout = {\n title:\"Top 10 OTUs\",\n xaxis: {title: \"Values\"},\n yaxis: {title: \"OTU ID\"},\n }\n \n Plotly.newPlot(\"bar\", chartData, layout);\n });\n}", "function chart(data, d3) {\n \n // DECLARE CONTAINERS\n var lists = {\n population: [],\n emission: [],\n capita: []\n }\n\n // FETCH THE YEARS FOR TOOLTIPS\n var years = Object.keys(data.overview);\n\n // LOOP THROUGH & FILL THE LISTS\n years.forEach(year => {\n lists.population.push(data.overview[year].population);\n lists.emission.push(data.overview[year].emission);\n lists.capita.push(data.overview[year].emission / data.overview[year].population);\n });\n\n // CONVERT ARRAY DATA TO CHARTS\n generate_charts(lists, years, d3);\n}", "function disegna_torta(etichette, dati) {\n var ctx = $('#torta-venditore')[0].getContext('2d');\n\n grafico_torta = new Chart(ctx, {\n type: 'pie',\n data: {\n labels: etichette,\n datasets: [{\n label: '€',\n data: dati,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n title: {\n display: true,\n text: 'Grafico delle vendite per venditore:',\n fontSize: 25\n }\n }\n });//fine grafico PIE\n }//fine funzione grafico torta" ]
[ "0.65312976", "0.6491264", "0.6420873", "0.6375188", "0.63717747", "0.63275135", "0.6252533", "0.61294657", "0.611863", "0.6028655", "0.59649205", "0.59522897", "0.5949413", "0.5921982", "0.59217566", "0.59129816", "0.58902776", "0.5859833", "0.58506334", "0.5850547", "0.5850445", "0.58402866", "0.5784559", "0.57637835", "0.5761236", "0.5748319", "0.5722164", "0.5716283", "0.57131004", "0.5706374", "0.5698035", "0.56867754", "0.5669395", "0.566682", "0.56604457", "0.56555426", "0.5648552", "0.56429833", "0.5640723", "0.5635413", "0.5632273", "0.5625558", "0.5623751", "0.5618916", "0.56168765", "0.5615898", "0.56141514", "0.5612992", "0.5609089", "0.56071264", "0.5601613", "0.5598768", "0.5585777", "0.5582113", "0.5574665", "0.55744094", "0.55709773", "0.55669427", "0.5564429", "0.55457723", "0.55430263", "0.55420583", "0.5539474", "0.5531985", "0.55295455", "0.5527312", "0.55271494", "0.55259633", "0.55229306", "0.5521535", "0.5516567", "0.55148304", "0.5510327", "0.5509516", "0.55094475", "0.54994166", "0.54953754", "0.54934645", "0.5492317", "0.5481336", "0.54808927", "0.5479285", "0.5476889", "0.5468349", "0.54672533", "0.54638207", "0.546045", "0.5456946", "0.5449336", "0.54475397", "0.5446789", "0.5444309", "0.5440517", "0.5429584", "0.5426056", "0.5425798", "0.5422035", "0.54207253", "0.5417496", "0.5416782" ]
0.6097072
9